This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年09月20日 23:07 by vstinner, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| mimetypes_encoding.patch | vstinner, 2011年09月20日 23:07 | review | ||
| Messages (5) | |||
|---|---|---|---|
| msg144357 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2011年09月20日 23:07 | |
On Debian and Ubuntu, /etc/mime.types file is pure ASCII, but on Fedora 15 it contains a non-ASCII character, 3 (U+00B3), in the line: "application/vnd.geocube+xml g3 g3" And the file is encoded in UTF-8. That's why Python should read this file from UTF-8 instead of the locale encoding, because the locale encoding can be ASCII. Attached patch implements this idead. I think that it is a bug and so it should also be fixed in Python 3.2. (Python 2.7 reads the file in binary mode, it doesn't care of the encoding.) |
|||
| msg144455 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年09月23日 16:42 | |
+1. I’ve finally understood that open using the locale is EvilTM. Please use the file from Fedora in a test. |
|||
| msg145493 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年10月14日 01:04 | |
New changeset 8d8ab3e04363 by Victor Stinner in branch '3.2': Issue #13025: mimetypes is now reading MIME types using the UTF-8 encoding, http://hg.python.org/cpython/rev/8d8ab3e04363 New changeset 2c223d686feb by Victor Stinner in branch 'default': (Merge 3.2) Issue #13025: mimetypes is now reading MIME types using the UTF-8 http://hg.python.org/cpython/rev/2c223d686feb |
|||
| msg145494 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2011年10月14日 01:04 | |
> Please use the file from Fedora in a test. Done. |
|||
| msg371926 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2020年06月20日 09:11 | |
However read_mime_types() still uses the locale encoding. See issue41048. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:21 | admin | set | github: 57234 |
| 2020年06月20日 09:11:44 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg371926 |
| 2011年10月14日 01:04:46 | vstinner | set | status: open -> closed resolution: fixed messages: + msg145494 |
| 2011年10月14日 01:04:25 | python-dev | set | nosy:
+ python-dev messages: + msg145493 |
| 2011年09月23日 16:59:50 | ezio.melotti | set | type: behavior stage: test needed |
| 2011年09月23日 16:42:22 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg144455 |
| 2011年09月20日 23:07:16 | vstinner | set | components: + Library (Lib), Unicode |
| 2011年09月20日 23:07:07 | vstinner | create | |