From: Antonio V. <ant...@ti...> - 2012-06-25 07:53:23
|
Ciao Daniele, Il giorno Mon, 25 Jun 2012 09:17:00 +0200 Mythsmith <sp...@mo...> ha scritto: > Hi Anthony, > Shouldn't the close() method also clear the cache? I think a file > should be either opened or closed... Should I file a bug report? > Best regards, > Daniele > The close method also remover the file from the cache if there are no more references to it https://github.com/PyTables/PyTables/blob/6fccb7495ba1bc758c7b04960fe1cd392abe9b96/tables/file.py#L2098 Anyway yes, if you have some problem with the file caching system please file a bug report on github. Of course test scripts or patches are very welcome. ciao > Il 21/06/2012 19:23, Anthony Scopatz ha scritto: > > Hi Daniele, > > > > This is probably because of the way PyTables caches its file > > objects. As a temporary work around, why don't you try clearing the > > cache or at least removing this file. The cache is just a > > dictionary and it is located at "tables.file._open_files". ie try: > > > > tables.file._open_files.clear() > > -or- > > del tables.file._open_files.pop["touch.h5"] > > > > Be Well > > Anthony > > > > On Thu, Jun 21, 2012 at 10:43 AM, Mythsmith <sp...@mo... > > <mailto:sp...@mo...>> wrote: > > > > Hi, > > I noticed that if I open an erroneous file (eg: empty), then it > > seems not possible to completely close it and reopen the same > > path, even if a valid file was created in the meanwhile. > > The error is: > > ValueError: The file 'touch.h5' is already opened. Please close > > it before reopening in write mode. > > > > You find a complete example attached. > > > > Regards, > > daniele -- Antonio Valentino |