[Numpy-discussion] Segfault with python 3.2 structured array non-existent field

Charles R Harris charlesr.harris@gmail....
Tue Mar 15 12:25:22 CDT 2011


On Tue, Mar 15, 2011 at 11:12 AM, Pauli Virtanen <pav@iki.fi> wrote:

> Tue, 15 Mar 2011 10:06:09 -0700, Matthew Brett wrote:
> > Sorry to ask, and I ask partly because I'm in the middle of a py3k port,
> > but is this the right fix to this problem?  I was confused by the
> > presence of the old PyString_AsString function.
>
> It's not a correct fix. The original code seems also wrong ("index" can
> either be Unicode or Bytes/String object), and will probably bomb when
> indexing with Unicode strings on Python 2. The right thing to do is to
> make it show the repr of the "index" object.
>
> The PyString_AsString is present, as it's mapped on Py3 to
> PyBytes_AsString by "npy_3kcompat.h".
>
>
Well, I applied the fix, so that needs to be fixed ;) What does repr return
in python 3k, utf-8?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110315/49ca3e22/attachment.html 


More information about the NumPy-Discussion mailing list