3.1 -> 3.2: base64 lost deprecation warning

Terry Reedy tjreedy at udel.edu
Mon Feb 28 17:02:38 EST 2011


On 2/28/2011 3:51 PM, Ethan Furman wrote:
> Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> --> import base64
> --> base64.encodestring(b'this is a test')
> __main__:1: DeprecationWarning: encodestring() is a deprecated alias,
> use encodebytes()
> b'dGhpcyBpcyBhIHRlc3Q=\n'
>
>
> Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit
> (Intel)] on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> --> import base64
> --> base64.encodestring(b'another test')
> b'dGhpcyBpcyBhIHRlc3Q=\n'
>
>
> The deprecation warning has gone away in 3.2,

No, still there:
def encodestring(s):
     """Legacy alias of encodebytes()."""
     import warnings
     warnings.warn("encodestring() is a deprecated alias, use 
encodebytes()",
                   DeprecationWarning, 2)
     return encodebytes(s)


> but the function
> remains... does anyone know if this was intentional?

In 3.2, DeprecationWarnings are turned off by default so as to not annoy 
users who can do nothing about them and developers who do not want to do 
anything at the moment. I presume the doc for warnings says how to turn 
them back on.

-- 
Terry Jan Reedy




More information about the Python-list mailing list