From fb4a48b77c6130f4f9f9e626d84cbb5f3abac20b Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Mon, 11 Dec 2023 09:57:06 +0100 Subject: [PATCH] Update ExternalResources.py close #549 --- src/fabio/utils/ExternalResources.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fabio/utils/ExternalResources.py b/src/fabio/utils/ExternalResources.py index 58a7bfe51..4d9d9e3bb 100644 --- a/src/fabio/utils/ExternalResources.py +++ b/src/fabio/utils/ExternalResources.py @@ -289,7 +289,8 @@ def get_file_and_repack(self, filename): if not gz_file_exists: try: - gzip.open(fullimagename_gz, "wb").write(decompressed) + with gzip.open(fullimagename_gz, "wb") as g: + g.write(decompressed) except IOError: raise IOError("unable to write gzipped \ data to disk at %s" % self.data_home)