Open
Description
When building the docs on Windows, I get some errors related to the removal of temporary files. For example, for building io.rst:
reading sources... [100%] io
---------------------------------------------------------------------------
WindowsError Traceback (most recent call last)
<ipython-input-124-e1699a291992> in <module>()
----> 1 os.remove('tmp.sv')
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'tmp.sv'
---------------------------------------------------------------------------
WindowsError Traceback (most recent call last)
<ipython-input-371-8e84b2979f2e> in <module>()
----> 1 os.remove('store.h5')
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'store.h5'
-
For
temp.sv
this is due to:reader = pd.read_table('tmp.sv', sep='|', iterator=True) reader.get_chunk(5)
where
reader
is still 'open'. A followingos.remove('tmp.sv')
will generate this error. Is there a way to close aTextFileReader
object? -
For
store.h5
this is due to the lastos.remove('store.h5')
(before 'SQL queries' http://pandas.pydata.org/pandas-docs/dev/io.html#sql-queries). For this, I don't directly see why this fails, as all the other calls toos.remove('store.h5')
do work (and there is astore.close()
command)