Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'responding': 0.04; 'received:verizon.net': 0.07; 'terry': 0.07; '(possibly': 0.09; 'contract.': 0.09; 'hostname': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:()': 0.09; 'subject:addresses': 0.09; 'am,': 0.12; 'interfaces': 0.12; 'things.': 0.13; 'posts.': 0.16; 'reedy': 0.16; 'roy': 0.16; 'wrote:': 0.16; '(i.e.': 0.17; '>>>': 0.18; 'that?': 0.18; 'jan': 0.19; '(most': 0.21; 'resolution': 0.21; 'maybe': 0.21; 'header :In-Reply-To:1': 0.22; 'interface': 0.23; '(on': 0.23; 'changed': 0.24; 'testing': 0.24; 'expect': 0.25; 'load': 0.26; 'host': 0.27; 'indicated': 0.29; 'order.': 0.29; 'asking': 0.29; 'specified': 0.31; 'list': 0.32; 'to:addr:python-list': 0.33; 'header:User- Agent:1': 0.34; 'doc': 0.34; 'see,': 0.34; 'header:X-Complaints- To:1': 0.35; 'primary': 0.36; 'question': 0.36; 'for?': 0.37; 'but': 0.37; 'could': 0.38; 'received:org': 0.38; 'cases,': 0.38; 'patch': 0.38; 'some': 0.38; 'addresses': 0.38; 'subject:: ': 0.39; 'returned': 0.39; 'header:Mime-Version:1': 0.39; 'why': 0.39; 'to:addr:python.org': 0.39; 'case': 0.39; 'where': 0.40; 'hope': 0.61; 'kind': 0.61; 'results': 0.61; 'order': 0.62; 'our': 0.63; 'alternative': 0.64; 'address,': 0.72; 'order,': 0.73; 'article': 0.76; 'subject:Order': 0.77; 'subject:skip:s 20': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Order of addresses returned by socket.gethostbyname_ex() Date: Mon, 22 Aug 2011 13:34:57 -0400 References: <356978ef-e9c1-48fd-bb87-849fe8e27a79@p5g2000vbl.googlegroups.com> <034ff4bf-e3e4-47ff-9a6c-195412431e73@s20g2000yql.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 In-Reply-To: <034ff4bf-e3e4-47ff-9a6c-195412431e73@s20g2000yql.googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1314034539 news.xs4all.nl 23852 [2001:888:2000:d::a6]:41929 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12041 On 8/22/2011 7:39 AM, Tomas Lid=C3=A9n wrote: > On 22 Aug, 13:26, Roy Smith wrote: >> In article >> <356978ef-e9c1-48fd-bb87-849fe8e27...@p5g2000vbl.googlegroups.com>, >> Tomas Lid=C3=A9n wrote: >> >>> In what order are the addresses returned by socket.gethostbyname_ex()= ? >> >>> We know that gethostbyname() is indeterministic but hope that >>> gethostbyname_ex() has a specified order. >> >> Why would you hope that? Or maybe a better question is, why would you= >> expect that? In general, all name resolution calls return results in >> arbitrary order. In some cases, results are intentionally changed on >> every call (i.e. round-robin) in an attempt at load sharing. >> >> What kind of ordering were you hoping for? > > See previous posts. > > Basically I was asking about the contract for this method.. The doc "Return a triple (hostname, aliaslist, ipaddrlist) where=20 hostname is the primary host name responding to the given ip_address,=20 aliaslist is a (possibly empty) list of alternative host names for the=20 same address, and ipaddrlist is a list of IPv4/v6 addresses for the same = interface on the same host (most likely containing only a single address)= =2E" > hoping that it is deterministic. As far as I can see, that is not in the contract. > Our testing indicated that the interfaces are returned in a specific > order, but we want to know if this is really the case (on all > platforms). Even if it were so now, a patch could change things. --=20 Terry Jan Reedy