Message393323
[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. |
|
Date |
User |
Action |
Args |
2021-05-09 15:57:56 | Ben.Darnell | set | recipients:
+ Ben.Darnell, r.david.murray, joseph.hackman, agnosticdev, ablack, sdbowman, midopa, alexmv |
2021-05-09 15:57:56 | Ben.Darnell | set | messageid: <1620575876.46.0.922018321913.issue32958@roundup.psfhosted.org> |
2021-05-09 15:57:56 | Ben.Darnell | link | issue32958 messages |
2021-05-09 15:57:56 | Ben.Darnell | create | |
|