Bugfix for encoding (ref:pso)
lp bug: https://launchpad.net/bugs/308074 fixed bzr revid: hda@tinyerp.com-20081216114315-jhb4vfs15bt1jzik
This commit is contained in:
@@ -42,7 +42,7 @@ def _zippy(archive, fromurl, path, src=True):
|
||||
else:
|
||||
exclude = ['py','pyo','pyc']
|
||||
if (path.split('.')[-1] not in exclude) or (os.path.basename(path)=='__terp__.py'):
|
||||
archive.write(os.path.join(fromurl, path), path)
|
||||
archive.write(os.path.join(fromurl, path).encode(), path.encode())
|
||||
return True
|
||||
|
||||
def createzip(cr, uid, moduleid, context, b64enc=True, src=True):
|
||||
@@ -60,7 +60,7 @@ def createzip(cr, uid, moduleid, context, b64enc=True, src=True):
|
||||
if os.path.isdir(os.path.join(ad, name)):
|
||||
archname = StringIO.StringIO('wb')
|
||||
archive = PyZipFile(archname, "w", ZIP_DEFLATED)
|
||||
archive.writepy(os.path.join(ad, name))
|
||||
archive.writepy(os.path.join(ad, name).encode())
|
||||
_zippy(archive, ad, name, src=src)
|
||||
archive.close()
|
||||
val =archname.getvalue()
|
||||
|
||||
Reference in New Issue
Block a user