Fix open zipfile on win32
bzr revid: ced-5995f1cfb813d1bb27b1b7d047a7de60c423b1db
This commit is contained in:
parent
f4c8e20ef6
commit
8c11d5598e
|
@ -192,7 +192,9 @@ def file_open(name, mode="r", subdir='addons'):
|
|||
if zipfile.is_zipfile(head+'.zip'):
|
||||
import StringIO
|
||||
zfile = zipfile.ZipFile(head+'.zip')
|
||||
return StringIO.StringIO(zfile.read(os.path.join(os.path.basename(head), zipname)))
|
||||
return StringIO.StringIO(zfile.read(os.path.join(
|
||||
os.path.basename(head), zipname).replace(
|
||||
os.sep, '/')))
|
||||
if os.path.isfile(name):
|
||||
return file(name, mode)
|
||||
|
||||
|
|
Loading…
Reference in New Issue