Knit corruption message triggered by KeyboardInterrupt
Alexander Belchenko
bialix at ukr.net
Wed Mar 14 00:42:57 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel пишет:
> 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.
BTW, python 2.5 change hierarchy of exception and separate KeyboardInterrupt.
See 'whats new': http://docs.python.org/whatsnew/pep-352.html
[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF90UQzYr338mxwCURAgyhAJ91NFAfmy43ox5TyuKpxO40gw0qowCeLHUK
hiaNCCQ4TpAf6XF9OJ+bNhc=
=1Vr8
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list