Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] gunittest: r3.flow test fails with Python 3.11 #2670

Closed
nilason opened this issue Nov 29, 2022 · 0 comments · Fixed by #2673
Closed

[Bug] gunittest: r3.flow test fails with Python 3.11 #2670

nilason opened this issue Nov 29, 2022 · 0 comments · Fixed by #2673
Labels
bug Something isn't working Python Related code is in Python

Comments

@nilason
Copy link
Contributor

nilason commented Nov 29, 2022

Describe the bug
The raster3d/r3.flow/testsuite/r3flow_test.py fails running on Python 3.11 :

ERROR: test_flowlines (__main__.FlowlineTest.test_flowlines)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "raster3d/r3.flow/testsuite/r3flow_test.py", line 140, in test_flowlines
    self.assertVectorAsciiEqualsVectorAscii(
  File "etc/python/grass/gunittest/case.py", line 1243, in assertVectorAsciiEqualsVectorAscii
    fromlines = open(actual, "U").readlines()
                ^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'U'

The 'U' mode has long been deprecated, Python 3.7 docs:

There is an additional mode character permitted, 'U', which no longer has any effect, and is considered deprecated. It previously enabled universal newlines in text mode, which became the default behaviour in Python 3.0. Refer to the documentation of the newline parameter for further details.

To Reproduce
Steps to reproduce the behavior:

  1. Install Python 3.11
  2. Run python raster3d/r3.flow/testsuite/r3flow_test.py

Expected behavior
The test should not fail because of this.

Screenshots
If applicable, add screenshots to help explain your problem.

System description (please complete the following information):

  • Operating System: all
  • GRASS GIS version: all
GRASS 8.3.dev (2022)
PROJ: 9.1.0
GDAL/OGR: 3.6.0
GEOS: 3.11.1
SQLite: 3.40.0
Python: 3.11.0 | packaged by conda-forge | (main, Oct 25 2022, 06:24:51) [Clang 14.0.4 ]

Additional context
Test report is available as artifact here https://github.com/OSGeo/grass/suites/9568241766/artifacts/455907193

@nilason nilason added bug Something isn't working Python Related code is in Python labels Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Related code is in Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant