##// END OF EJS Templates
py3: document why os.fsencode() can be used to get back bytes argv...
Yuya Nishihara -
r30334:19d8e19f default
parent child Browse files
Show More
@@ -43,6 +43,14 b' if ispy3:'
43 43 osname = os.name.encode('ascii')
44 44 ospathsep = os.pathsep.encode('ascii')
45 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 54 sysargv = list(map(os.fsencode, sys.argv))
47 55
48 56 def sysstr(s):
General Comments 0
You need to be logged in to leave comments. Login now