Modify ↓
#10424 closed defect (fixed)
Replace proprietary tz handling
| Reported by: | Steffen Hoffmann | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | normal | Component: | WatchlistPlugin |
| Severity: | normal | Keywords: | timezone time-stamp |
| Cc: | Ryan J Ollos | Trac Release: | 1.0 |
Description
This traceback was been provided for advice on IRC tonight:
2012-10-03 13:53:12,425 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 511, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 237, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/local/lib/python2.7/dist-packages/TracWatchlistPlugin-1.0-py2.7.egg/tracwatchlist/plugin.py", line 589, in process_request
offset = req.tz.utcoffset(datetime.now(req.tz))
File "/usr/lib/python2.7/dist-packages/pytz/tzinfo.py", line 401, in utcoffset
dt = self.localize(dt, is_dst)
File "/usr/lib/python2.7/dist-packages/pytz/tzinfo.py", line 299, in localize
raise ValueError('Not naive datetime (tzinfo is already set)')
ValueError: Not naive datetime (tzinfo is already set)
Seems like recent changes to Trac break current code, as hinted by osimons.
Better use functions from trac.util.datefmt for what is needed by the plugin.
Attachments (0)
Change History (5)
comment:1 Changed 13 years ago by
| Cc: | Ryan J Ollos added; anonymous removed |
|---|
comment:2 Changed 13 years ago by
comment:3 Changed 11 years ago by
| Summary: | Replace propriatary tz handling → Replace proprietary tz handling |
|---|
comment:5 Changed 11 years ago by
| Owner: | changed from Martin Scharrer to Jun Omae |
|---|
Note: See
TracTickets for help on using
tickets.



I suggest the following patch to fix the issue and another issue. See trac:ticket:10863#comment:3.
tracwatchlist/plugin.py
req.tz.utcoffset(datetime.now(req.tz))seconds / 60The another issue is about timezone with negative offset. In the case,
utcoffset().daysis-1.