]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-146310: Fix ensurepip to treat empty WHEEL_PKG_DIR as unset (#146357)
authorImgyu Kim <kimimgo@gmail.com>
Fri, 27 Mar 2026 20:48:07 +0000 (05:48 +0900)
committerGitHub <noreply@github.com>
Fri, 27 Mar 2026 20:48:07 +0000 (20:48 +0000)
commit73cc1fd4f45b4daf2b2f9a6be69148775c7c2bff
tree458be22a0c09394bd8f4d6ee2fcac3f4a53e155e
parent1384f025f5e8ad943c1ac699fd60877b046c0183
gh-146310: Fix ensurepip to treat empty WHEEL_PKG_DIR as unset (#146357)

Path('') resolves to CWD, so an empty WHEEL_PKG_DIR string caused
ensurepip to search the current working directory for wheel files.
Add a truthiness check to treat empty strings the same as None.

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/ensurepip/__init__.py
Lib/test/test_ensurepip.py
Misc/NEWS.d/next/Library/2026-03-24-03-49-50.gh-issue-146310.WhlDir.rst [new file with mode: 0644]