-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
compileall: -s
surprisingly makes path relative
#133503
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
Labels
docs
Documentation in the Doc dir
Comments
I'll do something about this |
sharktide
added a commit
to sharktide/cpython
that referenced
this issue
May 26, 2025
…-p` for clarity
sharktide
added a commit
to sharktide/cpython
that referenced
this issue
May 26, 2025
sharktide
added a commit
to sharktide/cpython
that referenced
this issue
May 26, 2025
sharktide
added a commit
to sharktide/cpython
that referenced
this issue
May 27, 2025
sharktide
added a commit
to sharktide/cpython
that referenced
this issue
May 27, 2025
sharktide
added a commit
to sharktide/cpython
that referenced
this issue
May 27, 2025
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz
added a commit
that referenced
this issue
Jun 1, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 1, 2025
(cherry picked from commit fe6f8a3) Co-authored-by: Rihaan Meher <meherrihaan@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 1, 2025
(cherry picked from commit fe6f8a3) Co-authored-by: Rihaan Meher <meherrihaan@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz
added a commit
that referenced
this issue
Jun 1, 2025
picnixz
added a commit
that referenced
this issue
Jun 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Documentation
(Filing as a documentation issue, since I suspect the behavior is intentional and has its valid use cases.)
In Gentoo, we install packages into a temporary directory whose contents resemble the actual filesystem prefix. For some packages that don't use PEP517 build systems, we invoke
python -m compileall
to byte-compile the installed modules.Today I wanted to switch our code to start using the
-s
option, and I've noticed that in addition to the path specified, it also strips the path separator following it.For example, consider the following example:
Note that while I expeced it to strip
/tmp/destdir
, leaving/usr/lib/python3.13/site-packages/foo.py
, it also stripped the following slash, making the path relative.Now, I can achieve the desired behavior by adding
-p /
:However, I found that behavior surprising and I think it should be documented better. Particularly, the current documentation states:
cpython/Doc/library/compileall.rst
Lines 58 to 63 in 120c9d4
which to me sounds like it would remove the specified string, rather than making the path relative. Perhaps it would make sense to specify explicitly that:
-s
and-p
can be used simultaneously.-p /
can be used to make the path absolute.Linked PRs
compileall.rst
's documentation of-s
and-p
for clarity, #134756compileall -s/-p
docs (GH-134756) #134996compileall -s/-p
docs (GH-134756) #134997The text was updated successfully, but these errors were encountered: