Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'returned.': 0.07; '*name*': 0.09; 'operation,': 0.09; 'subject:error': 0.09; 'am,': 0.12; 'received:209.85.214.174': 0.13; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inverse': 0.16; 'nick': 0.16; 'noteworthy': 0.16; 'tuple,': 0.16; 'wrote:': 0.18; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'correct,': 0.23; 'message- id:@mail.gmail.com': 0.28; 'drawing': 0.29; 'chris': 0.30; 'received:209.85.214': 0.32; 'tue,': 0.32; 'to:addr:python-list': 0.34; 'element': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'getting': 0.38; 'i.e.': 0.39; 'received:209': 0.40; 'to:addr:python.org': 0.40; '2012': 0.67; 'note:': 0.69; 'subject:( ': 0.84; '10:32': 0.91; 'subject:skip:s 20': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=7EwTV1wOfrR1VAt+knoblKHxnBkyD3RFOKYJ1ihhJxU=; b=BRAkmQb6qJaG9I4LprIOBIx+th/lHowj9QGiKusDFoZetWC/P59cOLZXvSjtl08TQD PzLPAp72M5a0TK0zp2R+kOylGiMgLFzv5c+YzoNZYHF9Q33TxgTDvnWT+UagcqjbKWAv S89kDydbNT37pd97K60gjMhglObiM2lufDr7A= MIME-Version: 1.0 In-Reply-To: <31290.1326151964@lefou.usa.hp.com> References: <24123dfe-b2fc-4f4c-8dfe-23bfef19b205@m10g2000vbc.googlegroups.com> <4F0B6BBE.5090501@codeaurora.org> <31290.1326151964@lefou.usa.hp.com> Date: Tue, 10 Jan 2012 13:08:35 +1100 Subject: Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326161318 news.xs4all.nl 6858 [2001:888:2000:d::a6]:41898 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18728 On Tue, Jan 10, 2012 at 10:32 AM, Nick Dokos wrote: > Chris Angelico wrote: >> Point to note: The inverse operation, getting IP addresses from names, > > so socket.gethostbyaddr(os.environ['REMOTE_ADDR'])[0] is the 0th element > of the tuple, i.e. the *name* that is returned. Correct, I was drawing a noteworthy parallel with the inverse - gethostbyname. ChrisA