Skip to content

[3.7] bpo-39769: Fix compileall ddir for subpkgs. (GH-18676) (GH-18718) #18725

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

Merged
merged 1 commit into from
Mar 1, 2020

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Mar 1, 2020

Fix compileall.compile_dir() ddir= behavior on sub-packages.

Fixes compileall.compile_dir's ddir parameter and compileall command
line flag -d to no longer write the wrong pathname to the generated
pyc file for submodules beneath the root of the directory tree being
compiled. This fixes a regression introduced with Python 3.5.

Tests backported from GH 0267335, the
implementation is different due to intervening code changes. But still
quiet simple.

Why was the bug ever introduced? The refactoring to add parallel
execution kept the ddir -> dfile computations but discarded the results
instead of sending them to compile_file(). This fixes that. Lack of tests
meant this went unnoticed..
(cherry picked from commit ce720d3)

Co-authored-by: Gregory P. Smith greg@krypto.org

https://bugs.python.org/issue39769

Automerge-Triggered-By: @gpshead

…ythonGH-18718)

Fix compileall.compile_dir() ddir= behavior on sub-packages.

Fixes compileall.compile_dir's ddir parameter and compileall command
line flag `-d` to no longer write the wrong pathname to the generated
pyc file for submodules beneath the root of the directory tree being
compiled.  This fixes a regression introduced with Python 3.5.

Tests backported from GH 0267335, the
implementation is different due to intervening code changes.  But still
quiet simple.

Why was the bug ever introduced?  The refactoring to add parallel
execution kept the ddir -> dfile computations but discarded the results
instead of sending them to compile_file().  This fixes that.  Lack of tests
meant this went unnoticed..
(cherry picked from commit ce720d3)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
@gpshead gpshead added the type-bug An unexpected behavior, bug, or error label Mar 1, 2020
@gpshead gpshead merged commit 7c64726 into python:3.7 Mar 1, 2020
@gpshead gpshead deleted the backport-ce720d3-3.7 branch March 1, 2020 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants