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, meador.inge, pitrou
Date 2011-12-06.03:17:21
SpamBayes Score 1.5336238e-10
Marked as misclassified No
Message-id <1323141442.4.0.137143878614.issue13505@psf.upfronthosting.co.za>
In-reply-to
Content
I think we are kind of stuck here. I might need to rely on some clever hack to generate the desired str object in 2.7 without breaking the bytes support in 3.3 and without changing 2.7 itself.

One *dirty* trick I am thinking about would be to use something like array.tostring() to construct the byte string.

    from array import array

    class bytes:
        def __reduce__(self):
            return (array.tostring, (array('B', self),))

Of course, this doesn't work because pickle doesn't method pickling. But, maybe someone can figure out a way around this... I don't know.

Also, this is a bit annoying to fix since we changed the semantic meaning of the STRING opcodes in 3.x---i.e., it now represents a unicode string instead of a byte string.
History
Date User Action Args
2011-12-06 03:17:22alexandre.vassalottisetrecipients: + alexandre.vassalotti, irmen, pitrou, meador.inge
2011-12-06 03:17:22alexandre.vassalottisetmessageid: <1323141442.4.0.137143878614.issue13505@psf.upfronthosting.co.za>
2011-12-06 03:17:21alexandre.vassalottilinkissue13505 messages
2011-12-06 03:17:21alexandre.vassalotticreate