Issue #27083: Respect the PYTHONCASEOK environment variable under

Windows.

Originally only b'PYTHONCASEOK' was being checked for in os.environ,
but that won't work under Windows where all environment variables are
strings (on OS X they are bytes).

Thanks to Eryk Sun for the bug report.
This commit is contained in:
Brett Cannon 2016-07-15 11:54:38 -07:00
parent f76457e122
commit a47a7a5bf8
3 changed files with 13 additions and 7 deletions

View file

@ -29,7 +29,8 @@ def _make_relax_case():
if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
def _relax_case():
"""True if filenames must be checked case-insensitively."""
return b'PYTHONCASEOK' in _os.environ
return (b'PYTHONCASEOK' in _os.environ
or 'PYTHONCASEOK' in _os.environ)
else:
def _relax_case():
"""True if filenames must be checked case-insensitively."""