From 9c38699f652c65227febf94ec016efd762461a63 Mon Sep 17 00:00:00 2001 From: Joern Hees Date: Mon, 20 Jul 2015 15:09:56 +0200 Subject: fix handling URLInputSource without content-type, closes #498 --- rdflib/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1