Bug 256826 - dns/py-namebench: Fails to run: SyntaxError: invalid syntax (detecting python version)
Summary: dns/py-namebench: Fails to run: SyntaxError: invalid syntax (detecting python...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Jason Helfman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-25 12:12 UTC by tech-lists
Modified: 2021-10-10 23:21 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tech-lists 2021-06-25 12:12:09 UTC
Hi,

py38-namebench-1.3.1_1 fails to detect correct python version when it runs.

context: 
built with poudriere-devel poudriere-devel-3.3.99.20210617
portstree last updated: Fri Jun 25 08:56:31 2021 +0800 version: 549828
OS: stable/13-n245218-41d864457dd (on both arm64 and aarch64)

[...]
% namebench.py 
  File "/usr/local/bin/namebench.py", line 28
    print '* Your Python version (%s) is too old! Please upgrade to 2.6+!' % your_version
          ^
SyntaxError: invalid syntax
[...]

% pkg info -xo python
py38-dnspython-1.16.0          dns/py-dnspython                                                                     
python3-3_3                    lang/python3                                                                         
python38-3.8.10                lang/python38
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2021-06-26 01:47:18 UTC
I don't believe namebench is Python 3 compatible [1], but if the issue can be isolated and resolved (patched), please do so. Trying 2to3 or using six may help

This was broken by ports r559531

See Also:

   https://forums.gentoo.org/viewtopic-t-957080-start-0.html

[1] https://github.com/catap/namebench/blob/master/namebench.py#L29
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-10-07 21:03:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=46ce9a1b7fd9447aa59aebf1984846e8c8729192

commit 46ce9a1b7fd9447aa59aebf1984846e8c8729192
Author:     Jason Helfman <jgh@FreeBSD.org>
AuthorDate: 2021-10-07 20:59:12 +0000
Commit:     Jason Helfman <jgh@FreeBSD.org>
CommitDate: 2021-10-07 20:59:12 +0000

    dns/py-namebench: chase r559531, mark broken

    PR:     256826 (based on)
    Reported by:    tech-lists@zyxst.net

 dns/py-namebench/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 3 Jason Helfman freebsd_committer freebsd_triage 2021-10-07 21:04:19 UTC
I've marked this port broken. I can take a look at fixing this, but happy to accept any patch contributions to get this up to speed.

Thanks for the report!
-jgh
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2021-10-10 23:21:56 UTC
^Triage: Correct resolution (issue resolved by a change (commit): FIXED)

I followed up with Jason offlist that if this port doesnt support Python 3.x, its USES=python:<version-spec> should be 2.7, and should never have been switched to port 3.6+ with changeset ports aa7a6c429ea6

I suggest replacing BROKEN with the <version-spec> change (bugfix, correction), and MFH'ing