• Thomas Heller's avatar
    Fix the ctypes tests. Patch from Victor Stinner. He writes: · 2fb5ac74
    Thomas Heller yazdı
    The problem is that ctypes c_char (and c_char_p) creates unicode string
    instead of byte string. I attached a proposition (patch) to change this
    behaviour (use bytes for c_char).
    
    So in next example, it will display 'bytes' and not 'str':
      from ctypes import c_buffer, c_char
      buf = c_buffer("abcdef")
      print (type(buf[0]))
    
    Other behaviour changes:
     - repr(c_char) adds a "b"
       eg. repr(c_char('x')) is "c_char(b'x')" instead of "c_char('x')"
     - bytes is mutable whereas str is not:
       this may break some modules based on ctypes
    2fb5ac74
Adı
Son kayıt (commit)
Son güncelleme
..
darwin Loading commit data...
libffi Loading commit data...
libffi_arm_wince Loading commit data...
libffi_msvc Loading commit data...
_ctypes.c Loading commit data...
_ctypes_test.c Loading commit data...
_ctypes_test.h Loading commit data...
callbacks.c Loading commit data...
callproc.c Loading commit data...
cfield.c Loading commit data...
ctypes.h Loading commit data...
ctypes_dlfcn.h Loading commit data...
malloc_closure.c Loading commit data...
stgdict.c Loading commit data...