[Ml-yokadi] IO handler (was :Re: import fix (die utils.py die die))

Aurélien Gâteau aurelien.gateau
Lun 9 Fév 23:19:53 CET 2009


Sébastien Renard wrote:
>> Another question: why are IOError exceptions trapped in IOStream.write?
>> can't we let them propagate?
> 
> We can (to purify tui from yokadi spirit). But we have to catch it in onecmd() 
> (in yokadi.py) else it will crash yokadi.
> 
> In 0.9 the following crash yokadi with an ugly stack trace (the error 
> on "more" is to create a broken pipe): 
> 
> yokadi  | mor
 >
> I've just commit a patch to clean up tui with your suggestions. I also remove 
> the needs of YokadiException in editText.
> 

I was just wondering why the error needed to get caught. Readable code 
is more important than purified tui :) If removing YokadiException leads 
to more complicated code, leave the code as is.
It would be a good idea to add a comment explaining why we catch 
IOError, though :)

Aurélien


Plus d'informations sur la liste de diffusion Ml-yokadi