Edgewall Software
Modify

Opened 8 years ago

Last modified 14 months ago

#12714 new defect

TypeError is raised when passing value to time field via query string of /newticket

Reported by: Jun Omae Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: ticket system Version:
Severity: normal Keywords: time
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

/newticket?timefield=0 crashes. /newticket?timefield=now and /newticket?timefield=2017-03-06T12:34:56+00:00 work. However, /newticket?timefield=2017-03-06T12:34:56Z differs with /newticket?timefield=2017-03-06T12:34:56+00:00.

02:32:43 PM Trac[main] ERROR: Internal Server Error: <RequestWithSession "GET '/newticket?timefield=0'">, referrer None
Traceback (most recent call last):
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/web/main.py", line 613, in _dispatch_request
    dispatcher.dispatch(req)
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/web/main.py", line 273, in dispatch
    iterable=chrome.use_chunked_encoding)
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/web/chrome.py", line 1159, in render_template
    encoding='utf-8')
  ...
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/ticket/templates/ticket_box.html", line 94, in <Expression u"pretty_dateinfo(value, field.format, dateonly=field.format != 'relative') if value else None">
    ${pretty_dateinfo(value, field.format, dateonly=field.format != 'relative') if value else None}
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/timeline/web_ui.py", line 283, in pretty_dateinfo
    absolute = user_time(req, format_datetime, date)
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/util/datefmt.py", line 909, in user_time
    return func(*args, **kwargs)
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/util/datefmt.py", line 312, in format_datetime
    return _format_datetime(t, format, tzinfo, locale, 'datetime')
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/util/datefmt.py", line 268, in _format_datetime
    t = to_datetime(t, tzinfo or localtz)
  File "/venv/trac/1.2/lib/python2.6/site-packages/trac/util/datefmt.py", line 179, in to_datetime
    type(t))
TypeError: expecting datetime, int, long, float, or None; got <type 'unicode'>

Attachments (0)

Change History (2)

comment:1 by Ryan J Ollos, 4 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:2 by Ryan J Ollos, 14 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.