Bug 239106

Summary: textproc/unoconv: SyntaxError: Missing parentheses in call to 'print' with Python 3.x
Product: Ports & Packages Reporter: Gerasimos Melissaratos <gmelis>
Component: Individual Port(s)Assignee: Alexey Dokuchaev <danfe>
Status: Closed FIXED    
Severity: Affects Some People CC: danfe, koalative, ndowens04
Priority: --- Keywords: needs-patch, needs-qa
Version: LatestFlags: koobs: maintainer-feedback? (koalative)
koobs: merge-quarterly?
Hardware: Any   
OS: Any   
See Also: https://github.com/unoconv/unoconv/pull/111
Attachments:
Description Flags
patch to make unoconv 0.6_1 run successfully with python3
none
patch to make unoconv 0.6_1 run successfully with python3
none
Makefile for unoconv 0.7
none
distinfo for unoconv 0.7
none
patch for Makefile for unoconv 0.7
none
patch for distinfo for unoconv 0.7 none

Description Gerasimos Melissaratos 2019-07-10 09:25:32 UTC
Created attachment 205651 [details]
patch to make unoconv 0.6_1 run successfully with python3

When starting `/usr/local/bin/unoconv --listener` it crashes with error message:
-----
  File "/usr/local/share/unoconv/unoconv", line 241
    print 'PATH=%s' % os.environ['PATH']
                  ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('PATH=%s' % os.environ['PATH'])?
-----
From what I saw it calls python3, but its code still uses python2 functions. The attached patch modifies the code from python2 to use python3 and starts unoconv successfully.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-07-10 09:29:55 UTC
@Gerasimos Thank you for the report and patch. Could you update it to be in unified diff format please
Comment 2 Gerasimos Melissaratos 2019-07-10 09:34:55 UTC
Created attachment 205652 [details]
patch to make unoconv 0.6_1 run successfully with python3

modified to use unified diff format
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2019-07-10 09:39:28 UTC
Looks like upstream fixed this a while ago in:

https://github.com/unoconv/unoconv/pull/111

Upstream (github) is now at 0.8.2

0.7.0 is the latest mentioned on http://dag.wiee.rs/home-made/unoconv/ (homepage)

This port has incorrectly not restricted USES=python to only 2.7 (0.6 does not appear to support Python 3)
Comment 4 Gerasimos Melissaratos 2019-07-10 10:13:03 UTC
In that case the new version needs to become available in the pkg colection, because it still downloads version 0.6_1.
Comment 5 Gerasimos Melissaratos 2019-07-10 14:54:45 UTC
Created attachment 205660 [details]
Makefile for unoconv 0.7
Comment 6 Gerasimos Melissaratos 2019-07-10 14:55:12 UTC
Created attachment 205661 [details]
distinfo for unoconv 0.7
Comment 7 Gerasimos Melissaratos 2019-07-10 14:58:29 UTC
Uploaded Makefile and distfile for version 0.7 of unoconv.
Comment 8 Gerasimos Melissaratos 2019-07-10 15:30:18 UTC
Created attachment 205662 [details]
patch for Makefile for unoconv 0.7

diff of Makefile
Comment 9 Gerasimos Melissaratos 2019-07-10 15:30:59 UTC
Created attachment 205663 [details]
patch for distinfo for unoconv 0.7

patch for distinfo
Comment 10 Nathan 2019-10-22 20:59:37 UTC
Seems https://github.com/unoconv/unoconv/commit/2f1c63b2df03376b1ac9d3ed9eb4adec621d6b6e should fix this bug, also I am updating this port's version with a CVE patch; Will link to this bug
Comment 11 commit-hook freebsd_committer freebsd_triage 2020-07-06 14:35:48 UTC
A commit references this bug:

Author: danfe
Date: Mon Jul  6 14:35:35 UTC 2020
New revision: 541346
URL: https://svnweb.freebsd.org/changeset/ports/541346

Log:
  - Update to version 0.7 (fixes issue with Python 3.x)
  - Simplify installation of the documentation files

  PR:		239106
  Submitted by:	Gerasimos Melissaratos

Changes:
  head/textproc/unoconv/Makefile
  head/textproc/unoconv/distinfo
Comment 12 Alexey Dokuchaev freebsd_committer freebsd_triage 2020-07-06 14:37:56 UTC
Port was updated with ports r541346, thank you.