RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 507614 - [PATCH] Use hashlib instead of deprecated module 'md5'
Summary: [PATCH] Use hashlib instead of deprecated module 'md5'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-cheetah
Version: 6.0
Hardware: All
OS: Linux
low
low
Target Milestone: beta
: ---
Assignee: Radek Novacek
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-23 13:43 UTC by Alexander Todorov
Modified: 2016-12-01 00:29 UTC (History)
7 users (show)

Fixed In Version: python-cheetah-2.2.2-2.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 480945
Environment:
Last Closed: 2010-07-02 19:45:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Alexander Todorov 2009-06-23 13:43:42 UTC
+++ This bug was initially created as a clone of Bug #480945 +++

Description of problem:
The problem looks same as bz#475871.

Cheetah uses deprecated module 'md5' and thus DeprecationWarning warning message will be printed. Here is an example log:

foo@localhost% echo "from Cheetah import CacheRegion" | python -                    ~
/usr/lib/python2.6/site-packages/Cheetah/CacheRegion.py:30: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5
foo@localhost%


Version-Release number of selected component (if applicable):
python-cheetah-2.0.1-4.fc11.x86_64

How reproducible: always if Cheetah.CacheRegion is imported


Steps to Reproduce:
try 'echo "from Cheetah import CacheRegion" | python -'

  
Actual results: See the log above.


Expected results: no warning message


Additional info:

--- Additional comment from ssato on 2009-01-21 09:25:12 EDT ---

Created an attachment (id=329608)
Patch to make use of hashlib instead of md5 module

It might depend on python >= 2.6.

--- Additional comment from mikeb on 2009-01-21 09:51:16 EDT ---

This is really a change that would need to be made upstream.  Also, in order to support older versions of python I think you'd have to fall back to md5 if hashlib isn't available.  You probably want to post a patch to

cheetahtemplate-discuss.net

--- Additional comment from ssato on 2009-01-26 13:46:53 EDT ---

(In reply to comment #2)
> This is really a change that would need to be made upstream.  Also, in order to
> support older versions of python I think you'd have to fall back to md5 if
> hashlib isn't available.  You probably want to post a patch to
> 
> cheetahtemplate-discuss.net

Absolutely right. I just took second best :P
I posted an updated patch to that list. thanks for letting me know that list!

Also, I will attach that patch here for the record.

--- Additional comment from ssato on 2009-01-26 13:47:48 EDT ---

Created an attachment (id=330020)
Updated patch posted to the upstream mailing list

--- Additional comment from jamundso on 2009-02-13 11:28:46 EDT ---

*** Bug 485445 has been marked as a duplicate of this bug. ***

--- Additional comment from ssato on 2009-03-19 01:18:10 EDT ---

FYI. 

"Cheetah Community Edition v2.1.0" looks including my fix.

--- Additional comment from fedora-triage-list on 2009-06-09 06:49:01 EDT ---


This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 1 Alexander Todorov 2009-06-23 13:45:44 UTC
Filing against RHEL6 with python-cheetah-2.0.1-5.fc11.x86_64.rpm. No python-cheetah component in Bugzilla so filing against distribution.

This pops up during installation of cobbler:

Installing cobbler-1.6.2-1.fc11.noarch
/usr/lib64/python2.6/site-packages/Cheetah/CacheRegion.py:30: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages database in /var/lib/rpm

invalid literal for float(): n
  File "/usr/lib/python2.6/site-packages/cobbler/cobbler.py", line 83, in main
    rc = BootCLI().run(sys.argv)

  File "/usr/lib/python2.6/site-packages/cobbler/cobbler.py", line 45, in __init__
    self.api = api.BootAPI(is_cobblerd=False)

  File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 101, in __init__
    self.os_version = utils.os_release()

  File "/usr/lib/python2.6/site-packages/cobbler/utils.py", line 776, in os_release
    version = float(version[0])

The rpm db open error will be reported separately.

Comment 3 Bill Nottingham 2009-06-23 17:05:52 UTC
Moving to beta target.

Comment 4 Mike Bonnet 2009-06-29 18:20:22 UTC
python-cheetah-2.2.1-1.fc11 has been submitted to F11 updates.  This will get pulled into RHEL-6 the next time rawhide is imported (pre-beta).

Comment 7 Chris Ward 2010-03-12 11:23:24 UTC
python-cheetah is in the latest RHEL 6 20100311.1 tree and installable.

yum search python-cheetah
...
python-cheetah.x86_64 : Template engine and code generator

%> rpm -q python-cheetah
python-cheetah-2.4.1-1.el6.x86_64

It's there for i386 too.
ls /mnt/globalsync/rhel/rel-eng/RHEL6.0-20100311.1/6/Workstation/i386/os/Packages/python-cheetah-2.4.1-1.el6.i686.rpm 
/mnt/globalsync/rhel/rel-eng/RHEL6.0-20100311.1/6/Workstation/i386/os/Packages/python-cheetah-2.4.1-1.el6.i686.rpm


echo "from Cheetah import CacheRegion" | python -
doesn't issue any depreciation warning.

Comment 8 releng-rhel@redhat.com 2010-07-02 19:45:00 UTC
Red Hat Enterprise Linux Beta 2 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.