Message193279
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/date_desc"
req = urllib.request.Request(url)
response = urllib.request.urlopen(req, timeout=30)
the_page = response.read().decode('utf-8')
print(the_page)
-----------------------------------------------------------------------
Attached the simple patch to solve this problem.
The question is whether we should fix this problem in urllib or not because strictly speaking the url should be ascii characters only. But if the Firefox can open this url, why not urllib?
I will contemplate about this problem and if I (or other people) think that urllib should handle url containing non-ascii characters, then I will add additional unit test.
Until then, people can use third party package, which is
request package from http://docs.python-requests.org/en/latest/
----------------------------------------------------------------
r = requests.get("http://www.libon.it/ricerca/7817940/3499155443/dettaglio/3102314/Onkel-Oswald-und-der-Sudan-Käfer/order/date_desc")
print(r.text)
---------------------------------------------------------------- |
|
Date |
User |
Action |
Args |
2013-07-18 10:29:06 | vajrasky | set | recipients:
+ vajrasky, terry.reedy, orsenthil, ezio.melotti, Mi.Zou, LDTech |
2013-07-18 10:29:06 | vajrasky | set | messageid: <1374143346.35.0.358310371371.issue17214@psf.upfronthosting.co.za> |
2013-07-18 10:29:06 | vajrasky | link | issue17214 messages |
2013-07-18 10:29:05 | vajrasky | create | |
|