[issue13757] os.fdlistdir() should not close the file descriptor given in argument

2012-01-10 Thread Charles-François Natali
Charles-François Natali added the comment: Thanks! -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue13757] os.fdlistdir() should not close the file descriptor given in argument

2012-01-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6d395ed03f95 by Charles-François Natali in branch 'default': Issue #13757: Change os.fdlistdir() so that it duplicates the passed file http://hg.python.org/cpython/rev/6d395ed03f95 -- nosy: +python-dev _

[issue13757] os.fdlistdir() should not close the file descriptor given in argument

2012-01-10 Thread Ross Lagerwall
Ross Lagerwall added the comment: The reason I made it like that was that it seemed "closer" to the fdopendir() function which steals the fd for internal use. However, I agree that it makes more sense to dup() it. Patch looks good. -- ___ Python t

[issue13757] os.fdlistdir() should not close the file descriptor given in argument

2012-01-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: Agreed with the change. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue13757] os.fdlistdir() should not close the file descriptor given in argument

2012-01-10 Thread Charles-François Natali
New submission from Charles-François Natali : os.fdlistdir() closes the FD passed as argument. This is annoying, since in 99% of the cases you'd like to keep FD intact, so you end up doing os.fdlistdir(os.dup(fd)). Here's a patch that duplicates the FD in fdlistdir(), so that the original FD is