mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
Before, the '-s STRIPDIR' option on compileall lead to some surprising results as it only strips away path components that match, but leaves alone the non-matching ones interspersed in between. For example, with: python -m compileall -s/path/to/another/src /path/to/build/src/file.py The resulting written path will be: build/file.py This fix only strips directories that are a fully matching prefix of the source path. If a stripdir is provided that is not a valid prefix, a warning will be displayed (which can be silenced with '-qq').
8 lines
489 B
ReStructuredText
8 lines
489 B
ReStructuredText
Change :mod:`compileall` to only strip the stripdir prefix from the full path
|
|
recorded in the compiled ``.pyc`` file, when the prefix matches the start of
|
|
the full path in its entirety. When the prefix does not match, no stripping is
|
|
performed and a warning to this effect is displayed.
|
|
|
|
Previously all path components of the stripdir prefix that matched the full
|
|
path were removed, while those that did not match were left alone (including
|
|
ones interspersed between matching components).
|