Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NameError: name 'self' is not defined" (RDFa parser, with TIME element containing another element) #576

Closed
dbs opened this issue Jan 16, 2016 · 0 comments · Fixed by #577
Labels
bug Something isn't working fix-in-progress parsing Related to a parsing.
Milestone

Comments

@dbs
Copy link
Contributor

dbs commented Jan 16, 2016

Given an HTML structure like the following:

<time><a href="http://example.org">2016-01-01</a></time>

the RDFa parser will abort with an unhandled NameError exception because the _get_literal() function body references self but we are not in an OO context at the time.

I'm working on a fix, with a unit test.

dbs added a commit to dbs/rdflib that referenced this issue Jan 16, 2016
The _get_literal() function in the RDFa parser referred to a self instance that
does not exist. This led to a NameError exception if the HTML to be parsed
included a TIME element with one or more child nodes, such as
'<time><em>2016-01-01</em></time>'. Removing the reference to 'self' fixes
the problem and fixes RDFLib#576.

Signed-off-by: Dan Scott <dan@coffeecode.net>
@joernhees joernhees added bug Something isn't working fix-in-progress parsing Related to a parsing. labels Jan 27, 2016
@joernhees joernhees added this to the rdflib 4.2.2 milestone Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix-in-progress parsing Related to a parsing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants