Quantcast

Python 3.2: convert convert PyObject* to PyUnicodeObject*?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Python 3.2: convert convert PyObject* to PyUnicodeObject*?

Steve M. Robbins-2
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

signature.asc (197 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python 3.2: convert convert PyObject* to PyUnicodeObject*?

Matthew Bradbury
Steve M. Robbins <steve <at> sumost.ca> writes:

>
> Hi,
>
> Boost 1.46.1 fails to build with Python 3.2 on linux (Debian).  The
> build fails with:
>
> error: cannot convert -F�PyObject*� to �PyUnicodeObject*� for argument �1� to
�Py_ssize_t
> PyUnicodeUCS4_AsWideChar(PyUnicodeObject*, wchar_t*, Py_ssize_t)�-A
>
> at this code:
snip
>
> Is there an easy fix?
>
> Thanks,
> -Steve


Yes, I submitted a bug and a patch some time ago.

https://svn.boost.org/trac/boost/ticket/4994

Matt


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python 3.2: convert convert PyObject* to PyUnicodeObject*?

Ralf W. Grosse-Kunstleve
In reply to this post by Steve M. Robbins-2
You may get more help here:

http://mail.python.org/mailman/listinfo/cplusplus-sig

The code you quote is still the same on the boost svn trunk.

Maybe if you post a minimal reproducer someone using Python 3 will
pick this up. (I use Boost.Python only with Python 2.)

Ralf



----- Original Message ----

> From: Steve M. Robbins <[hidden email]>
> To: [hidden email]
> Cc: [hidden email]
> Sent: Tue, April 5, 2011 10:53:38 PM
> Subject: [boost] Python 3.2: convert convert PyObject* to PyUnicodeObject*?
>
> Hi,
>
> Boost 1.46.1 fails to build with Python 3.2 on linux (Debian).   The
> build fails with:
>
> error: cannot convert -F¡PyObject*¢ to  ¡PyUnicodeObject*¢ for argument ¡1¢ to
>¡Py_ssize_t  PyUnicodeUCS4_AsWideChar(PyUnicodeObject*, wchar_t*, Py_ssize_t)¢-A
>
> at  this code:
>
>       static std::wstring extract(PyObject*  intermediate)
>       {
>            std::wstring result(::PyObject_Length(intermediate), L' ');
>            if (!result.empty())
>            {
>               int err =  PyUnicode_AsWideChar(
>                    intermediate
>                 ,  &result[0]
>                 ,  result.size());
>
>               if (err  == -1)
>                    throw_error_already_set();
>           }
>            return result;
>       }
>
> Is  there an easy fix?
>
> Thanks,
> -Steve
>
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python 3.2: convert convert PyObject* to PyUnicodeObject*?

Ralf W. Grosse-Kunstleve
In reply to this post by Steve M. Robbins-2
Thanks for the patch and the pointer. I just checked in the fix and closed the ticket.
Ralf



----- Original Message -----

> From:Matthew Bradbury <[hidden email]>
> To:[hidden email]
> Cc:
> Sent:Wednesday, April 6, 2011 3:43 AM
> Subject:Re: [boost] Python 3.2: convert convert PyObject* to PyUnicodeObject*?
>
> Steve M. Robbins <steve <at> sumost.ca> writes:
>
> >
> > Hi,
> >
> > Boost 1.46.1 fails to build with Python 3.2 on linux (Debian).  The
> > build fails with:
> >
> > error: cannot convert -F�PyObject*� to �PyUnicodeObject*� for argument �1�
> to
> �Py_ssize_t
> > PyUnicodeUCS4_AsWideChar(PyUnicodeObject*, wchar_t*, Py_ssize_t)�-A
> >
> > at this code:
> snip
> >
> > Is there an easy fix?
> >
> > Thanks,
> > -Steve
>
>
> Yes, I submitted a bug and a patch some time ago.
>
> https://svn.boost.org/trac/boost/ticket/4994
>
> Matt
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...