From 4933c6b58009da48970185f9abc429a1eb792ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Wed, 20 Jun 2018 23:08:22 +0200 Subject: [PATCH] Fixed error with large logs Due to change in file.seek() behavior, the log viewer errorer when faced with a very large file. --- qubesmanager/log_dialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubesmanager/log_dialog.py b/qubesmanager/log_dialog.py index f89c684..98ca5d8 100644 --- a/qubesmanager/log_dialog.py +++ b/qubesmanager/log_dialog.py @@ -58,7 +58,7 @@ class LogDialog(ui_logdlg.Ui_LogDialog, QtGui.QDialog): if log.tell() > LOG_DISPLAY_SIZE: self.displayed_text = self.tr( "(Showing only last %d bytes of file)\n") % LOG_DISPLAY_SIZE - log.seek(-LOG_DISPLAY_SIZE, os.SEEK_END) + log.seek(log.tell()-LOG_DISPLAY_SIZE, os.SEEK_SET) else: log.seek(0, os.SEEK_SET) self.displayed_text += log.read()