ah, sure.
I honestly did not think of a KeyboardInterrupt, but I thought that
catching all exceptions no matter what was strange when you know the
exact exception you want to catch, and that's why I rewrote my fix in
r5392.
Thanks for this precision, I learned something new :)
2008/5/18 Daniel Herding <DHerding(a)gmx.de>de>:
Am Samstag 17 Mai 2008 schrieb
nicdumz(a)svn.wikimedia.org:
Revision: 5391
* Bug #1965938 "Article 'Loyalit?\195?\164t' in de.wikt throws UTF decoding
exception" : That article contained an invalid template, {{Loyalit%E4t}},
and it appears that incorrect template names were not handled correctly.
Indeed, "except Error" does not catch _ALL_ Errors. "except
Exception", or
"except:" is needed if you want to catch UnicodeDecodeError
- except Error:
+ except:
Hi nicdumz,
please be careful when writing such stuff. If you just write except, you also
catch KeyboardInterrupt. But if you catch it, the user can no longer press
CTRL-C to interrupt the script.
See:
http://effbot.org/zone/stupid-exceptions-keyboardinterrupt.htm
Cheers
Daniel
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
--
Nicolas Dumazet — NicDumZ
pywikipedia & mediawiki
Deuxième année ENSIMAG.
06 03 88 92 29