Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-11 Thread Victor Stinner
Le jeudi 11 mars 2010 21:58:11, Brett Cannon a écrit : > > (...) > > Should I backport the fix to 3.1? (The backport to py3k is not done yet) > > Once you are happy with the stability then please port it to 3.1. My commit broke test_sysconfig, test_platform and test_subprocess. Some commits late

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-11 Thread Brett Cannon
On Thu, Mar 11, 2010 at 13:33, Benjamin Peterson wrote: > 2010/3/11 Brett Cannon : > > > > > > On Wed, Mar 10, 2010 at 17:21, Victor Stinner < > victor.stin...@haypocalc.com> > > wrote: > >> > >> Hi, > >> > >> Some news about my patch. > >> > >> Le lundi 08 mars 2010 19:21:20, Maciej Fijalkowski a

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-11 Thread Benjamin Peterson
2010/3/11 Brett Cannon : > > > On Wed, Mar 10, 2010 at 17:21, Victor Stinner > wrote: >> >> Hi, >> >> Some news about my patch. >> >> Le lundi 08 mars 2010 19:21:20, Maciej Fijalkowski a écrit : >> > On Mon, Mar 8, 2010 at 10:47 AM, Guido van Rossum >> > wrote: >> > > Actually it sounds like ther

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-11 Thread Brett Cannon
On Wed, Mar 10, 2010 at 17:21, Victor Stinner wrote: > Hi, > > Some news about my patch. > > Le lundi 08 mars 2010 19:21:20, Maciej Fijalkowski a écrit : > > On Mon, Mar 8, 2010 at 10:47 AM, Guido van Rossum > wrote: > > > Actually it sounds like there's some overly general except clause > > > so

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-10 Thread Victor Stinner
Hi, Some news about my patch. Le lundi 08 mars 2010 19:21:20, Maciej Fijalkowski a écrit : > On Mon, Mar 8, 2010 at 10:47 AM, Guido van Rossum wrote: > > Actually it sounds like there's some overly general except clause > > somewhere that should be adjusted to catch just "Exception" instead of >

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Guido van Rossum
On Mon, Mar 8, 2010 at 2:01 PM, Victor Stinner wrote: > Le lundi 08 mars 2010 22:06:36, vous avez écrit : >> OTOH I think the try/except in site.py around the execution of >> sitecustomize.py might be changed so that it prints a full traceback >> whenever it raises an exception other than ImportEr

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Victor Stinner
Le lundi 08 mars 2010 22:06:36, vous avez écrit : > OTOH I think the try/except in site.py around the execution of > sitecustomize.py might be changed so that it prints a full traceback > whenever it raises an exception other than ImportError or, again, > exceptions inheriting from BaseException bu

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Victor Stinner
Le lundi 08 mars 2010 22:18:34, Glyph Lefkowitz a écrit : > On Mar 8, 2010, at 4:06 PM, Guido van Rossum wrote: > > I am trying to remember why I made site.py failures non-fatal in the > > first place. I don't have any specific recollection but it must've > > been either from before the separation

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Guido van Rossum
On Mon, Mar 8, 2010 at 1:18 PM, Glyph Lefkowitz wrote: > > On Mar 8, 2010, at 4:06 PM, Guido van Rossum wrote: > > I am trying to remember why I made site.py failures non-fatal in the > first place. I don't have any specific recollection but it must've > been either from before the separation betw

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Glyph Lefkowitz
On Mar 8, 2010, at 4:06 PM, Guido van Rossum wrote: > I am trying to remember why I made site.py failures non-fatal in the > first place. I don't have any specific recollection but it must've > been either from before the separation between site.py (part of the > stdlib) and sitecustomize.py (sit

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Guido van Rossum
On Mon, Mar 8, 2010 at 12:50 PM, Victor Stinner wrote: > Le lundi 08 mars 2010 18:47:18, Guido van Rossum a écrit : >> Actually it sounds like there's some overly general except clause >> somewhere that should be adjusted to catch just "Exception" instead of >> "*". > > Most of my patches (for SIG

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Victor Stinner
Hi, Le lundi 08 mars 2010 18:47:18, Guido van Rossum a écrit : > Actually it sounds like there's some overly general except clause > somewhere that should be adjusted to catch just "Exception" instead of > "*". Most of my patches (for SIGINT) are exactly doing that: check the exception type inst

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Guido van Rossum
On Mon, Mar 8, 2010 at 10:21 AM, Maciej Fijalkowski wrote: > On Mon, Mar 8, 2010 at 10:47 AM, Guido van Rossum wrote: >> Actually it sounds like there's some overly general except clause >> somewhere that should be adjusted to catch just "Exception" instead of >> "*". >> > > There is at least one

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Maciej Fijalkowski
On Mon, Mar 8, 2010 at 10:47 AM, Guido van Rossum wrote: > Actually it sounds like there's some overly general except clause > somewhere that should be adjusted to catch just "Exception" instead of > "*". > There is at least one that prints "import 'site' failed" and continues to run your program

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Guido van Rossum
Actually it sounds like there's some overly general except clause somewhere that should be adjusted to catch just "Exception" instead of "*". On Mon, Mar 8, 2010 at 9:14 AM, Michael Foord wrote: > On 08/03/2010 13:12, Victor Stinner wrote: >> >> Hi, >> >> I wrote patches for the issue #3137 and I

Re: [Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Michael Foord
On 08/03/2010 13:12, Victor Stinner wrote: Hi, I wrote patches for the issue #3137 and I would like your opinion about my solution (not directly about the patches): I propose to consider a SIGINT during startup as a fatal error. If you press CTRL+c while Python is starting, Python displays an er

[Python-Dev] Catch SIGINT at Python startup

2010-03-08 Thread Victor Stinner
Hi, I wrote patches for the issue #3137 and I would like your opinion about my solution (not directly about the patches): I propose to consider a SIGINT during startup as a fatal error. If you press CTRL+c while Python is starting, Python displays an error and exit with the code 1. Currently,