[New-bugs-announce] [issue19044] getaddrinfo raises near-useless exception

Nikolaus Rath report at bugs.python.org
Thu Sep 19 05:38:52 CEST 2013


New submission from Nikolaus Rath:

I received a bugreport for a Python application that contains the following stacktrace:

>   File "/usr/lib/python3.3/http/client.py", line 1057, in endheaders
>     self._send_output(message_body)
>   File "/usr/lib/python3.3/http/client.py", line 902, in _send_output
>     self.send(msg)
>   File "/usr/lib/python3.3/http/client.py", line 840, in send
>     self.connect()
>   File "/usr/lib/python3.3/http/client.py", line 1194, in connect
>     self.timeout, self.source_address)
>   File "/usr/lib/python3.3/socket.py", line 417, in create_connection
>     for res in getaddrinfo(host, port, 0, SOCK_STREAM):
> OSError: [Errno 0] Error

My guess is that something went wrong with the name resolution, but it seems near impossible to handle this in the application because apparently the exception contains no machine usable useful informaton at all. 


It would be nice if whatever information Python used to determine that the getaddrinfo call failed could be included in the exception, so that it can be properly caught and handled.

----------
components: Library (Lib)
messages: 198039
nosy: Nikratio
priority: normal
severity: normal
status: open
title: getaddrinfo raises near-useless exception
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19044>
_______________________________________


More information about the New-bugs-announce mailing list