Index: Modules/posixmodule.c =================================================================== --- Modules/posixmodule.c (revision 64501) +++ Modules/posixmodule.c (working copy) @@ -2197,7 +2197,7 @@ /* Skip over . and .. */ if (strcmp(FileData.cFileName, ".") != 0 && strcmp(FileData.cFileName, "..") != 0) { - v = PyBytes_FromString(FileData.cFileName); + v = PyUnicode_FromString(FileData.cFileName); if (v == NULL) { Py_DECREF(d); d = NULL; @@ -2289,7 +2289,7 @@ /* Leave Case of Name Alone -- In Native Form */ /* (Removed Forced Lowercasing Code) */ - v = PyBytes_FromString(namebuf); + v = PyUnicode_FromString(namebuf); if (v == NULL) { Py_DECREF(d); d = NULL;