While it'd be good for meliae to explicitly close the file, I think this indicates that meliae is creating a reference cycle. From the look of it, you'd have the following cycle:
1. dump_all_objects execution frame
2. the all_objs list held as a local in that frame
3. the dump_all_objects frame as an item in the all_objs list.
This would likely keep a reference to the open file object (since the frame holds a reference to it too) until the cyclic garbage collector kicks in at some later point in time.
Making dump_all_objects() clear the all_objs list before exiting is probably enough to get rid of the cycle.
While it'd be good for meliae to explicitly close the file, I think this indicates that meliae is creating a reference cycle. From the look of it, you'd have the following cycle:
1. dump_all_objects execution frame
2. the all_objs list held as a local in that frame
3. the dump_all_objects frame as an item in the all_objs list.
This would likely keep a reference to the open file object (since the frame holds a reference to it too) until the cyclic garbage collector kicks in at some later point in time.
Making dump_all_objects() clear the all_objs list before exiting is probably enough to get rid of the cycle.