From: Christian Heimes Date: Thu, 22 Nov 2007 07:43:40 +0000 (+0000) Subject: os.environ contains PyUnicode instances and not PyString instances X-Git-Tag: v3.0a2~116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=830a4bcfd44ec651c2cb23bdaf4c1b4a3529e2f3;p=python os.environ contains PyUnicode instances and not PyString instances --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 5d65985f33..55ea3b9662 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -3026,7 +3026,7 @@ posix_execve(PyObject *self, PyObject *args) /* Omit Pseudo-Env Vars that Would Confuse Programs if Passed On */ if (stricmp(k, "BEGINLIBPATH") != 0 && stricmp(k, "ENDLIBPATH") != 0) { #endif - len = PyString_Size(key) + PyString_Size(val) + 2; + len = PyUnicode_GetSize(key) + PyUnicode_GetSize(val) + 2; p = PyMem_NEW(char, len); if (p == NULL) { PyErr_NoMemory(); @@ -3256,7 +3256,7 @@ posix_spawnve(PyObject *self, PyObject *args) { goto fail_2; } - len = PyString_Size(key) + PyString_Size(val) + 2; + len = PyUnicode_GetSize(key) + PyUnicode_GetSize(val) + 2; p = PyMem_NEW(char, len); if (p == NULL) { PyErr_NoMemory(); @@ -3489,7 +3489,7 @@ posix_spawnvpe(PyObject *self, PyObject *args) { goto fail_2; } - len = PyString_Size(key) + PyString_Size(val) + 2; + len = PyUnicode_GetSize(key) + PyUnicode_GetSize(val) + 2; p = PyMem_NEW(char, len); if (p == NULL) { PyErr_NoMemory();