Skip to content

Conversation

@vstinner
Copy link
Member

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

@serhiy-storchaka
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.
@vstinner
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 vstinner merged commit 3948719 into python:master Sep 4, 2018
@miss-islington
Copy link
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 <[email protected]>
@bedevere-bot
Copy link

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

@bedevere-bot
Copy link

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

@miss-islington
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 <[email protected]>
@bedevere-bot
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 <[email protected]>
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 <[email protected]>
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