[GRASS-git] [OSGeo/grass] 41d63e: temporal: add test for tgis.init() across a sessio...
Anna Petrasova
noreply at github.com
Wed Jun 3 06:52:35 PDT 2026
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: 41d63e587c650875207227f8b71811db34aff84a
https://github.com/OSGeo/grass/commit/41d63e587c650875207227f8b71811db34aff84a
Author: Anna Petrasova <kratochanna at gmail.com>
Date: 2026-06-03 (Wed, 03 Jun 2026)
Changed paths:
M pyproject.toml
M python/grass/temporal/core.py
A python/grass/temporal/tests/grass_temporal_core_init_session_change_test.py
Log Message:
-----------
temporal: add test for tgis.init() across a session change (#7445)
tgis.init() spawns message and C-library subprocesses that capture GISRC at spawn time. When a process
switches to a different project and calls tgis.init() again, those subprocesses stayed bound to the previous
session's GISRC (which may have been deleted), causing failures like No active GRASS session.
tgis.init() now detects a mapset/location/gisdbase change and stops the stale message and C-library
interfaces so they are respawned in the current environment.
The test exercises the multiprocessing subprocesses, which use spawn on macOS/Windows. Under pytest's default prepend import mode, the GRASS source python/ dir lands at sys.path[0], ahead of the installed tree. A
spawned child then re-imports grass from source, where grass.lib (compiled ctypes bindings) doesn't exist →
ModuleNotFoundError: No module named 'grass.lib', killing the RPC server. Setting --import-mode=importlib
(which doesn't mutate sys.path) resolves this. Verified with no regressions across the python/grass suite
(501 tests identical in both modes).
To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications
More information about the grass-commit
mailing list