#3692 closed defect (fixed)
The python gcore message() function does not work in 7.4.2
Reported by: | micha | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | 7.4.3 |
Component: | Python | Version: | 7.4.2 |
Keywords: | message, python | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Printing messages (warning, error, info) in a python script using GRASS 7.4.2 gives no output.
GRASS 7.4.2 (ITM):~ > ipython2 Python 2.7.12 (default, Dec 4 2017, 14:50:18) Type "copyright", "credits" or "license" for more information. IPython 5.1.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: import grass.script as gs In [2]: gs.message("Hello") In [3]: gs.warning("Hello") In [4]: print("Hello") Hello
Change History (12)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Component: | Default → Python |
---|
comment:4 by , 6 years ago
Comparing G74 and G76, this could play a role since messages are printed to stderr.
-_capture_stderr = True # capture stderr of subprocesses if possible +_capture_stderr = False # capture stderr of subprocesses if possible
comment:5 by , 6 years ago
Right, after changing
_capture_stderr = True
to
_capture_stderr = False
message is printed out.
comment:7 by , 6 years ago
Priority: | normal → critical |
---|
follow-up: 12 comment:11 by , 6 years ago
Right, what about releasing GRASS 7.4.3 soon (within weeks) with just one RC?
comment:12 by , 6 years ago
Replying to martinl:
Right, what about releasing GRASS 7.4.3 soon (within weeks) with just one RC?
That was partially my fault, even though r73240 was authored by neteler, sorry for the trouble! It was an attempt to capture standard error from python multiprocessing, but we found another solution.
+1 for releasing GRASS 7.4.3 soon, also because of an important bug fix in r.external.
Same here for GRASS GIS 7.4.3svn (r73647). Works for trunk, GRASS GIS 7.7.svn (r73645M).