Knit corruption message triggered by KeyboardInterrupt

John Arbash Meinel john at arbash-meinel.com
Tue Mar 13 22:40:57 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> KnitCorrupt: Knit
> d7/x_%2541aron_%2542entley_%253cabentley%40panoramicfeedback.com%253e_%2557ed_%254aan__7_12%253a15%253a49_2004_6479.91.knit
> corrupt: While reading
> {emulvaney at panoramicfeedback.com-20061116222058-4823a3c211749225} got
> KeyboardInterrupt()
> 
> bzr 0.16.0dev0 on python 2.4.1.final.0 (linux2)
> arguments: ['/home/abentley/bin/bzr', 'cdiff', '-r', '-3']
> 
> I think this handler is overbroad.  How about just handling IOErrors?
> 
> Aaron

Well, the code in question is handling GzipErrors, as well as other errors.

I would see at least IOError and OSError. However, I could also see just
separately catching KeyboardInterrupt with the standard:

try:
...
except KeyboardInterrupt:
  raise
except Exception, e:
  raise KnitCorrupt....

I'm okay either way, though. I just wasn't positive all the errors that
could be raised. (Actually, the current code will raise a
KnitCorrupt(KnitCorrupt()) if there is a problem with _check_header().

So yes, we should restrict the exception catcher a bit.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9yh5JdeBCYSNAAMRAnMkAJ48Nm0Do9h21hCa94ZgWneTZrbSlACgzgo+
gBVHWuRt9zXJygX+Y2AHwo4=
=K141
-----END PGP SIGNATURE-----



More information about the bazaar mailing list