Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.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; 'string': 0.09; 'executable': 0.09; 'f.close()': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'skip:/ 10': 0.09; 'skip:\\ 40': 0.09; '"w")': 0.16; 'does,': 0.16; 'encodings': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:issue': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'byte': 0.24; 'question': 0.24; 'script': 0.25; 'header:X -Complaints-To:1': 0.27; 'point': 0.28; "doesn't": 0.30; 'you?': 0.31; 'file': 0.32; 'there.': 0.32; 'text': 0.33; 'linux': 0.33; 'sense': 0.34; 'maybe': 0.34; 'skip:d 20': 0.34; 'test': 0.35; 'doing': 0.36; 'starting': 0.37; 'to:addr:python-list': 0.38; 'that,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'dave': 0.60; 'skip:f 50': 0.65; 'yes': 0.68; 'angel': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: UnicodeDecodeError issue Date: Mon, 2 Sep 2013 12:21:45 +0000 (UTC) References: <5222fc40$0$6599$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.36 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378124525 news.xs4all.nl 15972 [2001:888:2000:d::a6]:41609 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53478 On 2/9/2013 07:49, Ferrous Cranus wrote: > Στις 2/9/2013 2:38 μμ, ο/η Dave Angel έγραψε: >> >> Does that string make any sense to you? > > Yes it does, it mean "Unknown Hostname" > >> The Linux 'file' utility thinks this string is in ISO-8859, so you might >> want to try a decode('ISO-8859-1') as well. (and maybe ISO-8859-2, -3, >> -4, and -5) > > How did you test it? The utility afaik analyzes a file's encodings not > string encodings. > Starting with the byte string in the error message: >>> f = open("junk.txt", "w") >>> f.write(b'\xb6\xe3\xed\xf9\xf3\xf4\xef\xfc\xed\xef\xec\xe1 \xf3\xf5\xf3\xf4\xde\xec\xe1\xf4\xef\xf2\n') >>> f.close() > nikos@superhost.gr [~]# file www/cgi-bin/files.py > www/cgi-bin/files.py: a /usr/bin/python script text executable > > No point in doing that, as the string in question doesn't exist there. -- DaveA