This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年01月10日 18:56 by neologix, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| fdlistdir_noclose.diff | neologix, 2012年01月10日 18:56 | review | ||
| Messages (5) | |||
|---|---|---|---|
| msg151023 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2012年01月10日 18:56 | |
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 kept intact, which is much more natural (at least to me :). That's an API change, but since fdlistdir() has been introduced in 3.3 which hasn't been released yet, I think it should be acceptable. |
|||
| msg151024 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年01月10日 18:58 | |
Agreed with the change. |
|||
| msg151025 - (view) | Author: Ross Lagerwall (rosslagerwall) (Python committer) | Date: 2012年01月10日 19:00 | |
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. |
|||
| msg151027 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年01月10日 19:25 | |
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 |
|||
| msg151029 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2012年01月10日 20:40 | |
Thanks! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:25 | admin | set | github: 57966 |
| 2012年01月10日 20:40:19 | neologix | set | status: open -> closed resolution: fixed messages: + msg151029 stage: resolved |
| 2012年01月10日 19:25:46 | python-dev | set | nosy:
+ python-dev messages: + msg151027 |
| 2012年01月10日 19:00:28 | rosslagerwall | set | messages: + msg151025 |
| 2012年01月10日 18:58:46 | pitrou | set | messages: + msg151024 |
| 2012年01月10日 18:56:51 | neologix | create | |