[issue17214] http.client.HTTPConnection.putrequest encode error

2016-05-16 Thread Martin Panter
Martin Panter added the comment: I restored the “redundant” encoding of space, in case someone’s code was relying on this behaviour, and because redirect_request() is a publicly documented method. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___

[issue17214] http.client.HTTPConnection.putrequest encode error

2016-05-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset cb09fdef19f5 by Martin Panter in branch '3.5': Issue #17214: Percent-encode non-ASCII bytes in redirect targets https://hg.python.org/cpython/rev/cb09fdef19f5 New changeset 841a9a3f3cf6 by Martin Panter in branch 'default': Issue #14132, Issue #1721

[issue17214] http.client.HTTPConnection.putrequest encode error

2016-05-14 Thread Martin Panter
Martin Panter added the comment: I will look at committing this soon -- stage: patch review -> commit review versions: -Python 3.4 ___ Python tracker ___ ___

[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-30 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: -terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-30 Thread Martin Panter
Martin Panter added the comment: This bug only applies to Python 3. In Python 2, the non-ASCII bytes are sent through to the redirect target verbatim. I think this would also be the ideal way to handle the problem in 3, but percent-encoding them as proposed also seems good enough, and does not

[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-25 Thread Michael
Michael added the comment: I should have looked more closely. The typo is part of the patch. It should be corrected there. -- ___ Python tracker ___ ___

[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-25 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-25 Thread Michael
Michael added the comment: The patch issue17214 did fix this issue in my 3.4.2 install on Ubuntu LTS. It triggered however another bug: File "/usr/local/lib/python3.4/urllib/request.py", line 646, in http_error_302 path = urlparts.path if urlpaths.path else "/" NameError: name 'urlpaths'

[issue17214] http.client.HTTPConnection.putrequest encode error

2015-06-07 Thread Uche Ogbuji
Changes by Uche Ogbuji : -- nosy: +Uche Ogbuji ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue17214] http.client.HTTPConnection.putrequest encode error

2015-03-30 Thread Martin Panter
Martin Panter added the comment: I think this patch needs a test. I left some comments on Reitveld as well. Perhaps there should also be a test to prove that redirects to URLs like /spaced%20path/ do not get mangled. Have a look at the HTTPRedirectHandler.redirect_request() method. Perhaps the

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-19 Thread Christian Heimes
Christian Heimes added the comment: Something else is going on here. A valid server never returns an URL with non-ASCII chars. Your test server does the right thing, too: $ LC_ALL=C wget http://www.libon.it/libon/search/isbn/3499155443 --2013-07-19 11:01:54-- http://www.libon.it/libon/search/i

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-18 Thread Vajrasky Kok
Vajrasky Kok added the comment: Lars, I see. For the uninitiated, the issue is the original url (containing only ascii character) redirects to the url containing non-ascii characters which upsets urllib. To handle that situation, you can do something like this: - import ur

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-18 Thread Lars Ivarsson
Lars Ivarsson added the comment: The problem isn't the original requested url, as it is legit. The problem appears after the 302 redirect when a new (malformed) url is received from the server. There need to be some kind of check of the validity of that second url. And, preferably, an URLError

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-18 Thread Vajrasky Kok
Vajrasky Kok added the comment: I have no problem if this ticket is classified as "won't fix". I am writing this for the confused souls who want to use urllib to access url containing non-ascii characters: import urllib.request from urllib.parse import quote url = "http://www.libon.it/ricerca

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-18 Thread Christian Heimes
Christian Heimes added the comment: The problem may not be a bug but a deliberate design choice. urllib is rather low level and doesn't implement some browser magic. Browsers handle stuff like 'ä' -> '%C3%A4', ' ' -> '%20' or IDNA but urllib doesn't. I always saw it as may responsibility to qu

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-18 Thread Vajrasky Kok
Vajrasky Kok added the comment: The script for demonstrating bug can be simplified to: --- import urllib.request url = "http://www.libon.it/ricerca/7817940/3499155443/dettaglio/3102314/Onkel-Oswald-und-der-Sudan-Käfer/order/da

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-16 Thread LDTech
LDTech added the comment: This problem still exist in Python 3.3.2. The following code gives you an example: import urllib.request url = "http://www.libon.it/libon/search/isbn/3499155443"; req = urllib.request.Request(url) response = urllib.request.urlopen(req, timeout=30) the_page = response.r

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-02-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: Please give us 1. the exact Python version used. 3.2.3? or something earlier? 2. A minimal but complete example that we can run. What is 'headers'? 3. The complete traceback, not just the last two entries. 4. The result of running with the newer 3.3.0, if you pos

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-02-16 Thread Mi Zou
Mi Zou added the comment: while urllib following the redirection(302): http.client.HTTPConnection.putrequest raise an error: #-- ... File "D:\Program Files\Python32\lib\http\client.py", line 1004, in _send_request self.putrequest(meth

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-02-16 Thread Mi Zou
Changes by Mi Zou : -- title: urllib.client.HTTPConnection.putrequest encode error -> http.client.HTTPConnection.putrequest encode error ___ Python tracker ___ ___