Page MenuHomePhabricator

encoding: use special dictionary type for env variables on Windows
Needs RevisionPublic

Authored by indygreg on Mar 29 2020, 9:30 PM.


Group Reviewers

Environment variables on Windows are case insensitive and Python
internally uses a special dict type that normalizes all keys to

Our custom bytes-based environment variable dict on Windows was
not aware of this, leading to failures when looking up lower case
environment variables (such as http_proxy).

This commit introduces a custom dict type that normalizes keys
to uppercase on Windows. test-http-proxy.t passes after this
change, as a lookup of b'http_proxy' now succeeds.

It's worth noting that Python's behavior with regards to
normalizing all environment variables to uppercase is buggy.
See I preserved Python's
behavior for compatibility.

Diff Detail

rHG Mercurial
No Linters Available
No Unit Test Coverage

Event Timeline

indygreg created this revision.Mar 29 2020, 9:30 PM
marmoute accepted this revision.Apr 17 2020, 2:31 PM
marmoute added a subscriber: marmoute.

Urg, this make me sad, but seems a reasonable way to move forward.

baymax requested changes to this revision.Jul 31 2020, 1:56 PM

There seems to have been no activities on this Diff for the past 3 Months.

By policy, we are automatically moving it out of the need-review state.

Please, move it back to need-review without hesitation if this diff should still be discussed.


This revision now requires changes to proceed.Jul 31 2020, 1:56 PM