On this page
codecs.ignore_errors
Prev: codecs.getwriter | Up: codecs | Next: codecs.IncrementalDecoder
Rel: codecs.backslashreplace_errors, codecs.Codec, codecs.CodecInfo, codecs.decode
Ref: docs.python.org — codecs.ignore_errors
Tags: #public #python3 #stdlib #codecs
Import
import codecs
from codecs import ignore_errors
Signature & Overview
codecs.ignore_errors(self, object, /)
Implements the 'ignore' error handling, which ignores malformed data and continues.
Usage
import codecs
assert b"ok\xff!".decode("ascii", errors="ignore") == "ok!"
assert codecs.lookup_error("ignore") is codecs.ignore_errors
Gotchas
- Silently drops invalid bytes/characters: Can hide data corruption—prefer
"replace"or"strict".
REPL Inspect
from codecs import ignore_errors
help(ignore_errors)
Linked from
Related notes
- tuts/python3/stdlib_module/codecs/getwriter Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/IncrementalDecoder Linked here; links to this page; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/codecs/backslashreplace_errors Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/Codec Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/CodecInfo Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/decode Linked here; shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/encode shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/EncodedFile shared tags: #codecs, #stdlib
- tuts/python3/stdlib_module/codecs/getdecoder shared tags: #codecs, #stdlib