Modify

Opened 9 years ago

Closed 9 years ago

#120 closed defect (wontfix)

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

Reported by: anonymous Owned by: athomas
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 9 years ago by athomas

  • Resolution set to wontfix
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Action
as closed .
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.