summaryrefslogtreecommitdiffstats
path: root/Lib/codecs.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-09-02 13:14:32 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2002-09-02 13:14:32 (GMT)
commit3aeb632c3152fa082132ce55b9a880e0d16b04ae (patch)
tree192bc1543ea77a826d0c940d024dbc8ebba82156 /Lib/codecs.py
parent94fab762de532de551987e1f48a125145f85304b (diff)
downloadcpython-3aeb632c3152fa082132ce55b9a880e0d16b04ae.zip
cpython-3aeb632c3152fa082132ce55b9a880e0d16b04ae.tar.gz
cpython-3aeb632c3152fa082132ce55b9a880e0d16b04ae.tar.bz2
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r--Lib/codecs.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py
index b089e90..40f0a2e 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -20,7 +20,10 @@ except ImportError, why:
__all__ = ["register", "lookup", "open", "EncodedFile", "BOM", "BOM_BE",
"BOM_LE", "BOM32_BE", "BOM32_LE", "BOM64_BE", "BOM64_LE",
"BOM_UTF8", "BOM_UTF16", "BOM_UTF16_LE", "BOM_UTF16_BE",
- "BOM_UTF32", "BOM_UTF32_LE", "BOM_UTF32_BE"]
+ "BOM_UTF32", "BOM_UTF32_LE", "BOM_UTF32_BE",
+ "strict_errors", "ignore_errors", "replace_errors",
+ "xmlcharrefreplace_errors",
+ "register_error", "lookup_error"]
### Constants
@@ -632,6 +635,14 @@ def make_encoding_map(decoding_map):
m[v] = None
return m
+### error handlers
+
+strict_errors = lookup_error("strict")
+ignore_errors = lookup_error("ignore")
+replace_errors = lookup_error("replace")
+xmlcharrefreplace_errors = lookup_error("xmlcharrefreplace")
+backslashreplace_errors = lookup_error("backslashreplace")
+
# Tell modulefinder that using codecs probably needs the encodings
# package
_false = 0