Kaydet (Commit) 26e3b681 authored tarafından Marc-André Lemburg's avatar Marc-André Lemburg

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).
üst efc3a3af
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment