Modify

Opened 14 years ago

Closed 14 years ago

#7836 closed defect (fixed)

SHA module deprecated warning fix

Reported by: anonymous Owned by: Kamil Kisiel
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 (0)

Change History (2)

comment:1 Changed 14 years ago by Kamil Kisiel

Owner: changed from rlotun to Kamil Kisiel
Status: newassigned

comment:2 Changed 14 years ago by Kamil Kisiel

Resolution: fixed
Status: assignedclosed

This is fixed in the 0.3 release.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Kamil Kisiel.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.