Skip to content

Leaked file descriptor in Deer observables class #2

@kain88-de

Description

@kain88-de

pickle.dump([self.labels, self.moddepth, self.nrestraints, self.exp_tmp,
self.exp_err_tmp, self.sim_tmp], open(self.out_pkl, 'wb'))

This line contains a leak. The call to open returns a file descriptor that is never closed again. This is OK when using only the bioen CLI tool. It will be a problem when using the library from python and analyzing a lot of deer data examples with pkl_out set because each process only is allowed a limited number of open file descriptors. The correct solution would be to use a context manager.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions