[C++-sig] boost.python and numpy.int32 on 64-bit system

Ger van Diepen diepen at astron.nl
Thu Apr 17 10:22:56 CEST 2008


I'm a happy user of Boost.Python and use it to convert strings, dicts, numpy and numarray arrays, etc.

However, I have a problem with a function that accepts an int argument.
It works fine when doing something like
    t.getcell(name, 1)
but when doing
    arr=numpy.array([1,2,3],dtype='int32')
    t.getcell (name, arr[0])
I get the following error:
  ArgumentError: Python argument types in
    Table.getcell(table, str, numpy.int32)
  did not match C++ signature:
    getcell(casa::TableProxy {lvalue}, std::string columnname, int rownr)

The problem only occurs on a 64-bit system (Suse, Debian as well as Ubuntu), but not on a 32-bit system. It also works fine if the array type is int64.
I suspect that Boost.Python cannot handle this case, but I wonder if anybody had seen this before and if there is a solution.
Of course, I can do
   t.getcell(name, int(arr[0]))
but I regard that as a hack.

Cheers,
Ger van Diepen




More information about the Cplusplus-sig mailing list