Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:Python': 0.05; 'encode': 0.09; 'subject:characters': 0.09; 'subject:script': 0.09; 'subject: \n ': 0.15; 'codec': 0.16; 'list)': 0.16; 'ordinal': 0.16; 'subject:non': 0.16; 'subject:run': 0.16; 'wrote:': 0.16; 'all,': 0.20; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'environment': 0.29; 'character': 0.29; 'post': 0.31; "can't": 0.32; 'received:google.com': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'skip:p 20': 0.38; 'received:209.85.220': 0.38; 'received:192': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'skip:u 10': 0.61; 'charset:windows-1252': 0.62; 'from:addr:contact': 0.66; '15:': 0.84; 'frustrating': 0.84 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=A7gb9q2Hf76fUZwkrZzV2UXOMCA149hkDEJRyv6uUyA=; b=ifpBlCXIjuxnfSkpwSbNeQfi8kMVMkmuQq1h/xXbVOeTNKw1woaiR7Kb6J0ijnx23Q 7MZsh6W+dQD8vzHTLzJlo+JirutRC1WUDKBcvYZ6zptn6rqO+zQnyaalwrG6t8WhyN8R /sOk9Cs1ja9X1/0gzTqkoBrfJBz/LipSth/mpRJD5uenmkajbVrIZlTtABswsq+m8/5z QvtzAwha/HTBy4Wp0Su7xFTCYju3J5lX52TdGaUoTLb19EkaMsRVpvNeSJl+YGbkKyUf KSj4fs4IqqazZ70dm95vCIkDT1NdPWB/XcwtM06GsvJhmtCQA2Ua47AbyKn8E/2GfzrI 81IQ== X-Gm-Message-State: ALoCoQm+PBV94k1GOuHD9sA/YAIUD3/Dv9iomO26oUkfP34Nvckw3xSDpHfEr9HzadM1mJb/+92U X-Received: by 10.66.136.237 with SMTP id qd13mr67219624pab.84.1440572955975; Wed, 26 Aug 2015 00:09:15 -0700 (PDT) From: Pete Dowdell X-Google-Original-From: Pete Dowdell Date: Wed, 26 Aug 2015 14:09:11 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 26 Aug 2015 09:12:55 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 1440573177 news.xs4all.nl 23767 [2001:888:2000:d::a6]:40389 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:95644 On 26/08/15 04:19, RAH wrote: > UnicodeEncodeError: 'ascii' codec can't encode character '\\xc7' in position 15: ordinal not in range(128) (Hi all, this is my first post to the list) This can be a frustrating issue to resolve, but your issue might be solved with this environment variable: PYTHONIOENCODING=UTF-8 Regards, pd