Show More
@@ -43,6 +43,14 b' if ispy3:' | |||||
43 | osname = os.name.encode('ascii') |
|
43 | osname = os.name.encode('ascii') | |
44 | ospathsep = os.pathsep.encode('ascii') |
|
44 | ospathsep = os.pathsep.encode('ascii') | |
45 | ossep = os.sep.encode('ascii') |
|
45 | ossep = os.sep.encode('ascii') | |
|
46 | ||||
|
47 | # Since Python 3 converts argv to wchar_t type by Py_DecodeLocale() on Unix, | |||
|
48 | # we can use os.fsencode() to get back bytes argv. | |||
|
49 | # | |||
|
50 | # https://hg.python.org/cpython/file/v3.5.1/Programs/python.c#l55 | |||
|
51 | # | |||
|
52 | # TODO: On Windows, the native argv is wchar_t, so we'll need a different | |||
|
53 | # workaround to simulate the Python 2 (i.e. ANSI Win32 API) behavior. | |||
46 | sysargv = list(map(os.fsencode, sys.argv)) |
|
54 | sysargv = list(map(os.fsencode, sys.argv)) | |
47 |
|
55 | |||
48 | def sysstr(s): |
|
56 | def sysstr(s): |
General Comments 0
You need to be logged in to leave comments.
Login now