Bug 4426 - del_channel() in xmlrpc.py fails with traceback
Summary: del_channel() in xmlrpc.py fails with traceback
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Server (show other bugs)
Version: 3.4.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.0.0
Assignee: Aaron Sowry
URL:
Keywords: ossman_tester
Depends on:
Blocks:
 
Reported: 2012-10-11 13:10 CEST by Aaron Sowry
Modified: 2012-11-28 12:42 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Aaron Sowry cendio 2012-10-11 13:10:40 CEST
Unhandled exception on fd 9: <type 'exceptions.TypeError'> del_channel()
takes exactly 1 argument (2 given) Traceback (most recent call last):
  File "/opt/thinlinc/modules/thinlinc/vsm/async.py", line 110, in iii11
    obj . handle_read_event ( fd )
  File "/opt/thinlinc/modules/thinlinc/vsm/async.py", line 507, in
handle_read_event
    self . handle_accept ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/usersocketserver.py", line
120, in handle_accept
    UserSocketServerChannel ( self . vsmserver , I1i1I1II , self . uid )
  File "/opt/thinlinc/modules/thinlinc/vsm/usersocketserverchannel.py",
line 50, in __init__
    timeout = O0o0o00o0Oo0 )
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 469, in
__init__
    reregister_sock = reregister_sock )
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 123, in
__init__
    async_chat . __init__ ( self , sock )
  File "/usr/lib/python2.6/asynchat.py", line 79, in __init__
    asyncore.dispatcher.__init__ (self, sock, map)
  File "/usr/lib/python2.6/asyncore.py", line 245, in __init__
    self.del_channel(map)
TypeError: del_channel() takes exactly 1 argument (2 given)

I guess this is since we define del_channel(self) where it should be del_channel(self, map=None) as per Python's asyncore module. Not sure why/how this was omitted.
Comment 1 Aaron Sowry cendio 2012-10-12 11:23:11 CEST
Another part of this bug is that we call async_chat.__init__ in XMLRPCChannel before we have initialised the timeout_call variable. This results in a traceback like so:

Unhandled exception on fd 8: <type 'exceptions.AttributeError'>
timeout_call Traceback (most recent call last):
  File "/opt/thinlinc/modules/thinlinc/vsm/async.py", line 110, in iii11
    obj . handle_read_event ( fd )
  File "/opt/thinlinc/modules/thinlinc/vsm/async.py", line 507, in
handle_read_event
    self . handle_accept ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/usersocketserver.py", line
120, in handle_accept
    UserSocketServerChannel ( self . vsmserver , I1i1I1II , self . uid )
  File "/opt/thinlinc/modules/thinlinc/vsm/usersocketserverchannel.py",
line 50, in __init__
    timeout = O0o0o00o0Oo0 )
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 472, in
__init__
    reregister_sock = reregister_sock )
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 123, in
__init__
    async_chat . __init__ ( self , sock )
  File "/usr/lib/python2.6/asynchat.py", line 79, in __init__
    asyncore.dispatcher.__init__ (self, sock, map)
  File "/usr/lib/python2.6/asyncore.py", line 245, in __init__
    self.del_channel(map)
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 194, in
del_channel
    self . cancel_timeout ( )
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 150, in
cancel_timeout
    if self . timeout_call :
  File "/opt/thinlinc/modules/thinlinc/vsm/xmlrpc.py", line 140, in
__getattr__
    raise AttributeError , attr
AttributeError: timeout_call
Comment 3 Pierre Ossman cendio 2012-10-17 11:21:01 CEST
Code review. Looks fine.

Note You need to log in before you can comment on or make changes to this bug.