Message193306
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/7817940/3499155443/dettaglio/3102314/Onkel-Oswald-und-der-Sudan-Käfer/order/date_desc"
req = urllib.request.Request(url)
try:
req.selector.encode('ascii')
except UnicodeEncodeError:
req.selector = quote(req.selector)
response = urllib.request.urlopen(req, timeout=30)
the_page = response.read().decode('utf-8')
print(the_page) |
|
Date |
User |
Action |
Args |
2013-07-18 15:10:43 | vajrasky | set | recipients:
+ vajrasky, terry.reedy, orsenthil, christian.heimes, ezio.melotti, Mi.Zou, LDTech |
2013-07-18 15:10:43 | vajrasky | set | messageid: <1374160243.29.0.560739136632.issue17214@psf.upfronthosting.co.za> |
2013-07-18 15:10:43 | vajrasky | link | issue17214 messages |
2013-07-18 15:10:43 | vajrasky | create | |
|