Deprecated module md5 with python 2.6

Bug #336891 reported by Marco Rodrigues
2
Affects Status Importance Assigned to Milestone
SCons
Invalid
High
scons (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: scons

$ cat /usr/lib/scons/SCons/compat/_scons_hashlib.py | grep "import md5"
import md5

Tags: python2.6
Changed in scons:
importance: Undecided → Low
status: New → Confirmed
Changed in scons:
status: Unknown → Confirmed
Revision history for this message
Steven Knight (knight-baldmt) wrote :

Copying from the upstream bug report at scons.tigris.org:

The line of code you referenced is in a compatibility layer (SCons.compat) that
specifically wraps its import of md5 in an interface designed to mimic the
modern hashlib interface and for use only in older versions of Python. This
code is never used if the version of Python has a native hashlib module.

This is accomplished by the following snippet in
/usr/lib/scons/SCons/compat/__init__.py, which verifies that it can, in fact,
import the native hashlib module and only uses the module that imports md5 if
SCons is being run on an older version where the import fails:

try:
    import hashlib
except ImportError:
    # Pre-2.5 Python has no hashlib module.
    try:
        import_as('_scons_hashlib', 'hashlib')
    except ImportError:
        # If we failed importing our compatibility module, it probably
        # means this version of Python has no md5 module. Don't do
        # anything and let the higher layer discover this fact, so it
        # can fall back to using timestamp.
        pass

Closing as INVALID.

Changed in scons:
status: Confirmed → Invalid
Changed in scons:
status: Confirmed → Invalid
Changed in scons:
importance: Unknown → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.