Issue4969
Created on 2009-01-17 08:58 by gagenellina, last changed 2009-11-15 14:26 by pitrou.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
mimetypes.diff
|
gagenellina,
2009-11-15 08:55
|
Version 2 |
|
|
|
msg80007 - (view) |
Author: Gabriel Genellina (gagenellina) |
Date: 2009-01-17 08:58 |
|
The mimetypes module has a built-in default database, and, in addition,
reads mime.types files from a list of standard places (/etc/mime.types
by example)
On Windows, those files usually don't even present; MIME information is
stored in the registry instead. Until now, the mimetypes module just
ignored those settings; this patch adds support for reading the MIME
database from the Windows registry.
|
|
msg94875 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2009-11-04 01:26 |
|
A couple of points:
- if the method is Windows-specific, I don't think it shouldn't bear a
name as generic as "read_registry()". There are "registries" on other
systems.
- the method should probably raise early on non-Windows systems (raise
NotImplementedError?)
- please fix the coding style; don't collapse a "try", "except" or
"finally" and the following statement on a single line
- in the tests, rather than defining an empty test case on non-Windows
systems, make the tests skip (for example, call self.skipTest()
|
|
msg95279 - (view) |
Author: Gabriel Genellina (gagenellina) |
Date: 2009-11-15 08:55 |
|
A new patch taking into account M. Pitrou comments:
- name changed to read_windows_registry()
- read_windows_registry() does nothing on non-Windows platforms; same
as read_mime_types(filename) when the file does not exist.
- I hope the coding style is acceptable now
- the test is skipped on non-Windows platforms
- documentation updated
- documentation for MimeTypes.guess_all_extensions was missing; I
added it although it isn't directly related to this issue.
|
|
msg95291 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2009-11-15 14:06 |
|
Thank you, the patch looks ok to me.
|
|
msg95294 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2009-11-15 14:26 |
|
Committed in r76306 and r76307, closing.
|
|
| Date |
User |
Action |
Args |
| 2009-11-15 14:26:22 | pitrou | set | status: open -> closed resolution: accepted -> fixed messages:
+ msg95294
stage: patch review -> committed/rejected |
| 2009-11-15 14:06:10 | pitrou | set | resolution: accepted messages:
+ msg95291 |
| 2009-11-15 08:56:26 | gagenellina | set | files:
- mimetypes.diff |
| 2009-11-15 08:56:01 | gagenellina | set | files:
+ mimetypes.diff
messages:
+ msg95279 |
| 2009-11-04 01:33:46 | pitrou | set | nosy:
+ ocean-city
|
| 2009-11-04 01:26:15 | pitrou | set | nosy:
+ pitrou versions:
+ Python 3.2, - Python 3.1 messages:
+ msg94875 priority: normal type: feature request stage: patch review |
| 2009-11-03 22:25:28 | tercero12 | set | nosy:
+ tercero12
|
| 2009-01-17 09:51:07 | loewis | set | versions:
- Python 2.6, Python 3.0 |
| 2009-01-17 08:58:40 | gagenellina | create | |
|