FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-34689: Prevent sysconfig._parse_makefile from expanding $${variables} by lepaperwan · Pull Request #20439 · python/cpython · GitHub

Repository navigation

bpo-34689: Prevent sysconfig._parse_makefile from expanding $${variables} - #20439

Closed
lepaperwan wants to merge 4 commits into
python:mainfrom
lepaperwan:bpo-34689
Closed

lepaperwan wants to merge 4 commits into
python:mainfrom
lepaperwan:bpo-34689

Conversation

lepaperwan commented May 26, 2020 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

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

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.
Comment thread 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please limit lines to 79 characters.

@@ -0,0 +1,2 @@
Split strings prior to parsing in :func:`sysconfig._parse_makefile` so it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

sysconfig._parse_makefile is not a documented function, so I don't think the func role should be used here.

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Lib/sysconfig.py was turned into package. Could you please resolve conflicts?

bedevere-app Bot commented Feb 28, 2024

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

FFY00 added a commit to FFY00/cpython that referenced this pull request Oct 10, 2025
Signed-off-by: Filipe Laíns <lains@riseup.net>

FFY00 commented Oct 10, 2025

Copy link
Copy Markdown
Member

Closing as superseded by GH-136166.

FFY00 closed this Oct 10, 2025
FFY00 added a commit that referenced this pull request Oct 10, 2025
Signed-off-by: Filipe Laíns <lains@riseup.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL