Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95644

Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run

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 <contact@stridebird.com>
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 <contact@stridebird.com>
X-Google-Original-From Pete Dowdell <pete@stridebird.com>
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 <c085c6af-31f6-480c-a9b4-90f46441fdd1@googlegroups.com>
In-Reply-To <c085c6af-31f6-480c-a9b4-90f46441fdd1@googlegroups.com>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.38.1440573177.11709.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-25 14:19 -0700
  Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run Chris Kaynor <ckaynor@zindagigames.com> - 2015-08-25 14:28 -0700
    Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-26 02:12 -0700
      Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run Chris Angelico <rosuav@gmail.com> - 2015-08-26 19:24 +1000
        Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-26 07:24 -0700
  Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run Chris Angelico <rosuav@gmail.com> - 2015-08-26 09:16 +1000
    Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-26 07:18 -0700
  Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run dieter <dieter@handshake.de> - 2015-08-26 07:51 +0200
    Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-26 07:20 -0700
  Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run Pete Dowdell <contact@stridebird.com> - 2015-08-26 14:09 +0700
    Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-26 07:22 -0700
  Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-26 08:02 -0700
    Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run Chris Angelico <rosuav@gmail.com> - 2015-08-27 01:57 +1000
      Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-26 12:23 -0700
        Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run Chris Angelico <rosuav@gmail.com> - 2015-08-27 09:15 +1000
          Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run Marko Rauhamaa <marko@pacujo.net> - 2015-08-27 08:59 +0300
  Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run RAH <rene.heymans@gmail.com> - 2015-08-27 07:01 -0700

csiph-web