Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'mrab': 0.05; "subject:' ": 0.07; 'raises': 0.09; 'subject:position': 0.09; 'python': 0.11; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'oserror': 0.16; 'ptr': 0.16; 'record,': 0.16; 'subclass': 0.16; 'subject: \n ': 0.16; 'subject:start': 0.16; 'valid.': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; "skip:' 10": 0.31; 'skip:s 30': 0.35; 'error.': 0.37; 'server': 0.38; 'to:addr:python-list': 0.38; 'subject:can': 0.39; 'to:addr:python.org': 0.39; 'skip:a 30': 0.61; 'header:Reply-To:1': 0.67; 'of:': 0.68; 'reply-to:no real name:2**0': 0.71; '8bit%:92': 0.71; 'reply-to:addr:python.org': 0.84; 'clueless': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=KrN0hwmN c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=K2DDQYBT4xIA:10 a=scYcj5qmBLgA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=PMVg_betNJUA:10 a=LGhmFbe0QSwkbkFOBNwA:9 a=QEXdDO2ut3YA:10 a=msLclsPzT2QA:10 a=5JhJnCpaJwMA:10 X-AUTH: mrabarnett:2500 Date: Thu, 04 Jul 2013 14:34:42 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: python-list@python.org Subject: Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372944866 news.xs4all.nl 15934 [2001:888:2000:d::a6]:59178 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49862 On 04/07/2013 13:52, Νίκος wrote: > Στις 4/7/2013 3:07 μμ, ο/η MRAB έγραψε: >> Also, try printing out ascii(os.environ['REMOTE_ADDR']). > > '108.162.229.97' is the result of: > > print( ascii(os.environ['REMOTE_ADDR']) ) > > Seems perfectly valid. and also have a PTR record, so that leaved us > clueless about the internal server error. > For me, socket.gethostbyaddr('108.162.229.97') raises socket.herror, which is also a subclass of OSError from Python 3.3 onwards.