aboutcode-org / aboutcode-org/scancode-toolkit

Scancode report (RDF) can't be processed by spdx-tools

Đang mở
#2,674 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
2.6k
Fork
791
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Mô tả

### Description

**Background**: Scancode generates SDPX version 2.1 (with `--spdx-tv` or `--spdx-rdf`) and uses `spdx-tool` (https://github.com/spdx/tools-python) version `0.6.1? as listed in [requirements.txt](https://github.com/nexB/scancode-toolkit/blob/develop/requirements.txt)

**Problem**: When generating a scancode report the cli tools from [spdx-tool / tools-python](https://github.com/spdx/tools-python) (`parser` and `convertor`) can't process the file

### How To Reproduce

```
$ scancode --version
ScanCode version 21.8.4

$ git clone https://github.com/spdx/tools-python.git

$ scancode -clipe --license-text --license-text-diagnostics --classify --license-clarity-score --summary --summary-key-files --summary-with-details -n $(cat /proc/cpuinfo | grep processor | wc -l) --spdx-rdf tools-python-spdx.rdf tools-python

$ file tools-python-spdx.rdf
tools-python-spdx.rdf: XML 1.0 document, ASCII text

$ cd tools-python

$ virtualenv .

$ source bin/activate

$ pip install .

$ convertor --infile ../tools-python-spdx.rdf ../tools-python-spdx.tv
SPDXID must be "SPDXRef-[idstring]" where [idstring] is a unique string containing letters, numbers, ".", "-".
More than one File checksum defined.
More than one file copyright text defined.
Errors while parsing: True

$ parser --force --file ../tools-python-spdx.rdf
.... snip
FileCopyrightText Copyright 2014 Acme Inc. , ArtifactOfProjectName AcmeTest', ArtifactOfProjectHomePage http://www.acme.org
None, copyright None
copyright 2004-2020 Example Inc.
copyright 2004-2020 The OpenSSL Project
copyright 2004-2020 The OpenSSL Project Authors
copyrighted by the Free Software Foundation

Package summary: None
Package description: None
Package Files:
File name: ./tools-python/spdx/cli_tools/convertor.py
Traceback (most recent call last):
File "/home/hesa/tmp/tools-python/bin/parser", line 8, in
sys.exit(main())
File "/home/hesa/tmp/tools-python/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/hesa/tmp/tools-python/lib/python3.8/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/hesa/tmp/tools-python/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/hesa/tmp/tools-python/lib/python3.8/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/hesa/tmp/tools-python/lib/python3.8/site-packages/spdx/cli_tools/parser.py", line 79, in main
print("\tFile type: {0}".format(VALUES[f.type]))
KeyError: None

$ echo $?
1

```

### System configuration

* **OS**: Ubuntu", "20.04.2 LTS (Focal Fossa)"

* **Scancode version**: 21.8.4

* **spdx-tools / tools-python version**: 0.6.1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.