[Zope] urllib timeout

Tino Wildenhain tino at wildenhain.de
Tue Feb 3 12:05:35 EST 2004


Hi Florac,

FLORAC Thierry schrieb:
>   Hi,
> 
> I currently use the Python urllib module to write small Python scripts which, 
> launched via cron, access my Zope web site nightly to execute administration 
> tasks (which can't be done throught wget).

why not? Its possible, although the urllib variant isnt that bad either.

> 
> My problem is that some of these tasks (like database packing) are now very 
> long and I never see their output, even if the task is executed correctly. I 
> suppose that this is because of a timeout in the "FancyURLopener" subclass I 
> use.

You schould go for ZEO since this makes packing asynchronous, giving you
immediate result for the urllib call.
I'm not aware of any timeout in urllib and at least you should get
an exception, not nothing at all. If in doubt, run a sniffer/logger
for the network traffic in parallel, for example tcpflow.

The ZEO approach also leads to another interesting posibility:
you can call the methods with a 2nd client directly. Just
mount the ZODB from your "cron" script.

Regards
Tino Wildenhain




More information about the Zope mailing list