Skip to content

Commit 33bba4a

Browse files
committed
utils: is_binary(): lower allowed detected encoding confidence
So more types of files that use multiple encodings aren't flagged. An example file in the current gentoo repo would be app-editors/xemacs/files/xemacs-21.4.24-makeinfo.patch.
1 parent 6888ebe commit 33bba4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pkgcheck/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def is_binary(path, blocksize=1024):
9191

9292
# guess character encoding using chardet
9393
detected_encoding = chardet.detect(byte_str)
94-
if detected_encoding['confidence'] > 0.8:
94+
if detected_encoding['confidence'] > 0.6:
9595
try:
9696
byte_str.decode(encoding=detected_encoding['encoding'])
9797
decodable = True

0 commit comments

Comments
 (0)