REPOST: Re: Can't exit python with ^D under certain circumstances

Steve Holden sholden at holdenweb.com
Fri Dec 28 11:33:43 EST 2001


"wealthychef" <wealthychef at yahoo.com> wrote in message
news:mailman.1009322789.23019.python-list at python.org...
> Hi, this is weird to me, don't know how to fix.
> On my local python installation on machine A in a normal shell, ^
> D works to exit Python as expected.  On machine B on the
> console, ^D also works fine, but if I ssh to machine B from
> machine A and try to exit Python with ^D, Python does not exit,
> instead I get the following strange error message:
>
> >>> ^D
>   File "<stdin>", line 1
>     c
>     ^
> SyntaxError: invalid syntax
>
> What is printing here as a little 'c' is showing up in the terminal
> as maybe
>
> E
>  F
>
> crammed into one character, or
>
> F
>  F
>
> I can't quite read it.
> Can anyone help me?  I'm no xmodmap dude, but i suspect
> some sort of keyboard confusion.  The two systems are different.
> Machine A is running one flavor of Unix, and machine B is
> running another, each with radically different hardware.
> Is there another way to exit Python?  Workaround?  Fix?  Thanks.
>
The "E and F rammed into a single character" sounds like a representation of
"EOF" as a graphic. The real question is why the end of file you send to
your local ssh client doesn't make it through to the Python interpreter as
an EOF, but instead (apparently) gets transmitted as a character.

In the meantime, you can terminate the interpreter with something like:

    import sys
    sys.exit("No more Python!")

regards
 Steve
--
http://www.holdenweb.com/

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool0-milwwi.newsops.execpc.com!newsfeeds.sol.net!news-out.visi.com!hermes.visi.com!newsfeed.berkeley.edu!ucberkeley!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: "Steve Holden" <sholden at holdenweb.com>
Newsgroups: comp.lang.python
Subject: cmsg cancel <1c1X7.79465$7l5.52086 at atlpnn01.usenetserver.com>
Control: cancel <1c1X7.79465$7l5.52086 at atlpnn01.usenetserver.com>
Date: Mon, 31 Dec 2001 03:03:56 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.1c1X7.79465$7l5.52086 at atlpnn01.usenetserver.com>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009775253 27193 211.57.49.2 (31 Dec 2001 05:07:33 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 05:07:33 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list