Created attachment 252446 [details] Make py-kerberos compatible to python 3.11 After updating to ports to 2024Q3, which defaults to python 3.11, py-kerberos doesn’t work anymore. The patch is based on https://github.com/apple/ccs-pykerberos/pull/89/files Unfortunately, the github repository of py-kerberos is in archived state, so the pull requests will never be applied upstream. Further, I changed default options from „GSSAPI_BASE“ to „GSSAPI_MIT“. Without this, ansible hangs when using it indirectly with pywinrm. I would be happy if the attached patch could be applied.
(In reply to topical from comment #0) > I would be happy if the attached patch could be applied. So would I.
Why don't you use py-gssapi? It works fantastically.
(In reply to Michael Osipov from comment #2) > Why don't you use py-gssapi? It works fantastically. I'm not, others are: https://github.com/diyan/pywinrm/blob/cbc1e3475a516e2dabfc58925ed2bcd932856ccb/pyproject.toml#L53 https://github.com/freebsd/freebsd-ports/blob/33de0c36f124805e86d12437f2d4eb5bf629cac0/security/py-pywinrm/Makefile#L17 (see also #283176; recent versions vendor requests-kerberos and instead depend directly on pykerberos) https://github.com/freebsd/freebsd-ports/blob/33de0c36f124805e86d12437f2d4eb5bf629cac0/security/py-requests-kerberos/Makefile#L16
(In reply to Christian Ullrich from comment #3) I see, you can replace py-requests-kerberos with https://pypi.org/project/requests-gssapi/. It is more or less the official successor. The only issue is WinRM stuff. That's it. I think best here would be to reach out to downstream maintainers like jborean93 with WinRM otherwise this will go unnoticed...but I consider your patch reasonable for the time being.
I have two concerns: * changing the default options will break things for existing users - they had X, now they have Y * Is this patch compatible with older and still supported versions of Python? e.g. if you build this with Python 3.9, will it build and run?
(In reply to Dan Langille from comment #5) I agree with Dan, the patch conflates two distinct issues.
(In reply to Dan Langille from comment #5) > * changing the default options will break things for existing users - they had X, now they have Y I agree that should not be changed for POLA, although I personally rather like the idea. > * Is this patch compatible with older and still supported versions of Python? e.g. if you build this with Python 3.9, will it build and run? "#define PY_SSIZE_T_CLEAN" is supported - and required - since Python 3.7, so I'd say yes. Per my poudriere, it builds and "import kerberos" works with 3.10, 3.9, and 3.8.
(In reply to Dan Langille from comment #5) I don't know whether this package works at all with GSSAPI_BASE, but you are right that these are 2 different issues. To make one step after the other, I would be happy if you could at least apply the patch of the source code and leave the default options alone. The source code patch shouldn't impose compatibility issues in terms of Python (see comment #7) Thank you
FWIW: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277650
FYI, the patch is filled with control-M I fixed it manually, not sure how they got in there, but it's extra work.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=8d0bd4143c66131728dc6c321af2656752299199 commit 8d0bd4143c66131728dc6c321af2656752299199 Author: topical <topical@gmx.net> AuthorDate: 2025-01-19 16:19:01 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2025-01-19 16:22:27 +0000 security/py-kerberos: Make compatible with python3.11 PR: 280567 security/py-kerberos/Makefile | 2 +- .../py-kerberos/files/patch-src_kerberos.c (new) | 23 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-)