[issue25068] The proxy key's string should ignore case.

2019-09-13 Thread miss-islington


miss-islington  added the comment:


New changeset 590ed09a5b422d59cc1f049c64ac30733545eef0 by Miss Islington (bot) 
in branch '3.8':
bpo-25068: urllib.request.ProxyHandler now lowercases the dict keys (GH-13489)
https://github.com/python/cpython/commit/590ed09a5b422d59cc1f049c64ac30733545eef0


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2019-09-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you for your contribution, your PR has been merged into master but not in 
3.8.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2019-09-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15725
pull_request: https://github.com/python/cpython/pull/16107

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2019-09-13 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:


New changeset b761e3aed1fbada4572a776f6a0d3c4be491d595 by Stéphane Wirtel 
(Zackery Spytz) in branch 'master':
bpo-25068: urllib.request.ProxyHandler now lowercases the dict keys (GH-13489)
https://github.com/python/cpython/commit/b761e3aed1fbada4572a776f6a0d3c4be491d595


--
nosy: +matrixise

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2019-05-22 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
versions: +Python 3.8 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2019-05-22 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +13405
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2015-09-11 Thread Chris Angelico

Chris Angelico added the comment:

This sounds like a feature enhancement, which means it (almost certainly) won't 
be applied to Python 2.7. Does the same question come up in Python 3?

Also (FWIW) if you can confidently assume that all the keys are strings. then 
type.lower() is better than string.lower(type).

--
nosy: +Rosuav

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2015-09-11 Thread Martin Panter

Martin Panter added the comment:

On the other hand, a documentation update saying it has to be lower case would 
be fine for Python 2.7 and 3.4+, if you wanted to go that way.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2015-09-11 Thread Martin Panter

Martin Panter added the comment:

Looking at the code, I think Python 3 is in the same boat. Most things in 
Python are case-sensitive, but I think it is reasonable to make an exception 
here, since the protocol schemes in general are insensitive. E.g. 
urlopen("HTTPS://bugs.python.org/issue25068") still uses "https" internally.

It would be good to include a test case and a note in the documentation if we 
added this though.

--
nosy: +martin.panter
stage:  -> needs patch
type: resource usage -> enhancement
versions: +Python 3.6 -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25068] The proxy key's string should ignore case.

2015-09-11 Thread Chuang Cao

New submission from Chuang Cao:

When use a urllib2.ProxyHandler to set a proxy, if the proxies's key is an 
upper string, like "HTTP", "HTTPS". The proxy url can't be used, because they 
can't find the _open function.

Two way can sovle the issue.
1. Specify it in document to let users to use a lower string like "http".

2. Add a patch in urllib2.py:

diff -up ./urllib2.py.orig ./urllib2.py
--- ./urllib2.py.orig   2015-09-11 15:06:55.686927934 +0800
+++ ./urllib2.py2015-09-11 16:56:48.306138898 +0800
@@ -102,6 +102,7 @@ import sys
 import time
 import urlparse
 import bisect
+import string
 
 try:
 from cStringIO import StringIO
@@ -713,6 +714,7 @@ class ProxyHandler(BaseHandler):
 assert hasattr(proxies, 'has_key'), "proxies must be a mapping"
 self.proxies = proxies
 for type, url in proxies.items():
+type = string.lower(type)
 setattr(self, '%s_open' % type,
 lambda r, proxy=url, type=type, meth=self.proxy_open: \
 meth(r, proxy, type))


I think the second way is a good way.

--
components: Library (Lib)
messages: 250454
nosy: Chuang Cao
priority: normal
severity: normal
status: open
title: The proxy key's string should ignore case.
type: resource usage
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com