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!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'anyway.': 0.05; 'encoding': 0.05; 'globally.': 0.07; 'ascii': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'try:': 0.09; 'python': 0.11; 'windows': 0.15; 'nameerror:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'repr': 0.16; 'subject:3.3': 0.16; 'utf8': 0.16; 'subject:python': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'seems': 0.21; 'header:User- Agent:1': 0.23; 'environment': 0.24; "i've": 0.25; 'this:': 0.26; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply- To:1': 0.27; 'tried': 0.27; "doesn't": 0.30; 'code': 0.31; 'easier': 0.31; 'stuff': 0.32; 'run': 0.32; 'quite': 0.32; 'could': 0.34; 'except': 0.35; 'something': 0.35; 'late': 0.35; 'no,': 0.35; 'but': 0.35; 'too': 0.37; 'to:addr:python-list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'affect': 0.61; 'skip:o 30': 0.61; 'yes': 0.68; 'received:109': 0.72; '.....': 0.78; '..........': 0.84; 'batchelder': 0.84; 'vars': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robin Becker Subject: Re: python 3.3 repr Date: Fri, 15 Nov 2013 14:29:17 +0000 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 109.174.168.73 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 In-Reply-To: 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384525772 news.xs4all.nl 15924 [2001:888:2000:d::a6]:56328 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59524 On 15/11/2013 13:54, Ned Batchelder wrote: ......... > > No, but I've found that significant programs that run on both 2 and 3 need to have some shims to make the code work anyway. You could do this: > > try: > repr = ascii > except NameError: > pass .... yes I tried that, but it doesn't affect %r which is inlined in unicodeobject.c, for me it seems easier to fix windows to use something like a standard encoding of utf8 ie cp65001, but that's quite hard to do globally. It seems sitecustomize is too late to set os.environ['PYTHONIOENCODING'], perhaps I can stuff that into one of the global environment vars and have it work for all python invocations. -- Robin Becker