Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#2900 closed defect (invalid)

mod_python: txt format view of wiki pages throws exception

Reported by: Alec Thomas Owned by: Christopher Lenz
Priority: normal Milestone:
Component: web frontend/mod_python Version: devel
Severity: normal Keywords: wsgi
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I'm not sure whether it's limited to mod_python however.

23:17:13 Trac[main] ERROR: Response already started
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 283, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 176, in dispatch
    req.display(template, content_type or 'text/html')
  File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 324, in display
    self.end_headers()
  File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 244, in end_headers
    self._write = self._start_response(self._status, self._outheaders)
  File "/usr/lib/python2.4/site-packages/trac/web/wsgi.py", line 111, in _start_response
    assert not self.headers_set, 'Response already started'
AssertionError: Response already started

Attachments (0)

Change History (6)

comment:1 by Alec Thomas, 18 years ago

This is still present in r3047.

comment:2 by Alec Thomas, 18 years ago

This doesn't occur with FCGI under lighttpd.

comment:3 by Alec Thomas, 18 years ago

Actually, my last comment seems to not be 100% correct. I get an assertion failure under FCGI. The following patch fixes it:

  • trac/web/_fcgi.py

     
    11881188        result = None
    11891189
    11901190        def write(data):
    1191             assert type(data) is str, 'write() argument must be string'
     1191            assert isinstance(data, basestring), 'write() argument must be string'
    11921192            assert headers_set, 'write() before start_response()'
    11931193
    11941194            if not headers_sent:

comment:4 by Matthew Good, 18 years ago

Alec, where was that called from? The Request.write method encodes unicode objects to the configured character set, so the data written to the FCGI response should be str objects. If something's writing unicode objects directly to the response it should be changed to encode them first.

comment:5 by Alec Thomas, 18 years ago

Resolution: invalid
Status: newclosed

Ah okay. This is probably one of the plugins I have installed then.

I'll close it and if I encounter it again I will reopen.

comment:6 by Alec Thomas, 18 years ago

Yes, this was my own stupid fault. TracTags replaced the WikiModule but wasn't handling the return from the request handler correctly. Sorry about that.

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.