summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörn Hees <joernhees@users.noreply.github.com>2016-10-15 14:41:15 +0200
committerGitHub <noreply@github.com>2016-10-15 14:41:15 +0200
commit11e835afa1b83d7ab576f6d3b8e587a4bf7e6f01 (patch)
tree6bf0d07d972569824b1e336fb9c80d98ca75757b
parent7fa7e9628d131e7095210616b7665ecab1956d05 (diff)
parent1000e194a6e3b556f8fdd0dc6e6536d794a5a412 (diff)
downloadrdflib-11e835afa1b83d7ab576f6d3b8e587a4bf7e6f01.tar.gz
Merge pull request #650 from redapple/html5lib-encoding
Support newer transport_encoding parameter in html5lib parser call, closes #642
-rw-r--r--rdflib/plugins/parsers/pyRdfa/__init__.py5
-rw-r--r--requirements.py2.txt2
-rw-r--r--requirements.py3.txt2
3 files changed, 6 insertions, 3 deletions
diff --git a/rdflib/plugins/parsers/pyRdfa/__init__.py b/rdflib/plugins/parsers/pyRdfa/__init__.py
index a9223698..55ab61a3 100644
--- a/rdflib/plugins/parsers/pyRdfa/__init__.py
+++ b/rdflib/plugins/parsers/pyRdfa/__init__.py
@@ -609,7 +609,10 @@ class pyRdfa :
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
diff --git a/requirements.py2.txt b/requirements.py2.txt
index 3da97d62..4f8f97cf 100644
--- a/requirements.py2.txt
+++ b/requirements.py2.txt
@@ -1,5 +1,5 @@
flake8
-html5lib==1.0b8
+html5lib
isodate
pyparsing<=1.5.7
SPARQLWrapper
diff --git a/requirements.py3.txt b/requirements.py3.txt
index 5005d8bf..4851bb36 100644
--- a/requirements.py3.txt
+++ b/requirements.py3.txt
@@ -1,5 +1,5 @@
flake8
-html5lib==1.0b8
+html5lib
isodate
pyparsing
SPARQLWrapper