Index: Doc/library/codecs.rst =================================================================== --- Doc/library/codecs.rst (révision 76753) +++ Doc/library/codecs.rst (copie de travail) @@ -1102,6 +1102,10 @@ byte string. The result of the "decoding" direction is listed as operand type in the table. +.. deprecated:: 2.7 + The codecs which don't convert from Unicode strings to byte strings have been + removed in Python 3.0. Use the appropriate module when available. + +--------------------+---------------------------+----------------+---------------------------+ | Codec | Aliases | Operand type | Purpose | +====================+===========================+================+===========================+ Index: Lib/encodings/bz2_codec.py =================================================================== --- Lib/encodings/bz2_codec.py (révision 76753) +++ Lib/encodings/bz2_codec.py (copie de travail) @@ -7,6 +7,10 @@ by Marc-Andre Lemburg (mal@lemburg.com). """ +from warnings import warnpy3k +warnpy3k("the 'bz2' codec has been removed in Python 3.0", stacklevel=2) +del warnpy3k + import codecs import bz2 # this codec needs the optional bz2 module ! Index: Lib/encodings/quopri_codec.py =================================================================== --- Lib/encodings/quopri_codec.py (révision 76753) +++ Lib/encodings/quopri_codec.py (copie de travail) @@ -2,6 +2,9 @@ Like base64 and rot13, this returns Python strings, not Unicode. """ +from warnings import warnpy3k +warnpy3k("the 'quopri' codec has been removed in Python 3.0", stacklevel=2) +del warnpy3k import codecs, quopri try: Index: Lib/encodings/string_escape.py =================================================================== --- Lib/encodings/string_escape.py (révision 76753) +++ Lib/encodings/string_escape.py (copie de travail) @@ -5,6 +5,10 @@ Written by Martin v. Löwis (martin@v.loewis.de). """ +from warnings import warnpy3k +warnpy3k("the 'string_escape' codec has been removed in Python 3.0", stacklevel=2) +del warnpy3k + import codecs class Codec(codecs.Codec): Index: Lib/encodings/zlib_codec.py =================================================================== --- Lib/encodings/zlib_codec.py (révision 76753) +++ Lib/encodings/zlib_codec.py (copie de travail) @@ -6,6 +6,10 @@ Written by Marc-Andre Lemburg (mal@lemburg.com). """ +from warnings import warnpy3k +warnpy3k("the 'zlib' codec has been removed in Python 3.0", stacklevel=2) +del warnpy3k + import codecs import zlib # this codec needs the optional zlib module ! Index: Lib/encodings/uu_codec.py =================================================================== --- Lib/encodings/uu_codec.py (révision 76753) +++ Lib/encodings/uu_codec.py (copie de travail) @@ -8,6 +8,10 @@ modified by Jack Jansen and Fredrik Lundh. """ +from warnings import warnpy3k +warnpy3k("the 'uu' codec has been removed in Python 3.0", stacklevel=2) +del warnpy3k + import codecs, binascii ### Codec APIs Index: Lib/encodings/rot_13.py =================================================================== --- Lib/encodings/rot_13.py (révision 76753) +++ Lib/encodings/rot_13.py (copie de travail) @@ -6,6 +6,9 @@ Written by Marc-Andre Lemburg (mal@lemburg.com). """#" +from warnings import warnpy3k +warnpy3k("the 'rot_13' codec has been removed in Python 3.0", stacklevel=2) +del warnpy3k import codecs Index: Lib/encodings/hex_codec.py =================================================================== --- Lib/encodings/hex_codec.py (révision 76753) +++ Lib/encodings/hex_codec.py (copie de travail) @@ -6,6 +6,10 @@ Written by Marc-Andre Lemburg (mal@lemburg.com). """ +from warnings import warnpy3k +warnpy3k("the 'hex' codec has been removed in Python 3.0", stacklevel=2) +del warnpy3k + import codecs, binascii ### Codec APIs Index: Lib/encodings/base64_codec.py =================================================================== --- Lib/encodings/base64_codec.py (révision 76753) +++ Lib/encodings/base64_codec.py (copie de travail) @@ -6,6 +6,10 @@ Written by Marc-Andre Lemburg (mal@lemburg.com). """ +from warnings import warnpy3k +warnpy3k("the 'base64' codec has been removed in Python 3.0", stacklevel=2) +del warnpy3k + import codecs, base64 ### Codec APIs