aboutcode-org / aboutcode-org/scancode-toolkit

ScanCode fails to scan large unrar test file

未關閉
#712 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
complex fixed pending review timeout
主要語言
Python
星號
2.6k
分支
791
平均合併
1 天 12 小時
30 天內合併 PR
5

描述

Reported by @msrb in https://github.com/fabric8-analytics/fabric8-analytics-worker/issues/172

The culprit is in the `nulls.txt` file in https://pypi.python.org/pypi/py-unrar2/0.99.6 : this is a ~100MB test text file with zeroes that is the thing that ScanCode chokes on. Actually this file contains 100M times the '0' character.
```
$ python -c "print len(set(open('nulls.txt', 'rb').read()))"
1
```

There are a couple ways to deal with this that come to mind:
- only scan up to a certain size for large files (configurable with an option) and return a warning
- compute the number of unique characters in a file (or start of a file) and use this with a threshold to classify the file as data. Do not scan "data" files. This could be refined by computing the entropy.
- if the file is "text" and the size above a certain threshold, classify the file as data. Do not scan "data" files.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。