Re: Annoying message when interrupting python scripts

2008-06-19 Thread geoffbache
As nobody decried the idea of this being a bug, it now is :) http://bugs.python.org/issue3137 /Geoff -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying message when interrupting python scripts

2008-06-18 Thread geoffbache
Ben is correct in his interpretation of what I'm trying to say. The code "should surely be changed" so that it lets a KeyboardInterrupt exception through. Geoff -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying message when interrupting python scripts

2008-06-17 Thread John Machin
On Jun 18, 12:26 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > John Machin <[EMAIL PROTECTED]> writes: > > On Jun 18, 12:51 am, geoffbache <[EMAIL PROTECTED]> wrote: > > [snip] > > > Is this a bug? I couldn't find any code, but I imagine something like > > > try: > > > import site > > > except:

Re: Annoying message when interrupting python scripts

2008-06-17 Thread Ben Finney
John Machin <[EMAIL PROTECTED]> writes: > On Jun 18, 12:51 am, geoffbache <[EMAIL PROTECTED]> wrote: > [snip] > > Is this a bug? I couldn't find any code, but I imagine something like > > try: > > import site > > except: > > sys.stderr.write("import site failed; use -v for traceback\n")

Re: Annoying message when interrupting python scripts

2008-06-17 Thread John Machin
On Jun 18, 12:51 am, geoffbache <[EMAIL PROTECTED]> wrote: [snip] > Is this a bug? I couldn't find any code, but I imagine something like > try: > import site > except: > sys.stderr.write("import site failed; use -v for traceback\n") > > which should surely allow a KeyboardInterrupt excep

Re: Annoying message when interrupting python scripts

2008-06-17 Thread geoffbache
To clarify: this is more serious than an incorrect error message, as the intended interrupt gets swallowed and script execution proceeds. Sometimes I seem to get half-imported modules as well, the script failing later with something like AttributeError: 'module' object has no attribute 'getenv'

Annoying message when interrupting python scripts

2008-06-17 Thread geoffbache
Hi all, I find that I semi-frequently get the cryptic message import site failed; use -v for traceback printed on standard error when an arbitrary python script receives SIGINT while the python interpreter is still firing up. If I use -v for traceback I get something along the lines of 'import