Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9341757
D2044.id6893.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D2044.id6893.diff
View Options
diff --git a/swh/objstorage/objstorage.py b/swh/objstorage/objstorage.py
--- a/swh/objstorage/objstorage.py
+++ b/swh/objstorage/objstorage.py
@@ -6,6 +6,7 @@
import abc
from itertools import dropwhile, islice
import bz2
+import gzip
import lzma
import zlib
@@ -48,6 +49,7 @@
decompressors = {
'bz2': bz2.decompress,
'lzma': lzma.decompress,
+ 'gzip': gzip.decompress,
'zlib': zlib.decompress,
None: lambda x: x,
}
@@ -55,6 +57,7 @@
compressors = {
'bz2': bz2.BZ2Compressor,
'lzma': lzma.LZMACompressor,
+ 'gzip': lambda: zlib.compressobj(wbits=31),
'zlib': zlib.compressobj,
None: NullCompressor,
}
diff --git a/swh/objstorage/tests/test_objstorage_cloud.py b/swh/objstorage/tests/test_objstorage_cloud.py
--- a/swh/objstorage/tests/test_objstorage_cloud.py
+++ b/swh/objstorage/tests/test_objstorage_cloud.py
@@ -118,6 +118,10 @@
compression = 'bz2'
+class TestCloudObjStorageGzip(TestCloudObjStorage):
+ compression = 'gzip'
+
+
class TestCloudObjStorageLzma(TestCloudObjStorage):
compression = 'lzma'
diff --git a/swh/objstorage/tests/test_objstorage_seaweedfs.py b/swh/objstorage/tests/test_objstorage_seaweedfs.py
--- a/swh/objstorage/tests/test_objstorage_seaweedfs.py
+++ b/swh/objstorage/tests/test_objstorage_seaweedfs.py
@@ -53,6 +53,10 @@
compression = 'bz2'
+class TestWeedObjStorageGzip(TestWeedObjStorage):
+ compression = 'gzip'
+
+
class TestWeedObjStorageLzma(TestWeedObjStorage):
compression = 'lzma'
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 12:18 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222019
Attached To
D2044: Add gzip compression support
Event Timeline
Log In to Comment