Alexandre Vassalotti <alexan...@peadrop.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13505>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to