Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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; 'charset:iso-8859-7': 0.04; 'encoded': 0.07; "subject:' ": 0.07; 'string': 0.09; 'assuming': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:position': 0.09; 'conceivably': 0.16; 'fails.': 0.16; 'log.': 0.16; 'non-ascii': 0.16; 'outputs': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:start': 0.16; 'trace.': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'producing': 0.19; 'stack': 0.19; 'header:User- Agent:1': 0.23; 'error': 0.23; 'byte': 0.24; 'unicode': 0.24; 'looks': 0.24; 'question': 0.24; 'query': 0.26; 'values': 0.27; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'related': 0.29; 'errors': 0.30; 'file': 0.32; 'guess': 0.33; "i'd": 0.34; 'problem': 0.35; 'except': 0.35; 'but': 0.35; 'there': 0.35; 'so,': 0.37; 'sometimes': 0.38; 'somebody': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'subject:can': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'solve': 0.60; 'most': 0.60; 'tell': 0.60; 'ago,': 0.61; 'back': 0.62; 'times': 0.62; 'complete': 0.62; 'address': 0.63; 'more': 0.64; 'internet': 0.71; 'vars': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Date: Sun, 29 Sep 2013 11:11:23 +0000 (UTC) References: <5247f6bb$0$29988$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 174.32.174.35 User-Agent: XPN/1.2.6 (Street Spirit ; Linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380453107 news.xs4all.nl 15954 [2001:888:2000:d::a6]:47926 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:55007 On 29/9/2013 06:24, Νίκος wrote: > > except Exception as e: ===> except socket.gaierror as e: > which cannot handle unicore realted errors and the exact same error > appeared with my ip address involved at the error log. > > so, the question that arises again and reamins is how come 'host' vars > gets a values most of the times and sometimes it just outputs back > unicode related erros. > > I must tell you that i had this problem also months ago, but since i > couldnt able to solve it i left it as it was, but it just started to > make things more and more hectic. > it would be interesting to see a more complete stack trace. But I'd guess that in the process of looking up the ip address at the dns servers, somebody is producing a non-ascii byte string that isn't encoded in utf-8. It might conceivably be in your /etc/hosts file as well, assuming gethostbyname() looks there when the internet query fails. -- DaveA