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 valhallasw
Recipients Ronny.Pfannschmidt, RonnyPfannschmidt, alexandre.vassalotti, georg.brandl, ggenellina, gvanrossum, jcea, jdharper, loewis, pitrou, valhallasw
Date 2012-02-19.19:08:08
SpamBayes Score 8.794726e-09
Marked as misclassified No
Message-id <1329678490.57.0.0127552207963.issue6784@psf.upfronthosting.co.za>
In-reply-to
Content
OK, this is the pickle.py patch. A new parameter 'bytestr' has been added to both _Pickler and _Unpickler to toggle the pickle.string<=>bytes behaviour:

_Pickler:
IF protocol <= 2 AND bytestr=True
THEN bytes are stored as STRING/SHORT_BINSTRING/BINSTRING
ELSE (the old behaviour; obj for protocol <=2, else BINARY)

_Unpickler:
IF bytestr=True
THEN STRING/SHORT_BINSTRING/BINSTRING are read as bytes
ELSE they are read as str (old behaviour)

I also extracted the decoding stuff from the three string reading functions to a single one.
History
Date User Action Args
2012-02-19 19:08:10valhallaswsetrecipients: + valhallasw, gvanrossum, loewis, georg.brandl, jcea, ggenellina, pitrou, alexandre.vassalotti, RonnyPfannschmidt, jdharper, Ronny.Pfannschmidt
2012-02-19 19:08:10valhallaswsetmessageid: <1329678490.57.0.0127552207963.issue6784@psf.upfronthosting.co.za>
2012-02-19 19:08:10valhallaswlinkissue6784 messages
2012-02-19 19:08:09valhallaswcreate