-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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-35755: Remove current directory from posixpath.defpath #11586
Conversation
I would prefer to not merge this change before we decided how PATH="" (empty string) should be handled: https://bugs.python.org/issue35755#msg333832 |
Misc/NEWS.d/next/Security/2019-01-17-10-03-48.bpo-35755.GmllIs.rst
Outdated
Show resolved
Hide resolved
Hum. The test fails on Windows:
|
Lib/test/test_subprocess.py
Outdated
env.pop('PATH', None) | ||
|
||
with support.temp_cwd() as temp_dir: | ||
self.addCleanup(support.rmtree, temp_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. It's now useless, I forgot to remove it. I will remove it once I understand the Windows failure.
iirc the behaviour you're seeing is due to https://bugs.python.org/issue8557 |
I wrote PR #12858 to define the behavior when the PATH environment variable is set to an empty string. |
Document the change in a NEWS entry of the Security category.
* bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12858) shutil.which() and distutils.spawn.find_executable() now use os.confstr("CS_PATH") if available instead of os.defpath, if the PATH environment variable is not set. Don't use os.confstr("CS_PATH") nor os.defpath if the PATH environment variable is set to an empty string. Changes: * find_executable() now starts by checking for the executable in the current working directly case. Add an explicit "if not path: return None". * Add tests for PATH='' (empty string), PATH=':' and for PATHEXT. (cherry picked from commit 228a3c9) * bpo-35755: Remove current directory from posixpath.defpath (GH-11586) Document the change in a NEWS entry of the Security category. (cherry picked from commit 2c4c02f)
Document the change in a NEWS entry of the Security category.
https://bugs.python.org/issue35755