How do I persist to disk a temporary file using Python?
hop is right, and dF. is incorrect on why the error occurs. Since you haven’t called f.close() yet, the file is not removed. The doc for NamedTemporaryFile says: Whether the name can be used to open the file a second time, while the named temporary file is still open, varies across platforms (it can be … Read more