diff options
| author | Reuben Thomas <rrt@sc3d.org> | 2011-01-06 21:34:45 +0000 |
|---|---|---|
| committer | Reuben Thomas <rrt@sc3d.org> | 2011-01-06 21:34:45 +0000 |
| commit | 55a2e87c3420bbb3e7489de88778679aeb14236b (patch) | |
| tree | ea8cc46b5c5728e7684732a8445dbbaa794e2583 /python | |
| parent | 5c5c021e8637001ac0ff8bcc2c0f4626e77b1d8a (diff) | |
| download | file-git-55a2e87c3420bbb3e7489de88778679aeb14236b.tar.gz | |
Open file in binary mode for portability to Windows and Python 3.
Diffstat (limited to 'python')
| -rw-r--r-- | python/example.py | 4 |
1 files 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() |
