]> git.ipfire.org Git - pbs.git/commitdiff
Revert "jobs: Attempt opening logs in text mode"
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Oct 2022 14:58:21 +0000 (14:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Oct 2022 14:58:21 +0000 (14:58 +0000)
This reverts commit b10cea53c3e910adcbd02b9d71c2dfd58e193140.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/jobs.py

index be811bf7145860a895c97e9494810602bbc0363b..e081ee8aa09ffd29e36cc47d800d875192d236b5 100644 (file)
@@ -376,7 +376,7 @@ class Job(base.DataObject):
        def log_digest_blake2s(self):
                return self.data.log_digest_blake2s
 
-       async def open_log(self, mode="rb"):
+       async def open_log(self):
                """
                        Opens the log file, and returns an open file handle
                """
@@ -384,18 +384,18 @@ class Job(base.DataObject):
                if not self.has_log():
                        raise FileNotFoundError
 
-               return await asyncio.to_thread(self._open_log, mode)
+               return await asyncio.to_thread(self._open_log)
 
-       def _open_log(self, mode):
+       def _open_log(self):
                path = self.log_path
 
                # Open gzip-compressed files
                if path.endswith(".gz"):
-                       return gzip.open(path, mode)
+                       return gzip.open(path)
 
                # Open uncompressed files
                else:
-                       return open(open, mode)
+                       return open(open)
 
        async def tail_log(self, limit):
                """