-
Notifications
You must be signed in to change notification settings - Fork 147
Closed
Labels
Description
Getting spdx.parsers.builderexceptions.SPDXValueError: Entity when parsing a valid (according to the SPDX online tool) SPDX JSON file.
pyspdxtools_parser --file /tmp/rust.json
Traceback (most recent call last):
File "/root/Documents/git_repo/tools-python/bin/pyspdxtools_parser", line 8, in <module>
sys.exit(main())
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/spdx/cli_tools/parser.py", line 33, in main
doc, errors = parse_file(file)
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/spdx/parsers/parse_anything.py", line 51, in parse_file
return p.parse(f)
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/spdx/parsers/jsonparser.py", line 29, in parse
return super(Parser, self).parse()
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/spdx/parsers/jsonyamlxml.py", line 1757, in parse
self.parse_packages(self.document_object.get("packages"))
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/spdx/parsers/jsonyamlxml.py", line 1882, in parse_packages
self.parse_package(package, self.parse_relationship)
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/spdx/parsers/jsonyamlxml.py", line 1156, in parse_package
self.parse_pkg_supplier(package.get("supplier"))
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/spdx/parsers/jsonyamlxml.py", line 1246, in parse_pkg_supplier
entity = self.builder.create_entity(self.document, pkg_supplier)
File "/root/Documents/git_repo/tools-python/lib/python3.10/site-packages/spdx/parsers/rdfbuilders.py", line 167, in create_entity
raise SPDXValueError("Entity")
spdx.parsers.builderexceptions.SPDXValueError: Entity
Test file (it is a cut down version of a far bigger file) attached (rememebr to rename file to have a .json extension)
UPDATE The equivalent SPDX file in Tag Value format (also valid according to the SPDX Online validator) parses correctly.