Skip to content

Commit d83b660

Browse files
idomicblurb-it[bot]vstinner
authored
bpo-38691 Added a switch to ignore PYTHONCASEOK when -E or -I flags passed (#18314)
* Hard reset + cherry piciking the changes. * 📜🤖 Added by blurb_it. * Added @vstinner News * Update Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst Co-Authored-By: Victor Stinner <[email protected]> * Hard reset to master * Hard reset to master + latest changes Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Victor Stinner <[email protected]>
1 parent 85a2eef commit d83b660

File tree

5 files changed

+2658
-2647
lines changed

5 files changed

+2658
-2647
lines changed

Doc/library/functions.rst

+3
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,9 @@ are always available. They are listed here in alphabetical order.
18291829
Negative values for *level* are no longer supported (which also changes
18301830
the default value to 0).
18311831

1832+
.. versionchanged:: 3.9
1833+
When the command line options :option:`-E` or :option:`-I` are being used,
1834+
the environment variable :envvar:`PYTHONCASEOK` is now ignored.
18321835

18331836
.. rubric:: Footnotes
18341837

Doc/whatsnew/3.9.rst

+3
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,9 @@ Changes in the Python API
589589
since the *buffering* parameter has been removed.
590590
(Contributed by Victor Stinner in :issue:`39357`.)
591591

592+
* The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK`
593+
environment variable when the :option:`-E` or :option:`-I` command line
594+
options are being used.
592595

593596
CPython bytecode changes
594597
------------------------

Lib/importlib/_bootstrap_external.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _make_relax_case():
3535

3636
def _relax_case():
3737
"""True if filenames must be checked case-insensitively."""
38-
return key in _os.environ
38+
return not sys.flags.ignore_environment and key in _os.environ
3939
else:
4040
def _relax_case():
4141
"""True if filenames must be checked case-insensitively."""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK`
2+
environment variable when :option:`-E` or :option:`-I` command line option is used.

0 commit comments

Comments
 (0)