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

Issue 615 fix rdf parser #616

Merged
merged 3 commits into from
Apr 25, 2023
Merged

Issue 615 fix rdf parser #616

merged 3 commits into from
Apr 25, 2023

Conversation

meretp
Copy link
Collaborator

@meretp meretp commented Apr 25, 2023

This PR fixes two things:

  • If there is any error while parsing the creation info the parsing process will be canceled as the following code tries to access creation_info.doc_namespace. This lead to an uncaught AttributeError.
  • If there are no creators in the given input file an SPDXParsingError will be raised as this is not valid.

I added two negative tests for these cases. They seem to be pretty similar but they test different things. I added the invalid_creation_info_with_snippet to verify that there is no uncaught error whereas the other test simply tests that a file without creators will raise an SPDXParsingError.

fixes #615

meretp added 3 commits April 25, 2023 09:31
…since the following code is based on a correct initialization of CreationInfo

Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Copy link
Collaborator

@armintaenzertng armintaenzertng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@meretp meretp merged commit 1957d0f into spdx:main Apr 25, 2023
@meretp meretp deleted the issue_615_fix_rdf_parser branch April 25, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RDF Parser fails with AttributeError if CreationInfo has bugs
2 participants