Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI: exception in thread when switching to mapset #2994

Conversation

lindakarlovska
Copy link
Contributor

When switching to mapset, we can can encounter this error:

Exception in thread
Thread-4
:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in
_bootstrap_inner

self.run()
File "/home/linduska/.local/lib/python3.10/site-
packages/watchdog/observers/api.py", line 205, in run

self.dispatch_events(self.event_queue)
File "/home/linduska/.local/lib/python3.10/site-
packages/watchdog/observers/api.py", line 381, in
dispatch_events

handler.dispatch(event)
File "/home/linduska/.local/lib/python3.10/site-
packages/watchdog/events.py", line 272, in dispatch

{
File "/home/linduska/grass/dist.x86_64-pc-linux-
gnu/gui/wxpython/datacatalog/tree.py", line 179, in
on_modified

gisrc["GISDBASE"], gisrc["LOCATION_NAME"], gisrc["MAPSET"]
KeyError
:
'GISDBASE'

It is related to the fact that when accessing the GISRC file with Database/location/mapset info, at the same time the GISRC file could be accessed by another process.

Fixed by waiting 0.1 sec before reading GISRC.

@lindakarlovska lindakarlovska marked this pull request as ready for review June 2, 2023 14:05
@lindakarlovska lindakarlovska added bug Something isn't working GUI wxGUI related labels Jun 2, 2023
@lindakarlovska lindakarlovska added this to the 8.3.1 milestone Jun 2, 2023
@petrasovaa petrasovaa force-pushed the wxGUI-thread-exception-when-switching-mapset branch from 77efef9 to 20b2923 Compare June 3, 2023 08:19
@petrasovaa petrasovaa merged commit 549dee5 into OSGeo:main Jun 3, 2023
petrasovaa added a commit to petrasovaa/grass that referenced this pull request Jun 3, 2023
@petrasovaa
Copy link
Contributor

Backported to 8.3 and 8.2

@lindakarlovska lindakarlovska self-assigned this Jun 5, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GUI wxGUI related
Development

Successfully merging this pull request may close these issues.

2 participants