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

Support newer transport_encoding parameter in html5lib parser call #650

Merged
merged 2 commits into from
Oct 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rdflib/plugins/parsers/pyRdfa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,10 @@ def copyErrors(tog, options) :
if self.charset :
# This means the HTTP header has provided a charset, or the
# file is a local file when we suppose it to be a utf-8
dom = parser.parse(input, encoding=self.charset)
try:
dom = parser.parse(input, encoding=self.charset)
except TypeError:
dom = parser.parse(input, transport_encoding=self.charset)
else :
# No charset set. The HTMLLib parser tries to sniff into the
# the file to find a meta header for the charset; if that
Expand Down
2 changes: 1 addition & 1 deletion requirements.py2.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flake8
html5lib==1.0b8
html5lib
isodate
pyparsing<=1.5.7
SPARQLWrapper
2 changes: 1 addition & 1 deletion requirements.py3.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flake8
html5lib==1.0b8
html5lib
isodate
pyparsing
SPARQLWrapper