equal
deleted
inserted
replaced
41 fsdecode = os.fsdecode |
41 fsdecode = os.fsdecode |
42 # A bytes version of os.name. |
42 # A bytes version of os.name. |
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): |
49 """Return a keyword str to be passed to Python functions such as |
57 """Return a keyword str to be passed to Python functions such as |
50 getattr() and str.encode() |
58 getattr() and str.encode() |