[Twisted-Python] Broken Twisted on Debian/sarge
I'm using Debian sarge for my server, with twisted-web and twisted-python, and until recently was very happy at never having to touch Apache again. Now it's all dead. I did a standard 'apt-get upgrade', which moved me up to twisted-python version 1.0.5+1.0.6rc2. I am running a server thusly: mktap web --path ./docroot --allow-ignore-ext --logfile ./web.log That's all. No more. And when I browse to http://mysite/, instead of serving up 'index.html' (which exists), it endlessly redirects, with my log files piling up with requests for http://mysite///////////////////// Now, if the docroot directory is _empty_, or if it has no index files, it displays a directory listing normally. So it seems the problem is only when returning an index file. Additionally, navigating to http://mysite/index.html works fine. It's only when you have http://mysite/ that things get weird. When I signed up for Debian 'unstable', this isn't quite what I expected ;) Help? -- Alex Levy WWW: http://mesozoic.geecs.org "Never let your sense of morals prevent you from doing what is right." -- Salvor Hardin, Isaac Asimov's _Foundation_
On Thursday, June 26, 2003, at 11:45 AM, Alex Levy wrote:
it endlessly redirects, with my log files piling up with requests for http://mysite/////////////////////
!@#!@%$~! I thought this was just spiv's bug, but I just had a look in twisted.web.static.File. When did it get this bad? Is this my fault? :-) getChild() and render() are both _disasters_, which look like they've been hacked on by in excess of 10 people who didn't really understand what they're doing. I can't immediately unravel it enough to get a bugfix in, and there are no tests. I am pulling the emergency brake on the release until static.File has tests and they pass. I would _really_ like it if someone could take the time to eliminate PathReferenceAcquisitionContext as well, since this is a major part of the confusion and it violates a central contract in twisted.web.
On Thu, Jun 26, 2003 at 02:58:32PM -0500, Glyph Lefkowitz wrote:
On Thursday, June 26, 2003, at 11:45 AM, Alex Levy wrote:
it endlessly redirects, with my log files piling up with requests for http://mysite/////////////////////
!@#!@%$~!
I thought this was just spiv's bug, but I just had a look in twisted.web.static.File. When did it get this bad? Is this my fault? :-) getChild() and render() are both _disasters_, which look like they've been hacked on by in excess of 10 people who didn't really understand what they're doing. I can't immediately unravel it enough to get a bugfix in, and there are no tests.
Actually, I think this is *still* my bug. Tests would *really* help here ;) I suspect this patch will fix it: Index: twisted/web/static.py =================================================================== RCS file: /cvs/Twisted/twisted/web/static.py,v retrieving revision 1.95 diff -u -r1.95 static.py --- twisted/web/static.py 22 Jun 2003 01:01:57 -0000 1.95 +++ twisted/web/static.py 27 Jun 2003 00:26:38 -0000 @@ -288,7 +288,7 @@ if path == '..': return error.NoResource("Invalid request URL.") - if path == '': + if path == '' and os.path.isfile(self.path): childPath = self.path else: childPath = os.path.join(self.path, path) But I don't have time to test right at the moment. On the weekend, if no-one else gets to it first, I'll probably have a look at writing tests, and cleaning up static.File. It does look rather messy. -Andrew.
On Fri, Jun 27, 2003 at 10:28:58AM +1000, Andrew Bennetts wrote:
On Thu, Jun 26, 2003 at 02:58:32PM -0500, Glyph Lefkowitz wrote:
!@#!@%$~!
I thought this was just spiv's bug, but I just had a look in twisted.web.static.File. When did it get this bad? Is this my fault? :-) getChild() and render() are both _disasters_, which look like they've been hacked on by in excess of 10 people who didn't really understand what they're doing. I can't immediately unravel it enough to get a bugfix in, and there are no tests.
Actually, I think this is *still* my bug. Tests would *really* help here ;)
I suspect this patch will fix it:
[snip] Oh, I see glyph's already gone and fixed it properly, with tests :) -Andrew.
On Fri, 27 Jun 2003 10:37:53 +1000 Andrew Bennetts <andrew-twisted@puzzling.org> wrote:
Oh, I see glyph's already gone and fixed it properly, with tests :)
I think it could do with about 10 more tests. -- Itamar Shtull-Trauring http://itamarst.org/ http://www.zoteca.com -- Python & Twisted consulting
On Thu, Jun 26, 2003 at 08:35:54PM -0400, Itamar Shtull-Trauring wrote:
On Fri, 27 Jun 2003 10:37:53 +1000 Andrew Bennetts <andrew-twisted@puzzling.org> wrote:
Oh, I see glyph's already gone and fixed it properly, with tests :)
I think it could do with about 10 more tests.
Yes -- I posted too soon (again!)... on closer examination, there's just one new test method. -Andrew.
participants (4)
-
Alex Levy
-
Andrew Bennetts
-
Glyph Lefkowitz
-
Itamar Shtull-Trauring