[FIX] addons.zip_directory: ZipFile.write() still expects binary strings for filenames in python 2.5
lp bug: https://launchpad.net/bugs/690559 fixed bzr revid: odo@openerp.com-20101220191724-mvu1rsf3sup19s9m
This commit is contained in:
parent
75db037508
commit
a2055b6d31
|
@ -225,6 +225,10 @@ def zip_directory(directory, b64enc=True, src=True):
|
|||
|
||||
archname = StringIO()
|
||||
archive = PyZipFile(archname, "w", ZIP_DEFLATED)
|
||||
|
||||
# for Python 2.5, ZipFile.write() still expects 8-bit strings (2.6 converts to utf-8)
|
||||
directory = tools.ustr(directory).encode('utf-8')
|
||||
|
||||
archive.writepy(directory)
|
||||
_zippy(archive, directory, src=src)
|
||||
archive.close()
|
||||
|
|
Loading…
Reference in New Issue