Fix open zipfile on win32

bzr revid: ced-5995f1cfb813d1bb27b1b7d047a7de60c423b1db
This commit is contained in:
ced 2007-09-06 14:12:38 +00:00
parent f4c8e20ef6
commit 8c11d5598e
1 changed files with 3 additions and 1 deletions

View File

@ -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)