[Python-checkins] r42520 - python/trunk/Doc/lib/libpickle.tex

georg.brandl python-checkins at python.org
Mon Feb 20 14:12:04 CET 2006


Author: georg.brandl
Date: Mon Feb 20 14:12:02 2006
New Revision: 42520

Modified:
   python/trunk/Doc/lib/libpickle.tex
Log:
Bug #1102649: add a note to pickle docs that pickle files should be
opened in binary mode.


Modified: python/trunk/Doc/lib/libpickle.tex
==============================================================================
--- python/trunk/Doc/lib/libpickle.tex	(original)
+++ python/trunk/Doc/lib/libpickle.tex	Mon Feb 20 14:12:02 2006
@@ -163,8 +163,17 @@
 \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


More information about the Python-checkins mailing list