Edgewall Software
Modify

Ticket #4466 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Can't mark milestone as completed (TypeError: can't compare datetime.datetime to float)

Reported by: akaihola Owned by: cboos
Priority: high Milestone: 0.11
Component: general Version: devel
Severity: major Keywords:
Cc:
Release Notes:
API Changes:

Description

How to Reproduce

On the Manage Milestones page, if I check the "Completed" checkbox, accept the current date and time as automatically filled in, and click "Save", Trac issues an internal error. My trac is revision [4501] from svn.

{'__FORM_TOKEN': u'002c6d797a0a5b2da4663143',
 'cat_id': u'ticket',
 'completed': u'on',
 'completeddate': u'28.12.2006 00:37:14',
 'description': u'My milestone description',
 'duedate': u'28.12.2006',
 'name': u'My milestone name',
 'panel_id': u'milestones',
 'path_info': u'My milestone path info',
 'save': u'Save'}

System Information

Trac 0.11dev
Python 2.4 (#2, Feb 12 2005, 00:29:46)
[GCC 3.4.3 (Mandrakelinux 10.2 3.4.3-3mdk)]
SQLite 3.2.2
pysqlite 2.0.4
Genshi 0.4dev-r466
Subversion 1.1.4

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 395, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 213, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/trac/admin/web_ui.py", line 84, in process_request
    path_info)
  File "/usr/lib/python2.4/site-packages/trac/ticket/admin.py", line 132, in render_admin_panel
    if mil.completed > time.time():
TypeError: can't compare datetime.datetime to float

Attachments

Change History

comment:1 Changed 5 years ago by athomas

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

Fixed in r4502.

comment:2 Changed 5 years ago by kkatzke@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

This issue is still present in r4634.

How to Reproduce

While doing a POST operation on /admin/ticket/milestones/Camps - Admin 1, Trac issued an internal error.

{'panel_id': u'milestones', 'description': u, 'completed': u'on', 'FORM_TOKEN': u'60d637ed9e7ebd728fe8f5ff', 'path_info': u'Camps - Admin 1', 'cat_id': u'ticket', 'save': u'Save', 'duedate': u'02/05/07', 'name': u'Camps - Admin Campers'}

System Information

Trac 0.11dev
[GCC 3.4.3 20041114 (Red Hat 3.4.3-4)]
Python 2.3.4 (#1, Jan 12 2005, 09:22:26)
SQLite 3.3.3
pysqlite 1.1.7
Genshi 0.3.6
Subversion 1.1.4

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 395, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 213, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.3/site-packages/trac/admin/web_ui.py", line 96, in process_request
    path_info)
  File "/usr/lib/python2.3/site-packages/trac/ticket/admin.py", line 133, in render_admin_panel
    if mil.completed > datetime.now(utc):
TypeError: can't compare datetime.datetime to int


comment:3 Changed 5 years ago by kkatzke@…

  • Priority changed from normal to high
  • Severity changed from normal to major

Gents: This is a horrible bug in 0.11, as the "Complete Milestone" checkbox is checked by default when editing a milestone. Could someone either patch this, or at least fix it by removing the default 'on' in the Complete Milestone checkbox?

Upping priority to get it some attention, knock it down if you feel the need.

comment:4 Changed 5 years ago by cboos

  • Milestone set to 0.11
  • Owner changed from jonas to cboos
  • Status changed from reopened to new

Ok, bug reproduced.

comment:5 Changed 5 years ago by cboos

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

Should be fixed by r4661.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.