From 7f95ae71f2e47565f26e40140e2ec64eccf7d575 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Fri, 13 Mar 2009 14:51:19 +0000 Subject: [PATCH] get rid of deprecation warning from the md5 use --- md5-hashlib.patch | 38 ++++++++++++++++++++++++++++++++++++++ python-urlgrabber.spec | 8 +++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 md5-hashlib.patch diff --git a/md5-hashlib.patch b/md5-hashlib.patch new file mode 100644 index 0000000..09d1b20 --- /dev/null +++ b/md5-hashlib.patch @@ -0,0 +1,38 @@ +--- a/urlgrabber/keepalive.py~ 2009-03-13 10:45:27.000000000 -0400 ++++ b/urlgrabber/keepalive.py 2009-03-13 10:45:27.000000000 -0400 +@@ -475,7 +475,7 @@ + keepalive_handler.close_all() + + def continuity(url): +- import md5 ++ import hashlib + format = '%25s: %s' + + # first fetch the file with the normal http handler +@@ -484,7 +484,7 @@ + fo = urllib2.urlopen(url) + foo = fo.read() + fo.close() +- m = md5.new(foo) ++ m = hashlib.md5(foo) + print format % ('normal urllib', m.hexdigest()) + + # now install the keepalive handler and try again +@@ -494,7 +494,7 @@ + fo = urllib2.urlopen(url) + foo = fo.read() + fo.close() +- m = md5.new(foo) ++ m = hashlib.md5(foo) + print format % ('keepalive read', m.hexdigest()) + + fo = urllib2.urlopen(url) +@@ -504,7 +504,7 @@ + if f: foo = foo + f + else: break + fo.close() +- m = md5.new(foo) ++ m = hashlib.md5(foo) + print format % ('keepalive readline', m.hexdigest()) + + def comp(N, url): diff --git a/python-urlgrabber.spec b/python-urlgrabber.spec index c6f8008..1473408 100644 --- a/python-urlgrabber.spec +++ b/python-urlgrabber.spec @@ -3,7 +3,7 @@ Summary: A high-level cross-protocol url-grabber Name: python-urlgrabber Version: 3.0.0 -Release: 13%{?dist} +Release: 14%{?dist} Source0: urlgrabber-%{version}.tar.gz Patch0: urlgrabber-keepalive.patch Patch1: urlgrabber-string-type.patch @@ -14,6 +14,7 @@ Patch5: urlgrabber-grab-no-range.patch Patch6: urlgrabber-no-ssl-ok.patch Patch7: urlgrabber-extra-progress.patch Patch8: urlgrabber-file-checkfunc.patch +Patch9: md5-hashlib.patch License: LGPLv2+ Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -38,6 +39,8 @@ authentication, proxies and more. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 + %build python setup.py build @@ -56,6 +59,9 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/urlgrabber %changelog +* Fri Mar 13 2009 Seth Vidal +- kill deprecation warning from importing md5 if anyone uses keepalive + * Mon Mar 9 2009 Seth Vidal - apply patch for urlgrabber to properly check file:// urls with the checkfunc