[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
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

bpo-34530: Fix distutils find_executable() #9049

Merged
merged 1 commit into from
Sep 4, 2018
Merged

bpo-34530: Fix distutils find_executable() #9049

merged 1 commit into from
Sep 4, 2018

Conversation

Copy link
Member

vstinner commented Sep 3, 2018

distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.

https://bugs.python.org/issue34530

Copy link
Member

Do you mind to add tests?

distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
Copy link
Member Author

vstinner commented Sep 4, 2018

Do you mind to add tests?

Done. I added many tests, including tests for the fix.

I also rebased my change on master.


# test os.defpath: missing PATH environment variable
with test_support.EnvironmentVarGuard() as env:
with mock.patch('distutils.spawn.os.defpath', tmp_dir):
Copy link
Member

Choose a reason for hiding this comment

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

In 2.7 you will need to use test_support.swap_attr().

vstinner merged commit 3948719 into python:master Sep 4, 2018
Copy link
Contributor

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

vstinner deleted the find_executable branch September 4, 2018 09:01
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 4, 2018
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
(cherry picked from commit 3948719)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Copy link

GH-9056 is a backport of this pull request to the 3.7 branch.

Copy link

GH-9057 is a backport of this pull request to the 3.6 branch.

Copy link
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 4, 2018
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
(cherry picked from commit 3948719)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Copy link

GH-9058 is a backport of this pull request to the 2.7 branch.

miss-islington added a commit that referenced this pull request Sep 4, 2018
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
(cherry picked from commit 3948719)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
vstinner added a commit that referenced this pull request Sep 4, 2018
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.

(cherry picked from commit 3948719)
vstinner added a commit that referenced this pull request Sep 5, 2018
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
(cherry picked from commit 3948719)

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

5 participants