Modify ↓
#10775 closed defect (fixed)
KeyError: 'utc'
Reported by: | falkb | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | WikiFormsPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description (last modified by )
I installed it, used your example, changed a form value, pressed the "Send" button and "KeyError: 'utc'" appears:
File ".../Trac-1.0-py2.7.egg-tmp/trac/ticket/templates/ticket_box.html", line 109, in <Expression u'wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)'> ${wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)} File "build/bdist.win32/egg/trac/wiki/formatter.py", line 1546, in format_to_html return HtmlFormatter(env, context, wikidom).generate(escape_newlines) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 1501, in generate escape_newlines) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 1244, in format self.handle_code_block(line, block_start_match) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 1134, in handle_code_block processed = self.code_processor.process(code_text) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 343, in _macro_processor text) File "build/bdist.win32/egg/wikiforms/wikiforms.py", line 520, in expand_macro time_string = format_datetime(last_modified,'%a %b %d %T %Y %Z',timezone(timezone_name)) File "build/bdist.win32/egg/trac/util/datefmt.py", line 874, in timezone return _tzmap[tzname]
Attachments (0)
Change History (9)
comment:2 Changed 12 years ago by
I changed the code from 'utc' to 'UTC' and it seems I get one step further, though stopped on the next error which is "ValueError: Invalid format string":
File ".../Trac-1.0-py2.7.egg-tmp/trac/ticket/templates/ticket_box.html", line 109, in <Expression u'wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)'> ${wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)} File "build/bdist.win32/egg/trac/wiki/formatter.py", line 1546, in format_to_html return HtmlFormatter(env, context, wikidom).generate(escape_newlines) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 1501, in generate escape_newlines) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 1244, in format self.handle_code_block(line, block_start_match) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 1134, in handle_code_block processed = self.code_processor.process(code_text) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "build/bdist.win32/egg/trac/wiki/formatter.py", line 343, in _macro_processor text) File "build/bdist.win32/egg/wikiforms/wikiforms.py", line 520, in expand_macro time_string = format_datetime(last_modified,'%a %b %d %T %Y %Z',timezone(timezone_name)) File "build/bdist.win32/egg/trac/util/datefmt.py", line 219, in format_datetime return _format_datetime_without_babel(t, format, tzinfo) File "build/bdist.win32/egg/trac/util/datefmt.py", line 184, in _format_datetime_without_babel text = t.strftime(str(format))
comment:3 Changed 12 years ago by
changing line 520 to
time_string = format_datetime(last_modified
let the plugin run without error. The output may not be as you indented. The form displays now: Last Modified: 1/9/2013 10:27:32 AM (77 minutes ago) by falkb
comment:4 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:6 Changed 9 years ago by
Owner: | changed from asic_druide to Ryan J Ollos |
---|---|
Status: | new → accepted |
comment:8 Changed 9 years ago by
I should probably be more careful about handling of req.locale
for Trac < 0.12, but those early versions of Trac are dead to me and I'll fix it if someone complains.
Note: See
TracTickets for help on using
tickets.
...seems that 'utc' is not a valid timezone (you might try 'UTC' instead) or set a timezone (e.g. CET) in trac.ini.