#2353 closed defect (duplicate)

make sure all file objects get explicitly closed

Reported by: zooko Owned by:
Priority: normal Milestone: undecided
Component: code Version: 1.10.0
Keywords: Cc:
Launchpad Bug:


Find all places that we open a file and make sure that we explicitly close that file object instead of relying on garbage-collection/reference-counting to close the file as a side-effect of freeing up the object.

Here's an example of a buggy bit of code where we call close() on only one branch of an if: storage/mutable.py line 336.

See also #1437.

Change History (2)

comment:1 Changed at 2016-08-07T18:00:35Z by warner

  • Component changed from unknown to code

comment:2 Changed at 2020-01-09T18:40:08Z by exarkun

  • Resolution set to duplicate
  • Status changed from new to closed

This is related to ticket:1792. PyPy? does not use reference counting so files that are not explicitly closed tend to remain open for longer (until another garbage collector mechanism kicks in).

I expect that when that ticket is resolved, this one will be too.

Note: See TracTickets for help on using tickets.