#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 , 19 years ago
comment:3 by , 19 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
1188 1188 result = None 1189 1189 1190 1190 def write(data): 1191 assert type(data) is str, 'write() argument must be string'1191 assert isinstance(data, basestring), 'write() argument must be string' 1192 1192 assert headers_set, 'write() before start_response()' 1193 1193 1194 1194 if not headers_sent:
comment:4 by , 19 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 , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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 , 19 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.
This is still present in r3047.