From 5d24f75ce227d5d88e163fef468b3536d84f24e0 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 15 Aug 2017 10:53:19 -0400 Subject: [PATCH] fix BlobFile._close_file --- CHANGELOG.md | 6 ++++++ lbrynet/core/HashBlob.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e814d9f..ff20ef79d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ at anytime. ### Fixed * + * Fixed reflector server blocking the `received_blob` reply on the server announcing the blob to the dht + * Fixed non-blocking call in `BlobFile._close_writer` + * Fixed incorrect formatting of "amount" fields + * Fixed handling of SIGINT, SIGTERM. + * Fixed shutdown sequence + * Fix error when resolving an integer * ### Deprecated diff --git a/lbrynet/core/HashBlob.py b/lbrynet/core/HashBlob.py index 4d1521d0b..7494a606d 100644 --- a/lbrynet/core/HashBlob.py +++ b/lbrynet/core/HashBlob.py @@ -273,12 +273,13 @@ class BlobFile(HashBlob): file_handle.close() self.readers -= 1 + @defer.inlineCallbacks def _close_writer(self, writer): if writer.write_handle is not None: log.debug("Closing %s", str(self)) name = writer.write_handle.name writer.write_handle.close() - threads.deferToThread(os.remove, name) + yield threads.deferToThread(os.remove, name) writer.write_handle = None def _save_verified_blob(self, writer):