[GRASS-dev] [GRASS GIS] #3692: The python gcore message() function does not work in 7.4.2

#3692: The python gcore message() function does not work in 7.4.2
-----------------------------+-------------------------
Reporter: micha | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.4.3
Component: Default | Version: 7.4.2
Keywords: message, python | CPU: Unspecified
Platform: Unspecified |
-----------------------------+-------------------------
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
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.3
Component: Default | Version: 7.4.2
Resolution: | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by NikosA):

Same here for GRASS GIS 7.4.3svn (r73647). Works for trunk, GRASS GIS
7.7.svn (r73645M).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------
Changes (by martinl):

* component: Default => Python

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by martinl):

Right, only G74 seems to be affected. Works also in G76.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by martinl):

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
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by martinl):

Right, after changing

 _capture_stderr = True

to

 _capture_stderr = False

message is printed out.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by martinl):

Seems to be introduced in r73240

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------
Changes (by martinl):

* priority: normal => critical

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by martinl):

Apparently r73269 hasn't been backported to G74 branch...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: fixed | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------
Changes (by martinl):

* status: new => closed
* resolution: => fixed

Comment:

In [changeset:"73651" 73651]:
{{{
#!CommitTicketReference repository="" revision="73651"
libpython: revert r73238, fixes #3692
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: fixed | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by neteler):

I guess this warrants a new release? :frowning:

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:10&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: fixed | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by martinl):

Right, what about releasing GRASS 7.4.3 soon (within weeks) with just one
RC?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:11&gt;
GRASS GIS <https://grass.osgeo.org>

#3692: The python gcore message() function does not work in 7.4.2
--------------------------+-----------------------------
  Reporter: micha | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 7.4.3
Component: Python | Version: 7.4.2
Resolution: fixed | Keywords: message, python
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by mmetz):

Replying to [comment:11 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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3692#comment:12&gt;
GRASS GIS <https://grass.osgeo.org>