Skip to content

grass.script: Sanitize mapset region variables in runtime setup - #7577

Merged
petrasovaa merged 1 commit into
OSGeo:mainfrom
petrasovaa:init-fix-sanitize
Jun 16, 2026
Merged

petrasovaa merged 1 commit into
OSGeo:mainfrom
petrasovaa:init-fix-sanitize

Conversation

@petrasovaa

Copy link
Copy Markdown
Contributor

Remove mapset-specific variables (WIND_OVERRIDE, GRASS_REGION) when setting up the runtime environment in setup_runtime_env(), so they do not leak from the parent environment into a freshly initialized session. This reuses the existing sanitize_mapset_environment() function.
Add a parametrized pytest covering both variables through init().

@github-actions github-actions Bot added Python Related code is in Python libraries tests Related to Test Suite labels Jun 16, 2026

@wenzeslaus wenzeslaus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to handle mask as well.

@petrasovaa

Copy link
Copy Markdown
Contributor Author

I would like to get this merged and later add MASK separately, that's a bug in the sanitize function.

@wenzeslaus wenzeslaus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense.

@petrasovaa
petrasovaa merged commit 671d6f7 into OSGeo:main Jun 16, 2026
26 checks passed
@petrasovaa
petrasovaa deleted the init-fix-sanitize branch June 16, 2026 20:45
@github-actions github-actions Bot added this to the 8.6.0 milestone Jun 16, 2026
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Jul 7, 2026
…o#7577)

Remove mapset-specific variables (WIND_OVERRIDE, GRASS_REGION) when setting up the runtime environment in setup_runtime_env(), so they do not leak from the parent environment into a freshly initialized session. This reuses the existing sanitize_mapset_environment() function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants