[C++-sig] builtin_converters.hpp using outdated API on win64 builds
I'm currently trying to build boost-1.45 against python-3.1.3 on win64 (visual studio 2009 sp1). This build is failing because boost/python/converter/builtin_converters.hpp is using APIs that have been removed from python3 without checking the python version; at lines 138 and 144 PyInt_FromLong is being used. If I understand what's going in that code, the fix is to update line 125 to check the python version. I think we can just add: && PY_VERSION_HEX < 0x0300 to the preprocessor conditional. I've made this change locally, and it seems to fix things. Does this seem like the correct fix? If so, how do I get a patch to the right people (or at least ask them to make this change)? Austin ___ Cplusplus-sig mailing list [email protected] http://mail.python.org/mailman/listinfo/cplusplus-sig
Re: [C++-sig] builtin_converters.hpp using outdated API on win64 builds
- Original Message
> I'm currently trying to build boost-1.45 against python-3.1.3 on win64
> (visual studio 2009 sp1). This build is failing because
> boost/python/converter/builtin_converters.hpp is using APIs that have
> been removed from python3 without checking the python version; at
> lines 138 and 144 PyInt_FromLong is being used.
>
> If I understand what's going in that code, the fix is to update line
> 125 to check the python version. I think we can just add:
>
> && PY_VERSION_HEX < 0x0300
>
> to the preprocessor conditional.
>
> I've made this change locally, and it seems to fix things. Does this
> seem like the correct fix?
Did you test what happens when you have a function returning a size_t?
E.g.
std::size_t dummy() { return 123; }
def("dummy", dummy);
In Python3, what is the Python type you get?
In Python2 it is 123L without the special code for WIN64.
Ralf
___
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Re: [C++-sig] builtin_converters.hpp using outdated API on win64 builds
On Thu, Dec 23, 2010 at 12:49 PM, Ralf W. Grosse-Kunstleve
wrote:
> - Original Message
>
>> I'm currently trying to build boost-1.45 against python-3.1.3 on win64
>> (visual studio 2009 sp1). This build is failing because
>> boost/python/converter/builtin_converters.hpp is using APIs that have
>> been removed from python3 without checking the python version; at
>> lines 138 and 144 PyInt_FromLong is being used.
>>
>> If I understand what's going in that code, the fix is to update line
>> 125 to check the python version. I think we can just add:
>>
>> && PY_VERSION_HEX < 0x0300
>>
>> to the preprocessor conditional.
>>
>> I've made this change locally, and it seems to fix things. Does this
>> seem like the correct fix?
>
> Did you test what happens when you have a function returning a size_t?
> E.g.
>
> std::size_t dummy() { return 123; }
>
> def("dummy", dummy);
>
> In Python3, what is the Python type you get?
> In Python2 it is 123L without the special code for WIN64.
I haven't directly tested it, but as I understand things there is only
one built-in integral type (int) in python3:
http://docs.python.org/release/3.0.1/whatsnew/3.0.html#integers
If/when I get a chance, I'll try to answer this question a bit more
authoritatively. However, it seems pretty clear to me that size_t must
get translated to and int in python3.
Austin
___
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Re: [C++-sig] builtin_converters.hpp using outdated API on win64 builds
> I've made this change locally, and it seems to fix things. Does this > seem like the correct fix? If so, how do I get a patch to the right > people (or at least ask them to make this change)? > > Austin > There is a ticket in boost for this (https://svn.boost.org/trac/boost/ticket/4627) where you can submit patches. ___ Cplusplus-sig mailing list [email protected] http://mail.python.org/mailman/listinfo/cplusplus-sig
Re: [C++-sig] builtin_converters.hpp using outdated API on win64 builds
Hi Austin, > I haven't directly tested it, but as I understand things there is only > one built-in integral type (int) in python3: > > http://docs.python.org/release/3.0.1/whatsnew/3.0.html#integers > > If/when I get a chance, I'll try to answer this question a bit more > authoritatively. However, it seems pretty clear to me that size_t must > get translated to and int in python3. OK, I'll check in your suggested change. Ralf ___ Cplusplus-sig mailing list [email protected] http://mail.python.org/mailman/listinfo/cplusplus-sig
Re: [C++-sig] builtin_converters.hpp using outdated API on win64 builds
> OK, I'll check in your suggested change. Great, I see it in the trunk now. Thanks! Austin ___ Cplusplus-sig mailing list [email protected] http://mail.python.org/mailman/listinfo/cplusplus-sig
