Bug 1791951

Summary: jpype fails to build with Python 3.9: 'array.array' object has no attribute 'fromstring'
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: jpypeAssignee: Raphael Groner <projects.rg>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, hugovk+redhatbugzilla, mhroncok, projects.rg, tir.karthi
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: jpype-0.7.4-1.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-02 12:29:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1808625, 1813550    
Bug Blocks: 1785415    

Description Miro Hrončok 2020-01-16 18:54:39 UTC
jpype fails to build with Python 3.9.0a2:

running build_thunk
Building thunks
  including thunk build/lib/org/jpype/classloader/JPypeClassLoader.class
Traceback (most recent call last):
  File "/builddir/build/BUILD/jpype-0.7.1/setup.py", line 10, in <module>
    setup(
  File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib64/python3.9/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib64/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
    _build_ext.run(self)
  File "/usr/lib64/python3.9/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/builddir/build/BUILD/jpype-0.7.1/setupext/build_ext.py", line 74, in build_extensions
    self.run_command("build_thunk")
  File "/usr/lib64/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib64/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/builddir/build/BUILD/jpype-0.7.1/setupext/build_thunk.py", line 149, in run
    createThunks(
  File "/builddir/build/BUILD/jpype-0.7.1/setupext/build_thunk.py", line 103, in createThunks
    outputClass(filename, name, fimpl)
  File "/builddir/build/BUILD/jpype-0.7.1/setupext/build_thunk.py", line 53, in outputClass
    output(fout, l)
  File "/builddir/build/BUILD/jpype-0.7.1/setupext/build_thunk.py", line 36, in output
    buffer.fromstring(l)
AttributeError: 'array.array' object has no attribute 'fromstring'


See https://docs.python.org/3.9/whatsnew/3.9.html#removed

"array.array: tostring() and fromstring() methods have been removed. They were aliases to tobytes() and frombytes(), deprecated since Python 3.2.


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01148474-jpype/

For all our attempts to build jpype with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/jpype/

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.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
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.

Comment 1 Karthikeyan Singaravelan 2020-01-22 12:13:35 UTC
Upstream report : https://github.com/jpype-project/jpype/issues/570

Comment 2 Hugo van Kemenade 2020-01-23 15:41:33 UTC
Upstream PR: https://github.com/jpype-project/jpype/pull/572

Comment 3 Raphael Groner 2020-02-10 08:57:07 UTC
py4j is fixed, so we'd do for jpype as an alternative, too.

Comment 4 Ben Cotton 2020-02-11 16:34:31 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 5 Raphael Groner 2020-02-15 09:58:21 UTC
Upstream merged proposed PR.

Comment 6 Miro Hrončok 2020-03-16 12:47:03 UTC
Raphael, could you please backport it or update if possible?

Comment 7 Raphael Groner 2020-03-16 16:59:17 UTC
Upstream uses Travis CI to build and test the new version 0.7.2 (see bug #1808625) with Java 11. We still have jdk8 as default in the repository and 0.7.2 FTBFS with jdk8. Not sure how we should proceed.

Comment 8 Raphael Groner 2020-03-16 17:02:21 UTC
See also bug #1813550 for any java issues in Fedora 32.

Comment 9 Raphael Groner 2020-03-20 05:10:46 UTC
Discussion goes on in bug #1813550 due to I need confirmation java as the base works.

Comment 10 Raphael Groner 2020-05-02 11:31:38 UTC
Release 0.7.4 looks better, working on a rebuild.

Comment 11 Raphael Groner 2020-05-02 12:30:08 UTC
Please retry with jpype-0.7.4-1.fc33 and feel free to reopen this bug if there's still an issue.