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 2010年06月11日 00:33 by vstinner, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| fsencode_mbcs.patch | vstinner, 2010年06月11日 00:33 | |||
| Messages (2) | |||
|---|---|---|---|
| msg107510 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2010年06月11日 00:33 | |
mbcs encoding doesn't support surrogateescape (see #850997), and mbcs should only be used in strict mode to encode/decode filenames. os.fsencode() should also be enabled on Windows. First I tried to disable this function on Windows to avoid the evil mbcs encoding, but mbcs encoding *is* used by some modules written in C (functions using PyUnicode_FSConverter(): encode the filename to bytes with mbcs encoding on Windows). Eg. _ssl module use PyUnicode_FSConverter() to get filenames because the underlying library, OpenSSL, requires bytes for the filenames (C type: char*). Enable os.fsencode() on Windows helps some tests (eg. fix test_ssl). Use "strict" error handler, instead of "surrogateescape", to encode/decode filenames with mbcs encoding, does nothing yet because mbcs codec ignore the errors argument. These changes prepare the work on mbcs codec: see #850997. Note: os.fsencode() was introduced by #8514. |
|||
| msg107610 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2010年06月11日 23:57 | |
Patch commited as r81927 (3.2). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:02 | admin | set | github: 53215 |
| 2010年06月13日 21:16:11 | vstinner | set | status: open -> closed resolution: fixed |
| 2010年06月11日 23:57:26 | vstinner | set | messages: + msg107610 |
| 2010年06月11日 00:33:51 | vstinner | set | nosy:
+ lemburg, loewis |
| 2010年06月11日 00:33:06 | vstinner | create | |