From 55a2e87c3420bbb3e7489de88778679aeb14236b Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Thu, 6 Jan 2011 21:34:45 +0000 Subject: [PATCH] Open file in binary mode for portability to Windows and Python 3. --- python/example.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/example.py b/python/example.py index d78f15a8..18965a1f 100644 --- a/python/example.py +++ b/python/example.py @@ -4,10 +4,10 @@ import magic ms = magic.open(magic.MAGIC_NONE) ms.load() -tp = ms.file("/bin/ls") +tp = ms.file("/bin/ls") print (tp) -f = open("/bin/ls", "r") +f = open("/bin/ls", "rb") buffer = f.read(4096) f.close() -- 2.40.0