-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
bpo-34689: Prevent sysconfig._parse_makefile from expanding $${variables} #20439
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
base: main
Are you sure you want to change the base?
Conversation
The sysconfig._parse_makefile function expanded $${} formatted text if another variable was present in a value. This change splits values on $$ before searching for variables to avoid that.
Lib/sysconfig.py
Outdated
value = value[:m.start()] + item + after | ||
if "$" in after: | ||
after = value[offset + m.end():] | ||
value = value[:offset + m.start()] + item.replace('$', '$$') + after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please limit lines to 79 characters.
@@ -0,0 +1,2 @@ | |||
Split strings prior to parsing in :func:`sysconfig._parse_makefile` so it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sysconfig._parse_makefile
is not a documented function, so I don't think the func
role should be used here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lib/sysconfig.py
was turned into package. Could you please resolve conflicts?
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
As described in [bpo-34689](https://www.bugs.python.org/issue34689), sysconfig._parse_makefile recognizes
$${variable}
as a variable to expand in the second half of the_parse_makefile
function.This pull-request aims to fix that by splitting strings on
$$
before looking for variables in them and restoring the$$
in values that require more processing.There is no change to the documentation as this is a bug-fix.
https://bugs.python.org/issue34689
Supersedes #9362