summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index c26c2e5..fb9448e 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -291,6 +291,8 @@ class Pickler:
s = mdumps(l)[1:]
self.write(BINUNICODE + s + encoding)
else:
+ object = object.replace(u"\\", u"\\u005c")
+ object = object.replace(u"\n", u"\\u000a")
self.write(UNICODE + object.encode('raw-unicode-escape') + '\n')
memo_len = len(memo)