diff options
author | Georg Brandl <georg@python.org> | 2006-02-20 13:12:02 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-02-20 13:12:02 (GMT) |
commit | 69774c212a35c5b271729a47dc9ae2fc6d7cef29 (patch) | |
tree | 678d77619e9e1a19ae9728c11bf4852a02b7af7f | |
parent | 9b743f514c8e6781ebcb9ef444555b3a88633e6d (diff) | |
download | cpython-69774c212a35c5b271729a47dc9ae2fc6d7cef29.zip cpython-69774c212a35c5b271729a47dc9ae2fc6d7cef29.tar.gz cpython-69774c212a35c5b271729a47dc9ae2fc6d7cef29.tar.bz2 |
Bug #1102649: add a note to pickle docs that pickle files should be
opened in binary mode.
-rw-r--r-- | Doc/lib/libpickle.tex | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/lib/libpickle.tex b/Doc/lib/libpickle.tex index 99dd330..45e80b8 100644 --- a/Doc/lib/libpickle.tex +++ b/Doc/lib/libpickle.tex @@ -163,8 +163,17 @@ as a \var{protocol} value. \versionadded{2.3} \end{datadesc} +\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. + + A pickle file written with protocol 0 in binary mode will contain + lone linefeeds as line terminators and therefore will look ``funny'' + when viewed in Notepad or other editors which do not support this + format.} + The \module{pickle} module provides the -following functions to make this process more convenient: +following functions to make the pickling process more convenient: \begin{funcdesc}{dump}{obj, file\optional{, protocol}} Write a pickled representation of \var{obj} to the open file object |