`

DeprecationWarning: the md5 module is deprecated

阅读更多

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()

 

分享到:
评论

相关推荐

    Python中使用aiohttp模拟服务器出现错误问题及解决方法

    DeprecationWarning: loop argument is deprecated app = web.Application(loop=loop) DeprecationWarning: Application.make_handler(…) is deprecated, use AppRunner API instead srv = await loop.create_...

    Python错误的处理方法

    异常的捕获与处理 ... warnings.warn(deprecated, DeprecationWarning) 异常怎么处理 异常的处理形式如下: try: 你要做的可能会发生异常的事 except 可能会发生的异常: 发生异常之后要做的事 except 可能会发生

    解决 warning 显示 The linear_assignment function is deprecated in 0.21 and will be removed from 0.23. Us…

    用以下代码做实验 import time import cv2 as cv import glob import argparse import sys import numpy as np import os.path from collections import deque from sklearn.utils.linear_assignment_ import linear...

    node-lru-native, 面向 node.js的高性能LRU缓存.zip

    node-lru-native, 面向 node.js的高性能LRU缓存 node-lru-native这是 node.js 内存缓存的简单实现,支持 LRU ( least-recently-used ) 备份和 TTL expirations 。它是作为与( 精彩) node-lru-cache库的替代

    Python中asyncore异步模块的用法及实现httpclient的实例

    asyncore即是一个异步的socket封装,特别是dispatcher类中包含了很多异步调用的socket操作方法,非常犀利,下面我们就来讲解Python中asyncore异步模块的用法及实现httpclient的实例

    Python warning警告出现的原因及忽略方法

    python开发中经常遇到报错的情况,但是warning通常并... warnings.warn("deprecated", DeprecationWarning) with warnings.catch_warnings(): warnings.simplefilter("ignore") fxn() 这样就产生了warning错误 那么

    YOLOv7车牌和人脸识别+检测模型+数据集

    YOLOv7车牌和人脸识别,含训练好的检测权重,以及PR曲线,loss曲线等等,map达90% 多可检测出车牌的位置,司机脸部区域,是否戴口罩,但不能识别具体的车牌号码。附有一万张车牌人脸检测数据集,有下载链接,标签...

    2048游戏java笔试题-hello-world:我是一个新手.学习使用的仓库。文档转载请注明出处,谢谢

    2048游戏java 笔试题 hello-world 初始 git 仓库,学习使用 学习使用git工具创建的仓库。 ...TOOL 一个简易脚本,用于修改脚本...DeprecationWarning: the imp module is deprecated in favour of importlib; see the mo

    利用PyCharm Profile分析异步爬虫效率详解

    今天比较忙,水一下 下面的代码来源于这个视频里面提到的,github 的链接为:github.... 第一个代码如下,就是一个普通的 for 循环爬虫。原文地址。 import requests import bs4 from colorama import Fore ...

    babel7.x和webpack4.x配置vue项目的方法步骤

    很偶然的今天想开个自己的小项目,记录一下最近项目工程上实现的一个小交互。...(node:2628) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead i 「wds」: Project is ru

    Node Mongoose用法详解【Mongoose使用、Schema、对象、model文档等】

    本文实例讲述了Node Mongoose用法。分享给大家供大家参考,具体如下: Mongoose简介 是一个将JavaScript对象与数据库产生关系的一个框架,Object related model。操作对象,就是操作数据库了。对象产生了,同时也...

    The rails4 way

    The rails4 way, 英文原版

    oracle primavera unifier 21.12 新特征功能清单

    Support for the following items is deprecated. While they are supported in the current release of Unifier, they may not be supported in a future release: - Asset Manager: this module enables ...

    api.v7:Qiniu SDK for Golang(v7.x)

    当前代码库 github.com/qiniu/api.v7 在初始化时会输出过时警告,如果您暂时无法迁移又不希望看到该警告,可以在执行应用程序前设置环境变量 SUPPRESS_DEPRECATION_WARNING=1 来屏蔽该警告。 下载 使用 Go mod【推荐...

    checkmarx-github-action:Checkmarx 扫描 Github 操作

    - Deprecation Notice: - This action will be deprecated soon. - Please consider to migrate ASAP to Checkmarx CxFlow Action available in here: - ...

    Python 3.7.3

    PEP 565, Improved DeprecationWarning handling PEP 567, Context Variables Avoiding the use of ASCII as a default text encoding (PEP 538, legacy C locale coercion and PEP 540, forced UTF-8 runtime mode)...

    MissionComplete:任务

    任务完成 设定说明 安装 , , 和 在根文件夹中运行yarn install 。...(node:68008) DeprecationWarning: "--compilers" will be removed in a future version of Mocha; see https://git.io/vdcSr for more info

    python-3.7.4-docs-pdf-letter.zip

    PEP 565, Improved DeprecationWarning handling;PEP 567, Context Variables;Avoiding the use of ASCII as a default text encoding (PEP 538, legacy C locale coercion and PEP 540, forced UTF-8 runtime ...

    RS:推荐系统

    “ DeprecationWarning:为避免名称与igraph项目冲突,该可视化库已重命名为'jgraph'。 请在方便时进行升级。” 报错原因分析: 通过pip list发现Python安装的有igraph包有两个:igraph,python-igraph,导致加载...

    python3.6.5参考手册 chm

    Changes to the Handling of Deprecation Warnings Python 3.1 Features PEP 372: Adding an Ordered Dictionary to collections PEP 378: Format Specifier for Thousands Separator PEP 389: The argparse ...

Global site tag (gtag.js) - Google Analytics