mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
Paths and file names from the fs should always be decoded with PyUnicode_DecodeFSDefault and not PyUnicode_FromString
This commit is contained in:
parent
fef9bbaff2
commit
eb9b39bd57
1 changed files with 4 additions and 3 deletions
|
@ -1072,11 +1072,12 @@ _PySys_Init(void)
|
|||
SET_SYS_FROM_STRING("platform",
|
||||
PyUnicode_FromString(Py_GetPlatform()));
|
||||
SET_SYS_FROM_STRING("executable",
|
||||
PyUnicode_FromString(Py_GetProgramFullPath()));
|
||||
PyUnicode_DecodeFSDefault(
|
||||
Py_GetProgramFullPath()));
|
||||
SET_SYS_FROM_STRING("prefix",
|
||||
PyUnicode_FromString(Py_GetPrefix()));
|
||||
PyUnicode_DecodeFSDefault(Py_GetPrefix()));
|
||||
SET_SYS_FROM_STRING("exec_prefix",
|
||||
PyUnicode_FromString(Py_GetExecPrefix()));
|
||||
PyUnicode_DecodeFSDefault(Py_GetExecPrefix()));
|
||||
SET_SYS_FROM_STRING("maxint",
|
||||
PyInt_FromLong(PyInt_GetMax()));
|
||||
SET_SYS_FROM_STRING("maxsize",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue