diff options
author | Joern Hees <dev@joernhees.de> | 2015-07-20 15:09:56 +0200 |
---|---|---|
committer | Joern Hees <dev@joernhees.de> | 2015-07-20 15:09:56 +0200 |
commit | 9c38699f652c65227febf94ec016efd762461a63 (patch) | |
tree | 9bdecac5f33997c3f35072764a7e2445b65dc961 | |
parent | 9d1318c1bca5dd517ae6ce7756815f1adeee3e9f (diff) | |
download | rdflib-9c38699f652c65227febf94ec016efd762461a63.tar.gz |
fix handling URLInputSource without content-type, closes #498
-rw-r--r-- | rdflib/parser.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rdflib/parser.py b/rdflib/parser.py index 45915b45..6ada9dac 100644 --- a/rdflib/parser.py +++ b/rdflib/parser.py @@ -102,7 +102,8 @@ class URLInputSource(InputSource): self.url = file.geturl() # in case redirections took place self.setPublicId(self.url) self.content_type = file.info().get('content-type') - self.content_type = self.content_type.split(";", 1)[0] + if self.content_type is not None: + self.content_type = self.content_type.split(";", 1)[0] self.setByteStream(file) # TODO: self.setEncoding(encoding) self.response_info = file.info() # a mimetools.Message instance |