-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importlib: PYTHONCASEOK should be ignored when using python3 -E #82872
Comments
When using python3 -E or python3 -I, PYTHONCASEOK environment variable should be ignored by importlib. See an email sent in 2012: See importlib._bootstrap_external._relax_case attribute and its _make_relax_case() function. |
sys.flags.ignore_environment should be used. |
Created this PR: #62514 |
@ido Michael |
Tests fail on macOS: I reopen the issue. The issue should be fixed soon, or the change will be reverted to repair buildobts: ====================================================================== Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/extension/test_case_sensitivity.py", line 36, in test_case_insensitivity
self.assertTrue(hasattr(loader, 'load_module'))
AssertionError: False is not true ====================================================================== Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/extension/test_case_sensitivity.py", line 36, in test_case_insensitivity
self.assertTrue(hasattr(loader, 'load_module'))
AssertionError: False is not true ====================================================================== Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/source/test_case_sensitivity.py", line 57, in test_insensitive
self.assertIsNotNone(insensitive)
AssertionError: unexpectedly None ====================================================================== Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/source/test_case_sensitivity.py", line 57, in test_insensitive
self.assertIsNotNone(insensitive)
AssertionError: unexpectedly None ====================================================================== Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/source/test_case_sensitivity.py", line 57, in test_insensitive
self.assertIsNotNone(insensitive)
AssertionError: unexpectedly None ====================================================================== Traceback (most recent call last):
File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/source/test_case_sensitivity.py", line 57, in test_insensitive
self.assertIsNotNone(insensitive)
AssertionError: unexpectedly None |
I'm unable to debug the issue on macOS. I prepared PR 18553 to revert the change, just to give more time to fix the issue. It's to repair the CI, so we can notice other regressions. |
Tests are run with "./python.exe ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=900 -j2 --junit-xml test-results.xml" which runs tests with "./python.exe -E": ignore PYTHON* environment variables. Maybe the test should just take that in account. |
Yes I saw those in the morning, thanks for patching it up. I will debug this over the weekend and will update. |
From what I can tell, the regression seems like it could be fixed by adding "@unittest.skipIf(sys.flags.ignore_environment)" to the following tests in python/cpython/Lib/test/test_importlib/source/test_case_sensitivity.py that modify "PYTHONCASEOK": CaseSensitivityTest.test_sensitive Those tests seem ultimately pointless if environmental variables are being ignored (-E or -I), so I think in this case it's a misleading test failure, no? |
Ok, perfect. In the meanwhile, as announced, I reverted the change to be able to notify other regressions. Once we get a fix, we can reapply the change with the fix. |
Added a new clean PR with the code changes, will let you know once the tests are fixed: #62827 |
@vstinner ready for review. |
Re-opening as it causes refleaks all across the stable buildbots. I can reproduce on macOS Catalina as well. Run this to see for yourself:
Reverting #62827 fixes the issue. |
Sorry, this is false. I just checked out to the last commit to importlib before #62827 and it did not refleak. But when I actually reverted just #62827, the issue persisted. By bisecting, I found out that it's #63284 which causes the refleak and it only just so happens that this refleak appears in importlib tests. |
FYI importlib leak was fixed in bpo-40050 by: commit 83d46e0
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: