Modify ↓
Opened 20 years ago
Closed 20 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)
Note: See
TracTickets for help on using
tickets.



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.