Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-105931: Fix surprising compileall stripdir behaviour#108671

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
encukou merged 2 commits intopython:mainfromhetmankp:gh-105931
Oct 23, 2023

Conversation

@hetmankp
Copy link
Contributor

@hetmankphetmankp commentedAug 30, 2023
edited by bedevere-bot
Loading

This resolves issue#105931. Currently the '-s STRIPDIR' option on compileall can 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').

This resolves issuepython#105931. Currently the '-s STRIPDIR' option oncompileall can lead to some surprising results as it only strips awaypath components that match, but leaves alone the non-matching onesinterspersed in between.For example, with: python -m compileall -s/path/to/another/src/path/to/build/src/file.pyThe resulting written path will be: build/file.pyThis fix only strips directories that are a fully matching prefix of thesource path. If a stripdir is provided that is not a valid prefix, awarning will be displayed (which can be silenced with '-qq').
Copy link
Contributor

@frenzymadnessfrenzymadness left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I like the simplicity of the solution and I have just one suggestion. I'm not a core developer so we'll need someone to approve and merge this, Cc:@encukou (helped with the original implementation so he has the necessary context).

@frenzymadness
Copy link
Contributor

@encukou could you please help us to move this forward?

Copy link
Member

@encukouencukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The original behaviour is clearly wrong.
IMO, we don't need a deprecation period to change it: the filename is essentially debug information.
I don't plan to backport to this to previous versions (at least initially): new warnings/outputs tend to cause trouble for users.

@encukouencukouenabled auto-merge (squash)October 23, 2023 13:35
@encukouencukou merged commit3726cb0 intopython:mainOct 23, 2023
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
…GH-108671)Before, the '-s STRIPDIR' option oncompileall lead to some surprising results as it only strips awaypath components that match, but leaves alone the non-matching onesinterspersed in between.For example, with: python -m compileall -s/path/to/another/src/path/to/build/src/file.pyThe resulting written path will be: build/file.pyThis fix only strips directories that are a fully matching prefix of thesource path. If a stripdir is provided that is not a valid prefix, awarning will be displayed (which can be silenced with '-qq').
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
…GH-108671)Before, the '-s STRIPDIR' option oncompileall lead to some surprising results as it only strips awaypath components that match, but leaves alone the non-matching onesinterspersed in between.For example, with: python -m compileall -s/path/to/another/src/path/to/build/src/file.pyThe resulting written path will be: build/file.pyThis fix only strips directories that are a fully matching prefix of thesource path. If a stripdir is provided that is not a valid prefix, awarning will be displayed (which can be silenced with '-qq').
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@encukouencukouencukou approved these changes

+1 more reviewer

@frenzymadnessfrenzymadnessfrenzymadness left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@hetmankp@frenzymadness@encukou@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp