From: Jeff Allen Date: Sun, 24 Dec 2023 09:43:44 +0000 (+0000) Subject: gh-113028: Correctly memoize str in pickle when escapes added (GH-113436) X-Git-Tag: v3.13.0a3~271 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08398631a0298dcf785ee7bd0e26c7844823ce59;p=thirdparty%2FPython%2Fcpython.git gh-113028: Correctly memoize str in pickle when escapes added (GH-113436) This fixes a divergence between the Python and C implementations of pickle for protocol 0, such that it pickle.py fails to re-use the first pickled representation of strings involving characters that have to be escaped. --- diff --git a/Lib/pickle.py b/Lib/pickle.py index 4f5ad5b71e88..988c08873413 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -857,13 +857,13 @@ class _Pickler: else: self.write(BINUNICODE + pack("