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.Dismiss alert
This side effect breaks our use case currently. We use gnu make in cygwin for our build, in which all environment variables are case sensitive.
The core problem was unittest.mock.patch.dict(os.environ, {"NoDefaultCurrentDirectoryInExePath": "1"}) -- in which it will try to treat os.environ as a dictionary, but os.environ is not just a simple dictionary. It actually remembers the original casing of the environment variable. Unfortunately when reading it as dictionary it capitalize all letters.
We can also observe the same side effect with this code below:
It's an unexpected side-effect for sure :/. Maybe there are other ways to solve the original problem instead of affecting the callers os.environ like that.
This fix:
6029211
capitalized all environment variables on Windows. It can be illustrated by this short program:
The output is:
This side effect breaks our use case currently. We use gnu make in cygwin for our build, in which all environment variables are case sensitive.
The core problem was
unittest.mock.patch.dict(os.environ, {"NoDefaultCurrentDirectoryInExePath": "1"})
-- in which it will try to treatos.environ
as a dictionary, butos.environ
is not just a simple dictionary. It actually remembers the original casing of the environment variable. Unfortunately when reading it as dictionary it capitalize all letters.We can also observe the same side effect with this code below:
The side effect is the same as above.
The text was updated successfully, but these errors were encountered: