summaryrefslogtreecommitdiff
path: root/Python/fileutils.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-12-19 18:19:06 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2011-12-19 18:19:06 +0100
commit65f4c8fb8a67c300410ad2835b7850a2bedef51c (patch)
tree039c1cf2559a2714abd44beb73d7bb414ef36b33 /Python/fileutils.c
parent9dc8559f6ad56c1fbf87cc777858f8795c076d85 (diff)
downloadcpython-65f4c8fb8a67c300410ad2835b7850a2bedef51c.tar.gz
_Py_fopen now allows bytes filenames under non-Windows platforms.
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 8c049e02af..1e71431c00 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);