My program appears to be leaking file handles, how can I find out where? - My program uses file handles in a few different places - output from child processes, call ctypes api (imagemagick) opens files, and they are copied.
It crashes in shutil.copyfile, but I'm pretty sure this is not the place it is leaking
Traceback (most recent call last): File "", line 1, in File "C:\Python25\Lib\site-packages\magpy\magpy.py", line 874, in main magpy.run_all() File "C:\Python25\Lib\site-packages\magpy\magpy.py", line 656, in run_all [operation.operate() for operation in operations] File "C:\Python25\Lib\site-packages\magpy\magpy.py", line 417, in operate output_file = self.place_image(output_file) File "C:\Python25\Lib\site-packages\magpy\magpy.py", line 336, in place_image shutil.copyfile(str(input_file), str(self.full_filename)) File "C:\Python25\Lib\shutil.py", line 47, in copyfile fdst = open(dst, 'wb') IOError: [Errno 24] Too many open files: 'C:\\Documents and Settings\\stuart.axon\\Desktop\\calzone\\output\\wwtbam4\\Nokia_NCD\\nl\\icon_42x42_V000.png' Press any key to continue . . .