Use of hashlib Python 2.5 function

Bug #251849 reported by yippi
2
Affects Status Importance Assigned to Milestone
Moovida
Fix Released
Medium
Olivier Tilloy

Bug Description

The elisa file plugins/database/controller.py imports hashlib. This is a Python 2.5 specific function. For Python 2.4 use, it would be nice if elisa didn't have a hard dependency on this.

Related branches

Changed in elisa:
importance: Undecided → Medium
milestone: none → 0.5.x
status: New → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

This can be easily fixed by falling back to using the md5 module (marked as deprecated in 2.5) if hashlib cannot be imported.

Changed in elisa:
assignee: nobody → osomon
Revision history for this message
yippi (brian-cameron) wrote :

I note that elisa-plugins-bad has a few places where it refers to hashlib. This causes errors and warnings when using Python 2.4. Can these places be modified to fallback to md5 if hashlib is not available?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the patch.
However, md5 being marked as deprecated, we need a real fallback system so that we use hashlib when available.
That would be something like:

try:
    import hashlib
except ImportError:
    import md5 as hashlib

Olivier Tilloy (osomon)
Changed in elisa:
milestone: 0.5.x → 0.5.13
status: Confirmed → In Progress
Olivier Tilloy (osomon)
Changed in elisa:
status: In Progress → Fix Committed
Changed in elisa:
status: Fix Committed → Fix Released
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.