Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug] Unhandled ValueError terminates watchdog thread when GISRC value contains multiple colons

Open Beginner friendly
#8,096 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend, desktop

Research direction

Start with gui/wxpython/core/watchdog.py, where the reported traceback points to CurrentMapsetWatch.on_modified() parsing the GISRC file. Inspect the line.split(":") handling and check nearby tests or watcher behavior for GISRC values containing multiple colons. Done when the watcher handles such a value without raising ValueError; the issue does not name a specific test.

Written by the indexing model from the issue text.

Description

bug

Describe the bug

The following message in the console shows up when running GRASS. It might affect display of new layers in the data panel (I often have to use the refresh button to show them).

grass gis Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python3.14/threading.py", line 1082, in _bootstrap_inner self._context.run(self.run) ~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/usr/lib/python3/dist- packages/watchdog/observers/api.py", line 213, in run self.dispatch_events(self.event_queue) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist- packages/watchdog/observers/api.py", line 391, in dispatch_events handler.dispatch(event) ~~~~~~~~~~~~~~~~^^^^^^^ File "/usr/lib/python3/dist-packages/watchdog/events.py", line 217, in dispatch getattr(self, f"on_{event.event_type}")(event) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^ File "/usr/local/grassmaster/grass86/gui/wxpython/core/wat chdog.py", line 73, in on_modified key, val = line.split(":") ^^^^^^^^ ValueError: too many values to unpack (expected 2, got 3)

To reproduce

Nothing particularly, just run GRASS

Expected behavior

The exception message should not appear, and if related, layers should automatically show in the Data panel when created.

Screenshots

System description

Ubuntu 26.04
version=8.6.0dev
date=2026
revision=01eff84f83
build_date=2026-10-19
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8
libgis_revision=01eff84f83
libgis_date=2026-10-19T17:03:23+00:00
proj=9.7.1
gdal=3.12.2
geos=3.14.1
sqlite=3.46.1

Additional context

According to ChatGTP, this is a bug in the GRASS GIS wxGUI file watcher (gui/wxpython/core/watchdog.py). The CurrentMapsetWatch.on_modified() method monitors the GRASS session configuration file (GISRC) to detect changes in the active mapset. It reads that file using key, val = line.split(":"). This assumes that each line contains exactly one colon, separating a configuration key from its value. The exception terminates the affected watchdog observer thread. As a consequence, automatic detection of mapset changes may stop working, particularly changes initiated outside the GUI. Replacing key, val = line.split(":") with key, val = line.split(":", 1) should fix it.

For me, it does indeed fix it. I am not confident enough this is the right fix, so I am not creating a PR but putting it here as lead.

Dominant language
C
Stars
1.2k
Forks
447
Avg merge
2d 10h
Merged PRs (30d)
107

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OSGeo/grass

All issues in OSGeo/grass

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.