Code review comment for lp:~mars/launchpad/silence-pycrypto-warnings

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Hi Maris,

did you or Gary talk about the option following the deprecation warning and using hashlib instead of sha throughout lp? There's an example of a conditional import in:

lib/mailman/Mailman/Utils.py

Or temporarily suppressing the warning where it is currently used, so we don't introduce more?
http://docs.python.org/library/warnings.html#temporarily-suppressing-warnings

Also, I'm not sure how the module regex is meant to work there... at least, it doesn't work in a console:
{{{
In [1]: import warnings

In [2]: warnings.filterwarnings("ignore", category=DeprecationWarning, module="crypto")

In [3]: import sha
/usr/bin/ipython:1: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  #!/usr/bin/python

In [4]:
}}}

but this does:

{{{
In [1]: import warnings

In [2]: warnings.filterwarnings("ignore", category=DeprecationWarning, message="the sha module is deprecated")

In [3]: import sha

In [4]:
}}}

Thanks!

review: Needs Information (code)

« Back to merge proposal