Ond??ej ??ert??k <ondrej.cer...@gmail.com> wrote:
> https://github.com/numpy/numpy/pull/366

Using Python 3.3 compiled --with-pydebug it appears to be impossible
to fool the new Unicode implementation with byte-swapped data:


Apply the patch from:

http://projects.scipy.org/numpy/ticket/2193


Then:

Python 3.3.0b1 (default:68e2690a471d+, Jul 29 2012, 15:28:41) 
[GCC 4.4.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from numpy import array
[206376 refs]
>>> a = array(["abc"])
[206382 refs]
>>> b = a.newbyteorder()
[206387 refs]
>>> b
python3.3: Objects/unicodeobject.c:401: _PyUnicode_CheckConsistency: Assertion 
`maxchar <= 0x10ffff' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff71e6a75 in *__GI_raise (sig=<value optimized out>) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) 


This should be expected since the byte-swapped strings aren't valid.


Stefan Krah



_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to