From 2b0f65a9ee9b74002c8dea5a9f0e10b40f0516de Mon Sep 17 00:00:00 2001 From: Manish Date: Mon, 25 May 2020 23:05:15 +1000 Subject: [PATCH] Fixes "Logs are not line buffered" #868 issue in sugar repo Reason why it was working in python 2 is because this file is added only when switched to python 3. Compare [logger.py](https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/v0.95.2/src/sugar3/logger.py) file in sugar3 directory of v0.95.2 with [sugar directory](https://github.com/sugarlabs/sugar-toolkit-gtk3/tree/v0.95.1/src/sugar) of v0.95.1 --- src/sugar3/logger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sugar3/logger.py b/src/sugar3/logger.py index 43ef5b56..d63e76de 100644 --- a/src/sugar3/logger.py +++ b/src/sugar3/logger.py @@ -171,7 +171,7 @@ def start(log_filename=None): try: log_path = os.path.join(logs_path, log_filename + '.log') - log_fd = os.open(log_path, os.O_WRONLY | os.O_CREAT) + log_fd = os.open(log_path, os.O_WRONLY | os.O_CREAT, buffer=1) os.dup2(log_fd, sys.stdout.fileno()) os.dup2(log_fd, sys.stderr.fileno()) os.close(log_fd)