summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-02-20 13:12:07 (GMT)
committerGeorg Brandl <georg@python.org>2006-02-20 13:12:07 (GMT)
commitf1a408d40e34186297d490515498315d3f29c278 (patch)
treeb6aa3cec57074323ccb9f3a77bcacc08fdf7a4d4
parent9c65202f49d0a10367b53c10cb1552b09d985d9c (diff)
downloadcpython-f1a408d40e34186297d490515498315d3f29c278.zip
cpython-f1a408d40e34186297d490515498315d3f29c278.tar.gz
cpython-f1a408d40e34186297d490515498315d3f29c278.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.tex11
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/lib/libpickle.tex b/Doc/lib/libpickle.tex
index 74d289e..06a43a7 100644
--- a/Doc/lib/libpickle.tex
+++ b/Doc/lib/libpickle.tex
@@ -167,8 +167,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\optional{, bin}}}
Write a pickled representation of \var{obj} to the open file object