diff options
author | Marc-André Lemburg <mal@egenix.com> | 2001-09-20 10:33:38 +0000 |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2001-09-20 10:33:38 +0000 |
commit | ad3912f8299cf61e05ebc474d67856f556a64126 (patch) | |
tree | dd05f9edafd9cdf1677ba56499bf45111ddd60d0 /Lib/encodings | |
parent | 44f57d76975dbfe834f353e4f8094188dcff3d42 (diff) | |
download | cpython-ad3912f8299cf61e05ebc474d67856f556a64126.tar.gz |
Patch #462635 by Andrew Kuchling correcting bugs in the new
codecs -- the self argument does matter for Python functions (it
does not for C functions which most other codecs use).
Diffstat (limited to 'Lib/encodings')
-rw-r--r-- | Lib/encodings/base64_codec.py | 6 | ||||
-rw-r--r-- | Lib/encodings/hex_codec.py | 6 | ||||
-rw-r--r-- | Lib/encodings/quopri_codec.py | 6 | ||||
-rw-r--r-- | Lib/encodings/uu_codec.py | 8 | ||||
-rw-r--r-- | Lib/encodings/zlib_codec.py | 6 |
5 files changed, 21 insertions, 11 deletions
diff --git a/Lib/encodings/base64_codec.py b/Lib/encodings/base64_codec.py index ce21b1a4b2..bae9542ad5 100644 --- a/Lib/encodings/base64_codec.py +++ b/Lib/encodings/base64_codec.py @@ -44,8 +44,10 @@ def base64_decode(input,errors='strict'): class Codec(codecs.Codec): - encode = base64_encode - decode = base64_decode + def encode(self, input,errors='strict'): + return base64_encode(input,errors) + def decode(self, input,errors='strict'): + return base64_decode(input,errors) class StreamWriter(Codec,codecs.StreamWriter): pass diff --git a/Lib/encodings/hex_codec.py b/Lib/encodings/hex_codec.py index ab7d86fc50..572ff79eb8 100644 --- a/Lib/encodings/hex_codec.py +++ b/Lib/encodings/hex_codec.py @@ -44,8 +44,10 @@ def hex_decode(input,errors='strict'): class Codec(codecs.Codec): - encode = hex_encode - decode = hex_decode + def encode(self, input,errors='strict'): + return hex_encode(input,errors) + def decode(self, input,errors='strict'): + return hex_decode(input,errors) class StreamWriter(Codec,codecs.StreamWriter): pass diff --git a/Lib/encodings/quopri_codec.py b/Lib/encodings/quopri_codec.py index 42074f4a09..d98b5ed04b 100644 --- a/Lib/encodings/quopri_codec.py +++ b/Lib/encodings/quopri_codec.py @@ -41,8 +41,10 @@ def quopri_decode(input, errors='strict'): class Codec(codecs.Codec): - encode = quopri_encode - decode = quopri_decode + def encode(self, input,errors='strict'): + return quopri_encode(input,errors) + def decode(self, input,errors='strict'): + return quopri_decode(input,errors) class StreamWriter(Codec, codecs.StreamWriter): pass diff --git a/Lib/encodings/uu_codec.py b/Lib/encodings/uu_codec.py index 82e799c9c8..6ef8369d53 100644 --- a/Lib/encodings/uu_codec.py +++ b/Lib/encodings/uu_codec.py @@ -94,9 +94,11 @@ def uu_decode(input,errors='strict'): class Codec(codecs.Codec): - encode = uu_encode - decode = uu_decode - + def encode(self,input,errors='strict'): + return uu_encode(input,errors) + def decode(self,input,errors='strict'): + return uu_decode(input,errors) + class StreamWriter(Codec,codecs.StreamWriter): pass diff --git a/Lib/encodings/zlib_codec.py b/Lib/encodings/zlib_codec.py index 035bb0480a..d9f7d043ce 100644 --- a/Lib/encodings/zlib_codec.py +++ b/Lib/encodings/zlib_codec.py @@ -45,8 +45,10 @@ def zlib_decode(input,errors='strict'): class Codec(codecs.Codec): - encode = zlib_encode - decode = zlib_decode + def encode(self, input, errors='strict'): + return zlib_encode(input, errors) + def decode(self, input, errors='strict'): + return zlib_decode(input, errors) class StreamWriter(Codec,codecs.StreamWriter): pass |