kai zhu <[email protected]> added the comment:
i just found this bug independently, but yes its a bug, which i hope
gets fixed for sake of extension community:
// test.c beg
char s[4] = "ab\xff";
char *foo() { return s; }
// test.c end
$ gcc -fPIC -g -c -Wall test.c
$ gcc -shared test.o -o test.so
$ python3.1 -c "import ctypes; lib =
ctypes.cdll.LoadLibrary('./test.so'); lib.foo.restype = ctypes.c_char_p;
lib.foo()"
Traceback (most recent call last):
File "<string>", line 1, in <module>
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 2:
unexpected code byte
----------
nosy: +kaizhu
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue6239>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com