[issue17823] 2to3 fixers for missing codecs

Marc-Andre Lemburg report at bugs.python.org
Thu Apr 25 10:18:04 CEST 2013


Marc-Andre Lemburg added the comment:

On 25.04.2013 10:14, Nick Coghlan wrote:
> 
> Nick Coghlan added the comment:
> 
> A more consistent alternative conversion:
> 
> "...".encode("base64") => codecs.encode("...", "base64_codec")
> "...".encode("rot13") => codecs.encode("...", "rot_13")
> "...".encode("zlib") => codecs.encode("...", "zlib_codec")
> "...".encode("hex") => codecs.encode("...", "hex_codec")
> "...".encode("bz2") => codecs.encode("...", "bz2_codec")
> 
> "...".decode("base64") => codecs.decode("...", "base64_codec")
> "...".decode("rot13") => codecs.decode("...", "rot_13")
> "...".decode("zlib") => codecs.decode("...", "zlib_codec")
> "...".decode("hex") => codecs.decode("...", "hex_codec")
> "...".decode("bz2") => codecs.decode("...", "bz2_codec")

It would be better to add back the aliases we had for these codecs.

----------
nosy: +lemburg

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17823>
_______________________________________


More information about the Python-bugs-list mailing list