[albatross-users] Albatross development preview 1.2-dev-20040114
Andrew McNamara
andrewm at object-craft.com.au
Fri Jan 16 11:46:45 EST 2004
>This only has an effect in mod_python 3.x, 2.x ignores this and I've
>been unable to come up with a solution for traceback errors to be status
>500 on Apache 1.3. We are okay atm, because on a live site we'd never
>show that information anyway, and use a traceback.html. So for now we
>use apache ErrorDocument directives on the live side of things, and even
>has the upshot of having al- tags in the error page, which you can't do
>for traceback.html (which is to be expected).
>
>One small plus is setting req.status in 2.x has zero effect, so need to
>have code to check versions before applying.
I've been testing with mod_python 2.7.10 and apache 1.3.29 - setting
req.status to 500 (for example) is working fine here:
$ telnet localhost 80
GET http://localhost/cgi-bin/modpytest/modpytest.py HTTP/1.0
HTTP/1.1 500 Internal Server Error
Date: Fri, 16 Jan 2004 00:45:47 GMT
Server: Apache/1.3.29 (Debian GNU/Linux) mod_python/2.7.10 Python/2.3.2 DAV/1.0.3
Connection: close
Content-Type: text/html; charset=iso-8859-1
<pre>Template traceback (most recent call last):
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/albatross/app.py", line 283, in run
self.display_response(ctx)
File "/usr/lib/python2.3/site-packages/albatross/app.py", line 516, in display_response
func(ctx)
File "/usr/lib/cgi-bin/modpytest/modpytest.py", line 17, in page_display
ctx.run_template('foo.html')
File "/usr/lib/python2.3/site-packages/albatross/app.py", line 158, in run_template
templ = self.app.load_template(name)
File "/usr/lib/python2.3/site-packages/albatross/context.py", line 181, in load_template
raise TemplateLoadError("%s: %s" % (path, e.strerror))
TemplateLoadError: /usr/lib/cgi-bin/modpytestx/foo.html: No such file or directory
</pre>Connection closed by foreign host.
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
More information about the Albatross-users
mailing list