Author josh.r
Recipients Ramchandra Apte, alexandre.vassalotti, josh.r, pitrou, sbt, serhiy.storchaka, terry.reedy, vajrasky, vstinner
Date 2017-03-06.16:02:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488816162.08.0.508950083898.issue13566@psf.upfronthosting.co.za>
In-reply-to
Content
Right, but Antoine's objection is that suddenly strs pickled in Py3 can end up as strs in Py2, rather than unicode. If the library enforces a Py3-like type separation on Py2 (text arguments are unicode only, binary data is str only), then you have the problem where pickling on Py3 produces a pickle that will unpickle as str on Py2, and suddenly the library explodes because the argument, that should be unicode on Py2 and str on Py3, is suddenly str on both.

This means that, to fix a problem with non-forward compatible libraries (that accept text only as Py2 str), a Py2 library that's (very) forward thinking would have problems.

Admittedly, I wouldn't expect there to be very many such libraries, and many of them would have their own custom pickle formats, but stuff like numpy is quite sensitive to argument type; numpy.array(u'123') and numpy.array(b'123') are different. In numpy's case, each of those produces a derived datatype that is explicitly pickled and (I believe) would prevent the error, but some other more heuristic library might not do so.
History
Date User Action Args
2017-03-06 16:02:42josh.rsetrecipients: + josh.r, terry.reedy, pitrou, vstinner, alexandre.vassalotti, sbt, Ramchandra Apte, serhiy.storchaka, vajrasky
2017-03-06 16:02:42josh.rsetmessageid: <1488816162.08.0.508950083898.issue13566@psf.upfronthosting.co.za>
2017-03-06 16:02:42josh.rlinkissue13566 messages
2017-03-06 16:02:41josh.rcreate