diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-12-19 17:19:06 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-12-19 17:19:06 (GMT) |
commit | 2b1cc895729710e3e1751f4b1867299821e04c03 (patch) | |
tree | b45a9ad186e6bb5ad788daf479ab130d3eb1a3cf /Python/fileutils.c | |
parent | 923df6f22a4a9ca0e2d5f15b29ec747ce00cd606 (diff) | |
download | cpython-2b1cc895729710e3e1751f4b1867299821e04c03.zip cpython-2b1cc895729710e3e1751f4b1867299821e04c03.tar.gz cpython-2b1cc895729710e3e1751f4b1867299821e04c03.tar.bz2 |
_Py_fopen now allows bytes filenames under non-Windows platforms.
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r-- | Python/fileutils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c index 8c049e0..1e71431 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -321,8 +321,8 @@ _Py_fopen(PyObject *path, const char *mode) return _wfopen(wpath, wmode); #else FILE *f; - PyObject *bytes = PyUnicode_EncodeFSDefault(path); - if (bytes == NULL) + PyObject *bytes; + if (!PyUnicode_FSConverter(path, &bytes)) return NULL; f = fopen(PyBytes_AS_STRING(bytes), mode); Py_DECREF(bytes); |