-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
cantera fails to build with Python 3.11: ValueError: invalid mode: 'rU' #1325
Comments
I fixed the above error in (draft) PR #1326, but then we get another error:
|
For a recent discussion on Python 3.11, see #1287 ... I recall that there were some issues, and things were tabled. If you fix this, 3.11 should likely be added to CI (as long as the GH version is sufficiently recent). Tagging @bryanwweber on this ... Here are some build logs with failures ... as things ran farther on Ubuntu/macOS/Windows, I am wondering whether there are any additional fedora-specific issues at play. |
The error in this message appears to be to do with Cython, which will have to be updated for Python 3.11. They may or may not have backported any required fixes to a |
@ischoegl thanks - I wasn't aware of the previous discussion, but I feel pretty well caught up now. I'm building with the 2.6.0 release source code with only the modification in #1326 applied We're anticipating running with 3.11 on Fedora 37, to be released in <=6 months, so my personal hope is to be able to build cantera 2.6 with python 3.11 by about 4 months from now. |
It's not just that Cython needs to be rebuilt, it sometimes needs to be updated in terms of the C++ code it generates to match changes in the Python C-API. If that hasn't been done yet, there's nothing we can do until they do. I'm not sure that's the problem, but since the error is due to an include file from Python itself, that's my interpretation of the error. |
Cython was updated for Python 3.11 on the |
Possibly this is python/cpython#93442 |
It is exactly that. @bryanwweber @ischoegl The original issue regarding deprecated 'rU' is the only issue in the Cantera source code currently preventing builds under Python 3.11 |
Reported in full at https://bugzilla.redhat.com/show_bug.cgi?id=2094258
Problem description
cantera fails to build with Python 3.11.0b3.
Steps to reproduce
ValueError: invalid mode: 'rU':
File "/builddir/build/BUILD/cantera-2.6.0/SConstruct", line 2020:
SConscript("build/python/SConscript")
File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 660:
return method(*args, **kw)
File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/lib/python3.11/site-packages/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/builddir/build/BUILD/cantera-2.6.0/build/python/SConscript", line 98:
setup_cfg = localenv.SubstFile("setup.cfg", "setup.cfg.in")
File "/usr/lib/python3.11/site-packages/SCons/Util.py", line 742:
return self.method(*nargs, **kwargs)
File "/builddir/build/BUILD/cantera-2.6.0/site_scons/site_tools/subst.py", line 154:
return env.SubstGeneric(target,
File "/usr/lib/python3.11/site-packages/SCons/Environment.py", line 238:
return super().call(target, source, *args, **kw)
File "/usr/lib/python3.11/site-packages/SCons/Util.py", line 742:
return self.method(*nargs, **kwargs)
File "/usr/lib/python3.11/site-packages/SCons/Builder.py", line 662:
return self._execute(env, target, source, OverrideWarner(kw), ekw)
File "/usr/lib/python3.11/site-packages/SCons/Builder.py", line 568:
tlist, slist = self._create_nodes(env, target, source)
File "/usr/lib/python3.11/site-packages/SCons/Builder.py", line 530:
target, source = self.emitter(target=tlist, source=slist, env=env)
File "/builddir/build/BUILD/cantera-2.6.0/site_scons/site_tools/subst.py", line 124:
keys = _subst_keys(path, pattern)
File "/builddir/build/BUILD/cantera-2.6.0/site_scons/site_tools/subst.py", line 49:
f = open(source, "rU")
error: Bad exit status from /var/tmp/rpm-tmp.S5BgPF (%build)
open(), io.open(), codecs.open() and fileinput.FileInput no longer accept 'U' (“universal newline”) in the file mode. This flag was deprecated since Python 3.3. In Python 3, the “universal newline” is used by default when a file is open in text mode. The newline parameter of open() controls how universal newlines works. (Contributed by Victor Stinner in bpo-37330.)
https://bugs.python.org/issue?@action=redirect&bpo=37330
https://docs.python.org/3.11/whatsnew/3.11.html
For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/04495077-cantera/
For all our attempts to build cantera with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/cantera/
Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/
Let us know here if you have any questions.
Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
System information
The text was updated successfully, but these errors were encountered: