Merge lp:~mars/launchpad/silence-pycrypto-warnings into lp:launchpad
Proposed by
Māris Fogels
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Māris Fogels | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 10990 | ||||
Proposed branch: | lp:~mars/launchpad/silence-pycrypto-warnings | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
40 lines (+15/-1) 1 file modified
lib/lp_sitecustomize.py (+15/-1) |
||||
To merge this branch: | bzr merge lp:~mars/launchpad/silence-pycrypto-warnings | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | code | Approve | |
Review via email: mp+27203@code.launchpad.net |
Commit message
Silence a pair of DeprecationWarnings from pycrypto when running under Python2.6.
Description of the change
Hi,
This branch silences a pair of annoying warnings in pycrypto 2.0.1 under Python2.6.
I added a new site-wide warnings hook to lp_sitecustomize.py to do this.
I will run this through ec2 test before landing the change, as it touches the site-wide configuration.
Test: bin/ec2
Pre-implementation call with: gary_poster
Lint: None
Maris
To post a comment you must log in.
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? docs.python. org/library/ warnings. html#temporaril y-suppressing- warnings
http://
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= DeprecationWarn ing, 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= DeprecationWarn ing, message="the sha module is deprecated")
In [3]: import sha
In [4]:
}}}
Thanks!