Improve pip config set error when PIP_CONFIG_FILE is non-regular#13790
Improve pip config set error when PIP_CONFIG_FILE is non-regular#13790
Conversation
|
Repro: PIP_CONFIG_FILE=/dev/null pip config set ... previously produced “Fatal Internal error [id=2]”. Tests: nox -s test-3.12 -- tests/functional/test_configuration.py |
|
Minor wording tweak to align with pip-style error messages. |
There was a problem hiding this comment.
Can we not make the test work on windows using the equivalent windows special file (NUL)?
There was a problem hiding this comment.
https://docs.python.org/3/library/os.html#os.devnull might be relevant here.
|
I tried making the test cross-platform: instead of skipping Windows due to hardcoded /dev/null, use Patch is ready on my fork: commit a58ede1 (branch To apply: git fetch https://github.com/gcomneno/pip.git pr-13790
git cherry-pick a58ede1fcRationale: avoids hardcoding |
|
Quick follow-up: I have a small commit that makes the functional test cross-platform by using os.devnull instead of hardcoding /dev/null (commit a58ede1). Happy to push it directly onto this PR if you prefer. |
|
I pushed the cross-platform test tweak (use os.devnull instead of hardcoding /dev/null) onto the PR branch, so no cherry-pick is needed. |
Fixes #11880.
When PIP_CONFIG_FILE points to a non-regular file (e.g. /dev/null),
pip config setpreviously failed with "Fatal Internal error [id=2]". This change reports a clear,
actionable ConfigurationError instead, and adds a functional test covering the case.
Tests: