aboutcode-org / aboutcode-org/scancode-toolkit

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

オープン
#4,024 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る
documentation Priority: high
主要言語
Python
スター
2.6k
フォーク
791
平均マージ
1日 12時間
マージ済み PR(30日)
5

説明

### 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`.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。