[GRASS-git] [OSGeo/grass] f01da9: grass.script: Add env, handler, stderr to handle_e...

Vaclav Petras noreply at github.com
Tue Jun 24 06:20:13 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: f01da9f00defbd5e9ad6b7c236a0d75657f97224
      https://github.com/OSGeo/grass/commit/f01da9f00defbd5e9ad6b7c236a0d75657f97224
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2025-06-24 (Tue, 24 Jun 2025)

  Changed paths:
    M python/grass/script/core.py
    A python/grass/script/tests/grass_script_core_subprocesses_test.py

  Log Message:
  -----------
  grass.script: Add env, handler, stderr to handle_errors (#5875)

This add handler, stderr, and env to grass.script.handle_errors. This allows construction of better exception message and calling g.message with grass.script.fatal when global environment is not used. Otherwise, it follows the same rules as error passed with the explicit kwargs dict parameter. Using stderr and handler to reduce confusion with errors. The term errors is name of the type of handling in grass.script.handle_errors, but also the error messages in CalledModuleError.

It also reads env from kwargs which will make grass.script.fatal with g.message work with run_command and others which call the function without knowing all the parameters passed by the caller.

---------

Co-authored-by: Edouard Choinière <27212526+echoix at users.noreply.github.com>



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