Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temp file usage causing exceptions and disk storage leaks - Patch attached #289

Closed
kkissell opened this issue Apr 12, 2020 · 4 comments
Closed

Comments

@kkissell
Copy link
Contributor

The Cirq bindings and python tests used python tempfile constructs incorrectly, causing exceptions when the deconstructor tries to use the os bindings after the global os object is freed, and one of the test modules simply leaked files. Fixing this cleanly touches several files, though mostly with a simple substiution once the data_storage_interface fix is done. Zipped patch file attached.
0001-Changes-to-temporary-storage-management-to-fix-error.patch.zip

@alexandrupaler
Copy link
Contributor

Thank you. Can you please create a pull request with the patch? Is the core of the solution to use a directory for the file?

self._tdir = tempfile.TemporaryDirectory()
self.storage = tempfile.NamedTemporaryFile(mode='w',dir=self._tdir.name, delete=False)

@kkissell
Copy link
Contributor Author

kkissell commented Apr 12, 2020 via email

@alexandrupaler
Copy link
Contributor

No problem. Thank you again. I created #290 where I applied your patch.

@alexandrupaler
Copy link
Contributor

#290 merge should have solved this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants