convert proxy object to string before passing to urllib
This commit is contained in:
parent
d4f836fd65
commit
e244227f41
@ -14,7 +14,7 @@ except ImportError:
|
|||||||
|
|
||||||
import html5lib
|
import html5lib
|
||||||
|
|
||||||
from isso.compat import map, filter, PY2K
|
from isso.compat import map, filter, PY2K, string_types, text_type as str
|
||||||
|
|
||||||
if PY2K: # http://bugs.python.org/issue12984
|
if PY2K: # http://bugs.python.org/issue12984
|
||||||
from xml.dom.minidom import NamedNodeMap
|
from xml.dom.minidom import NamedNodeMap
|
||||||
@ -67,6 +67,9 @@ def host(name):
|
|||||||
('example.tld', 80, True)
|
('example.tld', 80, True)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not (isinstance(name, string_types)):
|
||||||
|
name = str(name)
|
||||||
|
|
||||||
if not name.startswith(('http://', 'https://')):
|
if not name.startswith(('http://', 'https://')):
|
||||||
name = 'http://' + name
|
name = 'http://' + name
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user