Permalink
Browse files

Make the parser error visible and use a(n uneaten) copy of self.line.

  • Loading branch information...
1 parent 4301c3b commit c74feee0cf1f8efc919e26048678197642566012 @gjhiggins gjhiggins committed Jun 5, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 rdflib/plugins/parsers/nquads.py
View
7 rdflib/plugins/parsers/nquads.py
@@ -69,11 +69,12 @@ def parse(self, inputsource, sink, **kwargs):
self.file = source
self.buffer = ''
while True:
- self.line = self.readline()
+ self.line = __line = self.readline()
if self.line is None: break
try: self.parseline()
- except ParseError:
- raise ParseError("Invalid line: %r" % self.line)
+ except ParseError, msg:
+ raise ParseError("Invalid line (%s):\n%r" % (msg, __line))
+
return self.sink
def context(self):

0 comments on commit c74feee

Please sign in to comment.