[issue19231] ctype cant's use printf

2013-10-12 Thread FreedomKnight
New submission from FreedomKnight: the code is simple, so i paste all of mycode #!/usr/bin/env python3 from ctypes import * cdll.LoadLibrary(libc.so.6) libc = CDLL(libc.so.6) libc.printf(hello\n) result: h expect result: hello plateform: fedora 19 x64 python3 (3.3.2)

[issue19231] ctype cant's use printf

2013-10-12 Thread Georg Brandl
Georg Brandl added the comment: In Python 3, hello\n is a Unicode string. printf() expects a byte string, so you should use bhello\n (or s.encode() for string object named s). -- nosy: +georg.brandl resolution: - invalid status: open - closed ___