aboutcode-org / aboutcode-org/scancode-toolkit

Strange error statement: Some characters could not be decoded, and were replaced with REPLACEMENT CHARACTER.\n

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

説明

### Description
I ran a scan on what looks like a minimized Debian filesystem (I got it from a Docker container):
`scancode -lpcu --quiet --json - /path/to/filesystem`
Before it spits out the giant json object it gives this message:
`Some characters could not be decoded, and were replaced with REPLACEMENT CHARACTER.\n`

When running without `--quiet` I get this message:
```
Scanning done.
Some files failed to scan properly:
Path: contents/usr/share/doc/gpgv/copyright
Path: contents/usr/share/doc/libgcrypt20/copyright
```
I don't see any issue with these two files.

When running the scan on just these two files I don't get the above "some characters could not be decoded" but it does give a scan error:
```
"ERROR: for scanner: licenses:\nERROR: Unknown error:\nTraceback (most recent call last):\n File \"/home/nisha/scancodeenv/lib/python3.6/site-packages/scancode/interrupt.py\", line 92, in interruptible\n return NO_ERROR, func(*(args or ()), **(kwargs or {}))\n File \"/home/nisha/scancodeenv/lib/python3.6/site-packages/scancode/api.py\", line 211, in get_licenses\n _licenses_data_from_match(match, matched_text, license_url_template)\n File \"/home/nisha/scancodeenv/lib/python3.6/site-packages/scancode/api.py\", line 234, in _licenses_data_from_match\n result['key'] = lic.key\nAttributeError: 'NoneType' object has no attribute 'key'\n"]}
```

### System configuration

System: Ubuntu 18.04
Scancode version: 3.1.1
Downloaded using pip install [scancode-toolkit](url)
Python version: 3.7

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

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

評価

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

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

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