Closed
Description
Bug report
For source file with relative path "path/to/file.py" it creates file with incorrect path "/absolute/path/to/path/to/file.pyc" instead of "path/to/file.pyc".
- it adds the directory path to the source file twice.
- it seems that returning an absolute path is unnecessary.
Surprisingly, the broken version works in all existing tests. Either they only use the source file path without directory, or absolute path, or the test is indifferent to the compiled file path. But it did not work in #124799 which created independent set of tests for running compiled files.
Linked PRs
- gh-124842: Fix test.support.import_helper.make_legacy_pyc() #124843
- [3.13] gh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843) #124853
- [3.12] gh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843) #124854
- Revert 'gh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843)' #124868