Bug 239106 - textproc/unoconv: SyntaxError: Missing parentheses in call to 'print' with Python 3.x
Summary: textproc/unoconv: SyntaxError: Missing parentheses in call to 'print' with Py...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Alexey Dokuchaev
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2019-07-10 09:25 UTC by Gerasimos Melissaratos
Modified: 2020-07-06 14:37 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback? (koalative)
koobs: merge-quarterly?


Attachments
patch to make unoconv 0.6_1 run successfully with python3 (8.08 KB, patch)
2019-07-10 09:25 UTC, Gerasimos Melissaratos
no flags Details | Diff
patch to make unoconv 0.6_1 run successfully with python3 (15.57 KB, patch)
2019-07-10 09:34 UTC, Gerasimos Melissaratos
no flags Details | Diff
Makefile for unoconv 0.7 (1.71 KB, text/plain)
2019-07-10 14:54 UTC, Gerasimos Melissaratos
no flags Details
distinfo for unoconv 0.7 (270 bytes, text/plain)
2019-07-10 14:55 UTC, Gerasimos Melissaratos
no flags Details
patch for Makefile for unoconv 0.7 (818 bytes, patch)
2019-07-10 15:30 UTC, Gerasimos Melissaratos
no flags Details | Diff
patch for distinfo for unoconv 0.7 (538 bytes, patch)
2019-07-10 15:30 UTC, Gerasimos Melissaratos
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.