summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes/test
Commit message (Collapse)AuthorAgeFilesLines
* 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-141-0/+9
| | | | 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-291-0/+63
|
* 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-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
|
* 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-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.
* 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.
* bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559)Erik Bray2017-06-072-0/+26
|
* bpo-30125: disable faulthandler in ctypes test_SEH (#1237)Victor Stinner2017-04-211-4/+8
| | | | | | | | Disable faulthandler to run test_SEH() of test_ctypes to prevent the following log with a traceback: Windows fatal exception: access violation Add support.disable_faulthandler() context manager.
* bpo-29845: Mark tests that use _testcapi as CPython-only (#711)Serhiy Storchaka2017-03-191-1/+4
|
* bpo-28129: fix ctypes crashes (#386)orenmn2017-03-025-0/+53
| | | | | | | | | | | | * init commit, with initial tests for from_param and fields __set__ and __get__, and some additions to from_buffer and from_buffer_copy * added the rest of tests and patches. probably only a first draft. * removed trailing spaces * replace ctype with ctypes in error messages * change back from ctypes instance to ctype instance
* Fixed bpo-29565: Corrected ctypes passing of large structs by value on ↵Vinay Sajip2017-02-202-0/+34
| | | | | | | | | | | | | | | Windows AMD64. (#168) * Fixed bpo-29565: Corrected ctypes passing of large structs by value. Added code and test to check that when a structure passed by value is large enough to need to be passed by reference, a copy of the original structure is passed. The callee updates the passed-in value, and the test verifies that the caller's copy is unchanged. A similar change was also added to the test added for bpo-20160 (that test was passing, but the changes should guard against regressions). * Reverted unintended whitespace changes.
* Issue #25659: Merge ctypes fix from 3.5Martin Panter2016-11-201-0/+8
|\
| * Issue #25659: Change assert to TypeError in from_buffer/_copy()Martin Panter2016-11-201-0/+8
| | | | | | | | Based on suggestion by Eryk Sun.
* | Merge test cleanup from 3.5 into 3.6Martin Panter2016-09-291-24/+1
|\ \ | |/
| * Remove disabled ctypes testMartin Panter2016-09-291-24/+1
| | | | | | | | | | | | The test was commented out in 2005 before ctypes was added to Python, because the “cdll” attribute loading feature “will no longer work this way”: http://svn.python.org/view?view=revision&revision=49102
* | Issue #27355: Import no longer neededMartin Panter2016-09-061-1/+1
| |
* | Issue #27355: Removed support for Windows CE. It was never finished,Larry Hastings2016-09-053-15/+8
| | | | | | | | and Windows CE is no longer a relevant platform for Python.
* | Closes #9998: Allowed find_library to search additional locations for libraries.Vinay Sajip2016-08-171-0/+43
| |