Commit c7fad20
committed
Fix Windows env var upcasing regression
This uses a simple hand-rolled context manager to patch the
NoDefaultCurrentDirectoryInExePath variable, instead of
unittest.mock.patch.dict. The latter set unrelated environment
variables to the original (same) values via os.environ, and as a
result, their names were all converted to upper-case on Windows.
Because only environment variables that are actually set through
os.environ have their names upcased, the only variable whose name
should be upcased now is NoDefaultCurrentDirectoryInExePath, which
should be fine (it has a single established use/meaning in Windows,
where it's treated case-insensitively as environment variables in
Windows *usually* are).1 parent 7296e5c commit c7fad20
2 files changed
+19
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
| 26 | + | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
965 | 964 | | |
966 | 965 | | |
967 | 966 | | |
968 | | - | |
| 967 | + | |
969 | 968 | | |
970 | 969 | | |
971 | | - | |
| 970 | + | |
972 | 971 | | |
973 | 972 | | |
974 | 973 | | |
| |||
984 | 983 | | |
985 | 984 | | |
986 | 985 | | |
987 | | - | |
| 986 | + | |
988 | 987 | | |
989 | 988 | | |
990 | 989 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
161 | 175 | | |
162 | 176 | | |
163 | 177 | | |
| |||
935 | 949 | | |
936 | 950 | | |
937 | 951 | | |
938 | | - | |
| 952 | + | |
939 | 953 | | |
940 | 954 | | |
941 | 955 | | |
| |||
0 commit comments