六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 104|回复: 0

DeprecationWarning: the md5 module is deprecated

[复制链接]

升级  28%

24

主题

24

主题

24

主题

秀才

Rank: 2

积分
92
 楼主| 发表于 2013-1-16 02:11:53 | 显示全部楼层 |阅读模式
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() 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表