gh-62824: Adjust test_alias_modules_exist test to allow .pyc codec files#134777
gh-62824: Adjust test_alias_modules_exist test to allow .pyc codec files#134777malemburg merged 3 commits intopython:mainfrom
Conversation
…dec files
In Fedora, we install many codecs as .pyc files to save space.
This test was failing when running from installed Python:
======================================================================
FAIL: test_alias_modules_exist (test.test_codecs.TransformCodecTest.test_alias_modules_exist)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.14/test/test_codecs.py", line 3115, in test_alias_modules_exist
self.assertTrue(os.path.isfile(codec_file),
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"Codec file not found: " + codec_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true : Codec file not found: /usr/lib64/python3.14/encodings/cp037.py
----------------------------------------------------------------------
|
I think it would be better to not go look for module files (they can also be frozen or in a ZIP file), but instead try to import them. |
15dd8af to
21c1e40
Compare
Indeed. I added a commit to switch to |
|
Do you want to add a news entry or should we skip this ? |
|
I assumed this is a skip news material. |
|
I added the label, but the branch is out of date. Could you please rebase it ? |
|
Ah, all good now. |
|
Thanks for the fix, @hroncok |
|
Can we get a backport for 3.14 please? |
|
Thanks @hroncok for the PR, and @malemburg for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…nstead of file checks (pythonGH-134777) (cherry picked from commit 8704d6b) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
|
GH-134781 is a backport of this pull request to the 3.14 branch. |
…nstead of file checks (python#134777)
…nstead of file checks (python#134777)
In Fedora, we install many codecs as .pyc files to save space.
This test was failing when running from installed Python: