[GRASS-dev] [GRASS GIS] #3798: Python 3: gunittest multirunner.py crashes

#3798: Python 3: gunittest multirunner.py crashes
-------------------------+-------------------------
Reporter: sbl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.8.0
Component: Python | Version: svn-trunk
Keywords: Python3 | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
Besides several failing tests, with Python 3, also the multirunner.py in
the testsuit crashes: e.g with test_topology_vgeneralize from ./lib/vector
failed:

{{{
test_topology_vgeneralize from ./lib/vector failed
Traceback (most recent call last):
   File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
     "__main__", mod_spec)
   File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
     exec(code, run_globals)
   File "/opt/src/grass7_trunk4/dist.x86_64-pc-linux-
gnu/etc/python/grass/gunittest/main.py", line 178, in <module>
     sys.exit(main())
   File "/opt/src/grass7_trunk4/dist.x86_64-pc-linux-
gnu/etc/python/grass/gunittest/main.py", line 174, in main
     results_dir=results_dir)
   File "/opt/src/grass7_trunk4/dist.x86_64-pc-linux-
gnu/etc/python/grass/gunittest/invoker.py", line 237, in run_in_location
     gisdbase=gisdbase, location=location)
   File "/opt/src/grass7_trunk4/dist.x86_64-pc-linux-
gnu/etc/python/grass/gunittest/invoker.py", line 193, in _run_test_module
     self._file_anonymizer.anonymize([stdout_path, stderr_path])
   File "/opt/src/grass7_trunk4/dist.x86_64-pc-linux-
gnu/etc/python/grass/gunittest/reporters.py", line 103, in anonymize
     replace_in_file(filename, path + path_end, '')
   File "/opt/src/grass7_trunk4/dist.x86_64-pc-linux-
gnu/etc/python/grass/gunittest/reporters.py", line 61, in replace_in_file
     for line in old_file:
   File "/opt/src/grass7_trunk4/grasspy3/lib64/python3.7/codecs.py", line
322, in decode
     (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 438:
invalid continuation byte
}}}

For systematic testing of Python 3 it would be useful to be able to run
all tests with the multirunner script...

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

#3798: Python 3: gunittest multirunner.py crashes
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: Python | Version: svn-trunk
Resolution: | Keywords: Python3
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by sbl):

* Attachment "reporters.diff" added.

encode opened file with latin1

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

#3798: Python 3: gunittest multirunner.py crashes
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: Tests | Version: svn-trunk
Resolution: | Keywords: Python3
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by sbl):

* component: Python => Tests

Comment:

The attached diff should fix the issue, but I am not sure if it is the
proper way to do it...

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

#3798: Python 3: gunittest multirunner.py crashes
--------------------------+-------------------------
  Reporter: sbl | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.8.0
Component: Tests | Version: svn-trunk
Resolution: fixed | Keywords: Python3
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by sbl):

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

Comment:

In [changeset:"74327" 74327]:
{{{
#!CommitTicketReference repository="" revision="74327"
fix multirunner.py with Py3; fix #3798; more Py3 fixes see #3771
}}}

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