[issue2291] Catching all exceptions with 'object'

2008-03-16 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Actually, if you go back to 2.4, before BaseException even existed, a try/except with a new-style class in the 'except' clause was also possible. Actual enforcement of what can be in an 'except' clause is a new thing added by PEP 352. Suddenly m

[issue2291] Catching all exceptions with 'object'

2008-03-16 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I thought some more about this issue and the current behavior seems wrong and potentially dangerous. Consider the following code: class x: pass class y(x): pass try: raise y except y: print "a" except: pri

[issue2291] Catching all exceptions with 'object'

2008-03-15 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: On Sat, Mar 15, 2008 at 5:30 PM, Neal Norwitz <[EMAIL PROTECTED]> wrote: > > Neal Norwitz <[EMAIL PROTECTED]> added the comment: > > See PEP 352. Currently this is slated for python 2.8. Perhaps the > schedule should be sped up a bit in lig

[issue2291] Catching all exceptions with 'object'

2008-03-15 Thread Neal Norwitz
Neal Norwitz <[EMAIL PROTECTED]> added the comment: See PEP 352. Currently this is slated for python 2.8. Perhaps the schedule should be sped up a bit in light the current release schedule. Brett, any comments? We should add all the warnings from PEP 352 with the -3 flag to 2.6. -- n

[issue2291] Catching all exceptions with 'object'

2008-03-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Py3k behavior seems to be better: Python 3.0a2+ (py3k:61137M, Feb 29 2008, 15:17:29) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin >>> try: ... raise ValueError("foo") ... except object: ... pass ... Traceback (most

[issue2291] Catching all exceptions with 'object'

2008-03-14 Thread Igor
New submission from Igor <[EMAIL PROTECTED]>: I have discovered the following behaviour in 2.5, which I cannot explain: >>> try: ... raise ValueError("foo") ... except object: ... print "aiee!" ... Traceback (most recent call last): File "", line 2, in ValueError: foo >>> sys.version '2.