Closed macosforgebot closed 6 years ago
bernie.hackett@… originally submitted this as comment:1:ticket:936
One solution to this problem would be to make authGSSClientClean and authGSSServerClean obsolete. PyCObject_FromVoidPointer and PyCapsule_New both take a destructor argument. The destructor is called when the PyCObject / PyCapsule is reclaimed. See this github fork for an example:
https://github.com/02strich/pykerberos/blob/master/src/kerberos.c
bernie.hackett@… originally submitted this as ticket:936
Both authGSSClientClean and authGSSServerClean call PyCObject_SetVoidPtr(pystate, NULL). When built for python 3.x PyCObject_SetVoidPtr is aliased as PyCapsule_SetPointer. According to The C API docs, the second parameter to PyCapsule_SetPointer cannot be NULL:
https://docs.python.org/3.1/c-api/capsule.html#PyCapsule_SetPointer
Reproduction:
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information.
1
ValueError: PyCapsule_SetPointer called with null pointer
This makes PyKerberos unusable under python 3.