GenericSetup: Buggy TAR-Export for Workflows with Non-Ascii-Characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope CMF buildout |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
We stumbled in problems with broken TAR-Exports from GenericSetup exports of DCWorkflows.
The reason: our interactively defined workflows contained non-ascii unicode characters.
For the enclosed example file "definitions.xml", the method "writeDataFile" in class "TarballExportC
The relevant workflow in the attached (fixed) export is
We have developped a simple workaround and replaced the original:
stream = StringIO( text )
info = TarInfo( filename )
info.size = len( text )
with
text = str(text) ### Patch to convert unicode to bytes [RJW 2011-02-09]
stream = StringIO( text )
info = TarInfo( filename )
info.size = len( text ) # len is wrong for utf-8 encoding
It works fine for our purposes. There may surely be a more elegant solution.
The bug appears in Plone 3.3.x and in Plone 4.0.x . Python operates in "utf-8" mode.
Best Regards
roman
I confirm this bug.