While the md5 and sha modules have been regarded as deprecated for quite some time now, it's only in Python 2.6 that importing these modules rather than using hashlib has started giving deprecation warnings. Quite a number of python ports use pycrypto, so anybody who's now using Python 2.6 will see lots of deprecations warnings concerning these two modules. The affected files in pycrypto are lib/Crypto/Hash/SHA.py and lib/Crypto/Hash/MD5.py Fix: A patch to modify these two modules to use hashlib if possible is attached. it patches them to be practically identical (save some differing whitespace and comments) to the same modules in the current development branch of pycrypto at http://gitweb.pycrypto.org/?p=crypto/pycrypto-2.x.git;a=summary The patch may be safely used with Python 2.5 and after. Patch attached with submission follows: How-To-Repeat: Install security/py-pycrypto with Python 2.6, and do the following: $ python
Responsible Changed From-To: freebsd-ports-bugs->freebsd-python freebsd-python@ wants this port PRs (via the GNATS Auto Assign Tool)
State Changed From-To: open->feedback I'm not sure that it's a good fix to suppress the warning in the Python 2.6. I think it should be there for its own reason. Maybe marking security/py-pycrypto use Python 2.5 work?
The patch that I provided is actually a *backport* from the current development version of PyCrypto (as evidenced by the link I provided to its git repository), so it's safe to say that the PyCrypto developers themselves consider it to be safe and good. The patch doesn't actually do any warning suppression. What it does is first try the non-deprecated method of using hashlib (which works in and is recommended for Python 2.5 and after), and then, if that fails (i.e. in pre-2.5 version of Python), it uses the old deprecated (see PEP-0004) method of importing the md5 and sha modules instead. Because quite a bit of code out there uses PyCrypto, requiring the use of 2.5 would probably cause more trouble than good. -- Keith Gaughan - kmgaughan@eircom.net - http://talideon.com/ - CF9F6473 With Age comes Wisdom--but sometimes Age travels alone.
State Changed From-To: feedback->open Feedback received.
lwhsu 2009-07-16 13:46:55 UTC FreeBSD ports repository Modified files: security/py-pycrypto Makefile Added files: security/py-pycrypto/files python25+.txt Log: - Add a patch to make SHA and MD5 use hashlib if possible - Transfer maintainership to submitter PR: ports/135832 Submitted by: Keith Gaughan <kmgaughan AT eircom.net> Revision Changes Path 1.14 +9 -3 ports/security/py-pycrypto/Makefile 1.1 +58 -0 ports/security/py-pycrypto/files/python25+.txt (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed. Thanks!