Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 667590 - dev-java/javatoolkit-0.6.0 fails with Python3.7
Summary: dev-java/javatoolkit-0.6.0 fails with Python3.7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Java team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-10-02 16:52 UTC by Helmut Jarausch
Modified: 2019-10-29 21:51 UTC (History)
3 users (show)

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


Attachments
check if the xml file is empty (javatoolkit.patch,555 bytes, patch)
2018-10-07 09:18 UTC, Helmut Jarausch
Details | Diff
patch for xml file open in correct mode for py3 (javatoolkit-0.6.0-elementtree.patch,354 bytes, patch)
2018-11-20 18:29 UTC, Joel Berendzen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2018-10-02 16:52:03 UTC
I have installed dev-java/javatoolkit-0.6.0 on my Python3.7 system (from my local overlay)

While installing sci-geosciences/josm-10966 I get

>>> Configuring source in /var/tmp/portage/sci-geosciences/josm-10966/work/josm-10966 ...
cElementTree rewriter
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.7/build-xml-rewrite", line 62, in <module>
    main()
  File "/usr/lib/python-exec/python3.7/build-xml-rewrite", line 58, in main
    tree.write(f)
  File "/usr/lib/python3.7/xml/etree/ElementTree.py", line 777, in write
    short_empty_elements=short_empty_elements)
  File "/usr/lib/python3.7/contextlib.py", line 119, in __exit__
    next(self.gen)
  File "/usr/lib/python3.7/xml/etree/ElementTree.py", line 836, in _get_writer
    yield file.write
  File "/usr/lib/python3.7/contextlib.py", line 511, in __exit__
    raise exc_details[1]
  File "/usr/lib/python3.7/contextlib.py", line 496, in __exit__
    if cb(*exc_details):
  File "/usr/lib/python3.7/contextlib.py", line 383, in _exit_wrapper
    callback(*args, **kwds)
TypeError: write() argument must be str, not bytes
 * ERROR: sci-geosciences/josm-10966::gentoo failed (configure phase):
 *   build-xml-rewrite failed

Many thanks for a hint.
By the way, josm-9999 is broken since
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/javatoolkit.git"
isn't valid any more.
Comment 1 Helmut Jarausch 2018-10-07 09:18:07 UTC
Created attachment 549580 [details, diff]
check if the xml file is empty

It turned out that a build.xml file was empty.
The attached patches just skips empty xml-files.
Comment 2 Joel Berendzen 2018-11-20 17:54:58 UTC
I'm having the same problem, but it isn't because of empty files as addressed by the patch.

The issue is that the file should be opened with mode 'wb'.
Comment 3 Joel Berendzen 2018-11-20 18:29:25 UTC
Created attachment 555818 [details, diff]
patch for xml file open in correct mode for py3
Comment 4 José de Paula Rodrigues 2019-10-02 04:02:15 UTC
Berendzen's patch is sufficient for me. I can confirm it works.
Comment 5 Larry the Git Cow gentoo-dev 2019-10-29 21:21:30 UTC
The bug has been referenced in the following commit(s):

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

commit adf9ed1917ab33ff0db1b9646a7e174c8e3e9184
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2019-10-29 21:20:03 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2019-10-29 21:20:53 +0000

    fix - check if xml file is empty
    
    Bug: https://bugs.gentoo.org/667590
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 src/py/build-xml-rewrite | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 6 Larry the Git Cow gentoo-dev 2019-10-29 21:51:27 UTC
The bug has been closed via the following commit(s):

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

commit ee82c0047a4661cf61246a6263290de6e8583715
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2019-10-29 21:47:17 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2019-10-29 21:51:18 +0000

    dev-java/javatoolkit-0.6.2: bump
    
    Closes: https://bugs.gentoo.org/667590
    Package-Manager: Portage-2.3.78, Repoman-2.3.17
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 dev-java/javatoolkit/Manifest                 |  1 +
 dev-java/javatoolkit/javatoolkit-0.6.2.ebuild | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)