[issue21259] replace "except: pass" by "except Exception: pass"

2015-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I presume you do not mind if I reclose this. Thanks, please do reclose this. -- ___ Python tracker ___

[issue21259] replace "except: pass" by "except Exception: pass"

2015-09-19 Thread Martin Panter
Changes by Martin Panter : -- superseder: -> Fix bare excepts in various places in std lib ___ Python tracker ___

[issue21259] replace except: pass by except Exception: pass

2015-05-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just committed smaller patch in issue16261 and closed the issue. Not all changes in the patch in this issue look innocent and correct. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org

[issue21259] replace except: pass by except Exception: pass

2015-05-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: A couple of years ago, when I pushed 'except: pass', I was told in post-review that grandfathered bad code is no excuse for more bad code and that I should be explicit, including if I actually meant except BaseException:, which in this case I did. No other

[issue21259] replace except: pass by except Exception: pass

2014-04-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is definitely a duplicate of #16261 and should be closed at such. On that issue, in msg202448, I explained that #15313 is about except: in idlelib and idlelib must be patched separately for the reason Raymond repeated (point 2). The other reason (point

[issue21259] replace except: pass by except Exception: pass

2014-04-17 Thread Berker Peksag
Berker Peksag added the comment: This looks like a duplicate of issue 16261. -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21259 ___

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Stéphane Wirtel
New submission from Stéphane Wirtel: Hi guys, Via this issue, I will attach a patch where I replace all the except: pass in the source code by a clear except Exception: pass. -- components: Library (Lib) messages: 216524 nosy: matrixise priority: normal severity: normal status: open

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: I attach the patch. Need review. Thanks -- keywords: +patch nosy: +haypo Added file: http://bugs.python.org/file34918/issue21259-replace_except_pass.patch ___ Python tracker rep...@bugs.python.org

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: You shouldn't change the grammar the tests, nor the pybench source. Also, in some places it would probably be interesting to narrow down the exception type more. -- nosy: +pitrou ___ Python tracker

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: I disabled the patch for pybench and the grammar. Thanks for your review. -- Added file: http://bugs.python.org/file34919/issue21259-replace_except_pass-2.patch ___ Python tracker rep...@bugs.python.org

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: FYI, the two are not equivalent. A bare except is equivalent to BaseException. Even then, the new code would be slower than the original, so I'm not sure this change should be made at all (it makes the code more verbose, slower, and risks introducing a

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: After more consideration, I'm going to reject the patch because it doesn't really make the code better and may make it worse (changing semantics, slower, etc). Any such changes should be done holistically as part of a deeper refactoring on an individual

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread STINNER Victor
STINNER Victor added the comment: FYI, the two are not equivalent. I don't get your point, the purpose of the change is to get ride of except: pass which is *bad*. Even then, the new code would be slower than the original, I don't understand why you are talking about performances here.

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please don't close the issue, Stéphane is fixing real bug. He appears to be doing a blanket search and replace without adding tests, without evaluating each change to see if makes sense, and without consulting the original author of each affected piece of

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread STINNER Victor
STINNER Victor added the comment: I reviewed issue21259-replace_except_pass-2.patch. Please split this huge patch into smaller patches: 1) remove dummy except: raise 2) use os.unlink() 3) replace except: pass with more precise exceptions like except OSError: = please write multiple small

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread STINNER Victor
STINNER Victor added the comment: 3) replace except: pass with more precise exceptions like except OSError: = please write multiple small patches for this part You may even open a new issue just for except: pass = except OSError: pass -- ___

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread STINNER Victor
STINNER Victor added the comment: @Raymond: To give you more context, Stéphane is sprinting at Pycon on Pycon. I suggested him to fix all bare except: pass. His first patch is wrong, but ignoring any exception is even worse. -- ___ Python tracker

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread STINNER Victor
STINNER Victor added the comment: If you (Victor) want to individually study each one to make sure it is the right thing to do, I would place more faith in the patch. But as it stands now, reviewing the patch for correctness will take substantially more care and thought than it took to

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Several areas for attention: * Changes to the test suite probably should not be made The user doesn't benefit in any way and you risk unintentionally breaking the test suite in a way that isn't obvious (we have no tests for the tests themselves so

[issue21259] replace except: pass by except Exception: pass

2014-04-16 Thread Martin Panter
Martin Panter added the comment: If you do go ahead and add “except Exception” clauses, maybe look around at what other exceptions are being handled. The other day I stumbled across this in “tkinter.font” module: try: ... except (KeyboardInterrupt, SystemExit): raise except Exception: