This is an adaptation of patch 2917775, based on (https://p.carnivore.it/G6R9Go)
I successfully used this patch with couchdb-python-curl (http://code.google.com/p/couchdb-python-curl/)
We've been running this patch for a while in Ubuntu.
One thing I've noticed is that it has several sections of code in getattr methods like:
PyErr_Clear();
v = my_getattro(o, n, ((CurlShareObject *)o)->dict,
curlshareobject_constants, curlshareobject_methods);
But that should be:
v = my_getattro(o, n, ((CurlShareObject *)o)->dict,
curlshareobject_constants, curlshareobject_methods);
if( v )
PyErr_Clear();
Because if you clear the AttributeError, but then still don't find the attribute with my_getattro, hasattr will throw a SystemError when it gets a None object back but no exception.
patch for py3k support
patch for:
setup.py 28 Apr 2010 16:06:35 -0000 1.152
examples/basicfirst.py 11 Feb 2005 11:09:11 -0000 1.5
examples/retriever-multi.py 28 Jul 2005 11:04:13 -0000 1.29
src/pycurl.c 13 Oct 2010 15:53:40 -0000 1.150
Do a "2to3 -w ." before "python3 setup.py build"
Thanks for Christopher Warner for the original patch 2917775.
Erratum: Credits to Markus for the original patch.
when is this getting accepted?
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
We've been running this patch for a while in Ubuntu.
One thing I've noticed is that it has several sections of code in getattr methods like:
PyErr_Clear();
v = my_getattro(o, n, ((CurlShareObject *)o)->dict,
curlshareobject_constants, curlshareobject_methods);
But that should be:
v = my_getattro(o, n, ((CurlShareObject *)o)->dict,
curlshareobject_constants, curlshareobject_methods);
if( v )
PyErr_Clear();
Because if you clear the AttributeError, but then still don't find the attribute with my_getattro, hasattr will throw a SystemError when it gets a None object back but no exception.
https://bugs.launchpad.net/ubuntu/+source/pycurl/+bug/1103667
Committed, thanks!