From: Francesc A. <fa...@py...> - 2009-08-04 18:55:49
|
Hi Anthony, El dl 03 de 08 del 2009 a les 16:08 -0400, en/na Anthony Foglia va escriure: > Anthony Foglia wrote: > [...] > > Now in trying to abstract the disk storage, I'm having trouble > > figuring out how to keep track of the open files, and knowing when to > > close them. I'm keeping a list of weakrefs to nodes in the file, and > > when they all go away, I try to close the file, but I get an exception > > "exceptions.AttributeError: AttributeError("'NoneType' object has no > > attribute '_f_close'",) in <function remove at ...> ignored". (remove > > doesn't call _f_close, but file.close, so it must be coming from in > > there. (I've attached this implementation.) Maybe what you are after is to personalize the behaviour of the `atexit` hook when exiting PyTables. See at: http://pytables.org/moin/UserDocuments/AtexitHooks and tell me if this helps. Cheers, Francesc |