[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

Mark Dickinson report at bugs.python.org
Fri Sep 9 04:55:59 EDT 2016


Mark Dickinson added the comment:

It looks as though this change in posixmodule.c is the cause:

 #ifdef MS_WINDOWS
-        if (path->wide)
-            fd = _wopen(path->wide, flags, mode);
-        else
+        fd = _wopen(path->wide, flags, mode);
 #endif
 #ifdef HAVE_OPENAT
         if (dir_fd != DEFAULT_DIR_FD)
             fd = openat(dir_fd, path->narrow, flags, mode);
         else
-#endif
             fd = open(path->narrow, flags, mode);
+#endif


The move of the final #endif means that `fd` is not defined on OS X. If I move the #endif back again, the compile succeeds.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27781>
_______________________________________


More information about the Python-bugs-list mailing list