potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
599 stars 79 forks source link

1 test fails: ValueError: invalid mode: 'rU' (with Python-3.11) #413

Closed yurivict closed 1 year ago

yurivict commented 1 year ago
[  0% 1/1] cd /usr/ports/math/clingo/work/.build && /usr/local/bin/ctest --force-new-ctest-process
Test project /usr/ports/math/clingo/work/.build
    Start 1: test_reify
1/4 Test #1: test_reify .......................   Passed    0.02 sec
    Start 2: test_gringo
2/4 Test #2: test_gringo ......................   Passed    1.30 sec
    Start 3: test_clingo
3/4 Test #3: test_clingo ......................   Passed    0.13 sec
    Start 4: test_clingo_app
4/4 Test #4: test_clingo_app ..................***Failed    0.13 sec
Traceback (most recent call last):
  File "/usr/ports/math/clingo/work/clingo-5.6.2/app/clingo/tests/run.py", line 124, in <module>
    with open(b + ".lp", 'rU') as inst_file:
         ^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU'

Test succeeds with Python-3.9

Version: 5.6.2 python-3.11 FreeBSD 13.1

rkaminsk commented 1 year ago

It looks like the universal newline mode has finally be removed in Python 3.11. I remember that I had to add this to get the tests running on some Windows configurations. Now, it has to be replaced by something else. On *nixes, you should be able to simply remove the U from the mode.

rkaminsk commented 1 year ago

I removed the 'U' from the mode. The next release will include the fix.