aboutcode-org / aboutcode-org/scancode-toolkit

Document `scancode-license-data` in the console scripts section

Đang mở
#4,024 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
documentation Priority: high
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

Running `scancode-license-data` that comes with 32.3.0 does not work.

### How To Reproduce

1. Install `scancode-toolkit` version 32.3.0.
2. Run `scancode-license-data` without any arguments.
3. See

```
$ scancode-license-data
Dumping license data to: None
Traceback (most recent call last):
File "/opt/python/versions/3.11.10/bin/scancode-license-data", line 8, in
sys.exit(dump_scancode_license_data())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python/versions/3.11.10/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python/versions/3.11.10/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/python/versions/3.11.10/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python/versions/3.11.10/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python/versions/3.11.10/lib/python3.11/site-packages/licensedcode/license_db.py", line 227, in dump_scancode_license_data
scancode_license_data(path=path)
File "/opt/python/versions/3.11.10/lib/python3.11/site-packages/licensedcode/license_db.py", line 204, in scancode_license_data
count = generate(build_location=path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python/versions/3.11.10/lib/python3.11/site-packages/licensedcode/license_db.py", line 175, in generate
if not os.path.exists(build_location):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 19, in exists
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
```

The same happens on another machine with Python 3.13:

```
Dumping license data to: None
Traceback (most recent call last):
File "/usr/bin/scancode-license-data", line 8, in
sys.exit(dump_scancode_license_data())
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/lib/python3.13/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.13/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/lib/python3.13/site-packages/licensedcode/license_db.py", line 227, in dump_scancode_license_data
scancode_license_data(path=path)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/licensedcode/license_db.py", line 204, in scancode_license_data
count = generate(build_location=path)
File "/usr/lib/python3.13/site-packages/licensedcode/license_db.py", line 175, in generate
if not os.path.exists(build_location):
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "", line 19, in exists
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
```

### System configuration

* What OS are you running on? Linux
* What version of scancode-toolkit was used to generate the scan file? 32.3.0
* What installation method was used to install/run scancode? Both RPM package on Fedora and `pip install`.

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.