Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'case.': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:script': 0.09; 'terry': 0.09; 'gui': 0.11; 'subject:not': 0.11; '2.7': 0.13; 'easier.': 0.16; 'eclipse': 0.16; 'evaluating': 0.16; 'operation.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:when': 0.16; 'unicodeerror': 0.16; 'wrote:': 0.17; 'unicode': 0.17; 'jan': 0.18; 'windows': 0.19; 'txt': 0.22; 'runs': 0.22; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'guess': 0.27; 'dos': 0.27; 'header:X-Complaints- To:1': 0.28; 'actual': 0.28; 'run': 0.28; 'window': 0.30; 'error': 0.30; 'print': 0.32; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'rather': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'different': 0.63; 'received:fios.verizon.net': 0.84; 'subject:running': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: UnicodeEncodeError when not running script from IDE Date: Tue, 12 Feb 2013 11:07:51 -0500 References: <650d144e-da3d-4ca7-ad3a-49f44ce9cbaa@googlegroups.com> <511a2ac5$0$29988$c3e8da3$5496439d@news.astraweb.com> <9bc96ed6-8cb7-421a-a25a-4a7c9404463a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: <9bc96ed6-8cb7-421a-a25a-4a7c9404463a@googlegroups.com> 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360686721 news.xs4all.nl 6884 [2001:888:2000:d::a6]:48381 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38769 On 2/12/2013 7:34 AM, Magnus Pettersson wrote: > Ahh so its the actual printing that makes it error out outside of > eclipse because its a different terminal that its printing to. Its > the default DOS terminal in windows that runs then i run the script > with python.exe and i guess its the same when i run with pythonw.exe > just that the terminal window is not opened up, only the pyqt gui in > this case. Writing txt = print(txt) rather than print() makes it easier to tell whether a UnicodeError comes from evaluating the expression or from the print operation. Using 3.3 instead of 2.7 will make using unicode somewhat easier. -- Terry Jan Reedy