Skip to content

[3.13] shell version of python-config started using bashisms #120291

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

Closed
mgorny opened this issue Jun 9, 2024 · 0 comments · Fixed by #120292
Closed

[3.13] shell version of python-config started using bashisms #120291

mgorny opened this issue Jun 9, 2024 · 0 comments · Fixed by #120292
Labels
3.13 bugs and security fixes 3.14 bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@mgorny
Copy link
Contributor

mgorny commented Jun 9, 2024

Bug report

Bug description:

Since de2a73d python-config.sh.in is using bashisms but declaring #!/bin/sh as the shell. As a result, it now throws errors on systems using non-bash shells:

$ python3.13-config 
/usr/bin/python3.13-config: 8: [[: not found
Usage: /usr/bin/python3.13-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed

FWICS, there's no reason to use [[ ... ]] over plain shell [ ... ] there.

CC @kiendang

CPython versions tested on:

3.13, CPython main branch

Operating systems tested on:

Linux

Linked PRs

@mgorny mgorny added the type-bug An unexpected behavior, bug, or error label Jun 9, 2024
@AlexWaygood AlexWaygood added 3.13 bugs and security fixes 3.14 bugs and security fixes labels Jun 9, 2024
mgorny added a commit to mgorny/cpython that referenced this issue Jun 9, 2024
Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes python#120291
sobolevn pushed a commit that referenced this issue Jun 11, 2024
gh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes #120291
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 11, 2024
pythongh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes pythonGH-120291
(cherry picked from commit 7d24471)

Co-authored-by: Michał Górny <[email protected]>
sobolevn pushed a commit that referenced this issue Jun 11, 2024
…120341)

gh-120291: Fix a bashism in python-config.sh.in (GH-120292)

gh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes GH-120291
(cherry picked from commit 7d24471)

Co-authored-by: Michał Górny <[email protected]>
mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
pythongh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes python#120291
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
pythongh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes python#120291
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
pythongh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes python#120291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes 3.14 bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants