summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoern Hees <dev@joernhees.de>2015-07-20 15:09:56 +0200
committerJoern Hees <dev@joernhees.de>2015-07-20 15:09:56 +0200
commit9c38699f652c65227febf94ec016efd762461a63 (patch)
tree9bdecac5f33997c3f35072764a7e2445b65dc961
parent9d1318c1bca5dd517ae6ce7756815f1adeee3e9f (diff)
downloadrdflib-9c38699f652c65227febf94ec016efd762461a63.tar.gz
fix handling URLInputSource without content-type, closes #498
-rw-r--r--rdflib/parser.py3
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