From 145d27119577d6e47664c9c275b5eb2066054d6f Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sat, 28 Aug 2010 19:02:37 -0400 Subject: [PATCH] files are opened in binary for windows compatibility --- nbt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbt.py b/nbt.py index d5ee6ed..0dcd101 100644 --- a/nbt.py +++ b/nbt.py @@ -4,12 +4,12 @@ import struct def load(fileobj): if isinstance(fileobj, basestring): # Is actually a filename - fileobj = open(fileobj, 'r') + fileobj = open(fileobj, 'rb') return NBTFileReader(fileobj).read_all() class NBTFileReader(object): def __init__(self, fileobj): - self._file = gzip.GzipFile(fileobj=fileobj, mode='r') + self._file = gzip.GzipFile(fileobj=fileobj, mode='rb') # These private methods read the payload only of the following types def _read_tag_end(self):