Commit e58de270 authored by Guido van Rossum's avatar Guido van Rossum

Milton L. Hankin reports that on Windows it is possible to have two

different values in the environ dict with the same key (although he
couldn't explain exactly how this came to be).  Since getenv() uses
the first one, Python should do too. (Some doubts about case
sensitivity, but for now this at least seems the right thing to do
regardless of platform.)
parent 724e1a5f
...@@ -300,7 +300,8 @@ convertenviron() ...@@ -300,7 +300,8 @@ convertenviron()
if (v == NULL) if (v == NULL)
continue; continue;
*p = '\0'; *p = '\0';
(void) PyDict_SetItemString(d, *e, v); if (PyDict_GetItemString(d, *e) == NULL)
(void) PyDict_SetItemString(d, *e, v);
*p = '='; *p = '=';
Py_DECREF(v); Py_DECREF(v);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment