-
Notifications
You must be signed in to change notification settings - Fork 135
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
Don't crash on duplicated filetypes #630
Comments
Thanks for opening this issue. In the meanwhile we merged a refactored version of the codebase to |
yes, using the latest pypi version of 0.7.1 |
Alright and yes, your argumentation sounds conclusive, the parser should probably not be that strict. As mentioned above we did a major refactoring of the codebase. The refactored version allows duplicated |
Thanks. Will try the alpha, was not aware of that. Regarding the fix. My oneliner fix was to just not do that check and raise the Cardinality error, i.e. just remove that code. Depending on how much you want to "fix" somewhat broken SBOMs you could just use a |
btw, the link in the README towards the migration is broken https://github.com/spdx/tools-python/wiki/How-to-migrate-from-0.7-to-1.0 |
Yes, I agree on that, simply skip should be sufficient.
Yeah I also noticed that and opened a PR #631 for that. |
fixed by #671 |
Some SBOM creation tools create
fileTypes
entries which might contain duplicates, e.g.The MR #310 added code for supporting multiple fileTypes but the code is too strict in that it does not allow duplicates. It throws a
raise CardinalityError("File::FileType")
in case of dupes. The spec does not forbid this https://spdx.github.io/spdx-spec/v2.2.2/file-information/#83-file-type-field so the parser should not be that strict and crash on such files. I see a similar behavior forlicenseInfoInFiles
which do not raise an exception on duplicates.The text was updated successfully, but these errors were encountered: