[BUG] static.File and nevow.static.File

Every page that has a static.File() inside when is reloaded from the browser causes a timeout error. Removing the static.File from the page solves the situation so I guess that the problem is inside static.File.
The same erroneous behaviour could be observed in customform.tac example if you refresh it.
In some cases refreshing 2 or 3 times the same example renders it. I don't remember having problems with this stuff except in the last 2 days, so it could have something to do with the latest changes in tcp and abstract, anyway I can reproduce this problem all the times is needed. I also have ethereal packets file that I used to sniff the connection from the browser and the server (if needed).
Here is a minimal example to demonstrate the bug:
==
from twisted.application import service, internet from nevow import appserver, rend, loaders, static
class Page(rend.Page): docFactory = loaders.xmlfile('min.html') children = {'style.css':static.File('style.css')}
site = appserver.NevowSite( Page() )
application = service.Application("minimal") internet.TCPServer(8080, site).setServiceParent(application)
==
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Error</title> <style type="text/css">@import url('style.css');</style> </head> <body> I'm not starting when you hit refresh on me </body> </html>
==
body { background-color: #CE9090; }
==

On Fri, 8 Oct 2004 13:04:56 +0200, Valentino Volonghi dialtone@gmail.com wrote:
Further investigation brought my attention to this:
if request.setLastModified(self.fp.getmtime()) is http.CACHED: return ''
lines 285-286 in nevow.static
This resolves to True during the refresh while doesn't during the first request.
If I remove those lines everything works again both in the minimal and in weever (which is the responsible for me investigating this bug).
As foom pointed out, this could be because a deferred is not properly fired.
participants (1)
-
Valentino Volonghi