[issue7865] io close() swallowing exceptions

Pascal Chambon report at bugs.python.org
Thu Apr 29 21:50:35 CEST 2010


Pascal Chambon <chambon.pascal at gmail.com> added the comment:

Here is a code/test patch which *should* fix the multiple close() case, and ensure flush() raise an error on closed file. 

All IO test suites pass on my win32 (except test_largefile that I skip due to lack of hdd space).


I've noticed that the detach() semantic was quite different between _pyio and _io, by the way: C code raises valueerror when we try to access the stream after detaching it, whereas python lets attribute errors be raised. But maybe this is not so important, as these are programming errors anyway.

One thing I'm still wondering : why couldn't we obtain these C extension by cythonizing _pyio ? Are there features that cython lacks, or optimization considerations I'm not aware of ? Cython-generated extensions seem soooo easier to maintain...

----------
Added file: http://bugs.python.org/file17132/no_swallow_on_close3.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7865>
_______________________________________


More information about the Python-bugs-list mailing list