Marshall cannot handle unicode actor from history #1

Open
chaoflow opened this Issue Jul 10, 2010 · 0 comments

Comments

Projects
None yet
1 participant

Seems to be a marshall bug, quintagroup.transmogrifier is affected so posting here for now:

Traceback (innermost last):
  Module ZPublisher.Publish, line 127, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
  Module ZPublisher.Publish, line 47, in call_object
  Module Products.GenericSetup.tool, line 575, in manage_exportSelectedSteps
  Module Products.GenericSetup.tool, line 1022, in _doRunExportSteps
  Module quintagroup.transmogrifier.exportimport, line 85, in exportSiteStructure
  Module quintagroup.transmogrifier.logger, line 30, in __iter__
  Module quintagroup.transmogrifier.writer, line 47, in __iter__
  Module quintagroup.transmogrifier.portlets, line 42, in __iter__
  Module quintagroup.transmogrifier.datacorrector, line 58, in __iter__
  Module quintagroup.transmogrifier.adapters.exporting, line 79, in __call__
  Module Products.Marshall.handlers.atxml, line 361, in marshall
  Module Products.Marshall.handlers.atxml, line 148, in serialize
  Module Products.Marshall.namespaces.cmfns, line 236, in serialize
  Module Products.Marshall.namespaces.cmfns, line 267, in serializeWorkflow
  Module Products.Marshall.namespaces.cmfns, line 341, in marshall_value
SyntaxError: Unknown value type u'roth'
> /home/cfl/.cache/buildout/eggs/Products.Marshall-2.0b2-py2.6.egg/Products/Marshall/namespaces/cmfns.py(341)marshall_value()
-> raise SyntaxError("Unknown value type %r" % value)
(Pdb) l 328, 342
328     def marshall_value(value):
329     
330         if isinstance(value, str):
331             return value, 'str'
332         elif isinstance(value, int):
333             return str(value), 'int'
334         elif isinstance(value, float):
335             return str(value), 'float'
336         elif isinstance(value, DateTime):
337             return value.ISO8601(), 'date'
338         elif isinstance(value, type(None)):
339             return 'None', 'None'
340         else:
341  ->         raise SyntaxError("Unknown value type %r" % value)
342     
(Pdb) value
u'roth'
(Pdb) u
> /home/cfl/.cache/buildout/eggs/Products.Marshall-2.0b2-py2.6.egg/Products/Marshall/namespaces/cmfns.py(267)serializeWorkflow()
-> value, vtype = marshall_value(v)
(Pdb) l 240, 280
240         def serializeWorkflow(self, dom, wf_id, wf_hist):
241     
242             prefix = self.namespace.prefix
243             xmlns = self.namespace.xmlns
244     
245             elname = "%s:workflow" % prefix
246             node = dom.createElementNS(xmlns, elname)
247     
248             wfid_attr = dom.createAttribute("id")
249             wfid_attr.value = wf_id
250     
251             node.setAttributeNode(wfid_attr)
252     
253             for history in wf_hist[wf_id]:
254                 elname = "%s:%s" % (prefix, "history")
255                 history_node = dom.createElementNS(xmlns, elname)
256                 items = history.items()
257                 items.sort(lambda a, b: cmp(a[0], b[0]))
258     
259                 for k, v in items:
260                     elname = "%s:%s" % (prefix, "var")
261                     var_node = dom.createElementNS(xmlns, elname)
262                     # Attributes normally do not have a namespace
263                     value_attr = dom.createAttribute("value")
264                     type_attr = dom.createAttribute("type")
265                     id_attr = dom.createAttribute("id")
266     
267  ->                 value, vtype = marshall_value(v)
268     
269                     id_attr.value = str(k)
270                     type_attr.value = vtype
271                     value_attr.value = value
272     
273                     var_node.setAttributeNode(id_attr)
274                     var_node.setAttributeNode(type_attr)
275                     var_node.setAttributeNode(value_attr)
276     
277                     history_node.appendChild(var_node)
278     
279                 node.appendChild(history_node)
280     
(Pdb) items
[('action', None), ('actor', u'roth'), ('comments', ''), ('review_state', 'private'), ('time', DateTime('2010/06/23 15:45:59.971199 GMT+2'))]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment