From: Mythsmith <sp...@mo...> - 2012-06-21 15:44:08
Attachments:
emptybug.py
|
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 |
From: Anthony S. <sc...@gm...> - 2012-06-21 17:23:57
|
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...> 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 > > > ------------------------------------------------------------------------------ > 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 > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users > > |
From: Antonio V. <ant...@ti...> - 2012-06-23 18:12:18
|
Ciao Daniele, Il 21/06/2012 17:43, Mythsmith ha scritto: > 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 > Thank you for reporting. The issue has already been fixed in the development branch an it should be available in PyTables 2.4. I filed a ticket on GitHub (https://github.com/PyTables/PyTables/issues/158) to track the issue. ciao > > ------------------------------------------------------------------------------ > 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 > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users > -- Antonio Valentino |
From: Mythsmith <sp...@mo...> - 2012-06-25 07:17:15
|
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 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 > > ------------------------------------------------------------------------------ > 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 > Pyt...@li... > <mailto:Pyt...@li...> > https://lists.sourceforge.net/lists/listinfo/pytables-users > > > > > ------------------------------------------------------------------------------ > 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 > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users |
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 |
From: Mythsmith <sp...@mo...> - 2012-06-25 15:29:39
Attachments:
test_reopening.py
|
Done: https://github.com/PyTables/PyTables/issues/159 I did not understand how to attach a file to a github issue. Anyway, I produced a pastebin address and attach the unittest here. Regards, Daniele Il 25/06/2012 09:35, Antonio Valentino ha scritto: > 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 > > |