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

Reply via email to