[web2py] Re: Bug in widget.py: lack type='int' in new added --socket-timeout param

2011-12-28 Thread Carlos
Hi,

Not sure if this is the actual cause of my problem, but after loading this 
changeset (9619eb054669 / Socket timeout is now int an defaults to 60secs), 
multiple semi-concurrent requests from different browsers (IE / firefox / 
chrome / opera / safari) to the same page (web2py function) take a very 
long time or even fail, which was not happening prior to that change.

If I load the previous changeset, then it seems to work correctly.

I'm using latest trunk on win7.

Thanks.

   Carlos



[web2py] Re: Bug in widget.py: lack type='int' in new added --socket-timeout param

2011-12-27 Thread Massimo Di Pierro
Thanks I changed to 60secs by default and type casted to int as you
suggested.

On Dec 27, 2:39 am, evantan tanhen...@gmail.com wrote:
 In version 1.99.4,  socket-timeout was added to start params, which is very
 needed to  tuning socket.settimeout in rocket.py. The default value 1
 second often lead to  class 'socket.timeout'(timed out)  error in a
 slow network,such as WAN than LAN.

 But  in widget.py line 557:

     parser.add_option('--socket-timeout',
                       default=1,
                       dest='socket_timeout',
                       help='timeout for socket (1 second)')

 lack a type to cast this param.Should be:

     parser.add_option('--socket-timeout',
                       default=1,
                       type='int',
                       dest='socket_timeout',
                       help='timeout for socket (1 second)')

 This bug lead to deadly exceptions(see below) when set python web2py.py
 ... --socket-timeout=60 ... in start time:

 --Traceback
 Exception in thread Thread-8:
 Traceback (most recent call last):
   File /usr/local/lib/python2.7/threading.py, line 552, in
 __bootstrap_inner
     self.run()
   File /home/git/web2py/gluon/rocket.py, line 1282, in run
     conn = Connection(*conn)
   File /home/git/web2py/gluon/rocket.py, line 130, in __init__
     self.socket.settimeout(SOCKET_TIMEOUT)
   File /usr/local/lib/python2.7/socket.py, line 224, in meth
     return getattr(self._sock,name)(*args)
 TypeError: a float is required
 -Traceback