[NumPy-Tickets] [NumPy] #1517: numpy.load does not release file handle for npz files
NumPy Trac
numpy-tickets@scipy....
Tue Jun 22 06:25:03 CDT 2010
#1517: numpy.load does not release file handle for npz files
------------------------------+---------------------------------------------
Reporter: etecman | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 2.0.0
Component: numpy.lib | Version: 1.3.0
Keywords: load, filehandle |
------------------------------+---------------------------------------------
When opening a npz file with numpy.load, the handle to the file is not
released such that the file cannot be deleted during the runtime of the
script - even if all returned values are deleted.
Error message:
WindowsError: [Error 32] The process cannot access the file because it is
being used by another process: 'deleteme.npz'
Example:
{{{
import os
import numpy
a = numpy.array([[1, 2, 3], [4, 5, 6]])
filenameNPZ = "deleteme.npz"
numpy.savez(filenameNPZ, a = a)
npz = numpy.load(filenameNPZ)
del npz
os.remove(filenameNPZ)
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1517>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list