Message102702
An interesting part of this story is *why* it doesn't crash in Py3k (despite explicitly closing the file descriptor in the same way as 2.x closes the C file pointer).
The reason is that PyFile_FromFd (the closest Py3k equivalent to PyFile_FromFile) will sometimes leave the file descriptor open, even if closefd is True. Specifically, this will happen if the raw file IO object fails to be created. Any subsequent failure while opening the file (e.g. while creating the line buffering or text wrapper) will trigger the same double close bug as occurs in 2.x.
io_open needs to be fixed so this behaviour is consistent: if creation of the raw file IO object fails and closefd is True, io_open should close the file descriptor so that the behaviour on error is consistent. |
|
Date |
User |
Action |
Args |
2010-04-09 08:55:32 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, doko, amaury.forgeotdarc, orsenthil, r.david.murray, Trundle, flox, l0nwlf |
2010-04-09 08:55:31 | ncoghlan | set | messageid: <1270803331.92.0.985671327492.issue7732@psf.upfronthosting.co.za> |
2010-04-09 08:55:30 | ncoghlan | link | issue7732 messages |
2010-04-09 08:55:29 | ncoghlan | create | |
|