Force binary mode to avoid newline madness
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/trunk/maps@4083 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
126830d2a9
commit
2e41e003cc
|
@ -40,7 +40,7 @@ class CFDataFile:
|
||||||
def make_file(self, header):
|
def make_file(self, header):
|
||||||
'''creates a datafile, making the column header from a list passed in'''
|
'''creates a datafile, making the column header from a list passed in'''
|
||||||
try:
|
try:
|
||||||
file = open(self.filename,'w')
|
file = open(self.filename,'wb')
|
||||||
except:
|
except:
|
||||||
print "Can't create datafile %s" % self.datafile_name
|
print "Can't create datafile %s" % self.datafile_name
|
||||||
else:
|
else:
|
||||||
|
@ -56,7 +56,7 @@ class CFDataFile:
|
||||||
'''Gets the formatted file as a dictionary
|
'''Gets the formatted file as a dictionary
|
||||||
The # key contains the column headers for the file and indicates the 'primary' key'''
|
The # key contains the column headers for the file and indicates the 'primary' key'''
|
||||||
try:
|
try:
|
||||||
file = open(self.filename,'r')
|
file = open(self.filename,'rb')
|
||||||
except:
|
except:
|
||||||
raise 'Unable to read %s' % self.filename
|
raise 'Unable to read %s' % self.filename
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue