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 belopolsky
Recipients ajaksu2, belopolsky, benjamin.peterson, ggenellina, gjb1002, jackjansen, loewis, pitrou, ronaldoussoren
Date 2010-07-15.15:41:29
SpamBayes Score 0.004206074
Marked as misclassified No
Message-id <1279208492.55.0.902419791605.issue1724366@psf.upfronthosting.co.za>
In-reply-to
Content
> The pickle.py docsstrings in 2.7+ contain the following text
> (amongst others): 
>
>       .. Protocol 0 is the
>       only protocol that can be written to a file opened in text
>       mode and read back successfully.

Hmm, indeed.  The ReST documentation also has the following note:

"""
Note: Be sure to always open pickle files created with protocols >= 1 in binary mode. For the old ASCII-based pickle protocol 0 you can use either text mode or binary mode as long as you stay consistent.
"""

but as Gabriel mentioned above, this should be qualified by at least adding unless pickle contains unicode strings with embedded '\r' on platforms that use '\r' as a part of its end of line sequence.

I don't think changing the way unicode is pickled is an option.  Fixing this aspect of cPickle to behave more like pickle.py given the number of other differences does not look like a good use of developer's time.

I think this is the case were existing behavior should just be better documented.  See also issue616013.
History
Date User Action Args
2010-07-15 15:41:33belopolskysetrecipients: + belopolsky, loewis, jackjansen, ronaldoussoren, gjb1002, ggenellina, pitrou, ajaksu2, benjamin.peterson
2010-07-15 15:41:32belopolskysetmessageid: <1279208492.55.0.902419791605.issue1724366@psf.upfronthosting.co.za>
2010-07-15 15:41:30belopolskylinkissue1724366 messages
2010-07-15 15:41:29belopolskycreate