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:
Husen Daudi
2008-12-16 17:13:15 +05:30
parent b230a3841b
commit b6c69c83a2
@@ -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()