Opened 12 years ago

Closed 12 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:


I've just installed PollMacro and noticed I'm getting lots of these in my error_log: 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 12 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
as closed The owner will remain Alec Thomas.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.