Package: syslog-summary Version: 1.13-1 Severity: wishlist Tags: patch python 2.6 deprecates the md5 library used by syslog-summary in favour of hashlib. As a result, every time syslog-summary runs under python2.6 it produces the following working:
/usr/bin/syslog-summary:44: DeprecationWarning: the md5 module is deprecated; use hashlib instead import sys, re, getopt, string, md5 The attached patch makes the required changes. (This bug came to my attention in Ubuntu jaunty, where the switch to python2.6 as the default has already happened. See bug https://bugs.launchpad.net/bugs/390709) -- System Information: Debian Release: squeeze/sid APT prefers oldstable APT policy: (500, 'oldstable'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.28-1-686 (SMP w/1 CPU core) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/dash Versions of packages syslog-summary depends on: ii python 2.5.4-2 An interactive high-level object-o syslog-summary recommends no packages. syslog-summary suggests no packages. -- debconf-show failed
--- syslog-summary.orig 2009-06-22 15:07:29.000000000 +0100 +++ syslog-summary 2009-06-22 15:07:07.000000000 +0100 @@ -41,7 +41,12 @@ version = "1.13" -import sys, re, getopt, string, md5 +import sys, re, getopt, string + +try: + from hashlib import md5 +except ImportError: + from md5 import md5 datepats = [ re.compile(r"^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] "), @@ -153,7 +158,7 @@ linecount = 0 - md5obj = md5.new() + md5obj = md5() if states.has_key(filename): oldlines, oldmd5 = states[filename] for i in xrange(oldlines): @@ -161,7 +166,7 @@ md5obj.update(line) if printable_md5(md5obj.digest()) != oldmd5: file.seek(0, 0) - md5obj = md5.new() + md5obj = md5() else: linecount = oldlines if not QUIET: