From 77b3a163f0f3a979bd085b40731341897ddf3e41 Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Sat, 4 May 2024 14:52:08 -0400 Subject: [PATCH] grass.script: Always use full env in create_project (#3685) For reporting errors the g.message tool is called, so the environment setup is always needed (except when doing XY without errors). --- python/grass/script/core.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/grass/script/core.py b/python/grass/script/core.py index b1c70973cb2..afac1b15ac1 100644 --- a/python/grass/script/core.py +++ b/python/grass/script/core.py @@ -1760,11 +1760,11 @@ def create_project( env = os.environ.copy() setup_runtime_env(env=env) - if epsg or proj4 or filename or wkt: - # The names don't really matter here. - tmp_gisrc, env = create_environment( - mapset_path.directory, mapset_path.location, mapset_path.mapset, env=env - ) + # Even g.proj and g.message need GISRC to be present. + # The names don't really matter here. + tmp_gisrc, env = create_environment( + mapset_path.directory, mapset_path.location, mapset_path.mapset, env=env + ) # check if location already exists if Path(mapset_path.directory, mapset_path.location).exists():