Bug 480945 - [PATCH] Use hashlib instead of deprecated module 'md5'
Summary: [PATCH] Use hashlib instead of deprecated module 'md5'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-cheetah
Version: 11
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Mike Bonnet
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 485445 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-21 14:22 UTC by Satoru SATOH
Modified: 2009-09-25 20:15 UTC (History)
6 users (show)

Fixed In Version: 2.2.2-1.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 507614 508837 (view as bug list)
Environment:
Last Closed: 2009-09-25 20:15:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch to make use of hashlib instead of md5 module (897 bytes, patch)
2009-01-21 14:25 UTC, Satoru SATOH
no flags Details | Diff
Updated patch posted to the upstream mailing list (774 bytes, patch)
2009-01-26 18:47 UTC, Satoru SATOH
no flags Details | Diff

Description Satoru SATOH 2009-01-21 14:22:54 UTC
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:

Comment 1 Satoru SATOH 2009-01-21 14:25:12 UTC
Created attachment 329608 [details]
Patch to make use of hashlib instead of md5 module

It might depend on python >= 2.6.

Comment 2 Mike Bonnet 2009-01-21 14:51:16 UTC
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

Comment 3 Satoru SATOH 2009-01-26 18:46:53 UTC
(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.

Comment 4 Satoru SATOH 2009-01-26 18:47:48 UTC
Created attachment 330020 [details]
Updated patch posted to the upstream mailing list

Comment 5 Jerry Amundson 2009-02-13 16:28:46 UTC
*** Bug 485445 has been marked as a duplicate of this bug. ***

Comment 6 Satoru SATOH 2009-03-19 05:18:10 UTC
FYI. 

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

Comment 7 Bug Zapper 2009-06-09 10:49:01 UTC
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 8 Juha Tuomala 2009-06-30 08:09:24 UTC
http://koji.fedoraproject.org:80/koji/packageinfo?packageID=3568
 There are already builds for 2.2.1

https://admin.fedoraproject.org/updates/search/python-cheetah
 This update (f11) has been submitted for stable

I guess this one could be closed. How about f10, it still appears to have 2.0.1.

Comment 9 Michael DeHaan 2009-07-02 16:08:32 UTC
Thanks very much, was hoping I didn't have to monkey-patch this warning out :)

Comment 10 Michael DeHaan 2009-08-13 15:06:49 UTC
Fedora 11 still seems to be broken.

Comment 11 Mike Bonnet 2009-08-13 15:14:24 UTC
I had prepared an update for F11 but it got as much negative karma as positive, so I didn't push it.

https://admin.fedoraproject.org/updates/F11/FEDORA-2009-5981

I'm waiting for version 2.2.2 (should be out in a couple weeks) and hoping for better luck with that one.  Is this a high priority?

Comment 12 Michael DeHaan 2009-08-13 15:25:23 UTC
Dumb update system won't let me see any reviews of problems with the above.  Ah well.

Not a priority, just wondering if this one slipped through.

Ping me when it's ready and I wouldn't mind helping test.  

--Michael

Comment 13 Mike Bonnet 2009-08-13 15:40:16 UTC
It doesn't actually show me who set the negative karma either, it just shows 3 positive and 3 negative (they didn't make a comment, either).

I'm in touch with the upstream Cheetah maintainer.  The 2.2.2 release should be available in a couple weeks, tops.  I'll send you a link to the build for testing when it's available.  Thanks for the help!

Comment 14 Fedora Update System 2009-09-15 18:05:49 UTC
python-cheetah-2.2.2-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/python-cheetah-2.2.2-1.fc11

Comment 15 Mike Bonnet 2009-09-15 18:10:44 UTC
Packages for the 2.2.2 release are available here:

https://koji.fedoraproject.org/koji/buildinfo?buildID=132136

Please test them and let me know if there are any problems.  You can comment and add/remove karma here:

https://admin.fedoraproject.org/updates/python-cheetah-2.2.2-1.fc11

In particular, please look for any unicode/utf-8 related problems, since handling of encoding issues has changed considerably since 2.0.1.

Note that this version no longer bundles the Markdown module.  If you're using the Markdown transform/filter, you'll need to install a copy locally.  python-markdown is not available in F-11, but is available in F-12 (and python-cheetah adds a dependency on it in F-12).

Comment 16 Fedora Update System 2009-09-16 20:31:34 UTC
python-cheetah-2.2.2-1.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python-cheetah'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9661

Comment 17 Fedora Update System 2009-09-25 20:14:55 UTC
python-cheetah-2.2.2-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


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