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 alexandre.vassalotti
Recipients alexandre.vassalotti, irmen, pitrou, python-dev, rhettinger
Date 2013-05-06.07:26:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1367825175.58.0.786648782155.issue13503@psf.upfronthosting.co.za>
In-reply-to
Content
Our hands are pretty much tied here. The pickle bytearray as unicode hack is likely the best we can do without pickling compatibility between Python 2 and 3. I can't think of a solution that could work here. For example.

1. Pickling bytearrays as a Python 2 str doesn't work because Python 2 strs are unpickled as unicode in Python 3.
2. Pickling bytearrays as an int lists makes the growth factor is much worst: 2x instead of the expected 1.5x.
3. Using a custom constructor breaks pickling compatibility with all the minor releases which doesn't implement the custom constructor.
4. Implementing special support in pickle for bytearrays requires a pickle protocol bump, which is disallowed for bugfixes releases.
5. Creating a special tag type to pickle Python 2 str as bytes in Python 3 has the same problem as #3.
History
Date User Action Args
2013-05-06 07:26:15alexandre.vassalottisetrecipients: + alexandre.vassalotti, rhettinger, irmen, pitrou, python-dev
2013-05-06 07:26:15alexandre.vassalottisetmessageid: <1367825175.58.0.786648782155.issue13503@psf.upfronthosting.co.za>
2013-05-06 07:26:15alexandre.vassalottilinkissue13503 messages
2013-05-06 07:26:15alexandre.vassalotticreate