From: SourceForge.net <no...@so...> - 2005-11-04 21:15:53
|
Bugs item #1348645, was opened at 2005-11-04 13:15 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1348645&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: socket.py send() error? Initial Comment: With Jython 2.1, I tried to run the send() method from socket.py and got the error : File "C:\jython\Lib\socket.py", line 304, in send TypeError: sendto() takes at least 3 arguments (2 given) Here is the method in socket.py with the problem shown in the stacktrace: def send(self, data): assert self.addr return self.sendto(self.addr) # line 304 The definition of self.sendto() is: def sendto(self, data, addr): n = len(data) if not self.sock: self.sock = java.net.DatagramSocket() host, port = addr bytes = jarray.array(map(ord, data), 'b') a = java.net.InetAddress.getByName(host) packet = java.net.DatagramPacket(bytes, n, a, port) self.sock.send(packet) return n It looks like there is a missing argument in the call to self.sendto() that is in send(). If I edit send(): return self.sendto(data, self.addr) # line 304 it seems to fix the problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1348645&group_id=12867 |