Modify

Opened 18 years ago

Closed 18 years ago

#120 closed defect (wontfix)

"hex()/oct() of negative int" FutureWarning

Reported by: anonymous Owned by: Alec Thomas
Priority: normal Component: PollMacro
Severity: minor Keywords:
Cc: Trac Release:

Description

I've just installed PollMacro and noticed I'm getting lots of these in my error_log:

Poll.py:12: FutureWarning: hex()/oct() of negative int will return a signed string in Python 2.4 and up

I've 'fixed' it with the following:

@@ -9,7 +9,7 @@
 polldir = "/var/state/trac/polls"

 def title2label(title):
-       return hex(abs(crc32(title)))[2:]
+       return hex(crc32(title))[2:]

 class Poll:
     def __init__(self, path, title, options, env):

but this might not be the best solution for everyone, as it changes the path where poll data is kept.

Attachments (0)

Change History (1)

comment:1 Changed 18 years ago by Alec Thomas

Resolution: wontfix
Status: newclosed

I do not see these FutureWarnings under Python 2.4 on Linux. Presumably the beginnings of the numeric fixes in Python are what was being warned about.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
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.