python / python/cpython

`urllib.request.getproxies_registry` does not return proxy exceptions (no_proxy)

Open
#121,085 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type-bug
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

On Windows

https://github.com/python/cpython/blob/b7a95dfee30aae171de47f98ed3b7d1cc08e5bd4/Lib/urllib/request.py#L2726-L2733

getproxies_environment() gets the proxy servers from environment variables HTTP_PROXY, HTTPS_PROXY, etc. and the proxy exceptions from NO_PROXY, returns a dict like {'http': '<URL>', 'no': '<FQDNs>'}; but getproxies_registry() gets only the proxy servers from Registry, returns a dict like {'http': '<URL>'}. These two ways to get proxies are inconsistent, a Windows user will get a proxy dict without exceptions list if he configures proxies in Settings or Internet Options (Registry).

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Lib/urllib/request.py at the referenced getproxies_registry() lines, then compare its result with getproxies_environment(), especially the no_proxy entry. Reproduce the Windows Registry proxy configuration described in the issue and verify that getproxies_registry() returns proxy exceptions consistently with the environment-based path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.