Georg Brandl ge...@python.org added the comment:
I fixed this, and a few other bytes/string issues, in r73293.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4309
Michael Newman michael.b.new...@gmail.com added the comment:
Watch out on Line 247 of r73293:
bytes objcet
should be:
bytes object
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4309
___
Michael Newman michael.b.new...@gmail.com added the comment:
Regarding Section 15.15.1.5. Calling functions, continued on:
http://docs.python.org/3.0/library/ctypes.html
I would recommend changing the first example code block to the following:
printf = libc.printf
printf(bHello, %s\n,
Changes by Gabriel Genellina [EMAIL PROTECTED]:
--
nosy: +gagenellina
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4309
___
___
Python-bugs-list
David W. Lambert [EMAIL PROTECTED] added the comment:
Changing the string to type byte
'Works'
from ctypes import *
libc = CDLL('libc.so.6')
libc.printf(b'hello')
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4309
David W. Lambert [EMAIL PROTECTED] added the comment:
When patching py3k/Doc/library/ctypes.rst or ctypes module tree please
consider
uWorld! produces a syntax error.
These wide character formats produce unintelligible output:
for n in range(3,6):
code = 'utf_%s'%2**n
David W. Lambert [EMAIL PROTECTED] added the comment:
Conversely, if the documentation is correct then my ctypes is flawed.
None, integers, byte strings and unicode strings are the only native
Python objects that can directly be used as parameters in these function
calls. None is passed as a
New submission from David W. Lambert [EMAIL PROTECTED]:
'''
http://docs.python.org/dev/3.0/library/ctypes.html
Where web page says
printf(An int %d, a double %f\n, 1234, c_double(3.14))
Integer 1234, double 3.141049
31
should instead read