sha模块已弃用

时间:2015-07-04 11:18:58

标签: python sip centos6 sha hashlib

我正在玩SIPVicious(python)

所以我有一个专用的服务器centos 6.6。当我运行脚本时,我收到此错误:

  

/root/1/fphelper.py:134:DeprecationWarning:不推荐使用sha模块;请改用hashlib模块

     

导入sha,重新

当我使用此命令时。

  

rpm -qa | grep python

以下是出现的内容:

rpm-python-4.8.0-38.el6_6.x86_64
dbus-python-0.83.0-6.1.el6.x86_64
gnome-python2-2.28.0-3.el6.x86_64
gnome-python2-canvas-2.28.0-3.el6.x86_64
libreport-python-2.0.9-21.el6.centos.x86_64
gnome-python2-applet-2.28.0-5.el6.x86_64
gnome-python2-gconf-2.28.0-3.el6.x86_64
gnome-python2-bonobo-2.28.0-3.el6.x86_64
python-urlgrabber-3.9.1-9.el6.noarch
python-tools-2.6.6-52.el6.x86_64
newt-python-0.52.11-3.el6.x86_64
python-ethtool-0.6-5.el6.x86_64
python-pycurl-7.19.0-8.el6.x86_64
python-docs-2.6.6-2.el6.noarch
gnome-python2-libegg-2.25.3-20.el6.x86_64
python-iwlib-0.1-1.2.el6.x86_64
libxml2-python-2.7.6-17.el6_6.1.x86_64
gnome-python2-gnome-2.28.0-3.el6.x86_64
python-iniparse-0.3.1-2.1.el6.noarch
gnome-python2-libwnck-2.28.0-5.el6.x86_64
libproxy-python-0.3.0-10.el6.x86_64
python-2.6.6-52.el6.x86_64
gnome-python2-gnomevfs-2.28.0-3.el6.x86_64
gnome-python2-desktop-2.28.0-5.el6.x86_64
gnome-python2-extras-2.25.3-20.el6.x86_64
abrt-addon-python-2.0.8-26.el6.centos.x86_64
at-spi-python-1.28.1-2.el6.centos.x86_64
python-libs-2.6.6-52.el6.x86_64
python-devel-2.6.6-52.el6.x86_64

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:2)

您收到此警告,因为Python标准库发生了变化。 sha模块的功能已与其他哈希算法合并到hashlib中。该警告通知您代码使用旧模块,并且应将其更改为新库。

请参阅https://docs.python.org/2/library/hashlib.html,了解如何更改代码以使用hashlib