diff options
| author | Nick Coghlan <ncoghlan@gmail.com> | 2013-11-22 22:39:36 +1000 |
|---|---|---|
| committer | Nick Coghlan <ncoghlan@gmail.com> | 2013-11-22 22:39:36 +1000 |
| commit | c72e4e6dccce99bcdcb45959767436d7e5cfda8c (patch) | |
| tree | 029832d80cc82a039dc1014302c9eb9dd2214543 /Lib/encodings/base64_codec.py | |
| parent | 322f5ba0d8d5e8a9cd2a134fa215884b4cbc373d (diff) | |
| download | cpython-git-c72e4e6dccce99bcdcb45959767436d7e5cfda8c.tar.gz | |
Issue #19619: Blacklist non-text codecs in method API
str.encode, bytes.decode and bytearray.decode now use an
internal API to throw LookupError for known non-text encodings,
rather than attempting the encoding or decoding operation and
then throwing a TypeError for an unexpected output type.
The latter mechanism remains in place for third party non-text
encodings.
Diffstat (limited to 'Lib/encodings/base64_codec.py')
| -rw-r--r-- | Lib/encodings/base64_codec.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/encodings/base64_codec.py b/Lib/encodings/base64_codec.py index 321a961782..881d1ba0be 100644 --- a/Lib/encodings/base64_codec.py +++ b/Lib/encodings/base64_codec.py @@ -52,4 +52,5 @@ def getregentry(): incrementaldecoder=IncrementalDecoder, streamwriter=StreamWriter, streamreader=StreamReader, + _is_text_encoding=False, ) |
