My Dinky Note

Aditya Arie Nugraha's weblog

Posts Tagged ‘hashlib

md5 Module Problem on mod_python

with 3 comments

I got this error message in my /var/log/apache2/error.log:

[Fri Aug 14 10:16:51 2009] [error] /usr/lib/python2.6/dist-packages/mod_python/importer.py:32: DeprecationWarning: the md5 module is deprecated; use hashlib instead
[Fri Aug 14 10:16:51 2009] [error]   import md5

I had tried upgrade the libapache2-mod-python package from 3.3.1-6build2 (jaunty package) to 3.3.1-7 (karmic package), but it wasn’t solve the problem.

So, the solution is edit /usr/lib/python2.6/dist-packages/mod_python/importer.py. Change import md5 to from hashlib import md5 and also md5.new(file).hexdigest() to md5(file).hexdigest().

Advertisements

Written by arie

August 14, 2009 at 10:44 am

Posted in Hobbies & Interests

Tagged with , ,