RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.15k stars 555 forks source link

BadSyntax subclasses from SyntaxError, but does not set parent fields #1194

Closed sa-bpelakh closed 2 years ago

sa-bpelakh commented 3 years ago

The documentation for SyntaxError states:

Instances of this class have attributes filename, lineno, offset and text for easier access to the details.

but none of these are set by BadSyntax.

ghost commented 2 years ago

The documentation for SyntaxError states: "Instances of this class have attributes filename, lineno, offset and text for easier access to the details." but none of these are set by BadSyntax.

The Notation3 parser doesn't have access to some of these values when it isn't parsing a file but some values are bound:

https://github.com/RDFLib/rdflib/blob/6ed2ef48ed38679bcdafe7cae250a2ef4b315e7b/rdflib/plugins/parsers/notation3.py#L1653