Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BedTool.__len__ leaks file descriptors #68

Closed
daler opened this issue Nov 30, 2012 · 1 comment
Closed

BedTool.__len__ leaks file descriptors #68

daler opened this issue Nov 30, 2012 · 1 comment

Comments

@daler
Copy link
Owner

daler commented Nov 30, 2012

The following code illustrates the leak:

import pybedtools
fn = pybedtools.example_filename('a.bed')
orig_fds = pybedtools.helpers.n_open_fds()

# no len()
n1 = []
for i in range(100):
    x = pybedtools.BedTool(fn)
    n1.append(pybedtools.helpers.n_open_fds())
print max(n1) - orig_fds
#2

# check len() each time
n2 = []
for i in range(100):
    x = pybedtools.BedTool(fn)
    len(x)
    n2.append(pybedtools.helpers.n_open_fds())
print max(n2) - orig_fds
#100
@daler
Copy link
Owner Author

daler commented Oct 8, 2014

fixed in adc0195

@daler daler closed this as completed Oct 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant