DeprecationWarning: the md5 module is deprecated
Apache的error_log:
/usr/local/lib/python2.6/site-packages/mod_python/importer.py:32:DeprecationWarning:themd5moduleisdeprecated;usehashlibinsteadimportmd5
解决办法:
GOOGLE下发现这是个BUG,在Red Hat Bugzilla找到了解决办法:https://bugzilla.redhat.com/show_bug.cgi?id=526062mod_python patch:
--- mod_python-3.3.1/lib/python/mod_python/importer.py +++ mod_python-3.3.1/lib/python/mod_python/importer.py @@ -29,7 +29,10 @@ import new import types import pdb import imp -import md5 +try: + from hashlib import md5 +except ImportError: + from md5 import md5 import time import string import StringIO @@ -969,7 +972,7 @@ class _ModuleCache: # name which is a filesystem path. Hope MD5 hex # digest is okay. - return self._prefix + md5.new(file).hexdigest() + return self._prefix + md5(file).hexdigest() _global_modules_cache = _ModuleCache()
相关推荐
huavhuahua 2020-11-20
weiiron 2020-11-16
cakecc00 2020-11-15
千锋 2020-11-15
JakobHu 2020-11-14
guangcheng 2020-11-13
xirongxudlut 2020-11-10
solarLan 2020-11-09
pythonxuexi 2020-11-08
文山羊 2020-11-07
susmote 2020-11-07
wuShiJingZuo 2020-11-05
Pythonjeff远 2020-11-06
jacktangj 2020-11-04
lousir 2020-11-04
Noneyes 2020-11-10
ailxxiaoli 2020-11-16
chensen 2020-11-14
Nostalgiachild 2020-11-13