Edgewall Software
Modify

Opened 18 years ago

Closed 17 years ago

#5143 closed defect (fixed)

Roadmap error on exporting to iCalendar [PATCH]

Reported by: anonymous Owned by: Christopher Lenz
Priority: normal Milestone: 0.11
Component: roadmap Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

System Information
Trac: 	0.11dev-r5194
Python: 	2.4.4 (#1, Jan 13 2007, 17:48:09) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]
setuptools: 	0.6c5
pyPgSQL: 	2.5.1
Genshi: 	0.4dev-r509
Subversion: 	1.4.2 (r22196)

This is the content of the exported iCalendar:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Edgewall Software//NONSGML Trac 0.11dev-r5194//EN
METHOD:PUBLISH
X-WR-CALNAME:Staff500 - Roadmap
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>200 OK</title>
</head><body>
<h1>OK</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 webmaster@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 mod_python/3.2.10 Python/2.4.4 mod_ssl/2.2.3 OpenSSL/0.9.8e Server at debian Port 443</address>
</body></html>

This is my apache log when I try to download the roadmap on iCalendar format.

[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):, referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\n    result = object(req), referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/web/modpython_frontend.py", line 91, in handler\n    gateway.run(dispatch_request), referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/web/wsgi.py", line 87, in run\n    response = application(self.environ, self._start_response), referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/web/main.py", line 495, in dispatch_request\n    req.send_error(exc_info, status=500, env=env, data=data), referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/web/api.py", line 353, in send_error\n    exc_info), referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/web/main.py", line 429, in dispatch_request\n    dispatcher.dispatch(req), referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/web/main.py", line 217, in dispatch\n    resp = chosen_handler.process_request(req), referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/ticket/roadmap.py", line 214, in process_request\n    self.render_ics(req, db, milestones), referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/ticket/roadmap.py", line 293, in render_ics\n    uid = '<%s/milestone/%s@%s>' % (req.base_path, milestone['name'],, referer: https://debian/trac/roadmap
[Fri Apr 13 12:22:29 2007] [error] [client 192.168.254.1] PythonHandler trac.web.modpython_frontend: TypeError: unsubscriptable object, referer: https://debian/trac/roadmap

Attachments (1)

icalendar_roadmap_bug_r5887.patch (2.6 KB ) - added by jfrancis 17 years ago.
patch that fixes ics rendering of roadmap

Download all attachments as: .zip

Change History (8)

comment:1 by diego o. pego, 18 years ago

This is the Trac Log, on DEBUG level

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/web/main.py", line 429, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/web/main.py", line 217, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/ticket/roadmap.py", line 214, in process_request
    self.render_ics(req, db, milestones)
  File "/usr/lib/python2.4/site-packages/Trac-0.11dev_r5194-py2.4.egg/trac/ticket/roadmap.py", line 293, in render_ics
    uid = '<%s/milestone/%s@%s>' % (req.base_path, milestone['name'],
TypeError: unsubscriptable object

comment:2 by anonymous, 18 years ago

Severity: normalblocker

comment:3 by Emmanuel Blot, 18 years ago

Severity: blockernormal
  1. This is not a blocker issue: blocker means that the issue makes Trac unusable
  2. anonymous: whenever you change a field, please provide some details or motivation to do so.

comment:4 by christian.hergert@…, 18 years ago

I am seeing this as well, up through current trunk (revision 5342).

I think there might be a couple issues causing this. It seems that the due and name values are now retrieved through milestone.due and milestone.name rather than milestonedue and milestonename. Also, the value I'm seeing from milestone.due is in format 2007-05-08 00:00:00+00:00 (from Sqlite).

So around line 298 in trac/tickets/roadmap.py it is trying to call localtime on this string date. This obviously needs to be a 9-piece tuple so strptime or similar date parsing method will probably need to be used.

I'd make a patch, but I'm not sure how to properly extract that timezone in a clean and efficient manner other than regex.

by jfrancis, 17 years ago

patch that fixes ics rendering of roadmap

comment:5 by jfrancis, 17 years ago

Summary: Roadmap error on exporting to iCalendarRoadmap error on exporting to iCalendar [PATCH]

modified render_ics to be aware it is using the milestone object, and not a simple dict anymore. Added [PATCH] to summary.

comment:6 by anonymous, 17 years ago

I have tested this patch and it works. Why haven't we included it in the SVN?

Are there any issues with it? None that I could see…

in reply to:  6 comment:7 by Christian Boos, 17 years ago

Milestone: 0.11.10.11
Resolution: fixed
Status: newclosed

Replying to anonymous:

I have tested this patch and it works. Why haven't we included it in the SVN?

Are there any issues with it? None that I could see…

The patch looks indeed ok, committed as r5984 with a few adaptations. I took your word for the it works part ;-)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


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