This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kaizhu
Recipients benjamin.peterson, georg.brandl, kaizhu, theller, vstinner
Date 2009-08-21.07:13:54
SpamBayes Score 3.9236392e-11
Marked as misclassified No
Message-id <1250838837.03.0.608485428191.issue6239@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2009-08-21 07:13:57kaizhusetrecipients: + kaizhu, theller, georg.brandl, vstinner, benjamin.peterson
2009-08-21 07:13:57kaizhusetmessageid: <1250838837.03.0.608485428191.issue6239@psf.upfronthosting.co.za>
2009-08-21 07:13:55kaizhulinkissue6239 messages
2009-08-21 07:13:54kaizhucreate