Skip to content

bpo-34530: Fix distutils find_executable()#9049

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:find_executable
Sep 4, 2018
Merged

bpo-34530: Fix distutils find_executable()#9049
vstinner merged 1 commit into
python:masterfrom
vstinner:find_executable

Conversation

@vstinner

@vstinner vstinner commented Sep 3, 2018

Copy link
Copy Markdown
Member

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

https://bugs.python.org/issue34530

@serhiy-storchaka

Copy link
Copy Markdown
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.
@vstinner

vstinner commented Sep 4, 2018

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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 vstinner merged commit 3948719 into python:master Sep 4, 2018
@miss-islington

Copy link
Copy Markdown
Contributor

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

@vstinner 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>
@bedevere-bot

Copy link
Copy Markdown

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

@bedevere-bot

Copy link
Copy Markdown

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

@miss-islington

Copy link
Copy Markdown
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>
@bedevere-bot

Copy link
Copy Markdown

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