From 81ece6dd0d6679ce84d74892e41a4a84007c57c1 Mon Sep 17 00:00:00 2001 From: Linda Karlovska <49241681+lindakladivova@users.noreply.github.com> Date: Sat, 3 Jun 2023 13:39:24 +0200 Subject: [PATCH] wxGUI: fix exception when switching to mapset (#2994) --- gui/wxpython/core/watchdog.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gui/wxpython/core/watchdog.py b/gui/wxpython/core/watchdog.py index ad20f3169d6..06cf8f3d4a5 100644 --- a/gui/wxpython/core/watchdog.py +++ b/gui/wxpython/core/watchdog.py @@ -18,6 +18,7 @@ """ import os +import time watchdog_used = True try: @@ -63,6 +64,8 @@ def on_modified(self, event): if timestamp - self.modified_time < 0.5: return self.modified_time = timestamp + # wait to make sure file writing is done + time.sleep(0.1) with open(event.src_path, "r") as f: gisrc = {} for line in f.readlines():