diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-30 16:48:45 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-30 16:48:45 (GMT) |
commit | 0964ee1cf5ddbb1cbf367a1a1a69508983a14b04 (patch) | |
tree | 86b3bbc13c00c23657b18b0114695802d3c7ce72 /Objects | |
parent | b9a20ad036ea0e4b8dd2f57158375d5138dd0663 (diff) | |
download | cpython-0964ee1cf5ddbb1cbf367a1a1a69508983a14b04.zip cpython-0964ee1cf5ddbb1cbf367a1a1a69508983a14b04.tar.gz cpython-0964ee1cf5ddbb1cbf367a1a1a69508983a14b04.tar.bz2 |
PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
PyUnicode_FromString() to support surrogates in the filename and use the right
encoding
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/fileobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 85e87d7..bbed57b 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -41,7 +41,7 @@ PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding, if (stream == NULL) return NULL; if (name != NULL) { - nameobj = PyUnicode_FromString(name); + nameobj = PyUnicode_DecodeFSDefault(name); if (nameobj == NULL) PyErr_Clear(); else { |