diff options
| author | Jörn Hees <joernhees@users.noreply.github.com> | 2016-10-15 14:41:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-15 14:41:15 +0200 |
| commit | 11e835afa1b83d7ab576f6d3b8e587a4bf7e6f01 (patch) | |
| tree | 6bf0d07d972569824b1e336fb9c80d98ca75757b | |
| parent | 7fa7e9628d131e7095210616b7665ecab1956d05 (diff) | |
| parent | 1000e194a6e3b556f8fdd0dc6e6536d794a5a412 (diff) | |
| download | rdflib-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__.py | 5 | ||||
| -rw-r--r-- | requirements.py2.txt | 2 | ||||
| -rw-r--r-- | requirements.py3.txt | 2 |
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 |
