Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 758716 - =dev-java/javatoolkit-0.6.4 incompatibility with python 3.9: build-xml-rewrite causes emerge =dev-java/commons-codec-1.7 (and 1.11) to fail to build with system python 3.9: AttributeError: 'ElementTree' object has no attribute 'getiterator'
Summary: =dev-java/javatoolkit-0.6.4 incompatibility with python 3.9: build-xml-rewrit...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL: https://bugs.python.org/issue36543
Whiteboard:
Keywords:
Depends on:
Blocks: 747055 758371
  Show dependency tree
 
Reported: 2020-12-06 04:43 UTC by Nick
Modified: 2020-12-15 10:28 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
commons-codec-1.7-python-3.9.log (commons-codec-1.7-python-3.9.log,2.73 KB, text/x-log)
2020-12-06 04:45 UTC, Nick
Details
commons-codec-1.11-python-3.9.log (commons-codec-1.11-python-3.9.log,2.74 KB, text/x-log)
2020-12-06 04:45 UTC, Nick
Details
/etc/portage/patches/dev-java/javatoolkit/python3_9.patch (python3_9.patch,1.29 KB, patch)
2020-12-10 08:03 UTC, Volkmar W. Pogatzki
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick 2020-12-06 04:43:28 UTC
When system python is 3.9 (through eselect), =dev-java/commons-codec-1.7 and =dev-java/commons-codec-1.11 fail to build because getiterator() method has been removed from ElementTree (https://bugs.python.org/issue36543), but the method is used in build-xml-rewrite. It builds successfully on python 3.8.

I believe dev-java/javatoolkit is the actual package responsible for this error:

equery belongs /usr/lib/python-exec/python3.9/build-xml-rewrite
 * Searching for /usr/lib/python-exec/python3.9/build-xml-rewrite ... 
dev-java/javatoolkit-0.6.4 (/usr/lib/python-exec/python3.9/build-xml-rewrite)


Note that on python 3.8, the following deprecation warnings are given at the build-xml-rewrite step:

>>> Configuring source in /var/tmp/portage/dev-java/commons-codec-1.7/work/commons-codec-1.7-src ...
cElementTree rewriter
/usr/lib/python-exec/python3.8/build-xml-rewrite:38: DeprecationWarning: This method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.
  for javac in tree.getiterator('javac'):
/usr/lib/python-exec/python3.8/build-xml-rewrite:43: DeprecationWarning: This method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.
  for javadoc in tree.getiterator('javadoc'):
/usr/lib/python-exec/python3.8/build-xml-rewrite:51: DeprecationWarning: This method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.
  for e in tree.getiterator(elem):
/usr/lib/python-exec/python3.8/build-xml-rewrite:53: DeprecationWarning: This method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.
  for junit in tree.getiterator('junit'):
>>> Source configured.

Reproducible: Always

Steps to Reproduce:
1. Ensure python version is set to 3.9 (eselect, python --version), and that dev-java/javatoolkit is installed with python_targets_python3_9
2. sudo emerge -a1 =dev-java/commons-codec-1.7 or =dev-java/commons-codec-1.11
3. Observe build failure with message "AttributeError: 'ElementTree' object has no attribute 'getiterator'"
Actual Results:  
Build fails on packages that use build-xml-rewrite.

Expected Results:  
Packages using build-xml-rewrite should install without error on system python 3.9.
Comment 1 Nick 2020-12-06 04:45:15 UTC
Created attachment 676930 [details]
commons-codec-1.7-python-3.9.log
Comment 2 Nick 2020-12-06 04:45:45 UTC
Created attachment 676933 [details]
commons-codec-1.11-python-3.9.log
Comment 3 Nick 2020-12-06 04:48:58 UTC
I also experienced a similar failure with dev-java/commons-httpclient (which gets pulled in by =games-strategy/triplea-1.8.0.9-r1)
Comment 4 Volkmar W. Pogatzki 2020-12-06 11:02:47 UTC
https://github.com/gentoo/javatoolkit/pull/2
Comment 5 Volkmar W. Pogatzki 2020-12-10 08:03:20 UTC
Created attachment 677545 [details, diff]
/etc/portage/patches/dev-java/javatoolkit/python3_9.patch
Comment 6 Larry the Git Cow gentoo-dev 2020-12-15 10:21:07 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=608db5f55c913e6ad0974ead162b7521e865031e

commit 608db5f55c913e6ad0974ead162b7521e865031e
Author:     Volkmar W. Pogatzki <gentoo@pogatzki.net>
AuthorDate: 2020-12-06 10:47:52 +0000
Commit:     Miroslav Šulc <fordfrog@fordfrog.com>
CommitDate: 2020-12-15 10:20:59 +0000

    https://bugs.gentoo.org/758716
    
    Bug: https://bugs.gentoo.org/758716
    
    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    Closes: https://github.com/gentoo/javatoolkit/pull/2
    Signed-off-by: Miroslav Šulc <fordfrog@fordfrog.com>

 src/py/build-xml-rewrite | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2020-12-15 10:28:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fd4eb8befc1bf69ea1d495058c3ba3df7198f61

commit 0fd4eb8befc1bf69ea1d495058c3ba3df7198f61
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2020-12-15 10:28:02 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2020-12-15 10:28:02 +0000

    dev-java/javatoolkit: fixed py3_9 compatibility
    
    Closes: https://bugs.gentoo.org/758716
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 dev-java/javatoolkit/Manifest                                           | 2 +-
 .../javatoolkit/{javatoolkit-0.6.4.ebuild => javatoolkit-0.6.5.ebuild}  | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
Comment 8 Miroslav Šulc gentoo-dev 2020-12-15 10:28:52 UTC
Volkmar, thank you for the fix!