Apache的error_log:
/usr/local/lib/python2.6/site-packages/mod_python/importer.py:32: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5
解决办法:
GOOGLE下发现这是个BUG,在Red Hat Bugzilla找到了解决办法:https://bugzilla.redhat.com/show_bug.cgi?id=526062
mod_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()
本文详细介绍了如何解决Apache服务器中mod_python导入器模块出现的DeprecationWarning错误问题,通过应用mod_python补丁并更新md5模块,成功解决了错误并优化了服务器性能。
3588

被折叠的 条评论
为什么被折叠?



