[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed in r85982, thank you. I will backport later. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Brian Brazil
Brian Brazil added the comment: Version 2 of the patch is attached. This fixes a warning at line 256 in test_fileio.py: f = _FileIO("/dev/tty", "a") on my Hardy machine. -- Added file: http://bugs.python.org/file19433/fileio_fd_leak_v2.patch ___

[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: It should be closed only if closefd is true. Does it fix a warning in the test suite? Otherwise I think it would need its own test. -- nosy: +pitrou ___ Python tracker __

[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +amaury.forgeotdarc, benjamin.peterson stage: -> patch review type: -> resource usage versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.3 ___ Python tracker

[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Brian Brazil
New submission from Brian Brazil : fileio_init will leak a fd if you open a file for append that isn't seekable. We should close this fd before returning the failure. The attached patch fixes this and a resource warning in the tests, but I'm unsure if it'd be better to use internal_close. I'd