commit | 0964ee1cf5ddbb1cbf367a1a1a69508983a14b04 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Fri Apr 30 16:48:45 2010 +0000 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Fri Apr 30 16:48:45 2010 +0000 |
tree | 86b3bbc13c00c23657b18b0114695802d3c7ce72 | |
parent | b9a20ad036ea0e4b8dd2f57158375d5138dd0663 [diff] [blame] |
PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString() to support surrogates in the filename and use the right encoding
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 @@ if (stream == NULL) return NULL; if (name != NULL) { - nameobj = PyUnicode_FromString(name); + nameobj = PyUnicode_DecodeFSDefault(name); if (nameobj == NULL) PyErr_Clear(); else {