Skip to content

Commit

Permalink
Merge pull request #499 from joernhees/fix_no_content_type
Browse files Browse the repository at this point in the history
fix handling URLInputSource without content-type, closes #498
  • Loading branch information
joernhees committed Jul 20, 2015
2 parents 9d1318c + 9c38699 commit 4e257e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rdflib/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def __init__(self, system_id=None, format=None):
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
Expand Down

0 comments on commit 4e257e4

Please sign in to comment.