New submission from R. David Murray: create_connection will try multiple times to connect if there are multiple addresses returned by getaddrinfo. If all connections file it inspects the exceptions, and raises the first one if they are all equal. But since the addresses are often different (else why would we try multiple times?), the messages will usually be different. When the messages are different, the code raises an OSError with a list of the exceptions so the user can see them all. This, however, looses the information as to *what* kind of exception occurred (ie: ConnectioRefusedError, etc).
I propose that if all of the exceptions raised are of the same subclass, that that subclass be raised with the multi-message list, rather than the base OSError. ---------- components: asyncio messages: 291126 nosy: r.david.murray, yselivanov priority: normal severity: normal status: open title: OSError: multiple exceptions should preserve the exception type if it is common _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29980> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com