Bug 265237 - mail/pyzor: Crash on iteritems() on Python 3.9
Summary: mail/pyzor: Crash on iteritems() on Python 3.9
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: Danilo G. Baio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-15 15:37 UTC by Jakob Stoklund Olesen
Modified: 2022-08-04 22:44 UTC (History)
0 users

See Also:
dbaio: maintainer-feedback+
dbaio: merge-quarterly+


Attachments
pyzor-py39.patch (8.18 KB, patch)
2022-07-15 22:10 UTC, Danilo G. Baio
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakob Stoklund Olesen 2022-07-15 15:37:52 UTC
The pyzor command in the py39-pyzor-1.0.0_1 package crashes because dicts no longer have an iteritems() method:

% pyzor ping
Traceback (most recent call last):
  File "/usr/local/bin/pyzor", line 432, in <module>
    main()
  File "/usr/local/bin/pyzor", line 131, in main
    config, options, args = load_configuration()
  File "/usr/local/bin/pyzor", line 113, in load_configuration
    for key, value in defaults.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

I can see they fixed this Python 2/3 problem in 2016 upstream:

    https://github.com/SpamExperts/pyzor/commit/7afe0aedc320dd2689bfbf45e97fdb09adb89686

I understand that upstream hasn't released anything since 2014, and there's not much you can do about that. I just wanted to let you know that the port is broken as is.


I'm testing this in a jail on TrueNAS, but I don't believe that is related.

% uname -a
FreeBSD mail.home.2pi.dk 13.1-RELEASE FreeBSD 13.1-RELEASE n245376-eba770b30ff TRUENAS amd64
% python3.9 -V
Python 3.9.13
Comment 1 Danilo G. Baio freebsd_committer freebsd_triage 2022-07-15 22:10:36 UTC
Created attachment 235282 [details]
pyzor-py39.patch
Comment 2 Danilo G. Baio freebsd_committer freebsd_triage 2022-07-15 22:11:18 UTC
Hi.

Could you help test?

I couldn't apply the patch cleanly, so I partially added it.
Comment 3 Jakob Stoklund Olesen 2022-07-15 23:06:59 UTC
Thanks, I'll give it a try. Please not that I'm all pkg-based, and I haven't used /usr/ports before, so it may take me a while to figure out.
Comment 4 Jakob Stoklund Olesen 2022-07-16 04:16:10 UTC
With the patch, it looks like things are working now. I can run "pyzor ping" and pyzor check" and get meaningful replies.

I didn't get any responses other than. "0 0" from public.pyzor.org:24441, but that can be an issue with the public DB. I don't know how many users there are, or what to expect from it.
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-07-16 18:19:51 UTC
A commit in branch main references this bug:

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

commit c0927c63a74f462bcbaa415ea6b906c66d691188
Author:     Danilo G. Baio <dbaio@FreeBSD.org>
AuthorDate: 2022-07-15 22:05:37 +0000
Commit:     Danilo G. Baio <dbaio@FreeBSD.org>
CommitDate: 2022-07-16 18:18:54 +0000

    mail/pyzor: Fix runtime with Python 3.9

    Partial patch of
    https://github.com/SpamExperts/pyzor/commit/7afe0aedc320dd2689bfbf45e97fdb09adb89686

    PR:             265237 [1]
    Reported by:    Jakob Stoklund Olesen <swig.morning0d@icloud.com> [1]
    Reported by:    Andrew <andrew@tekrealm.net>

 mail/pyzor/Makefile                        |   2 +-
 mail/pyzor/files/patch-7afe0ae.patch (new) | 182 +++++++++++++++++++++++++++++
 2 files changed, 183 insertions(+), 1 deletion(-)
Comment 6 Danilo G. Baio freebsd_committer freebsd_triage 2022-07-16 18:23:44 UTC
(In reply to Jakob Stoklund Olesen from comment #4)

Thanks, I'll wait for a few more tests before merging it into quarterly.

Regards.
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-08-04 22:44:20 UTC
A commit in branch 2022Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7839223a2353e58f18b5733abc69967f7354a30e

commit 7839223a2353e58f18b5733abc69967f7354a30e
Author:     Danilo G. Baio <dbaio@FreeBSD.org>
AuthorDate: 2022-07-15 22:05:37 +0000
Commit:     Danilo G. Baio <dbaio@FreeBSD.org>
CommitDate: 2022-08-04 22:42:04 +0000

    mail/pyzor: Fix runtime with Python 3.9

    Partial patch of
    https://github.com/SpamExperts/pyzor/commit/7afe0aedc320dd2689bfbf45e97fdb09adb89686

    PR:             265237 [1]
    Reported by:    Jakob Stoklund Olesen <swig.morning0d@icloud.com> [1]
    Reported by:    Andrew <andrew@tekrealm.net>

    (cherry picked from commit c0927c63a74f462bcbaa415ea6b906c66d691188)

 mail/pyzor/Makefile                        |   2 +-
 mail/pyzor/files/patch-7afe0ae.patch (new) | 182 +++++++++++++++++++++++++++++
 2 files changed, 183 insertions(+), 1 deletion(-)