Ticket #2022 (closed defect: fixed)
ConnectionRefusedError's errno and strerror surprising on BSD/OSX
| Reported by: | dalke | Owned by: | exarkun |
|---|---|---|---|
| Priority: | highest | Milestone: | |
| Component: | core | Keywords: | |
| Cc: | spiv, exarkun, jerub | Branch: | |
| Author: | Launchpad Bug: |
Description (last modified by exarkun) (diff)
When a non-blocking connect fails on BSD, the attempt sets errno to EINVAL. Twisted currently handles this, turning that errno into a ConnectionRefusedError instance and passing that on to application-code. However, it preserves the exact errno reported by the operating system. For people accustomed to the Linux behavior, BSD's behavior seems surprising and less useful.
At the very least, this platform inconsistency should be documented so that users know to rely on the exception type rather than the errno itself.
I can't think of any code changes which make sense here. In particular, the platform errno must be preserved exactly, not mangled into something less surprising.
Change History
Note: See
TracTickets for help on using
tickets.
