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

[3.15] gh-159819: Fix python-config.sh for installation paths containing spaces (GH-159820) by miss-islington · Pull Request #160184 · python/cpython · GitHub

Repository navigation

[3.15] gh-159819: Fix python-config.sh for installation paths containing spaces (GH-159820) - #160184

Merged
itamaro merged 1 commit into
python:3.15from
miss-islington:backport-3e13407-3.15
Oct 22, 2026
Merged

itamaro merged 1 commit into
python:3.15from
miss-islington:backport-3e13407-3.15

Conversation

miss-islington commented Oct 22, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

The shell python-config located its own prefix with unquoted command
substitutions, so any whitespace in the installation path made it print an
empty --prefix and -I/include/...-style paths while exiting 0.

  • Quote the substitutions and the argument loop (POSIX sh, no bashisms).
  • Exit 1 with a message when the script's directory cannot be resolved,
    instead of silently printing empty paths.
  • Replace sed "s#$prefix#$prefix_real#" with a relocate helper using
    parameter expansion, so #, &, \ and regex metacharacters in either
    prefix are handled literally. Same first-occurrence semantics.
  • Add test_python_config_sh_prefix_with_spaces: runs the
    generated script from …/path with spaces/bin/ and checks --prefix,
    --exec-prefix, --includes and empty stderr
    (cherry picked from commit 3e13407)

Co-authored-by: Itamar Oren itamarost@gmail.com

…ng spaces (pythonGH-159820)

The shell `python-config` located its own prefix with unquoted command
substitutions, so any whitespace in the installation path made it print an
empty `--prefix` and `-I/include/...`-style paths while exiting 0.

- Quote the substitutions and the argument loop (POSIX `sh`, no bashisms).
- Exit 1 with a message when the script's directory cannot be resolved,
  instead of silently printing empty paths.
- Replace `sed "s#$prefix#$prefix_real#"` with a `relocate` helper using
  parameter expansion, so `#`, `&`, `\` and regex metacharacters in either
  prefix are handled literally. Same first-occurrence semantics.
- Add `test_python_config_sh_prefix_with_spaces`: runs the
  generated script from `…/path with spaces/bin/` and checks `--prefix`,
  `--exec-prefix`, `--includes` and empty stderr
(cherry picked from commit 3e13407)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL