mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Fix for issue1153027, making Py3k changes similar to fix in issue918368.
This will address: a) urllib/ in py3k, b) urllib in py2x is addressed by issue918368. c) urllib2 in py2x was already addressed in Revision 43132.
This commit is contained in:
parent
501927d541
commit
690ce9b353
3 changed files with 15 additions and 1 deletions
|
@ -1398,6 +1398,7 @@ class URLopener:
|
|||
def open(self, fullurl, data=None):
|
||||
"""Use URLopener().open(file) instead of open(file, 'r')."""
|
||||
fullurl = unwrap(to_bytes(fullurl))
|
||||
fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]")
|
||||
if self.tempcache and fullurl in self.tempcache:
|
||||
filename, headers = self.tempcache[fullurl]
|
||||
fp = open(filename, 'rb')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue