• Pauli Virtanen's avatar
    bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (#31) · 07f1658a
    Pauli Virtanen yazdı
    Ctypes currently produces wrong pep3118 type codes for several types.
    E.g. memoryview(ctypes.c_long()).format gives "<l" on 64-bit platforms,
    but it should be "<q" instead for sizeof(c_long) == 8
    
    The problem is that the '<>' endian specification in the struct syntax
    also turns on the "standard size" mode, which makes type characters have
    a platform-independent meaning, which does not match with the codes used
    internally in ctypes.  The struct module format syntax also does not
    allow specifying native-size non-native-endian items.
    
    This commit adds a converter function that maps the internal ctypes
    codes to appropriate struct module standard-size codes in the pep3118
    format strings. The tests are modified to check for this.
    07f1658a
Adı
Son kayıt (commit)
Son güncelleme
..
__init__.py Loading commit data...
__main__.py Loading commit data...
test_anon.py Loading commit data...
test_array_in_pointer.py Loading commit data...
test_arrays.py Loading commit data...
test_as_parameter.py Loading commit data...
test_bitfields.py Loading commit data...
test_buffers.py Loading commit data...
test_bytes.py Loading commit data...
test_byteswap.py Loading commit data...
test_callbacks.py Loading commit data...
test_cast.py Loading commit data...
test_cfuncs.py Loading commit data...
test_checkretval.py Loading commit data...
test_delattr.py Loading commit data...
test_errno.py Loading commit data...
test_find.py Loading commit data...
test_frombuffer.py Loading commit data...
test_funcptr.py Loading commit data...
test_functions.py Loading commit data...
test_incomplete.py Loading commit data...
test_init.py Loading commit data...
test_internals.py Loading commit data...
test_keeprefs.py Loading commit data...
test_libc.py Loading commit data...
test_loading.py Loading commit data...
test_macholib.py Loading commit data...
test_memfunctions.py Loading commit data...
test_numbers.py Loading commit data...
test_objects.py Loading commit data...
test_parameters.py Loading commit data...
test_pep3118.py Loading commit data...
test_pickling.py Loading commit data...
test_pointers.py Loading commit data...
test_prototypes.py Loading commit data...
test_python_api.py Loading commit data...
test_random_things.py Loading commit data...
test_refcounts.py Loading commit data...
test_repr.py Loading commit data...
test_returnfuncptrs.py Loading commit data...
test_simplesubclasses.py Loading commit data...
test_sizes.py Loading commit data...
test_slicing.py Loading commit data...
test_stringptr.py Loading commit data...
test_strings.py Loading commit data...
test_struct_fields.py Loading commit data...
test_structures.py Loading commit data...
test_unaligned_structures.py Loading commit data...
test_unicode.py Loading commit data...
test_values.py Loading commit data...
test_varsize_struct.py Loading commit data...
test_win32.py Loading commit data...
test_wintypes.py Loading commit data...