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 serhiy.storchaka
Recipients Aaron.Staley, Zectbumo, eric.araujo, ezio.melotti, ned.deily, pitrou, rhettinger, serhiy.storchaka, vlcinsky
Date 2018-04-13.18:07:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523642825.69.0.682650639539.issue14573@psf.upfronthosting.co.za>
In-reply-to
Content
Things are more complicated. bytes object is an iterable. I think serialize an bytes object (which can be unexpectedly leaked in a code ported from 2.7) as a list of integers is not expected behavior in most cases. It is safer to fail by default and provide an explicit handling for bytes if it is needed. There are other iterables that are better not to serialize by default: mappings, which are not dict subclasses, exhaustible iterators.

I'm working on large patch for the json module (maybe even a PEP). It will not allow serializing all iterables by default, but will make easy to switch on serialization for particular types, including iterables.
History
Date User Action Args
2018-04-13 18:07:05serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, pitrou, ned.deily, ezio.melotti, eric.araujo, Aaron.Staley, Zectbumo, vlcinsky
2018-04-13 18:07:05serhiy.storchakasetmessageid: <1523642825.69.0.682650639539.issue14573@psf.upfronthosting.co.za>
2018-04-13 18:07:05serhiy.storchakalinkissue14573 messages
2018-04-13 18:07:05serhiy.storchakacreate