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


Groups > comp.lang.python > #18801

Re: UnicodeEncodeError in compile

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
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; 'url:bugs': 0.05; 'received:verizon.net': 0.07; 'system?': 0.07; 'terry': 0.07; 'python': 0.08; '>>>>': 0.09; 'filename': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'am,': 0.12; 'argument': 0.15; 'tries': 0.15; 'codec': 0.16; 'did,': 0.16; 'encode': 0.16; 'reedy': 0.16; 'question.': 0.16; 'wrote:': 0.18; '2.x': 0.18; '3.2': 0.18; 'convert': 0.19; 'jan': 0.19; '(which': 0.19; 'so.': 0.22; '(or': 0.22; 'header:In-Reply-To:1': 0.22; 'statement': 0.23; 'windows': 0.26; 'invalid': 0.28; 'compile': 0.29; 'unicode': 0.29; 'pm,': 0.29; "can't": 0.32; 'header:User- Agent:1': 0.33; 'header:X-Complaints-To:1': 0.33; 'to:addr:python- list': 0.34; 'character': 0.34; 'deleted.': 0.34; 'changing': 0.35; 'url:python': 0.36; 'explain': 0.36; 'could': 0.37; 'using': 0.38; 'received:org': 0.38; 'getting': 0.38; 'characters': 0.39; 'url:org': 0.39; 'should': 0.39; 'why': 0.39; 'to:addr:python.org': 0.40; 'your': 0.61; '8bit%:21': 0.62; 'believe': 0.65; '11:24': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: UnicodeEncodeError in compile
Date Tue, 10 Jan 2012 22:50:51 -0500
References <9043309.329.1326169476466.JavaMail.geo-discussion-forums@yqhi24> <jegrmo$juv$1@dough.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding quoted-printable
X-Gmane-NNTP-Posting-Host pool-74-109-121-73.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
In-Reply-To <jegrmo$juv$1@dough.gmane.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4625.1326253880.27778.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1326253880 news.xs4all.nl 6864 [2001:888:2000:d::a6]:51188
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18801

Show key headers only | View raw


On 1/10/2012 3:08 AM, Terry Reedy wrote:
> On 1/9/2012 11:24 PM, pyscripter@gmail.com wrote:
>> Using python 3.2 in Windows 7 I am getting the following:
>>
>>>> compile('pass', r'c:\temp\工具\module1.py', 'exec')

Is this a filename that could be an actual, valid filename on your system?

>> UnicodeEncodeError: 'mbcs' codec can't encode characters in position
>> 0--1: invalid character
>>
>> Can anybody explain why the compile statement tries to convert the
>> unicode filename using mbcs?

Good question. I believe this holdover from 2.x should be deleted.
I argued that in http://bugs.python.org/issue10114
(which was about a different problem) and now, directly, in
http://bugs.python.org/issue13758

If you (or anyone) can make a better argument for the requested change, 
or for also changing compile on *nix, than I did, please do so.

-- 
Terry Jan Reedy


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


Thread

UnicodeEncodeError in compile pyscripter@gmail.com - 2012-01-09 20:24 -0800
  Re: UnicodeEncodeError in compile Terry Reedy <tjreedy@udel.edu> - 2012-01-10 03:08 -0500
    Re: UnicodeEncodeError in compile jmfauth <wxjmfauth@gmail.com> - 2012-01-10 01:42 -0800
    Re: UnicodeEncodeError in compile 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-10 02:53 -0800
      Re: UnicodeEncodeError in compile jmfauth <wxjmfauth@gmail.com> - 2012-01-10 04:28 -0800
        Re: UnicodeEncodeError in compile jmfauth <wxjmfauth@gmail.com> - 2012-01-10 05:43 -0800
          Re: UnicodeEncodeError in compile Terry Reedy <tjreedy@udel.edu> - 2012-01-10 19:56 -0500
            Re: UnicodeEncodeError in compile jmfauth <wxjmfauth@gmail.com> - 2012-01-11 01:29 -0800
            Re: UnicodeEncodeError in compile jmfauth <wxjmfauth@gmail.com> - 2012-01-10 23:05 -0800
    Re: UnicodeEncodeError in compile 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-10 02:53 -0800
  Re: UnicodeEncodeError in compile pyscripter@gmail.com - 2012-01-10 02:04 -0800
  Re: UnicodeEncodeError in compile Terry Reedy <tjreedy@udel.edu> - 2012-01-10 22:50 -0500
    Re: UnicodeEncodeError in compile pyscripter@gmail.com - 2012-01-11 03:27 -0800
      Re: UnicodeEncodeError in compile Dave Angel <d@davea.name> - 2012-01-11 06:45 -0500
        Re: UnicodeEncodeError in compile pyscripter@gmail.com - 2012-01-11 04:14 -0800
        Re: UnicodeEncodeError in compile pyscripter@gmail.com - 2012-01-11 04:14 -0800
    Re: UnicodeEncodeError in compile pyscripter@gmail.com - 2012-01-11 03:27 -0800

csiph-web