Ticket #7836 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

SHA module deprecated warning fix

Reported by: anonymous Assigned to: kisielk
Priority: normal Component: TracMathPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

Hi,

Enclosed you will find a fix for the SHA deprecated warning.

--- tracmath.py	(revision 248)
+++ tracmath.py	(revision 249)
@@ -5,7 +5,7 @@
 
 import codecs
 import re
-import sha
+import hashlib 
 from cStringIO import StringIO
 import os
 import sys
@@ -142,7 +142,7 @@
             if m:
                 label = m.group(1)
 
-        key = sha.new(content.encode('utf-8')).hexdigest()
+        key = hashlib.sha1(content.encode('utf-8')).hexdigest()
 
         imgname = key + '.png'
         imgpath = os.path.join(self.cacheDirectory, imgname)

regards

Mario

Attachments

Change History

12/28/10 08:21:56 changed by kisielk

  • status changed from new to assigned.
  • owner changed from rlotun to kisielk.

12/29/10 07:48:56 changed by kisielk

  • status changed from assigned to closed.
  • resolution set to fixed.

This is fixed in the 0.3 release.


Add/Change #7836 (SHA module deprecated warning fix)




Change Properties
Action