diff options
author | Helmut Grohne <helmut@subdivi.de> | 2016-05-01 14:31:56 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2016-05-01 14:31:56 +0200 |
commit | e6bc38edc9d0b9c8a34971ae8bcf0f0d53607f5e (patch) | |
tree | 9b54b6992e466792380f95122415c277f184cbc1 /dedup/compression.py | |
parent | 2aef917cabba4e660f2525a551368532dbc7c195 (diff) | |
download | debian-dedup-e6bc38edc9d0b9c8a34971ae8bcf0f0d53607f5e.tar.gz |
push more functionality into DebExtractor
The handle_ar_member and handle_ar_end methods now have a default
implementation adding further handlers handle_debversion,
handle_control_tar and handle_data_tar.
In that process two additional bugs were fixed:
* decompress_tar was wrongly passing errors="surrogateescape" for
Python 2.x even though that's only supported for Python 3.x.
* The use of decompress actually passes the extension as unicode.
Diffstat (limited to 'dedup/compression.py')
-rw-r--r-- | dedup/compression.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dedup/compression.py b/dedup/compression.py index 5df6613..7f6dc99 100644 --- a/dedup/compression.py +++ b/dedup/compression.py @@ -156,10 +156,10 @@ class DecompressedStream(object): self.closed = True decompressors = { - '.gz': GzipDecompressor, - '.bz2': bz2.BZ2Decompressor, - '.lzma': lzma.LZMADecompressor, - '.xz': lzma.LZMADecompressor, + u'.gz': GzipDecompressor, + u'.bz2': bz2.BZ2Decompressor, + u'.lzma': lzma.LZMADecompressor, + u'.xz': lzma.LZMADecompressor, } def decompress(filelike, extension): @@ -168,7 +168,7 @@ def decompress(filelike, extension): close(). @param extension: permitted values are "", ".gz", ".bz2", ".lzma", and ".xz" - @type extension: str + @type extension: unicode @returns: a read-only byte-stream with the decompressed contents of the original filelike. It supports read(size) and close(). If the original supports seek(pos) and tell(), then it also supports |