summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single ↵Steve Dower2019-11-181-2/+2
| | | | argument (GH-17243)
* bpo-38622: Add missing audit events for ctypes module (GH-17158)Steve Dower2019-11-182-7/+65
|
* bpo-16576: Add checks for bitfields passed by value to functions. (GH-17097)Vinay Sajip2019-11-122-3/+60
|
* bpo-16575: Add checks for unions passed by value to functions. (GH-16799)Vinay Sajip2019-10-314-0/+98
|
* bpo-11410: Standardize and use symbol visibility attributes across POSIX and ↵Vinay Sajip2019-10-151-5/+1
| | | | Windows. (GH-16347)
* bpo-38368: Added fix for ctypes crash when handling arrays in structs… ↵Vinay Sajip2019-10-082-25/+179
| | | | (GH-16589)
* bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492)Victor Stinner2019-09-301-1/+1
| | | | | | bpo-22273, bpo-38321: Fix following warning: modules\_ctypes\stgdict.c(704): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
* Changed conditions for ctypes array-in-struct handling. (GH-16381)Vinay Sajip2019-09-251-7/+4
|
* bpo-22273: Disabled tests while investigating buildbot failures on ↵Vinay Sajip2019-09-251-1/+1
| | | | ARM7L/PPC64. (GH-16377)
* bpo-22273: Update ctypes to correctly handle arrays in small structur… ↵Vinay Sajip2019-09-252-0/+146
| | | | (GH-15839)
* closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for ↵Zackery Spytz2019-09-121-1/+5
| | | | | failure. (GH-16011) An exception may occur during a PyObject_IsSubclass() call.
* Fix calling order of PyEval_InitThreads. (GH-4602)Kenta Murata2019-09-101-1/+1
| | | | As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called before Py_Initialize() function.
* bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls ↵Zackery Spytz2019-09-091-1/+3
| | | | | (GH-14462) If FormatMessageW() is passed the FORMAT_MESSAGE_FROM_SYSTEM flag without FORMAT_MESSAGE_IGNORE_INSERTS, it will fail if there are insert sequences in the message definition.
* bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)HongWeipeng2019-09-081-1/+2
| | | | This is a complement to PR 13375.
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-302-2/+2
|
* bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)Victor Stinner2019-08-301-14/+59
| | | | | | | | | | | | Fix a ctypes regression of Python 3.8. When a ctypes.Structure is passed by copy to a function, ctypes internals created a temporary object which had the side effect of calling the structure finalizer (__del__) twice. The Python semantics requires a finalizer to be called exactly once. Fix ctypes internals to no longer call the finalizer twice. Create a new internal StructParam_Type which is only used by _ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument). StructUnionType_paramfunc() creates such object.
* Fix typos in comments, docs and test names (#15018)Min ho Kim2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Update posixmodule checksum. * Reverse idlelib changes.
* bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)Jeroen Demeyer2019-07-111-1/+1
|
* bpo-27679: Remove set_bitfields() from _ctypes_test (GH-14648)Hai Shi2019-07-091-24/+0
|
* bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)Jeroen Demeyer2019-07-081-1/+1
|
* bpo-37493: use _PyObject_CallNoArg in more places (GH-14575)Jeroen Demeyer2019-07-042-12/+11
|
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-041-4/+4
|
* bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13881)Eric Wieser2019-06-071-1/+1
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-315-38/+38
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)Victor Stinner2019-05-271-3/+3
| | | | | * sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs. * Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call() and gc delete_garbage().
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-232-0/+23
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)Zackery Spytz2019-05-171-2/+4
| | | | | | | The final addition (cur += step) may overflow, so use size_t for "cur". "cur" is always positive (even for negative steps), so it is safe to use size_t here. Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
* bpo-36594: Fix incorrect use of %p in format strings (GH-12769)Zackery Spytz2019-05-062-6/+6
| | | In addition, fix some other minor violations of C99.
* ctypes: remove use of legacy unicode API (GH-12340)Inada Naoki2019-04-192-15/+19
| | | PyUnicode_AsUnicodeAndSize() -> PyUnicode_AsWideChar()
* bpo-36071 Add support for Windows ARM32 in ctypes/libffi (GH-12059)Paul Monson2019-04-183-4/+14
|
* bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). ↵Zackery Spytz2019-04-021-1/+1
| | | | (GH-12660)
* bpo-36150: Fix possible assertion failures due to _ctypes.c's ↵Zackery Spytz2019-03-311-4/+5
| | | | PyCData_reduce(). (GH-12106)
* bpo-35947: Fix a compiler warning in _ctypes.c's ↵Zackery Spytz2019-03-311-1/+1
| | | | StructUnionType_paramfunc(). (GH-12629)
* bpo-36085: Enable better DLL resolution on Windows (GH-12302)Steve Dower2019-03-291-9/+25
|
* bpo-35947: Update Windows to the current version of libffi (GH-11797)Paul Monson2019-03-2914-2291/+39
| | | We now use a pre-built libffi binary from our binaries repository, and no longer vendor the full implementation.
* bpo-36421: Fix a possible double decref in _ctypes.c's PyCArrayType_new(). ↵Zackery Spytz2019-03-251-0/+1
| | | | | | | (GH-12530) Set type_attr to NULL after the assignment to stgdict->proto (like what is done with stgdict after the Py_SETREF() call) so that it is not decrefed twice on error.
* bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)Serhiy Storchaka2019-03-133-9/+9
|
* bpo-33895: Relase GIL while calling functions that acquire Windows loader ↵Tony Roberts2019-02-022-3/+21
| | | | | lock (GH-7789) LoadLibrary, GetProcAddress, FreeLibrary and GetModuleHandle acquire the system loader lock. Calling these while holding the GIL will cause a deadlock on the rare occasion that another thread is detaching and needs to destroy its thread state at the same time.
* bpo-35847: RISC-V needs CTYPES_PASS_BY_REF_HACK (GH-11694)Andreas Schwab2019-01-291-1/+1
| | | | | | This fixes the ctypes.test.test_structures.StructureTestCase test. https://bugs.python.org/issue35847
* bpo-27643 - skip test_ctypes test case with XLC compiler. (GH-5164)Michael Felt2018-12-261-4/+14
| | | | | | | | | This test case needs "signed short" bitfields, but the IBM XLC compiler (on AIX) does not support this. Skip the code and test when AIX and XLC are used. Use __xlc__ as identifier to detect the XLC compiler.
* bpo-35529: Fix a reference counting bug in PyCFuncPtr_FromDll(). (GH-11229)Zackery Spytz2018-12-201-5/+8
| | | | | "dll" would leak if an error occurred in _validate_paramflags() or GenericPyCData_new().
* bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. ↵Zackery Spytz2018-12-171-0/+4
| | | | (GH-11175)
* bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. ↵Zackery Spytz2018-12-072-3/+10
| | | | | | (GH-11015) Set MemoryError when appropriate, add missing failure checks, and fix some potential leaks.
* bpo-35384: The repr of ctypes.CArgObject no longer fails for non-ascii ↵Serhiy Storchaka2018-12-061-4/+22
| | | | character. (GH-10863)
* bpo-32787: Better error handling in ctypes. (#3727)Serhiy Storchaka2018-12-055-112/+247
| | | | | | | | | | | | * bpo-31572: Get rid of PyObject_HasAttrString() in ctypes. * Fix error handling for _pack_. * Don't silence errors when look up in a dict. * Use _PyObject_LookupAttrId(). * More changes.
* bpo-10320: Replace nonstandard sprintf() length modifier in ctypes' ↵Zackery Spytz2018-12-031-1/+1
| | | | | PyCArg_repr(). (GH-10853) Use "ll" instead of the nonstandard "q".
* bpo-33029: Fix signatures of getter and setter functions. (GH-10746)Serhiy Storchaka2018-11-271-17/+17
| | | Fix also return type for few other functions (clear, releasebuffer).
* bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)Gregory P. Smith2018-11-131-2/+2
| | | | Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER. Project based C Preprocessor namespacing at its finest. :P
* bpo-35214: Initial clang MemorySanitizer support (GH-10479)Gregory P. Smith2018-11-121-0/+11
| | | | | | | | | | Adds configure flags for msan and ubsan builds to make it easier to enable. These also encode the detail that address sanitizer and memory sanitizer should disable pymalloc. Define MEMORY_SANITIZER when appropriate at build time and adds workarounds to existing code to mark things as initialized where the sanitizer is otherwise unable to determine that. This lets our build succeed under the memory sanitizer. not all tests pass without sanitizer failures yet but we're in pretty good shape after this.
* bpo-29843: raise AttributeError if given negative _length_ (GH-10029)Tal Einat2018-10-221-5/+20
| | | | | | | | Raise ValueError OverflowError in case of a negative _length_ in a ctypes.Array subclass. Also raise TypeError instead of AttributeError for non-integer _length_. Co-authored-by: Oren Milman <orenmn@gmail.com>