summaryrefslogtreecommitdiff
path: root/Lib/codecs.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-09-02 13:14:32 +0000
committerWalter Dörwald <walter@livinglogic.de>2002-09-02 13:14:32 +0000
commitb5b43ef9cfbd9e39e96f289fb5b570cd8a65a342 (patch)
tree5229556cf85dcb123d30effd8660777221ca5bdb /Lib/codecs.py
parent855ff2d8c027dbc11ed58c8a96e94d7efeba6f0d (diff)
downloadcpython-b5b43ef9cfbd9e39e96f289fb5b570cd8a65a342.tar.gz
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 b089e90766..40f0a2e226 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