summaryrefslogtreecommitdiffstats
path: root/Doc/library/pickle.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-07 11:42:10 (GMT)
committerGitHub <noreply@github.com>2018-12-07 11:42:10 (GMT)
commit8452ca15f41061c8a6297d7956df22ab476d4df4 (patch)
tree5c90cf33bbe31772f0a6b131d7de8bc433fea7a8 /Doc/library/pickle.rst
parent4c49da0cb7434c676d70b9ccf38aca82ac0d64a9 (diff)
downloadcpython-8452ca15f41061c8a6297d7956df22ab476d4df4.zip
cpython-8452ca15f41061c8a6297d7956df22ab476d4df4.tar.gz
cpython-8452ca15f41061c8a6297d7956df22ab476d4df4.tar.bz2
bpo-22005: Fixed unpickling instances of datetime classes pickled by Python 2. (GH-11017)
encoding='latin1' should be used for successful decoding.
Diffstat (limited to 'Doc/library/pickle.rst')
-rw-r--r--Doc/library/pickle.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
index 4f9d359..5fe49a0 100644
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -243,6 +243,9 @@ process more convenient:
*errors* tell pickle how to decode 8-bit string instances pickled by Python
2; these default to 'ASCII' and 'strict', respectively. The *encoding* can
be 'bytes' to read these 8-bit string instances as bytes objects.
+ Using ``encoding='latin1'`` is required for unpickling NumPy arrays and
+ instances of :class:`~datetime.datetime`, :class:`~datetime.date` and
+ :class:`~datetime.time` pickled by Python 2.
.. function:: loads(bytes_object, \*, fix_imports=True, encoding="ASCII", errors="strict")
@@ -260,6 +263,9 @@ process more convenient:
*errors* tell pickle how to decode 8-bit string instances pickled by Python
2; these default to 'ASCII' and 'strict', respectively. The *encoding* can
be 'bytes' to read these 8-bit string instances as bytes objects.
+ Using ``encoding='latin1'`` is required for unpickling NumPy arrays and
+ instances of :class:`~datetime.datetime`, :class:`~datetime.date` and
+ :class:`~datetime.time` pickled by Python 2.
The :mod:`pickle` module defines three exceptions: