aboutcode-org / aboutcode-org/scancode-toolkit

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

Aperta
#4,024 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
documentation Priority: high
Lingua principale
Python
Stelle
2.6k
Fork
791
Merge medio
1g 12h
PR unite (30g)
5

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.