packages/s3ql: always copy buffer in comprenc

This commit is contained in:
Max Headroom 2024-06-09 22:28:26 +02:00
parent b680f81e69
commit 9dce56ffb6

View file

@ -0,0 +1,17 @@
diff --git a/src/s3ql/backends/comprenc.py b/src/s3ql/backends/comprenc.py
index 9ed3627e..db419bb7 100644
--- a/src/s3ql/backends/comprenc.py
+++ b/src/s3ql/backends/comprenc.py
@@ -276,6 +276,12 @@ class ComprencBackend(AbstractBackend):
buf.seek(0)
fh = buf
+ if meta_raw['compression'] == 'None' and meta_raw['encryption'] == 'None':
+ buf = io.BytesIO()
+ copyfh(fh, buf, len_)
+ buf.seek(0)
+ fh = buf
+
return self.backend.write_fh(key, fh, meta_raw, len_=len_ if meta_raw['compression'] == 'None'and meta_raw['encryption'] == 'None' else None)
def contains(self, key):