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 個 reaction 已指派 0 人 在 GitHub 檢視
bug license scan
主要語言
Python
星號
2.6k
分支
791
平均合併
1 天 12 小時
30 天內合併 PR
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 摘要。