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

Prevent RDFa parser from failing on time elements with child nodes #577

Merged
merged 1 commit into from
Jan 28, 2016

Conversation

dbs
Copy link
Contributor

@dbs dbs commented 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
'2016-01-01'. Removing the reference to 'self' fixes
the problem and fixes #576.

Signed-off-by: Dan Scott dan@coffeecode.net

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 the parsing Related to a parsing. label Jan 25, 2016
@joernhees joernhees added this to the rdflib 4.2.2 milestone Jan 25, 2016
@joernhees
Copy link
Member

hmm, actually same problem as with pyMicrodata: maybe such things should go to https://github.com/RDFLib/PyRDFa or https://github.com/RDFLib/pyrdfa3 so they could be included in upstream test cases? @iherman ?

@iherman
Copy link
Contributor

iherman commented Jan 28, 2016

Thanks @dbs and @joernhees. I have made the change in the https://github.com/RDFLib/pyrdfa3 repo (see RDFLib/pyrdfa3#13). The https://github.com/RDFLib/PyRDFa is explicitly marked as 'outdated', so I did not touch it.

@iherman
Copy link
Contributor

iherman commented Jan 28, 2016

I do not do merges of PR myself, I leave that to @joernhees ...

joernhees added a commit that referenced this pull request Jan 28, 2016
Prevent RDFa parser from failing on time elements with child nodes, backported in RDFLib/pyrdfa3@f1030e7
@joernhees joernhees merged commit 2344de9 into RDFLib:master Jan 28, 2016
@avengerpenguin
Copy link

I keep hitting this bug over and over. Is v4.2.2 going to be released any time soon please so I can just depend on that version in all my builds?

@joernhees
Copy link
Member

@avengerpenguin sorry for that... my plan was to fix a couple of SPARQL bugs (Milestone 4.2.2) before the release, but i couldn't find enough time to work through them yet... maybe we should just release 4.2.2 and care about the SPARQL issues in a future release?

@avengerpenguin
Copy link

That's up to you if you feel 4.2.2 is in a fit state to be released. I would normally advocate a bug fix release for each bug just to get fixes out there for people, just as with my situation where I would benefit from this issue being fixed in a proper package and I haven't encountered any of the SPARQL bugs you're holding off the release for. Nothing's stopping you having a 4.2.3 release with those bugs fixed when you have time :-)

If you think 4.2.2 has is no worse than 4.2.1 and it has this issue fixed in it, then please do release it if you can.

@avengerpenguin
Copy link

I've got my application building ok using the master branch of this repo, so that takes some pressure off me. I guess it'd still be nice to see a release with this fix and any other fixes if 4.2.2-dev has fewer bugs than 4.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion parsing Related to a parsing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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