summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #20320: select.select() and select.kqueue.control() now round the timeoutVictor Stinner2014-02-161-6/+25
| | | | | | aways from zero, instead of rounding towards zero. It should make test_asyncio more reliable, especially test_timeout_rounding() test.
* Issue #20530: Argument Clinic's signature format has been revised again.Larry Hastings2014-02-091-5/+22
| | | | | | | The new syntax is highly human readable while still preventing false positives. The syntax also extends Python syntax to denote "self" and positional-only parameters, allowing inspect.Signature objects to be totally accurate for all supported builtins in Python 3.4.
* Issue #20326: Argument Clinic now uses a simple, unique signature toLarry Hastings2014-01-281-4/+4
| | | | | | | | | | annotate text signatures in docstrings, resulting in fewer false positives. "self" parameters are also explicitly marked, allowing inspect.Signature() to authoritatively detect (and skip) said parameters. Issue #20326: Argument Clinic now generates separate checksums for the input and output sections of the block, allowing external tools to verify that the input has not changed (and thus the output is not out-of-date).
* Issue #20189: Four additional builtin types (PyTypeObject,Larry Hastings2014-01-241-4/+4
| | | | | | PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type) have been modified to provide introspection information for builtins. Also: many additional Lib, test suite, and Argument Clinic fixes.
* Issue #20226: Major improvements to Argument Clinic.Larry Hastings2014-01-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | * You may now specify an expression as the default value for a parameter! Example: "sys.maxsize - 1". This support is intentionally quite limited; you may only use values that can be represented as static C values. * Removed "doc_default", simplified support for "c_default" and "py_default". (I'm not sure we still even need "py_default", but I'm leaving it in for now in case a use presents itself.) * Parameter lines support a trailing '\\' as a line continuation character, allowing you to break up long lines. * The argument parsing code generated when supporting optional groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize, leading to a 850% speedup in parsing. (Just kidding, this is an unmeasurable difference.) * A bugfix for the recent regression where the generated prototype from pydoc for builtins would be littered with unreadable "=<object ...>"" default values for parameters that had no default value. * Converted some asserts into proper failure messages. * Many doc improvements and fixes.
* Issue #20144: Argument Clinic now supports simple constants as parameterLarry Hastings2014-01-071-0/+12
| | | | | default values. inspect.Signature correspondingly supports them in __text_signature__ fields for builtins.
* Backout changeset 46393019b650Victor Stinner2013-12-131-4/+0
| | | | test_capi is failing and the fix is not trivial, I prefer to revert
* Close #19787: PyThread_set_key_value() now always set the value. In Python 3.3,Victor Stinner2013-12-131-0/+4
| | | | | | | | the function did nothing if the key already exists (if the current value is a non-NULL pointer). _testcapi.run_in_subinterp() now correctly sets the new Python thread state of the current thread when a subinterpreter is created.
* (Merge 3.3) Issue #14432: Fix compilation when thread support is disabledVictor Stinner2013-12-131-0/+5
|\
| * Issue #14432: Fix compilation when thread support is disabledVictor Stinner2013-12-131-0/+4
| |
| * Issue #14432: Generator now clears the borrowed reference to the thread stateVictor Stinner2013-12-131-0/+89
| | | | | | | | | | | | | | Fix a crash when a generator is created in a C thread that is destroyed while the generator is still used. The issue was that a generator contains a frame, and the frame kept a reference to the Python state of the destroyed C thread. The crash occurs when a trace function is setup.
* | Issue #14432: Remove the thread state field from the frame structure. Fix aVictor Stinner2013-12-131-0/+89
| | | | | | | | | | | | | | crash when a generator is created in a C thread that is destroyed while the generator is still used. The issue was that a generator contains a frame, and the frame kept a reference to the Python state of the destroyed C thread. The crash occurs when a trace function is setup.
* | Issue #19674: inspect.signature() now produces a correct signatureLarry Hastings2013-11-231-0/+44
| | | | | | | | for some builtins.
* | Issue #19433: test_capi: check signness of some C typesVictor Stinner2013-10-291-10/+34
| |
* | Issue #19433: test_capi: add tests on the size of some C typesVictor Stinner2013-10-291-0/+40
| |
* | Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-1/+1
|\ \ | |/ | | | | error messages and comments.
| * Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-1/+1
| | | | | | | | error messages and comments.
* | Fix warning: ‘ptr2’ may be used uninitialized in this functionChristian Heimes2013-08-021-0/+1
| |
* | Test Py_IncRef() and Py_DecRef() C functionsChristian Heimes2013-07-311-0/+11
| |
* | Issue #18112: PEP 442 implementation (safe object finalization).Antoine Pitrou2013-07-301-0/+80
| |
* | Handle yet another potential failure in testcapiChristian Heimes2013-07-261-0/+2
|\ \ | |/ | | | | CID 1058280
| * Handle yet another potential failure in testcapiChristian Heimes2013-07-261-0/+2
| | | | | | | | CID 1058280
* | remove surplus and wrong Py_DECREF() introduced in 33891989c9cfChristian Heimes2013-07-261-1/+0
|\ \ | |/
| * remove surplus and wrong Py_DECREF() introduced in 33891989c9cfChristian Heimes2013-07-261-1/+0
| |
* | Fix memory leaks and add checks for failing malloc() calls to testcapi moduleChristian Heimes2013-07-261-3/+16
|\ \ | |/ | | | | | | CID 1058288 Fix declaration-after-statement of d49f65ff4f3c
| * Fix declaration-after-statement of d49f65ff4f3cChristian Heimes2013-07-261-3/+7
| |
| * Fix memory leaks and add checks for failing malloc() calls to testcapi moduleChristian Heimes2013-07-261-0/+9
| | | | | | | | CID 1058288
* | Fix possible NULL pointer dereferences in testcapi moduleChristian Heimes2013-07-261-1/+7
|\ \ | |/ | | | | | | | | CID 1058280 CID 1058282 CID 1058284
| * Fix possible NULL pointer dereferences in testcapi moduleChristian Heimes2013-07-261-1/+7
| | | | | | | | | | | | CID 1058280 CID 1058282 CID 1058284
* | Add missing check of PyDict_SetItem()'s return valueChristian Heimes2013-07-201-1/+4
|\ \ | |/ | | | | CID 486659
| * Add missing check of PyDict_SetItem()'s return valueChristian Heimes2013-07-201-1/+4
| | | | | | | | CID 486659
* | Issue #3329: Implement the PEP 445Victor Stinner2013-07-071-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new enum: * PyMemAllocatorDomain Add new structures: * PyMemAllocator * PyObjectArenaAllocator Add new functions: * PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() * PyMem_GetAllocator(), PyMem_SetAllocator() * PyObject_GetArenaAllocator(), PyObject_SetArenaAllocator() * PyMem_SetupDebugHooks() Changes: * PyMem_Malloc()/PyObject_Realloc() now always call malloc()/realloc(), instead of calling PyObject_Malloc()/PyObject_Realloc() in debug mode. * PyObject_Malloc()/PyObject_Realloc() now falls back to PyMem_Malloc()/PyMem_Realloc() for allocations larger than 512 bytes. * Redesign debug checks on memory block allocators as hooks, instead of using C macros
* | Revert changeset 6661a8154eb3: Issue #3329: Add new APIs to customize memory ↵Victor Stinner2013-06-151-178/+0
| | | | | | | | | | | | allocators The new API require more discussion.
* | Issue #3329: Add new APIs to customize memory allocatorsVictor Stinner2013-06-141-0/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a new PyMemAllocators structure * New functions: - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree(): GIL-free memory allocator functions - PyMem_GetRawAllocators(), PyMem_SetRawAllocators() - PyMem_GetAllocators(), PyMem_SetAllocators() - PyMem_SetupDebugHooks() - _PyObject_GetArenaAllocators(), _PyObject_SetArenaAllocators() * Add unit test for PyMem_Malloc(0) and PyObject_Malloc(0) * Add unit test for new get/set allocators functions * PyObject_Malloc() now falls back on PyMem_Malloc() instead of malloc() if size is bigger than SMALL_REQUEST_THRESHOLD, and PyObject_Realloc() falls back on PyMem_Realloc() instead of realloc() * PyMem_Malloc() and PyMem_Realloc() now always call malloc() and realloc(), instead of calling PyObject_Malloc() and PyObject_Realloc() in debug mode
* | don't expand the operand to Py_XINCREF/XDECREF/CLEAR/DECREF multiple times ↵Benjamin Peterson2013-05-271-0/+46
| | | | | | | | | | | | (closes #17206) A patch from Illia Polosukhin.
* | Fix memory leak introduced in 15190138d3f3.Ezio Melotti2013-03-071-2/+6
| |
* | Issue #17223: Add another test to check that _PyUnicode_Ready() rejectsVictor Stinner2013-03-051-0/+10
|/ | | | code points bigger than U+10ffff
* Issue #16145: Support legacy strings in the _csv module.Stefan Krah2012-11-021-0/+24
|
* Closes #16126: PyErr_Format format mismatch in _testcapimodule.cJesus Cea2012-10-041-1/+1
|
* Issue #15589: Ensure double-alignment for brute-force capi argument parser testLarry Hastings2012-08-081-1/+1
| | | | that occasionally uses doubles.
* Issue #14769: test_capi now has SkipitemTest, which cleverly checksLarry Hastings2012-06-221-38/+60
| | | | | for "parity" between PyArg_ParseTuple() and the Python/getargs.c static function skipitem() for all possible "format units".
* Issue #14705: Add 'p' format character to PyArg_ParseTuple* for bool support.Larry Hastings2012-05-051-0/+10
|
* Issue #14127: Add st_{cma}time_ns fields to os.stat() result object.Larry Hastings2012-04-191-11/+0
|
* Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo.Martin v. Löwis2012-04-191-0/+24
| | | | Patch by Stefan Behnel.
* Issue #14328: Add keyword-only parameters to PyArg_ParseTupleAndKeywords.Larry Hastings2012-03-201-1/+19
| | | | | | They're optional-only for now (unlike in pure Python) but that's all I needed. The syntax can easily be relaxed if we want to support required keyword-only arguments for extension types in the future.
* Close #14180: Factorize code to convert a number of seconds to time_t, ↵Victor Stinner2012-03-131-6/+39
| | | | | | | | | | | | | timeval or timespec time.ctime(), gmtime(), time.localtime(), datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now raises an OverflowError, instead of a ValueError, if the timestamp does not fit in time_t. datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now round microseconds towards zero instead of rounding to nearest with ties going away from zero.
* Issue #13964: signal.sigtimedwait() timeout is now a float instead of a tupleVictor Stinner2012-03-021-0/+19
| | | | Add a private API to convert an int or float to a C timespec structure.
* - Issue #10181: New memoryview implementation fixes multiple ownershipStefan Krah2012-02-251-91/+0
| | | | | | | | | | | | | | | | | | and lifetime issues of dynamically allocated Py_buffer members (#9990) as well as crashes (#8305, #7433). Many new features have been added (See whatsnew/3.3), and the documentation has been updated extensively. The ndarray test object from _testbuffer.c implements all aspects of PEP-3118, so further development towards the complete implementation of the PEP can proceed in a test-driven manner. Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review and many ideas. - Issue #12834: Fix incorrect results of memoryview.tobytes() for non-contiguous arrays. - Issue #5231: Introduce memoryview.cast() method that allows changing format and shape without making a copy of the underlying memory.
* Check for errors in creating sub-interpreters when testing the C API.Brett Cannon2012-02-031-0/+8
|
* Test running of code in a sub-interpreterAntoine Pitrou2012-01-171-0/+27
|\ | | | | | | (prelude to issue #6531).