Skip to content

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 [email protected]

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 <[email protected]>
@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