[issue7865] io close() swallowing exceptions

2010-05-06 Thread Pascal Chambon
Pascal Chambon added the comment: Cool, thanks a lot B-) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue7865] io close() swallowing exceptions

2010-05-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the patch! It was committed in r80720 (trunk), r80721 (2.6), r80722 (py3k), r80723 (3.1). -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue7865] io close() swallowing exceptions

2010-04-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > But maybe this is not so important, as these are programming errors > anyway. Agreed :) > 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 consideration

[issue7865] io close() swallowing exceptions

2010-04-29 Thread Pascal Chambon
Pascal Chambon 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() seman

[issue7865] io close() swallowing exceptions

2010-04-29 Thread Pascal Chambon
Changes by Pascal Chambon : Removed file: http://bugs.python.org/file17077/no_swallow_on_close2.patch ___ Python tracker ___ ___ Python-bugs-li

[issue7865] io close() swallowing exceptions

2010-04-28 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue7865] io close() swallowing exceptions

2010-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: For what it's worth, I documented the possibility to call close() several times in r80592. > Then when you try to wrap a non-readable stream into a readable > buffered stream (like BufferedRWPair), it should raise a value error as > well, Good point. Unfort

[issue7865] io close() swallowing exceptions

2010-04-28 Thread Pascal Chambon
Pascal Chambon added the comment: >Probably an oversight. Do you want to add some tests? That's WIP > Because it's not an IO error at all. No I/O occurs. You are just using the file wrongly (or the wrong file), hence the ValueError. Then when you try to wrap a non-readable stream into a reada

[issue7865] io close() swallowing exceptions

2010-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'm quite surprised it wasn't already covered by the test suite :S Probably an oversight. Do you want to add some tests? > Should a flush on a closed stream fail (at the moment sometimes it > does, sometimes doesn't) ? It probably should, yes. > Why is som

[issue7865] io close() swallowing exceptions

2010-04-27 Thread Pascal Chambon
Pascal Chambon added the comment: I'm quite surprised it wasn't already covered by the test suite :S Anyway I'm quite confused about the semantic which is expected from IO operations... Should a flush on a closed stream fail (at the moment sometimes it does, sometimes doesn't) ? Why is somet

[issue7865] io close() swallowing exceptions

2010-04-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: I just tried the patch. One problem is that you are supposed to be able to call close() several times without having it fail: >>> f = open("LICENSE") >>> f.close() >>> f.close() >>> f = io.open("LICENSE") >>> f.close() >>> f.close() Traceback (most recent call

[issue7865] io close() swallowing exceptions

2010-04-25 Thread Pascal Chambon
Pascal Chambon added the comment: SHould be better this way then B-) -- Added file: http://bugs.python.org/file17077/no_swallow_on_close2.patch ___ Python tracker ___ ___

[issue7865] io close() swallowing exceptions

2010-04-25 Thread Pascal Chambon
Changes by Pascal Chambon : Removed file: http://bugs.python.org/file17046/release_io_close_exceptions.patch ___ Python tracker ___ ___ Python-

[issue7865] io close() swallowing exceptions

2010-04-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: The tests should probably check all three types of I/O (raw, buffered, text). -- stage: needs patch -> patch review ___ Python tracker ___ _

[issue7865] io close() swallowing exceptions

2010-04-22 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue7865] io close() swallowing exceptions

2010-04-22 Thread Pascal Chambon
Pascal Chambon added the comment: Patch and test to stop swallowing exceptions on stream close(), for python SVN trunk. -- keywords: +patch Added file: http://bugs.python.org/file17046/release_io_close_exceptions.patch ___ Python tracker

[issue7865] io close() swallowing exceptions

2010-04-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: You're right that silencing IO errors is bad. Patch welcome. -- nosy: +amaury.forgeotdarc, pitrou priority: low -> normal ___ Python tracker __

[issue7865] io close() swallowing exceptions

2010-04-09 Thread Pascal Chambon
Pascal Chambon added the comment: Well, it would break code which currently ignores that it fails, so it's more a benefit than a loss for programmers imo. I doubt the impact will be important though, because the io module is still quite recent, and furthermore errors on the last flush are qui

[issue7865] io close() swallowing exceptions

2010-04-08 Thread Daniel Diniz
Daniel Diniz added the comment: Wouldn't this break code that currently works? -- nosy: +ajaksu2 priority: -> low stage: -> needs patch type: -> behavior versions: -Python 2.5 ___ Python tracker ___

[issue7865] io close() swallowing exceptions

2010-02-06 Thread Pascal Chambon
New submission from Pascal Chambon : The current semantic of io streams is to swallow IOErrors on close(), eg. in _pyio from the trunk, we have each time constructs like: try: self.flush() except IOError: pass # If flush() fails, just give up and in C files : /* If flush() fa