From 216d6687c041411c0bbeb1050ef5fe63bb5ca563 Mon Sep 17 00:00:00 2001 From: Patrik Dufresne Date: Wed, 14 Feb 2018 16:42:00 -0500 Subject: [PATCH] Fix related to missing _read_gzip_header in python 3.5. --- rdiffweb/librdiff.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rdiffweb/librdiff.py b/rdiffweb/librdiff.py index 5fc6c2c0..cb28a4b8 100755 --- a/rdiffweb/librdiff.py +++ b/rdiffweb/librdiff.py @@ -461,16 +461,15 @@ class FileStatisticsEntry(IncrementEntry): def _search(self, path): """ This function search for a file entry in the file_statistics compress - file. Since python gzip seams to be 2 time slower, we directly use - zgrep to search the file. If zgrep is not available, fallback to - python implementation. + file. Since python gzip.open() seams to be 2 time slower, we directly use + zlib library on python2. """ logger.debug("read file_statistics [%r]", self.name) path += b' ' # Open file are compress. - if self._is_compressed: + if not PY3 and self._is_compressed: line = None fullfn = os.path.join(self.repo._data_path, self.name) in_file = gzip.open(fullfn, 'r') -- GitLab