mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Fixed a bug in PyUnicode_DecodeFSDefault. strcmp() returns 0 on success.
Added PyUnicode_DecodeFSDefaultAndSize Fixed a problem with the sys.path code that caused a segfault on Windows when the path contains non ASCII chars. The code for sys.executable, exec_prefix and prefix should be fixed, too.
This commit is contained in:
parent
9c1257ecf8
commit
5894ba7fad
3 changed files with 17 additions and 5 deletions
|
@ -1150,7 +1150,7 @@ makepathobject(const char *path, int delim)
|
|||
p = strchr(path, delim);
|
||||
if (p == NULL)
|
||||
p = strchr(path, '\0'); /* End of string */
|
||||
w = PyUnicode_FromStringAndSize(path, (Py_ssize_t) (p - path));
|
||||
w = PyUnicode_DecodeFSDefaultAndSize(path, (Py_ssize_t) (p - path));
|
||||
if (w == NULL) {
|
||||
Py_DECREF(v);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue