[test] python 2.5 specifix
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 Feb 2011 17:17:54 +0100
changeset 6975 75a232b2e477
parent 6974 6f23b2baf99b
child 6980 8e59c2cdcc99
[test] python 2.5 specifix
sobjects/parsers.py
--- 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,