From 81a950a120451982ab4077916a2e66dc7f269d29 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 26 Dec 2013 18:01:55 +0100 Subject: Improved detection of binary files --- CHANGES | 3 +++ MgaRepo/binrepo.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 347f842..e8119a7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +* 1.10.6 +- Improved detection of binary files + * 1.10.5 - Added README.BINREPO and youridb.sql to Python manifest - Don't block waiting for stderr when displaying subprocess output (#952) diff --git a/MgaRepo/binrepo.py b/MgaRepo/binrepo.py index 13e2c45..ee429f6 100644 --- a/MgaRepo/binrepo.py +++ b/MgaRepo/binrepo.py @@ -34,6 +34,8 @@ def is_binary(path): st = os.stat(path) if st[stat.ST_SIZE] >= maxsize: return True + if open(path).read(0x10000).find('\0') >= 0: + return True return False def find_binaries(paths): -- cgit v1.2.1