please add a commit ratchet for bare excepts

Bug #636325 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

specifically, we shouldn't have any, and we shouldn't be adding them.

If we do have them, for correctness, they should include 'raise' in the code block - otherwise we'll get servers that won't shut down and test runs that won't stop promptly. (Which we have)>

Revision history for this message
Gary Poster (gary) wrote :

Are you thinking make lint here, or something more tightly integrated, like something checked in PQM/tarmac?

Changed in launchpad-foundations:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 636325] Re: please add a commit ratchet for bare excepts

A lint check (which buildbot can enforce) would be nice. There is/was
machinery for doing this in LP in the past.

Revision history for this message
Stuart Bishop (stub) wrote :

The style guideline should require a comment explicitly stating why
the bare except is needed rather than catching Exception.

--
Stuart Bishop <email address hidden>
http://www.stuartbishop.net/

Revision history for this message
Curtis Hovey (sinzui) wrote :

I agree with the RC and SB, but how would the linter know the user has a comment that permits the exception.?pocketlint is a wrapper for pyflakes and pep8, and they do not have an issue with this.

Adding python rules requires patches to go upstream, hacking our local module (pep8.py), or adding a new python linting module. version 0.5.5 of pylint does have a hacked pep8.py, so I favour keeping our madness in a single location.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.