[Bug 640062] Re: the md5 module is deprecated; use hashlib instead import md5

Brian Murray brian at ubuntu.com
Tue Dec 17 01:11:11 UTC 2013


** Bug watch added: Debian Bug tracker #610386
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610386

** Also affects: pyrex (Debian) via
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610386
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to pyrex in Ubuntu.
https://bugs.launchpad.net/bugs/640062

Title:
  the md5 module is deprecated; use hashlib instead   import md5

Status in “pyrex” package in Ubuntu:
  Triaged
Status in “pyrex” package in Debian:
  Unknown

Bug description:
  lsb_release -rd
  Description:	Ubuntu 10.04.1 LTS
  Release:	10.04
  python-pyrex:
    Installed: 0.9.8.5-1ubuntu2
    Candidate: 0.9.8.5-1ubuntu2
    Version table:
   *** 0.9.8.5-1ubuntu2 0
          500 http://mx.archive.ubuntu.com/ubuntu/ lucid/main Packages
          100 /var/lib/dpkg/status

  When using python-pyrex with python2.6 it gives this warning:
  /usr/lib/python2.6/dist-packages/Pyrex/Compiler/Scanning.py:39: DeprecationWarning: the md5 module is deprecated; use hashlib instead  import md5

  Reading the Scanning.py and about the hashlib superseding md5 I found
  that this can be fixed changing only two lines (also I think is solved
  in upstream Pyrex 0.9.9)vicm3 at mini:/usr/lib/python2.6/dist-
  packages/Pyrex/Compiler$ diff -u Scanning.py Scanning.py.new

  --- Scanning.py	2008-05-10 04:12:45.000000000 -0500
  +++ Scanning.py.new	2010-09-15 18:51:44.000000000 -0500
  @@ -36,7 +36,7 @@
       # Try to calculate a hash code for the given source file.
       # Returns an empty string if the file cannot be accessed.
       #print "Hashing", path ###
  -    import md5
  +    import hashlib
       try:
           try:
               f = open(path, "rU")
  @@ -52,7 +52,7 @@
       # tabs by a single space.
       import re
       text = re.sub("[ \t]+", " ", text)
  -    hash = md5.new(text).hexdigest()
  +    hash = hashlib.md5(text).hexdigest()
       return hash
   
   def open_pickled_lexicon(expected_hash):

  Closes the warning.

  ProblemType: Bug
  DistroRelease: Ubuntu 10.04
  Package: python-pyrex 0.9.8.5-1ubuntu2 [modified: usr/share/pyshared/Pyrex/Compiler/Scanning.py]
  ProcVersionSignature: Ubuntu 2.6.32-23.37-generic 2.6.32.15+drm33.5
  Uname: Linux 2.6.32-23-generic i686
  NonfreeKernelModules: wl
  Architecture: i386
  Date: Wed Sep 15 18:48:34 2010
  InstallationMedia: Xubuntu 10.04 "Lucid Lynx" - Release i386 (20100429)
  PackageArchitecture: all
  ProcEnviron:
   LANG=en_US.utf8
   SHELL=/bin/bash
  SourcePackage: pyrex

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyrex/+bug/640062/+subscriptions



More information about the foundations-bugs mailing list