This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eudoxos
Recipients asvetlov, docs@python, eudoxos, tim.golden
Date 2012-12-07.17:11:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I checked on Windows 7 64bit with python 2.7 (sorry, not python 3.3 installed here) with the script attached. Each line sets a variable using the method in the very left column, then it attempts to read it back using all methods.

              os.environ       win32   os.?etenv      msvcrt      msvcr?
  os.environ          OK          OK          OK          --          --
       win32          --          OK          --          --          --
   os.?etenv          --          OK          --          --          --
      msvcrt          --          OK          --          OK          --
      msvcr?          --          OK          --          --          --

Methods which can read back what they also set are os.environ, win32api, msvcrt. OTOH, msvcr? (which is ctypes.util.find_msvcr(), in my case msvcr90.dll) does not read its own values, just like os.getenv/os.putenv.

It *seems* that reading with win32 API is very reliable (that is not a good news for writing cross-platform extension modules), though, but perhaps it just asks the CRT if it does not find the variable defined (my testing did not go that far).

@Andrew: you're probably right, though it does not explain, why msvcr90.dll does not read back the values I set in there - that is the CRT python27.dll itself links to --
Date User Action Args
2012-12-07 17:11:50eudoxossetrecipients: + eudoxos, tim.golden, asvetlov, docs@python
2012-12-07 17:11:50eudoxossetmessageid: <>
2012-12-07 17:11:50eudoxoslinkissue16633 messages
2012-12-07 17:11:50eudoxoscreate