BPO | [18332](https://bugs.python.org/issue18332) --- | :--- Nosy | @tiran Superseder | bpo-17899: os.listdir() leaks FDs if invoked on FD pointing to a non-directory *Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.* Show more details GitHub fields: ```python assignee = None closed_at = created_at = labels = ['extension-modules', 'performance'] title = '_posix_listdir may leak FD' updated_at = user = 'https://github.com/tiran' ``` bugs.python.org fields: ```python activity = actor = 'christian.heimes' assignee = 'none' closed = True closed_date = closer = 'christian.heimes' components = ['Extension Modules'] creation = creator = 'christian.heimes' dependencies = [] files = [] hgrepos = [] issue_num = 18332 keywords = [] message_count = 3.0 messages = ['192077', '192080', '192082'] nosy_count = 2.0 nosy_names = ['christian.heimes', 'sbt'] pr_nums = [] priority = 'normal' resolution = 'duplicate' stage = 'needs patch' status = 'closed' superseder = '17899' type = 'resource usage' url = 'https://bugs.python.org/issue18332' versions = ['Python 3.3', 'Python 3.4'] ```
Activity
tiran commentedon Jun 30, 2013
Under rare circumstances listdir() could leak a FD:
Proposed fix:
CID 992693 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable "fd" going out of scope leaks the handle
sbt commentedon Jun 30, 2013
I think this is a duplicate of bpo-17899.
tiran commentedon Jun 30, 2013
You are right.