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

gh-132415: Use shutil.which() in missing_compiler_executable() by vstinner · Pull Request #132906 · python/cpython · GitHub

Repository navigation

gh-132415: Use shutil.which() in missing_compiler_executable() - #132906

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:which
Apr 25, 2025
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:which

Conversation

vstinner commented Apr 25, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Replace deprecated distutils.spawn.find_executable() with shutil.which() in missing_compiler_executable() of test.support.

Replace deprecated distutils.spawn.find_executable() with
shutil.which() in missing_compiler_executable() of test.support.

Copy link
Copy Markdown
Member Author

test_peg_generator fails with DeprecationWarning.

Example: https://buildbot.python.org/#/builders/64/builds/9220

ERROR: test_c_parser (test.test_peg_generator.test_c_parser.TestCParser.test_c_parser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto/build/Lib/test/test_peg_generator/test_c_parser.py", line 113, in setUp
    cmd = support.missing_compiler_executable()
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto/build/Lib/test/support/__init__.py", line 1963, in missing_compiler_executable
    if spawn.find_executable(cmd[0]) is None:
       ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto/build/build/test_python_626928æ/tempcwd/venv/lib/python3.14/site-packages/setuptools/_distutils/spawn.py", line 104, in find_executable
    warnings.warn(
    ~~~~~~~~~~~~~^
        'Use shutil.which instead of find_executable', DeprecationWarning, stacklevel=2
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
DeprecationWarning: Use shutil.which instead of find_executable

vstinner merged commit de6482e into python:main Apr 25, 2025
vstinner deleted the which branch April 25, 2025 09:50

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 25, 2025
…ythonGH-132906)

Replace deprecated distutils.spawn.find_executable() with
shutil.which() in missing_compiler_executable() of test.support.
(cherry picked from commit de6482e)

Co-authored-by: Victor Stinner <vstinner@python.org>

bedevere-app Bot commented Apr 25, 2025

Copy link
Copy Markdown

GH-132916 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Apr 25, 2025
vstinner added a commit that referenced this pull request Apr 25, 2025
…GH-132906) (#132916)

gh-132415: Use shutil.which() in missing_compiler_executable() (GH-132906)

Replace deprecated distutils.spawn.find_executable() with
shutil.which() in missing_compiler_executable() of test.support.
(cherry picked from commit de6482e)

Co-authored-by: Victor Stinner <vstinner@python.org>

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker de6482eda3a46cc9c9a03fb9ba57295ab99b4722 3.9

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker de6482eda3a46cc9c9a03fb9ba57295ab99b4722 3.10

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker de6482eda3a46cc9c9a03fb9ba57295ab99b4722 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 11, 2025
…ythonGH-132906)

Replace deprecated distutils.spawn.find_executable() with
shutil.which() in missing_compiler_executable() of test.support.
(cherry picked from commit de6482e)

Co-authored-by: Victor Stinner <vstinner@python.org>

bedevere-app Bot commented Jun 11, 2025

Copy link
Copy Markdown

GH-135392 is a backport of this pull request to the 3.12 branch.

bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jun 11, 2025

ambv commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

Actually nevermind the backports to 3.9 - 3.11, distutils is still there.

ambv pushed a commit that referenced this pull request Jun 11, 2025
…GH-132906) (GH-135392)

Replace deprecated distutils.spawn.find_executable() with
shutil.which() in missing_compiler_executable() of test.support.
(cherry picked from commit de6482e)

Co-authored-by: Victor Stinner <vstinner@python.org>
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.

2 participants


Back | FazBrowse Home | New Git URL