diff -r ae8b054155c1 Lib/encodings/base64_codec.py --- a/Lib/encodings/base64_codec.py Sat Jul 06 10:25:04 2013 +0200 +++ b/Lib/encodings/base64_codec.py Sat Jul 06 14:43:09 2013 +0200 @@ -3,6 +3,8 @@ This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). +Error-handling mode is irrelevant for this codec, and is ignored. + Written by Marc-Andre Lemburg (mal@lemburg.com). """ @@ -12,11 +14,9 @@ ### Codec APIs def base64_encode(input, errors='strict'): - assert errors == 'strict' return (base64.encodebytes(input), len(input)) def base64_decode(input, errors='strict'): - assert errors == 'strict' return (base64.decodebytes(input), len(input)) class Codec(codecs.Codec): @@ -27,12 +27,10 @@ class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): - assert self.errors == 'strict' return base64.encodebytes(input) class IncrementalDecoder(codecs.IncrementalDecoder): def decode(self, input, final=False): - assert self.errors == 'strict' return base64.decodebytes(input) class StreamWriter(Codec, codecs.StreamWriter): diff -r ae8b054155c1 Lib/encodings/bz2_codec.py --- a/Lib/encodings/bz2_codec.py Sat Jul 06 10:25:04 2013 +0200 +++ b/Lib/encodings/bz2_codec.py Sat Jul 06 14:43:09 2013 +0200 @@ -3,6 +3,8 @@ This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). +Error-handling mode is irrelevant for this codec, and is ignored. + Adapted by Raymond Hettinger from zlib_codec.py which was written by Marc-Andre Lemburg (mal@lemburg.com). """ @@ -13,11 +15,9 @@ ### Codec APIs def bz2_encode(input, errors='strict'): - assert errors == 'strict' return (bz2.compress(input), len(input)) def bz2_decode(input, errors='strict'): - assert errors == 'strict' return (bz2.decompress(input), len(input)) class Codec(codecs.Codec): @@ -28,7 +28,6 @@ class IncrementalEncoder(codecs.IncrementalEncoder): def __init__(self, errors='strict'): - assert errors == 'strict' self.errors = errors self.compressobj = bz2.BZ2Compressor() @@ -44,7 +43,6 @@ class IncrementalDecoder(codecs.IncrementalDecoder): def __init__(self, errors='strict'): - assert errors == 'strict' self.errors = errors self.decompressobj = bz2.BZ2Decompressor() diff -r ae8b054155c1 Lib/encodings/hex_codec.py --- a/Lib/encodings/hex_codec.py Sat Jul 06 10:25:04 2013 +0200 +++ b/Lib/encodings/hex_codec.py Sat Jul 06 14:43:09 2013 +0200 @@ -3,6 +3,8 @@ This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). +Error-handling mode is irrelevant for this codec, and is ignored. + Written by Marc-Andre Lemburg (mal@lemburg.com). """ @@ -12,11 +14,9 @@ ### Codec APIs def hex_encode(input, errors='strict'): - assert errors == 'strict' return (binascii.b2a_hex(input), len(input)) def hex_decode(input, errors='strict'): - assert errors == 'strict' return (binascii.a2b_hex(input), len(input)) class Codec(codecs.Codec): @@ -27,12 +27,10 @@ class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): - assert self.errors == 'strict' return binascii.b2a_hex(input) class IncrementalDecoder(codecs.IncrementalDecoder): def decode(self, input, final=False): - assert self.errors == 'strict' return binascii.a2b_hex(input) class StreamWriter(Codec, codecs.StreamWriter): diff -r ae8b054155c1 Lib/encodings/quopri_codec.py --- a/Lib/encodings/quopri_codec.py Sat Jul 06 10:25:04 2013 +0200 +++ b/Lib/encodings/quopri_codec.py Sat Jul 06 14:43:09 2013 +0200 @@ -2,6 +2,8 @@ This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). + +Error-handling mode is irrelevant for this codec, and is ignored. """ import codecs @@ -9,14 +11,12 @@ from io import BytesIO def quopri_encode(input, errors='strict'): - assert errors == 'strict' f = BytesIO(input) g = BytesIO() quopri.encode(f, g, 1) return (g.getvalue(), len(input)) def quopri_decode(input, errors='strict'): - assert errors == 'strict' f = BytesIO(input) g = BytesIO() quopri.decode(f, g) diff -r ae8b054155c1 Lib/encodings/uu_codec.py --- a/Lib/encodings/uu_codec.py Sat Jul 06 10:25:04 2013 +0200 +++ b/Lib/encodings/uu_codec.py Sat Jul 06 14:43:09 2013 +0200 @@ -3,6 +3,8 @@ This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). +Error-handling mode is irrelevant for this codec, and is ignored. + Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were adapted from uu.py which was written by Lance Ellinghouse and modified by Jack Jansen and Fredrik Lundh. @@ -15,7 +17,6 @@ ### Codec APIs def uu_encode(input, errors='strict', filename='', mode=0o666): - assert errors == 'strict' infile = BytesIO(input) outfile = BytesIO() read = infile.read @@ -32,7 +33,6 @@ return (outfile.getvalue(), len(input)) def uu_decode(input, errors='strict'): - assert errors == 'strict' infile = BytesIO(input) outfile = BytesIO() readline = infile.readline diff -r ae8b054155c1 Lib/encodings/zlib_codec.py --- a/Lib/encodings/zlib_codec.py Sat Jul 06 10:25:04 2013 +0200 +++ b/Lib/encodings/zlib_codec.py Sat Jul 06 14:43:09 2013 +0200 @@ -3,6 +3,8 @@ This codec de/encodes from bytes to bytes and is therefore usable with bytes.transform() and bytes.untransform(). +Error-handling mode is irrelevant for this codec, and is ignored. + Written by Marc-Andre Lemburg (mal@lemburg.com). """ @@ -12,11 +14,9 @@ ### Codec APIs def zlib_encode(input, errors='strict'): - assert errors == 'strict' return (zlib.compress(input), len(input)) def zlib_decode(input, errors='strict'): - assert errors == 'strict' return (zlib.decompress(input), len(input)) class Codec(codecs.Codec): @@ -27,7 +27,6 @@ class IncrementalEncoder(codecs.IncrementalEncoder): def __init__(self, errors='strict'): - assert errors == 'strict' self.errors = errors self.compressobj = zlib.compressobj() @@ -43,7 +42,6 @@ class IncrementalDecoder(codecs.IncrementalDecoder): def __init__(self, errors='strict'): - assert errors == 'strict' self.errors = errors self.decompressobj = zlib.decompressobj()