You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
msvc9_query_vcvarsall returns environment dict with keys "lib", "libpath", "include" and "PATH". On Python 2.7 32-bit values of this dict are regular strings, however on Python 2.7 64-bit this dict contains unicode strings. So when I later use this dict to update os.environ it throws an error:
TypeError: environment can only contain string
Not sure if this is a bug or not, if not you can close it. It's not a big deal for me, I already have it fixed in my code.
The text was updated successfully, but these errors were encountered:
It does seem like a bug. If Python 2.7 os.environ doesn't accept Unicode and msvc9_query_vcvarsall returns only strings in distutils, then the monkeypatch should probably also supply that interface for maximum compatibility.
I am sorry, but this issue seems to be invalid and your commits should be reversed. I retested and msvc9_query_vcvarsall() returns unicode on both Python 2.7 32-bit and 64-bit. Previously I have been testing multiple Python flavors and must got confused somewhere on the way. The issue in my code with updating os.environ is still valid, as you can't update it with unicode strings on Python 2.7, however this is not an issue with setuptools. I have checked distutils query_vcvarsall() in distutils/msvc9compiler.py and this function calls str.decode("mbcs"), so it returns unicode strings. So looks like setuptools should be returning unicode strings as well. Again, sorry for causing the trouble.
However there is one bug in setuptools that I've noticed - but that's a separate issue. EnvironmentInfo().return_env() replaces unicode characters with its ascii equivalents. I've added "C:\Tęstą" to my PATH env variable and setuptools returned it as "C:\Testa" - which is an invalid directory. It's not an issue for me, but looks like a bug.