diff Python/sysmodule.c @ 43761:658cd34a8c5d

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.
author Christian Heimes <christian@cheimes.de>
date Sun, 04 Nov 2007 11:43:14 +0000
parents 1998ee0eff2c
children 0d462d789b18
line wrap: on
line diff
--- a/Python/sysmodule.c	Sun Nov 04 11:37:22 2007 +0000
+++ b/Python/sysmodule.c	Sun Nov 04 11:43:14 2007 +0000
@@ -1150,7 +1150,7 @@
 		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;