[issue22889] set a timeout for DNS lookups

2015-01-23 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue22889] set a timeout for DNS lookups

2014-11-17 Thread R. David Murray
R. David Murray added the comment: Oh, my apologies. I totally missed your link to the go example when I first read your message. Yes, Python supports the equivalent. In the asyncio module, which is our closest equivalent to goroutines, the functionality exists implicitly: the base event lo

[issue22889] set a timeout for DNS lookups

2014-11-17 Thread Kevin Burke
Kevin Burke added the comment: Hi, You are correct, there's no way to set it in the C API. Go works around this by resolving addresses in a goroutine. I was wondering if something similar would be possible in Python (for people who set a timeout in the interface). -- _

[issue22889] set a timeout for DNS lookups

2014-11-17 Thread R. David Murray
R. David Murray added the comment: As far as I know, the libc dns timeout is controlled by /etc/resolv.conf (or whatever the Windows equivalent is), and libc doesn't provide any way for an application to override this. There is no mention of timeout on the resolver(3) man page. Do you know

[issue22889] set a timeout for DNS lookups

2014-11-16 Thread Kevin Burke
New submission from Kevin Burke: It would be nice to be able to set a timeout for DNS lookups in the event of a DNS server failure. 1. Set your DNS to something like 123.123.123.123 or any other host that is not listening for DNS queries on port 53. 2. Run requests.get('http://jsonip.com', ti