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


Groups > comp.lang.python > #65203

Re: Python shell wont open idle or an exisiting py file

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
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; 'mrab': 0.05; 'subject:Python': 0.06; 'abuse': 0.07; 'encoded': 0.07; 'source.': 0.07; 'subject:file': 0.07; 'utf-8': 0.07; 'string': 0.09; 'strings.': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'etc?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'reedy': 0.16; 'weird.': 0.16; 'sat,': 0.16; 'weird': 0.16; 'wrote:': 0.18; '(not': 0.18; 'later': 0.20; 'written': 0.21; 'feb': 0.22; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'byte': 0.24; 'string,': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'violation': 0.31; 'ago': 0.33; 'common': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'possible': 0.36; 'url:org': 0.36; 'should': 0.36; 'represent': 0.38; 'pm,': 0.38; 'anything': 0.39; 'expect': 0.39; 'heard': 0.39; 'skip:u 10': 0.60; 'first': 0.61; 'become': 0.64; 'special': 0.74; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=rRF2+onIfWtBxqIYxdlRSZ6VoeC2mZJc1NUxWr3oI7U=; b=L8d/2pc+PZNnEhC2jESHrfw7CUq9PPGtGYmF6byKVsQwLEGct8trPNwbEWz3sxQUX0 2kwXNjlYUlryVm0yQbux+gM1r+eAeM0Owf4F3JoOeZXiAyyAciaWSlArn5W0jwowkqvS xWspJRArKDU62O6yw9NsDJMwWroUOxm31OADB9Sh8XEe04LX3uKYNfERFc2NxOZMxAG1 YvY8s23mIn2Er06uGx7ynaY3hbyIRxKdJqXXwN/8dF0EsLoVJiJoSgwQIH7oVSZd3c1h W1nH3HpsvGqXiovaVBqzmLsewBeQ57TMJLFfqPhdZhMC2YYKEo/7z9/jR899SfJACW24 cHRg==
MIME-Version 1.0
X-Received by 10.66.163.2 with SMTP id ye2mr25027172pab.110.1391239608533; Fri, 31 Jan 2014 23:26:48 -0800 (PST)
In-Reply-To <lci1ni$369$2@ger.gmane.org>
References <24EAA33389A147D8BC08B029E2209E16@UserPC> <lcguq4$a3s$1@ger.gmane.org> <lchjk7$8og$1@ger.gmane.org> <CAPTjJmpc6+hSjTy9tn_AMNMVsdnfQh6E+GHx0a=SmJmJ5=5Uvw@mail.gmail.com> <52EC61FF.4060204@mrabarnett.plus.com> <CAPTjJmrPNEvo4D=ZYcFxadAbyYm4+r=c1rAr-Cvpmw2_SDNsTA@mail.gmail.com> <lci1ni$369$2@ger.gmane.org>
Date Sat, 1 Feb 2014 18:26:48 +1100
Subject Re: Python shell wont open idle or an exisiting py file
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.6269.1391239617.18130.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391239617 news.xs4all.nl 2908 [2001:888:2000:d::a6]:38649
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65203

Show key headers only | View raw


On Sat, Feb 1, 2014 at 4:46 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> On 1/31/2014 10:36 PM, Chris Angelico wrote:
>>
>> On Sat, Feb 1, 2014 at 1:54 PM, MRAB <python@mrabarnett.plus.com> wrote:
>>>
>>> I think that some years ago I heard about a variation on UTF-8
>>> (Microsoft?) where codepoint U+0000 is encoded as 0xC0 0x80 so that the
>>> null byte can be used as the string terminator.
>>>
>>> I had a look on Wikipedia found this:
>>>
>>> http://en.wikipedia.org/wiki/Null-terminated_string
>>
>>
>> Yeah, it's a common abuse of UTF-8. It's a violation of spec, but an
>> understandable one. However, I don't understand why the first part -
>> why should \0 become U+0000 but (presumably) the \a later on
>> (...cs\accel...) doesn't become U+0007, etc?
>
>
> Because only  \0 has a special meaning in a C string, and Tk is written in C
> and uses C strings.

Eh? I've used \a in C programs (not often but I have used it).

It's possible that \0 is the only one that actually bombs anything
(because of C0 80 representation). But since \7 and \a both represent
0x07 in a C string, I would expect there to be other problems, if it's
interpreting it as source. Ah well! Weird weird.

ChrisA

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


Thread

Re: Python shell wont open idle or an exisiting py file Chris Angelico <rosuav@gmail.com> - 2014-02-01 18:26 +1100

csiph-web