-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Multiple config paths treated as single path #12903
Comments
D'oh, how silly. A PR fixing this would be welcome! I can't find a reason why multipath was enabled, but not handled. The PR introducing it doesn't have any clues: #7501. |
It looks like this needs to be fixed in platformdirs. Labelling this to reflect that. @alexreg Could I ask you to file an issue with https://github.com/platformdirs/platformdirs/? |
Or... am I misunderstanding something? |
It looks like this is an intended behaviour, and downstream users are simply expected to handle the possible return format. I should note that even platformdirs itself does not handle this correctly— It seems like the Homebrew note was added last year without work to actually accomodate this change anywhere else. This change was not mentioned in the release notes. So yeah from the information currently available, I think we should fix it in pip. But judging from the peripherals, we should probably still raise an issue in platformdirs first to make sure the “intended” behaviour is actually intended, and then act accordingly. |
I created an issue upstream to discuss: tox-dev/platformdirs#292 |
I agree with @uranusjr that this appears to be an issue with both pip and platformdirs itself failing to handle the case of multiple colon-separated paths. I'll have a look at implementing a fix and submitting a PR on the weekend, if no one beats me to it. |
Description
The global configuration path on my macOS system is in fact a colon-separated list of multiple paths, but is treated as a single path.
Specifically, the global configuration path
/opt/homebrew/share/pip:/Library/Application Support/pip/pip.conf
is incorrectly treated as a single path where the:
is part of a supposed intermediate directory namedpip:
.This seems to be originating with the
site_data_dir
function, which since v4.2.0 may return a colon-separated list of paths, and pip doesn't presently handle that.Expected behavior
Both global configuration paths should be searched separately by pip.
pip version
24.2
Python version
3.12.4
OS
macOS 14.5
How to Reproduce
brew install python3.12
.pip3.12 config debug
.Output
Code of Conduct
The text was updated successfully, but these errors were encountered: