summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36820: Break unnecessary cycle in socket.py, codeop.py and dyld.py ↵Mario Corchero2019-12-061-0/+2
| | | | | | | | | | | | (GH-13135) Break cycle generated when saving an exception in socket.py, codeop.py and dyld.py as they keep alive not only the exception but user objects through the ``__traceback__`` attribute. https://bugs.python.org/issue36820 Automerge-Triggered-By: @pablogsal
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-191-1/+1
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-38622: Add missing audit events for ctypes module (GH-17158)Steve Dower2019-11-181-0/+4
|
* bpo-16576: Add checks for bitfields passed by value to functions. (GH-17097)Vinay Sajip2019-11-121-0/+81
|
* bpo-16575: Add checks for unions passed by value to functions. (GH-16799)Vinay Sajip2019-10-311-0/+80
|
* bpo-38368: Added fix for ctypes crash when handling arrays in structs… ↵Vinay Sajip2019-10-081-0/+51
| | | | (GH-16589)
* bpo-22273: Removed temporary test skipping on PPC platforms. (GH-16399)Vinay Sajip2019-09-251-2/+3
|
* bpo-22273: Re-enabled ctypes test on ARM machines. (GH-16388)Vinay Sajip2019-09-251-1/+1
|
* Changed conditions for ctypes array-in-struct handling. (GH-16381)Vinay Sajip2019-09-251-1/+1
|
* bpo-22273: Disabled tests while investigating buildbot failures on ↵Vinay Sajip2019-09-251-0/+5
| | | | ARM7L/PPC64. (GH-16377)
* bpo-22273: Update ctypes to correctly handle arrays in small structur… ↵Vinay Sajip2019-09-251-0/+41
| | | | (GH-15839)
* bpo-36253: Remove use after free reference in ctypes test suite (GH-12257)Ben Harper2019-09-101-2/+2
|
* bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)Victor Stinner2019-08-301-6/+45
| | | | | | | | | | | | 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.
* bpo-19865: ctypes.create_unicode_buffer() supports non-BMP strings on ↵Zackery Spytz2019-06-142-1/+18
| | | | Windows (GH-14081)
* Use assertEqual(). (#13883)Stefan Krah2019-06-071-2/+2
|
* bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13881)Eric Wieser2019-06-071-0/+15
|
* bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)Zackery Spytz2019-05-171-0/+11
| | | | | | | 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-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). ↵Zackery Spytz2019-04-021-0/+6
| | | | (GH-12660)
* bpo-36085: Add additional load flag to ensure DLL loads successfully (GH-12633)Steve Dower2019-03-311-1/+2
|
* bpo-36085: Enable better DLL resolution on Windows (GH-12302)Steve Dower2019-03-292-1/+74
|
* bpo-35947: Update Windows to the current version of libffi (GH-11797)Paul Monson2019-03-291-29/+0
| | | We now use a pre-built libffi binary from our binaries repository, and no longer vendor the full implementation.
* bpo-36048: Use __index__() instead of __int__() for implicit conversion if ↵Serhiy Storchaka2019-02-251-1/+7
| | | | | | available. (GH-11952) Deprecate using the __int__() method in implicit conversions of Python numbers to C integers.
* bpo-27643 - skip test_ctypes test case with XLC compiler. (GH-5164)Michael Felt2018-12-261-0/+4
| | | | | | | | | 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-35523: Remove ctypes callback workaround (GH-11211)Victor Stinner2018-12-181-5/+0
| | | | Remove ctypes callback workaround: no longer create a callback at startup. Avoid SELinux alert on "import ctypes" and "import uuid".
* bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. ↵Zackery Spytz2018-12-171-0/+7
| | | | (GH-11175)
* bpo-35384: The repr of ctypes.CArgObject no longer fails for non-ascii ↵Serhiy Storchaka2018-12-061-0/+1
| | | | character. (GH-10863)
* bpo-29843: raise AttributeError if given negative _length_ (GH-10029)Tal Einat2018-10-221-5/+19
| | | | | | | | 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>
* Use assertEqual() instead of assertEquals(). (GH-9721)Serhiy Storchaka2018-10-051-1/+1
| | | Fixes warnings in tests added in bpo-32117 and bpo-34603.
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-181-0/+1
|
* bpo-34603, ctypes/libffi_msvc: Fix returning structs from functions (GH-9258)Vladimir Matveev2018-09-161-0/+18
|
* bpo-34558: Add missing parentheses in _aix.py (GH-9017)Michael Felt2018-09-011-1/+1
| | | p.wait()
* Fixed several assertTrue() that were intended to be assertEqual(). (GH-8191)Sergey Fedoseev2018-07-091-1/+1
| | | Fixed also testing the "always" warning filter.
* bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)Segev Finer2018-05-141-0/+7
|
* bpo-21983: Fix a crash in ctypes.cast() when passed a ctypes structured data ↵Oren Milman2018-05-091-0/+13
| | | | type (GH-3859)
* bpo-33281: Fix ctypes.util.find_library regression on macOS (GH-6625)Ray Donnelly2018-05-021-2/+2
|
* bpo-32746: Fix multiple typos (GH-5144)Leo Arias2018-02-041-2/+2
| | | Fix typos found by codespell in docs, docstrings, and comments.
* bpo-26439: Convert %s in Lib/ctypes/_aix.py to f-strings. (GH-4986)Mariatta2017-12-232-17/+17
|
* bpo-26439 Fix ctypes.util.find_library failure on AIX (#4507)Michael Felt2017-12-193-0/+364
| | | | | Implement find_library() support in ctypes/util for AIX. Add some AIX specific tests.
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-142-2/+2
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* time.clock() now emits a DeprecationWarning (GH-4020)Victor Stinner2017-10-172-2/+2
| | | | | | | | | | bpo-31803: time.clock() and time.get_clock_info('clock') now emit a DeprecationWarning warning. Replace time.clock() with time.perf_counter() in tests and demos. Remove also hasattr(time, 'monotonic') in test_time since time.monotonic() is now always available since Python 3.5.
* bpo-31311: Fix a SystemError and a crash in ctypes._CData.__setstate__(), in ↵Oren Milman2017-09-251-0/+21
| | | | case of a bad __dict__. (#3254)
* bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is ↵Oren Milman2017-09-171-0/+13
| | | | defined only outside _fields_. (#3615)
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-20/+17
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Removed noop branch from ctypes code (#3234)Alex Gaynor2017-08-301-4/+1
|
* bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (#31)Pauli Virtanen2017-08-281-28/+55
| | | | | | | | | | | | | | | 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.
* [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)Serhiy Storchaka2017-06-281-0/+2
| | | | | | | Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.
* bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (#2285)Serhiy Storchaka2017-06-271-2/+2
| | | | | Raise a ValueError if the second argument is NULL and the wchar_t\* string contains null characters.
* Show what's changed when Travis fails regen check (GH-2095)Zachary Ware2017-06-111-1/+1
| | | Also fixed a few more line endings that were missed in GH-840, which were causing failure.
* bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559)Erik Bray2017-06-072-0/+26
|