summaryrefslogtreecommitdiffstats
path: root/Lib/encodings
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-08-14 07:46:28 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-08-14 07:46:28 (GMT)
commit8a8da798a5a35bb387575d696799be29c4eaa0d3 (patch)
tree66bb5ad750db964cd527b74b3bd6a4b11b2dcac1 /Lib/encodings
parentcffac66393c2af89c6546ab081f9098633273a53 (diff)
downloadcpython-8a8da798a5a35bb387575d696799be29c4eaa0d3.zip
cpython-8a8da798a5a35bb387575d696799be29c4eaa0d3.tar.gz
cpython-8a8da798a5a35bb387575d696799be29c4eaa0d3.tar.bz2
Patch #505705: Remove eval in pickle and cPickle.
Diffstat (limited to 'Lib/encodings')
-rw-r--r--Lib/encodings/string_escape.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/encodings/string_escape.py b/Lib/encodings/string_escape.py
new file mode 100644
index 0000000..0e9a17f
--- /dev/null
+++ b/Lib/encodings/string_escape.py
@@ -0,0 +1,23 @@
+# -*- coding: iso-8859-1 -*-
+""" Python 'escape' Codec
+
+
+Written by Martin v. Löwis (martin@v.loewis.de).
+
+"""
+import codecs
+
+class Codec(codecs.Codec):
+
+ encode = codecs.escape_encode
+ decode = codecs.escape_decode
+
+class StreamWriter(Codec,codecs.StreamWriter):
+ pass
+
+class StreamReader(Codec,codecs.StreamReader):
+ pass
+
+def getregentry():
+
+ return (Codec.encode,Codec.decode,StreamReader,StreamWriter)