I think it's annoying. The atexit calls happen *before* the double under del destructor gets called, so even if you have the close call in the destructor, you still get the annoying pytables printout in a typical OpenMM script.

Sent from my iPhone

On Apr 16, 2013, at 10:50 AM, kyleabeauchamp <notifications@github.com> wrote:

> In MDTraj/reporters/hdf5reporter.py:
> 
> > +    https://www.pytables.org/moin/UserDocuments/AtexitHooks"""
> > +    open_files = tables.file._open_files
> > +    are_open_files = len(open_files) > 0
> > +    if verbose and are_open_files:
> > +        print >> sys.stderr, "Closing remaining open files:",
> > +    for fileh in open_files.keys():
> > +        if verbose:
> > +            print >> sys.stderr, "%s..." % (open_files[fileh].filename,),
> > +        open_files[fileh].close()
> > +        if verbose:
> > +            print >> sys.stderr, "done",
> > +    if verbose and are_open_files:
> > +        print >> sys.stderr
> > +
> > +
> > +atexit.register(close_open_files, False)
> I wonder if it's useful to have verbose be the default. PyTables files can get corrupted pretty easily. I think one easy path towards corruption is trying to have two processes write the same database.
> 
> Printing this message should help remind users when file handles are still open.
> 
> —
> Reply to this email directly or view it on GitHub.