Bugfix for 5146 and 5106 - ImportProGen fails on Windows because some files

must be read as "binary".


svn: r18056
This commit is contained in:
Kees Bakker 2011-08-23 19:48:33 +00:00
parent abaf5cd4f6
commit d04efcfb7e

View File

@ -110,7 +110,7 @@ def _read_mem(bname):
fname = bname + '.MEM' fname = bname + '.MEM'
else: else:
fname = bname + '.mem' fname = bname + '.mem'
f = open(fname) f = open(fname, "rb")
recfmt = "i28s" recfmt = "i28s"
reclen = struct.calcsize( recfmt ) reclen = struct.calcsize( recfmt )
#print "# reclen = %d" % reclen #print "# reclen = %d" % reclen
@ -131,7 +131,7 @@ def _read_recs(table, bname):
fname = bname + table.fileext fname = bname + table.fileext
else: else:
fname = bname + table.fileext.lower() fname = bname + table.fileext.lower()
f = open(fname) f = open(fname, "rb")
recfmt = table.recfmt recfmt = table.recfmt
log.info("# %s - recfmt = %s" % (table['name1'], recfmt)) log.info("# %s - recfmt = %s" % (table['name1'], recfmt))
reclen = struct.calcsize( recfmt ) reclen = struct.calcsize( recfmt )