#4984 closed defect (fixed)
Usage of deprecated md5 and sha (vs. hashlib)
Reported by: | Justin R. Cutler | Owned by: | Matt Good |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | minor | Keywords: | md5, sha, hashlib |
Cc: | Trac Release: | 0.11 |
Description
The following warnings occur when using the AccountManagerPlugin under Python 2.6.
/usr/local/lib/python2.6/dist-packages/TracAccountManager-0.2.1dev_r5479-py2.6.egg/acct_mgr/pwhash.py:13: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5, sha /usr/local/lib/python2.6/dist-packages/TracAccountManager-0.2.1dev_r5479-py2.6.egg/acct_mgr/md5crypt.py:14: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5
Attachments (1)
Change History (8)
comment:1 Changed 16 years ago by
Changed 16 years ago by
Attachment: | accountmanagerplugin.patch added |
---|
Trivial patch to fix Python 2.6 warnings
comment:2 Changed 16 years ago by
Keywords: | hashlib added; shashlib removed |
---|
The patch has been updated to fix both issues.
comment:3 follow-up: 4 Changed 16 years ago by
Priority: | normal → low |
---|---|
Severity: | normal → minor |
I just applied the patch and now get a similar message on notification.py
/usr/local/lib/python2.6/dist-packages/TracWikiNotification-0.2.1-py2.6.egg/WikiNotification /notification.py:17: DeprecationWarning: the md5 module is deprecated; use hashlib instead
as before all works, just a warning.
comment:4 Changed 16 years ago by
Priority: | low → normal |
---|
Replying to alexknol@gmail.com:
I just applied the patch and now get a similar message on notification.py
/usr/local/lib/python2.6/dist-packages/TracWikiNotification-0.2.1-py2.6.egg/WikiNotification /notification.py:17: DeprecationWarning: the md5 module is deprecated; use hashlib insteadas before all works, just a warning.
I would recommend filing a ticket with the WikiNotificationPlugin (http://wikinotification.ufsoft.org/), as your warning is the same issue, but for a different plugin.
comment:5 Changed 16 years ago by
please consider applying this patch and get rid of the deprecation warnings. it's a good way to get ready for 3.0 thanks
comment:6 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Looks like there is an infinite recursion in the
sha_new
function whenhashlib
is unavailable: it calls itself instead of callingsha.new
.Moreover, arguments are not handled properly. It should be:
And something similar for
md5_new
.