Ben Darnell <ben.darn...@gmail.com> added the comment:

[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.

----------
nosy: +Ben.Darnell

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32958>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to