Ciao Daniele,

Il giorno Mon, 25 Jun 2012 09:17:00 +0200
Mythsmith <s...@modena1.it> 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 <s...@modena1.it 
> > <mailto:s...@modena1.it>> 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

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to