summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c2
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 {