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

2014-04-26 Thread saaj
saaj added the comment: I'll try to be more specific at my point. There're two cases: 1. Scalar: NoneType, int, bool, float, str. Ended immediately. 2. Non-scalar: list/tuple, dict. Recursively traversed, which may result in subsequent calls to the custom function. If the retur

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

2014-04-26 Thread saaj
saaj added the comment: Well, as far as I see the question here is whether it makes sense to allow the default function to return JSON-incompatible objects. -- ___ Python tracker <http://bugs.python.org/issue21

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

2014-04-14 Thread saaj
New submission from saaj: I was chaning an implementation of the function that is passed to json.dumps to extend serializable types. By a mistake (**return** instead of **raise**) it turned into, which at its minum can be expressed as:: def d(obj): return TypeError(repr(obj