This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ben.Darnell
Recipients Ben.Darnell, ablack, agnosticdev, alexmv, joseph.hackman, midopa, r.david.murray, sdbowman
Date 2021-05-09.15:57:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620575876.46.0.922018321913.issue32958@roundup.psfhosted.org>
In-reply-to
Content
[I'm coming here from https://github.com/tornadoweb/tornado/pull/3010)

UnicodeError is a subclass of ValueError, so I don't see what value that change would provide. The thing that's surprising to me is that it's not a `socket.herror` (or `gaierror` for socket.getaddrinfo). I guess the docs don't formally say that `herror`/`gaierror` is the *only* possible error from these functions, but `gaierror` was the only error I was catching so the unexpected UnicodeError escaped the layer that was intended to handle it. 

I do think that in the special case of `getaddrinfo` with the `AI_NUMERICHOST` flag it should be handled differently: in that mode there is no network access necessary and it's reasonable to assume that the only possible error is a `gaierror` with `EAI_NONAME`. 

I'd like to at least see better documentation about what errors are possible from this family of functions.
History
Date User Action Args
2021-05-09 15:57:56Ben.Darnellsetrecipients: + Ben.Darnell, r.david.murray, joseph.hackman, agnosticdev, ablack, sdbowman, midopa, alexmv
2021-05-09 15:57:56Ben.Darnellsetmessageid: <1620575876.46.0.922018321913.issue32958@roundup.psfhosted.org>
2021-05-09 15:57:56Ben.Darnelllinkissue32958 messages
2021-05-09 15:57:56Ben.Darnellcreate