After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640387 - The sha,md5 module are deprecated; use the hashlib module instead
The sha,md5 module are deprecated; use the hashlib module instead
Status: RESOLVED FIXED
Product: gnome-commander
Classification: Other
Component: plugins
1.2.x
Other Linux
: Normal normal
: 1.2.9
Assigned To: epiotr
epiotr
: 610768 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-01-24 09:25 UTC by Alessio Treglia
Modified: 2011-05-12 20:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Replace the md5,sha modules to avoid DeprecationWarnings with Python 2.6 (1.62 KB, patch)
2011-01-24 09:25 UTC, Alessio Treglia
none Details | Review
Avoid hiding warnings (2.58 KB, patch)
2011-05-04 13:51 UTC, Alessio Treglia
none Details | Review

Description Alessio Treglia 2011-01-24 09:25:09 UTC
Created attachment 179139 [details] [review]
Replace the md5,sha modules to avoid DeprecationWarnings with Python 2.6

When running gnome-commander from the terminal, on right-clicking to {md5,sha1}sum the following message is shown:

usr/lib/gnome-commander/plugins/sha1sum.py:30: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha

This is 'cause of the md5,sha modules are deprecated since Python2.6.

The attached patch solves this.
Comment 1 epiotr 2011-01-24 17:10:45 UTC
1.2.8.x series of gcmd comes with python 2.4 requirement. I wouldn't like to increase dependency in this series and - unfortunately - hashlib is available starting from 2.5

So I've silenced DeprecationWarnings using:

   import warnings
   warnings.simplefilter("ignore", DeprecationWarning)

The latest code (upcoming 1.4) doesn't use deprecated md5 and sha modules


Thank you for your bug report - the fix will go into the next, 1.2.8.11 release
Comment 2 epiotr 2011-01-24 17:12:00 UTC
*** Bug 610768 has been marked as a duplicate of this bug. ***
Comment 3 Alessio Treglia 2011-05-04 13:51:06 UTC
Created attachment 187190 [details] [review]
Avoid hiding warnings

Hi again,

the attached patch fixes this without hiding any warning.
Comment 4 epiotr 2011-05-12 20:17:26 UTC
Thank you for your fix - it'll go into the next, 1.2.8.12 release.