Issue1809

classification
Title: socket.getaddrinfo sometimes returns an object that crashes in __str__ (so it can't be printed)
Type: Severity: normal
Components: Library Versions: 2.5.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, irmen
Priority: Keywords:

Created on 2011-10-17.19:59:03 by irmen, last changed 2011-11-02.22:34:33 by irmen.

Messages
msg6681 (view) Author: Irmen de Jong (irmen) Date: 2011-10-17.19:59:03
socket.getaddrinfo sometimes returns an object that crashes in __str__ (so it can't be printed). This is caused by a port number being None where a format string expects an int (%d).

Reproduce session:

>>> import socket
>>> socket.getaddrinfo("",None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "E:\projects\jython\dist\Lib\socket.py", line 647, in __str__
    return "('%s', %d)" % (self.sockaddr, self.port)
TypeError: int argument required
>>>
msg6689 (view) Author: Alan Kennedy (amak) Date: 2011-11-02.00:35:39
Fix checked in at http://hg.python.org/jython/rev/7306b9651a3a
msg6691 (view) Author: Irmen de Jong (irmen) Date: 2011-11-02.22:34:33
thanks for the fix.
History
Date User Action Args
2011-11-02 22:34:33irmensetmessages: + msg6691
2011-11-02 00:35:39amaksetstatus: open -> closed
resolution: fixed
messages: + msg6689
2011-10-22 10:34:10amaksetassignee: amak
nosy: + amak
2011-10-17 19:59:03irmencreate