scancode-toolkit
scancode-toolkit copied to clipboard
Error: 'ScannedResource' object has no attribute 'holders'
Description
Running scancode with --package
and --summary
options produces the following error:
Scanning done.
Some files failed to scan properly:
ERROR: failed to run post-scan plugin: summary:
Traceback (most recent call last):
File "/opt/scancode-toolkit-v31.1.1/venv/lib/python3.9/site-packages/scancode/cli.py", line 1077, in run_codebase_plugins
plugin.process_codebase(codebase, **kwargs)
File "/opt/scancode-toolkit-v31.1.1/venv/lib/python3.9/site-packages/summarycode/summarizer.py", line 102, in process_codebase
) = get_origin_info_from_top_level_packages(
File "/opt/scancode-toolkit-v31.1.1/venv/lib/python3.9/site-packages/summarycode/summarizer.py", line 273, in get_origin_info_from_top_level_packages
holders = [h['holder'] for h in key_file_resource.holders]
AttributeError: 'ScannedResource' object has no attribute 'holders'
How To Reproduce
- scancode --processes 4 --license --package --json-pp ../scancode-output.json --summary --classify .
System configuration
- What OS are you running on? MacOS
- What version of scancode-toolkit was used to generate the scan file?
-
- ScanCode version: 31.1.1
-
- ScanCode Output Format version: 2.0.0
-
- SPDX License list version: 3.17
- What installation method was used to install/run scancode? download tarball from GH
@bwjohnson-ss Thanks for the report. I'm working on fixing this, just for reference, can you provide the files/package you were scanning when the error occured (if they are public and can be shared, otherwise ignore this), it'll be easier to test my fix then. Thanks!
Unfortunately it's proprietary code and can't be shared. Sorry. Let me know if you have trouble reproducing it with something that's open source. Thanks.
@bwjohnson-ss Thanks! This was an easy fix, and I could also reproduce the bug and add a test for that.
The fix is now merged and released, closing this.