sobjects/parsers.py
changeset 6975 75a232b2e477
parent 6970 a6ccbfbacf3d
child 6994 4b2c7e401065
--- a/sobjects/parsers.py	Thu Feb 10 16:21:35 2011 +0100
+++ b/sobjects/parsers.py	Thu Feb 10 17:17:54 2011 +0100
@@ -34,6 +34,9 @@
 from cubicweb import ValidationError, typed_eid
 from cubicweb.server.sources import datafeed
 
+def ensure_str_keys(dict):
+    for key in dict:
+        dict[str(key)] = dict.pop(key)
 
 # see cubicweb.web.views.xmlrss.SERIALIZERS
 DEFAULT_CONVERTERS = BASE_CONVERTERS.copy()
@@ -282,6 +285,7 @@
                           ritem['cwtype'], searchvalues)
 
     def _create_not_found(self, entity, rtype, role, ritem, searchvalues):
+        ensure_str_keys(searchvalues) # XXX necessary with python < 2.6
         return self._cw.create_entity(ritem['cwtype'], **searchvalues).eid
 
     def _related_link(self, entity, rtype, role, ttype, value, searchattrs,