[twill] Twill does not respect time limit in http-equiv="refresh" tag

David L. Erdman II linuxluser at gmail.com
Sat Jul 19 15:53:58 PDT 2008


HTML TAG:
<META HTTP-EQUIV="Refresh"
CONTENT="900;URL=/online/servlet/efsonline/SignOff">


Most browsers interpret this to mean "refresh this page in 900 and redirect
to /online/servlet/efsonline/SignOff". However, twill seems to be ignoring
the "900" and refreshing immediately (although it does redirect to the
proper URL).


Turning on debugging for equiv-refresh gives me:
equiv-refresh DEBUG: code 200, hdrs has 'refresh'
equiv-refresh DEBUG: refresh header is
900;URL=/online/servlet/efsonline/SignOff
equiv-refresh DEBUG: pause: 900
equiv-refresh DEBUG: new url: URL=/online/servlet/efsonline/SignOff
equiv-refresh DEBUG: final url: /online/servlet/efsonline/SignOff
Following HTTP-EQUIV=REFRESH to /online/servlet/efsonline/SignOff


The problem appears in line 436:
                    if pause != 0 and 0:  # CTB hack! ==#  and
self.honor_time:

In this case, pause != 0 BUT 0 always evaluates to False! My guess is that
it is there because there is no solution yet, as using time.sleep(pause)
seems to be a bad idea because it blocks everything else (I'm sure you know
this!).


What was the purpose of that if-statement?


--
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/twill/attachments/20080719/90745403/attachment.html 


More information about the twill mailing list