what exceptions may file() and read() throw?
onurb at xiludom.gro
Fri Jun 23 17:13:01 CEST 2006
Daniel Schüle wrote:
>>You can't easily list the exceptions that your code could throw. There are
>>some obvious ones apart from IOError: say filename was an int (or even
>>certain strings) you would get TypeError, or you might get MemoryError or
>>KeyboardInterrupt. More obscurely, if you reused file as a global variable
>>you could generate any exception at all.
> I undestand now, so it would be better to let it in the code
> in case it's triggered
Nope. Let it propagate, so you have a full traceback. traceback are usefull.
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list