Opened 10 years ago

Last modified 10 years ago

user story #61 (closed: DONE)

EndUser? should be prevented from crashing agile-trac with empty iteration dates

Test Complete Size: 5 Test Complete Date: 02/16/2009
Documentation Complete Size: 1 Documentation Complete Date: 02/16/2009
Acceptance Complete Size: 1 Acceptance Complete Date: 02/16/2009
Reported by: ja11sop Owned by: ja11sop
Milestone: Clean up of Plugin with Patch Component: iterations
Version: Keywords:
Cc: Blocked By:
Blocking: Patch SVN Revision:
Patch Trac Version:
In Iterations: 12 14 18

Description


Change History

Have a look at the list of modified files related to this ticket.

Changed 10 years ago by jm_thia

I vote for a quick patch... This is what i get with an empty iteration date in the roadmap tab Hope this helps.

Jean Marie

Copy and paste of the web page :

Oops… Trac detected an internal error: TypeError?: can't compare datetime.datetime to NoneType? If you think this should work you can reproduce the problem, you should consider reporting this to the Trac team.

Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket.

Otherwise, please

How to Reproduce

While doing a GET operation on /iterations, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'show': u'all'}

User Agent was: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2)

System Information

Trac 0.11.1
Python 2.4.4 (#1, Apr 15 2008, 23:37:53)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]
setuptools 0.6c9
SQLite 3.3.8
pysqlite 2.3.2
Genshi 0.5.1
mod_python 3.2.10
Pygments 0.9
Subversion 1.4.2 (r22196)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/roadmap.py", line 380, in process_request
    iterations.sort(lambda x, y: cmp(x.end_date, y.end_date))
  File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/roadmap.py", line 380, in <lambda>
    iterations.sort(lambda x, y: cmp(x.end_date, y.end_date))
TypeError: can't compare datetime.datetime to NoneType

a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it.

Python Traceback Most recent call last: File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request Code fragment:

try: if not env and env_error: raise HTTPInternalError(env_error) try: dispatcher = RequestDispatcher?(env)

dispatcher.dispatch(req)

except RequestDone?: pass resp = req._response or [] except HTTPException, e:

Local variables:

Name Value after [u' except RequestDone:', u' pass', u' resp = ... before [u' try:', u' if not env and env_error:', u' raise ... dispatcher <trac.web.main.RequestDispatcher? object at 0x4256c2cc> e <exceptions.TypeError? instance at 0x428b0f0c> env <trac.env.Environment object at 0x423a7e6c> env_error None exc_info (<class exceptions.TypeError? at 0x409e52fc>, <exceptions.TypeError? ... filename '/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py' frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ... has_admin True line u' dispatcher.dispatch(req)' lineno 422 message u"TypeError?: can't compare datetime.datetime to NoneType?" req <Request "GET u'/iterations'"> resp [] tb <traceback object at 0x42875d24> tb_hide None traceback 'Traceback (most recent call last):\n File ...

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 197, in dispatch Code fragment:

req.args.get('FORM_TOKEN') != req.form_token: raise HTTPBadRequest('Missing or invalid form token. ' 'Do you have cookies enabled?') # Process the request and render the template

resp = chosen_handler.process_request(req) if resp: if len(resp) == 2: # Clearsilver chrome.populate_hdf(req) template, content_type = \ self._post_process_request(req, *resp)

Local variables:

Name Value chosen_handler <trac.ticket.roadmap.IterationsModule? object at 0x4256cc2c> chrome <trac.web.chrome.Chrome object at 0x4253608c> err (<class exceptions.TypeError? at 0x409e52fc>, <exceptions.TypeError? ... handler <trac.ticket.roadmap.IterationsModule? object at 0x4256cc2c> req <Request "GET u'/iterations'"> self <trac.web.main.RequestDispatcher? object at 0x4256c2cc>

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/roadmap.py", line 380, in process_request Code fragment:

db = self.env.get_db_cnx() iterations = [i for i in Iteration.select(self.env, showall, db) if 'MILESTONE_VIEW' in req.perm(i.resource)] # Sort by end date so the most recent iteration is displayed last

iterations.sort(lambda x, y: cmp(x.end_date, y.end_date))

iterations_info = [] for iteration in iterations: iteration_info = TicketSystem?(self.env).get_iteration_info(iteration, req, self.stats_provider)

Local variables:

Name Value db <trac.db.pool.PooledConnection? object at 0x428b05cc> i <trac.ticket.model.Iteration object at 0x428bd38c> iterations [<trac.ticket.model.Iteration object at 0x428bd54c>, ... iterations_realm <Resource 'iteration'> req <Request "GET u'/iterations'"> self <trac.ticket.roadmap.IterationsModule? object at 0x4256cc2c> showall True

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/roadmap.py", line 380, in <lambda> Code fragment:

db = self.env.get_db_cnx() iterations = [i for i in Iteration.select(self.env, showall, db) if 'MILESTONE_VIEW' in req.perm(i.resource)] # Sort by end date so the most recent iteration is displayed last

iterations.sort(lambda x, y: cmp(x.end_date, y.end_date))

iterations_info = [] for iteration in iterations: iteration_info = TicketSystem?(self.env).get_iteration_info(iteration, req, self.stats_provider)

Local variables:

Name Value x <trac.ticket.model.Iteration object at 0x428bd92c> y <trac.ticket.model.Iteration object at 0x428bd54c>

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request

dispatcher.dispatch(req)

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 197, in dispatch

resp = chosen_handler.process_request(req)

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/roadmap.py", line 380, in process_request

iterations.sort(lambda x, y: cmp(x.end_date, y.end_date))

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/ticket/roadmap.py", line 380, in <lambda>

iterations.sort(lambda x, y: cmp(x.end_date, y.end_date))

Changed 10 years ago by ja11sop

  • acceptance_complete_date set to 02/16/09
  • doc_complete_date set to 02/16/09
  • test_complete_date set to 02/16/09
Note: See TracTickets for help on using tickets.