This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author MultiSosnooley
Recipients MultiSosnooley
Date 2019-02-05.16:50:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549385438.15.0.743086795547.issue35901@roundup.psfhosted.org>
In-reply-to
Content
```
__import__('json').dumps(object(), default=lambda o: repr(o).encode())
```
Produce infinite recursion on `default` function.

Here is more informative example:
```
>>> def f(o):
...     input(f"{o!r} {type(o)}")
...     return repr(o).encode()
... 
>>> import json
>>> json.dumps(object(), default=f)
<object object at 0x7f8c87e987c0> <class 'object'>
b'<object object at 0x7f8c87e987c0>' <class 'bytes'>
b"b'<object object at 0x7f8c87e987c0>'" <class 'bytes'>
b'b"b\'<object object at 0x7f8c87e987c0>\'"' <class 'bytes'>
b'b\'b"b\\\'<object object at 0x7f8c87e987c0>\\\'"\'' <class 'bytes'>
b'b\'b\\\'b"b\\\\\\\'<object object at 0x7f8c87e987c0>\\\\\\\'"\\\'\'' <class 'bytes'>
```
History
Date User Action Args
2019-02-05 16:50:41MultiSosnooleysetrecipients: + MultiSosnooley
2019-02-05 16:50:38MultiSosnooleysetmessageid: <1549385438.15.0.743086795547.issue35901@roundup.psfhosted.org>
2019-02-05 16:50:38MultiSosnooleylinkissue35901 messages
2019-02-05 16:50:38MultiSosnooleycreate