On 05/11/16, g00r00 said the following...
trying to see what I can do with it. I'm quite frequently getting th below error, even when I can find no error like it that applies withi my code.
Can you give actual working example of the failure? There isn't enough code here for me to see what is happening.
Here's the error I get:
PYTHON ERROR:
File "chat_client.mpy", line 85, in <module>
File "/usr/lib/python2.7/socket.py", line 189, in __init__
for method in _delegate_methods:
TypeError: function takes exactly 1 argument (0 given)
Here's the code snippet, with line numbers:
-----------------------
03:import socket, select, string, sys
04:import time
05:from mystic_bbs import *
...
77:if __name__ == "__main__":
78:
79:
80: host = "localhost"
81: port = 5000
82: user = thisuser["handle"]
83: userlen=len(user)
84:
85: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
86: s.settimeout(2)
87:
88: try :
89: s.connect((host, port))
90: except :
91: add2chat('Unable to connect')
92: exit_app();
As you can see, it's giving an error when I try to use the socket.socket() module in /usr/lib/python2.7/socket.py.
In my socket.py file, I find this:
185:def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, _sock=None): 186: if _sock is None:
187: _sock = _realsocket(family, type, proto)
188: self._sock = _sock
189: for method in _delegate_methods:
190: setattr(self, method, getattr(_sock, method))
The _delegate_methods is listed as follows:
164:_delegate_methods = ("recv", "recvfrom", "recv_into", "recvfrom_into",
165: "send", "sendto")
----------------------------------------
HTH
"No matter where you go, there you are!" - Buckaroo Bonzai
--- Mystic BBS v1.12 A13 (Raspberry Pi)
* Origin: Cyberia BBS | Cyberia.Darktech.Org | Kingwood, TX (46:1/116)