[issue21213] Memory bomb by incorrect custom serializer to json.dumps

Lukas Lueg report at bugs.python.org
Sat Apr 26 20:08:47 CEST 2014


Lukas Lueg added the comment:

It's perfectly fine for the function to return an object that can't be put directly into a json string. The function may not convert the object directly but in multiple steps; the encoder will call the function again with the new object until everything boils down to a str, an integer etc.. If one keeps returning objects that never converge to one of those basic types, the interpreter faces death by infinite recursion. The situation described here adds the oom condition caused by repr() blowing up.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21213>
_______________________________________


More information about the Python-bugs-list mailing list