Bug 1229908 - ScriptMixin._urlopen() has to use quoted URL to not fail if spaces are contained. r=jlund

This commit is contained in:
Henrik Skupin 2015-12-03 11:38:05 +01:00
parent cba4151a41
commit 8a2568e4ac

View File

@ -319,7 +319,9 @@ class ScriptMixin(PlatformMixin):
.. _urllib2.urlopen:
https://docs.python.org/2/library/urllib2.html#urllib2.urlopen
"""
return urllib2.urlopen(url, **kwargs)
# http://bugs.python.org/issue13359 - urllib2 does not automatically quote the URL
url_quoted = urllib2.quote(url, safe='%/:=&?~#+!$,;\'@()*[]|')
return urllib2.urlopen(url_quoted, **kwargs)
def _download_file(self, url, file_name):
""" Helper script for download_file()