Opened 6 months ago

Closed 6 months ago

#3798 closed defect (fixed)

Python 3: gunittest multirunner.py crashes

Reported by: sbl Owned by: grass-dev@…
Priority: normal Milestone: 7.8.0
Component: Tests Version: svn-trunk
Keywords: Python3 Cc:
CPU: Unspecified Platform: Unspecified

Description

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

Attachments (1)

reporters.diff (651 bytes) - added by sbl 6 months ago.
encode opened file with latin1

Download all attachments as: .zip

Change History (3)

Changed 6 months ago by sbl

Attachment: reporters.diff added

encode opened file with latin1

comment:1 Changed 6 months ago by sbl

Component: PythonTests

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

comment:2 Changed 6 months ago by sbl

Resolution: fixed
Status: newclosed

In 74327:

fix multirunner.py with Py3; fix #3798; more Py3 fixes see #3771

Note: See TracTickets for help on using tickets.