summaryrefslogtreecommitdiff
path: root/debian/patches/002_md5_deprecation.dpatch
blob: 2d84c553164321d446ba81f9fd6c2acd306c75aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/sh /usr/share/dpatch/dpatch-run
## 002_md5_deprecation.dpatch by Michael Bienia <geser@ubuntu.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix deprecation warning from python 2.6 about the md5 module

@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' urlgrabber-3.1.0~/urlgrabber/keepalive.py urlgrabber-3.1.0/urlgrabber/keepalive.py
--- urlgrabber-3.1.0~/urlgrabber/keepalive.py	2010-06-21 13:43:49.000000000 +0200
+++ urlgrabber-3.1.0/urlgrabber/keepalive.py	2010-06-21 13:45:26.000000000 +0200
@@ -485,7 +485,7 @@
     keepalive_handler.close_all()
 
 def continuity(url):
-    import md5
+    from hashlib import md5
     format = '%25s: %s'
     
     # first fetch the file with the normal http handler
@@ -494,7 +494,7 @@
     fo = urllib2.urlopen(url)
     foo = fo.read()
     fo.close()
-    m = md5.new(foo)
+    m = md5(foo)
     print format % ('normal urllib', m.hexdigest())
 
     # now install the keepalive handler and try again
@@ -504,7 +504,7 @@
     fo = urllib2.urlopen(url)
     foo = fo.read()
     fo.close()
-    m = md5.new(foo)
+    m = md5(foo)
     print format % ('keepalive read', m.hexdigest())
 
     fo = urllib2.urlopen(url)
@@ -514,7 +514,7 @@
         if f: foo = foo + f
         else: break
     fo.close()
-    m = md5.new(foo)
+    m = md5(foo)
     print format % ('keepalive readline', m.hexdigest())
 
 def comp(N, url):