This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib does not support NO_PROXY environment variable containing domain with asterisk
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Jiri Hnidek, cheryl.sabella, xiang.zhang
Priority: normal Keywords:

Created on 2017-05-24 20:13 by Jiri Hnidek, last changed 2022-04-11 14:58 by admin.

Pull Requests
URL Status Linked Edit
PR 1795 closed python-dev, 2017-05-25 05:15
Messages (7)
msg294388 - (view) Author: Jiri Hnidek (Jiri Hnidek) * Date: 2017-05-24 20:13
Module urllib contains method proxy_bypass_environment(domain_name). This method check if domain_name should be excluded from proxying. The domain_name is checked against environment variable no_proxy or NO_PROXY. This variable contains comma separated list of domain names/domains. Domains can be specified in following variants:

 - domain.com
 - .domain.com
 - *.domain.com

Method proxy_bypass_environment support first two variants, but it doesn't support variant with asterisk at beginning of domain. The last variant is not anything unusual; e.g.: https://www.gnu.org/software/emacs/manual/html_node/url/Proxies.html
msg294955 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-06-01 16:19
Hi Jiri, thanks for your PR. But at least we need a corresponding test and an entry in Misc/NEWS to complete the patch. Also, if your name is not in Misc/ACKS, please add it. :-)
msg295213 - (view) Author: Jiri Hnidek (Jiri Hnidek) * Date: 2017-06-05 21:40
Hi Xiang,
* I added entry to Misc/NEWS
* I added my name to Misc/ACKS (without diacritics)
* I added/updated several unit tests
* I updated PR (two commits squashed into one commit)

Cheers,

Jiri
msg296692 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-06-23 08:40
One question about this function: hosts like "*.foo.com" gets an unambiguous intention, but how about hosts like "*foo.com"? Should it match hosts like barfoo.com, or treat it as a typo and not match? Although the link says "asterisks can be used as wildcards" but I am still not quite sure it's intention.
msg297159 - (view) Author: Jiri Hnidek (Jiri Hnidek) * Date: 2017-06-28 07:08
Hi,
good point about *foo.com. It seems this is not valid DNS RR according following RFC:

https://tools.ietf.org/html/rfc4592

Especially this section is more focused on allowed combinations of asterisks and other characters:

https://tools.ietf.org/html/rfc4592#section-2.1.1

There is also page at mediawiki about wildcards in DNS:

https://en.wikipedia.org/wiki/Wildcard_DNS_record

Thus I will modify my PR.
msg320020 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2018-06-20 05:35
Hi, Jiri. Could you update your PR and let's continue with this issue?
msg370065 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2020-05-27 11:55
The original pull request has been closed for inactivity, so this is now available for anyone to work on.  Please credit the original author if anyone change is based on the original PR.  Thanks!
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74647
2020-05-27 11:55:12cheryl.sabellasetnosy: + cheryl.sabella

messages: + msg370065
versions: + Python 3.10, - Python 3.8
2018-06-20 05:35:20xiang.zhangsetmessages: + msg320020
versions: + Python 3.8, - Python 3.7
2017-06-28 07:08:26Jiri Hnideksetmessages: + msg297159
2017-06-23 08:40:10xiang.zhangsetmessages: + msg296692
2017-06-05 21:40:43Jiri Hnideksetmessages: + msg295213
2017-06-01 16:19:25xiang.zhangsetnosy: + xiang.zhang
messages: + msg294955
2017-05-25 05:15:28python-devsetpull_requests: + pull_request1894
2017-05-24 20:13:11Jiri Hnidekcreate