Skip to content

Empty user-settings do not overrule global settings anymore #13696

@gdiepen

Description

@gdiepen

Description

Ran into this on windows machines, but ran into the same problem with docker containers.

When using python:3.12.12 container with pip 25.0.1

The following situation works:

pip config set --global global.proxy http://non_existing_proxy._server.tld

pip config set --user global.proxy ""

When I now execute a pip install pandas statement, the above configuration will have my empty user-based setting for global.proxy disable the http://non_existing_proxy._server.tld set in the global config.

When I do the exact same thing with the latest python:3.13.11 docker image with pip 25.3, this does NOT work anymore.

Executing the pip install pandas with the setup where the empty user setting for global.proxy would void the global setting for global.proxy will try to use the http://non_existing_proxy._server.tld

The easiest solution would be that I would modify the global config, but unfortunately, on my work laptop I do not have the rights to modify the global config file....

In our situation, I would sometimes need to actually NOT use the proxy server, but there is no way that I can disable the global.proxy configuration setting with an empty value to indicate that I do not want to use a proxy server (or actually fallback to http_proxy and https_proxy)

This happens not only with the proxy setting, but also with others (e.g. extra-index-url ,etc)

Expected behavior

I would expect that as a user I can void/disable settings made in the global configuration file by providing an empty value in my user configuration.

pip version

25.3

Python version

3.13.11

OS

Linux (also windows)

How to Reproduce

pip config set --global global.proxy http://non_existing_proxy._server.tld
pip config set --user global.proxy ""

pip install pandas

Output

root@79eaea45aa7b:/# pip config set --global global.proxy http://non_existing_proxy._server.tld
Writing to /etc/pip.conf
root@79eaea45aa7b:/# pip config set --user global.proxy ""
Writing to /root/.config/pip/pip.conf
root@79eaea45aa7b:/# pip install pandas==2.0.0
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7610ecea5550>: Failed to establish a new connection: [Errno -2] Name or service not known'))': /simple/pandas/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7610ed016210>: Failed to establish a new connection: [Errno -2] Name or service not known'))': /simple/pandas/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7610ed016490>: Failed to establish a new connection: [Errno -2] Name or service not known'))': /simple/pandas/

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: needs triageIssues/PRs that need to be triagedtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions