Modify

Opened 4 years ago

Closed 4 years ago

#7836 closed defect (fixed)

SHA module deprecated warning fix

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

Change History (2)

comment:1 Changed 4 years ago by kisielk

  • Owner changed from rlotun to kisielk
  • Status changed from new to assigned

comment:2 Changed 4 years ago by kisielk

  • Resolution set to fixed
  • Status changed from assigned to closed

This is fixed in the 0.3 release.

Add Comment

Modify Ticket

Action
as closed The owner will remain kisielk.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.