Skip to content

no_proxy setting ignores the proxies dictionary #5000

@ofek

Description

@ofek

These work:

$ python -c "import os,requests;os.environ['HTTPS_PROXY']='https://b.r.o.k.e.n.com';requests.get('https://google.com', proxies={'no_proxy': 'google.com'})"
$ python -c "import os,requests;os.environ['HTTPS_PROXY']='https://b.r.o.k.e.n.com';os.environ['NO_PROXY']='google.com';requests.get('https://google.com')"

These do not work:

$ python -c "import requests;requests.get('https://google.com', proxies={'https': 'https://b.r.o.k.e.n.com', 'no_proxy': 'google.com'})"
$ python -c "import os,requests;os.environ['NO_PROXY']='google.com';requests.get('https://google.com', proxies={'https': 'https://b.r.o.k.e.n.com'})"

System Information

$ python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.8"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.6.5"
  },
  "platform": {
    "release": "10",
    "system": "Windows"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.21.0"
  },
  "system_ssl": {
    "version": "100020bf"
  },
  "urllib3": {
    "version": "1.24.1"
  },
  "using_pyopenssl": false
}

cc @Lukasa @sigmavirus24

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions