[pyxser-users] problem serializing built-in and other types
Brought to you by:
damowe
From: Vardan A. <vak...@gm...> - 2010-08-22 23:54:19
|
Hi Daniel, It looks like pyxser has a problem serializing built-in types when they are at the top level. For example each of the following will throw a "ValueError: Argument given for serialization/deserialization is not a Python Object or is None.": pyxser.serialize(obj = 1, enc = 'utf-8') pyxser.serialize(obj = 'foo', enc = 'utf-8') pyxser.serialize(obj = ['foo'], enc = 'utf-8') pyxser.serialize(obj = ('foo'), enc = 'utf-8') pyxser.serialize(obj = {1:'foo'}, enc = 'utf-8') Also, an empty class also has the same problem: class Test: pass pyxser.serialize(obj = Test(), enc = 'utf-8') But if I do x = Test() x.foo = 'foo' pyxser.serialize(obj = x, enc = 'utf-8') then it works fine. Is this by design, or am I using it wrongly? I encountered this when I was trying to serialize the result of User.all() that gets all the users through sqlalchemy. Thanks. -Vardan |