- Notifications
You must be signed in to change notification settings - Fork294
Closed
Labels
Milestone
Description
This gives the empty string on Python 3.x
fromurllib.clientimporturlopenhtml5lib.serialize(html5lib.parse(urlopen('http://html5lib.readthedocs.org/en/latest/')))
The cause is a bug in Python:http://bugs.python.org/issue20007 , bug given CPython’s release cycle timeline I would like to have a work-around in html5lib.
The bug is triggered here:
html5lib-python/html5lib/inputstream.py
Line 122 ine269a2f
isUnicode=isinstance(source.read(0),text_type) |
Unfortunately, the only work-around I can think of (adding a special caseif isinstance(source, http.client.HTTPResponse): isUnicode = False
) is very ugly.