From 3e46139a45100861c08228e47b6ca25c3a9d46e7 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Fri, 27 Oct 2023 13:51:04 -0500 Subject: [PATCH] Fixed subtle shared mutability bug in tracebd.py In the hack where we wait for multiple updates to fill out a full braille/dots line we store the current pixels in a temporary array. Unfortunately, in some cases, this is the array we modify with updates... A copy fixes this. --- scripts/tracebd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tracebd.py b/scripts/tracebd.py index cff9ac31..0ce57788 100755 --- a/scripts/tracebd.py +++ b/scripts/tracebd.py @@ -534,7 +534,7 @@ class Bd: needed_height = 4 if braille else 2 self.history = getattr(self, 'history', []) - self.history.append(grid) + self.history.append(grid.copy()) if len(self.history)*self.height < needed_height: # skip for now