Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot explicitly set an encoding with a unicode string #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Cannot explicitly set an encoding with a unicode string #47

wants to merge 1 commit into from

Conversation

brthanmathwoag
Copy link

Publish script throws an exception:

started build
validating HTML
Traceback (most recent call last):
  File "util/validate.py", line 12, in <module>
    html5doc = parser.parse(data, encoding='utf-8')
  File "/usr/lib/python3/dist-packages/html5lib/html5parser.py", line 224, in parse
    parseMeta=parseMeta, useChardet=useChardet)
  File "/usr/lib/python3/dist-packages/html5lib/html5parser.py", line 88, in _parse
    parser=self, **kwargs)
  File "/usr/lib/python3/dist-packages/html5lib/tokenizer.py", line 40, in __init__
    self.stream = HTMLInputStream(stream, encoding, parseMeta, useChardet)
  File "/usr/lib/python3/dist-packages/html5lib/inputstream.py", line 133, in HTMLInputStream
    raise TypeError("Cannot explicitly set an encoding with a unicode string")
TypeError: Cannot explicitly set an encoding with a unicode string
Failed to validate about.html

I ran it on Arch so my first guess was that it's html5lib package's fault but it doesn't work on other distros and html5lib versions too:

Ubuntu 14.04
Python 3.4.3 (default, Oct 14 2015, 20:33:09) [GCC 4.8.4] on linux
python3-html5lib/trusty-updates,now 0.999-3~ubuntu1 all [installed]

Ubuntu 16.04
Python 3.5.2 (default, Jul 5 2016, 12:43:10) [GCC 5.4.0 20160609] on linux
python3-html5lib/xenial,xenial,now 0.999-4

Archlinux
Python 3.5.2 (default, Jun 28 2016, 08:46:01) [GCC 6.1.1 20160602] on linux
python-html5lib 0.9999999-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant