summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
Commit message (Collapse)AuthorAgeFilesLines
* 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).
| * Test running of code in a sub-interpreterAntoine Pitrou2012-01-171-0/+27
| | | | | | | | (prelude to issue #6531).
| * Issue #13093: Fix error handling on PyUnicode_EncodeDecimal()Victor Stinner2011-11-221-2/+49
| | | | | | | | | | * Add tests for PyUnicode_EncodeDecimal() and PyUnicode_TransformDecimalToASCII() * Remove the unused "e" variable in replace()
| * Merged revisions 88550 via svnmerge fromAntoine Pitrou2011-02-241-0/+11
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88550 | antoine.pitrou | 2011-02-24 21:50:49 +0100 (jeu., 24 févr. 2011) | 4 lines Issue #11286: Raise a ValueError from calling PyMemoryView_FromBuffer with a buffer struct having a NULL data pointer. ........
* | Write tests for invalid characters (U+00110000)Victor Stinner2011-12-091-0/+18
| | | | | | | | | | | | | | | | | | Test the following functions: * codecs.raw_unicode_escape_decode() * PyUnicode_FromWideChar() * PyUnicode_FromUnicode() * "unicode_internal" and "unicode_escape" decoders
* | Rewrite PyUnicode_EncodeDecimal() to use the new Unicode APIVictor Stinner2011-11-211-2/+49
| | | | | | | | | | Add tests for PyUnicode_EncodeDecimal() and PyUnicode_TransformDecimalToASCII().
* | test_widechar() uses the new Unicode APIVictor Stinner2011-11-211-1/+1
| | | | | | | | PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()
* | Use PyUnicode_CompareWithASCIIString() instead of Py_UNICODE_strcmp() to avoidVictor Stinner2011-11-201-2/+1
| | | | | | | | the deprecate Py_UNICODE type
* | Use the new Py_ARRAY_LENGTH macroVictor Stinner2011-09-281-1/+1
| |
* | Implement PEP 393.Martin v. Löwis2011-09-281-1/+1
| |
* | Issue #12909: Make PyLong_As* functions consistent in their use of exceptions.Nadeem Vawda2011-09-071-0/+64
| | | | | | | | | | | | PyLong_AsDouble() and PyLong_AsUnsignedLongLong() now raise TypeError (rather than SystemError) when passed a non-integer argument, matching the behavior of all the other PyLong_As*() functions.
* | Issue #12380: PyArg_ParseTuple now accepts a bytearray for the 'c' format.Eli Bendersky2011-07-291-0/+10
| | | | | | | | | | | | | | As a side effect, this now allows the rjust, ljust and center methods of bytes and bytearray to accept a bytearray argument. Patch by Petri Lehtinen
* | Issue #10833: Use PyErr_Format() and PyUnicode_FromFormat() instead ofVictor Stinner2011-03-211-8/+1
| | | | | | | | | | PyOS_snprintf() to avoid temporary buffer allocated on the stack and a conversion from bytes to Unicode.
* | Issue #10833: Use PyUnicode_FromFormat() and PyErr_Format() instead ofVictor Stinner2011-03-211-4/+2
| | | | | | | | PyOS_snprintf().
* | Issue #11286: Raise a ValueError from calling PyMemoryView_FromBuffer withAntoine Pitrou2011-02-241-0/+11
|/ | | | a buffer struct having a NULL data pointer.
* test_unicode: use ctypes to test PyUnicode_FromFormat()Victor Stinner2011-01-051-12/+0
| | | | | Instead of _testcapi.format_unicode() because it has a limited API: it requires exactly one argument of type unicode.
* Issue #9566: use Py_ssize_t instead of intVictor Stinner2011-01-041-1/+1
|
* Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for ↵Alexander Belopolsky2010-12-081-9/+10
| | | | NULL
* Merge branches/pep-0384.Martin v. Löwis2010-12-031-1/+1
|
* Issue #10359: Remove ";" after function definition, invalid in ISO CVictor Stinner2010-11-091-1/+1
|
* Issue #10185: use Py_hash_t instead of longAntoine Pitrou2010-10-231-1/+1
|
* PyUnicode_AsWideCharString() takes a PyObject*, not a PyUnicodeObject*Victor Stinner2010-10-071-1/+1
| | | | | All unicode functions uses PyObject* except PyUnicode_AsWideChar(). Fix the prototype for the new function PyUnicode_AsWideCharString().
* Issue #8670: Rename testcapi unicode test methodsVictor Stinner2010-10-021-4/+4
| | | | | * test_aswidechar() => unicode_aswidechar() * test_aswidecharstring() => unicode_aswidecharstring()
* Oops, revert unwanted _testcapi changes of r85174Victor Stinner2010-10-021-4/+4
|
* Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_tVictor Stinner2010-10-021-4/+4
|
* Issue #8870: PyUnicode_AsWideCharString() doesn't count the trailing nul ↵Victor Stinner2010-10-021-9/+63
| | | | | | character And write unit tests for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString().
* Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error onVictor Stinner2010-09-111-0/+12
| | | | | | a non-ASCII byte in the format string. Document also the encoding.
* Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, useVictor Stinner2010-06-251-0/+23
| | | | "w*" format instead. Add tests for "w*" format.
* Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"Victor Stinner2010-06-131-1/+165
| | | | | formats if the string contains a null byte/character. Write unit tests for string formats.
* Fix test_capi in !pydebug mode, where my original attempt segfaulted withoutJeffrey Yasskin2010-05-171-1/+5
| | | | | producing the expected error message. The test only tests what it's supposed to test in pydebug mode though. Fixes issue 8726.
* Make PyErr_Occurred return NULL if there is no current thread. Previously itJeffrey Yasskin2010-05-131-0/+12
| | | | | | | would Py_FatalError, which called PyErr_Occurred, resulting in a semi-infinite recursion. Fixes issue 3605.
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-1673/+1673
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Merged revisions 79661 via svnmerge fromMark Dickinson2010-04-031-9/+16
| | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79661 | mark.dickinson | 2010-04-03 11:27:05 +0100 (Sat, 03 Apr 2010) | 14 lines Fix a couple of issues with the test_structmembersType class in _testcapimodule - rename to _test_structmembersType to avoid the class being automatically called by test_capi - allow space for trailing NUL in inplace_member field of all_structmembers - use T_STRING_INPLACE instead of T_INPLACE_STRING as keyword argument to _test_structmembersType initializer - don't attempt to initialize inplace_member field if T_STRING_INPLACE argument wasn't supplied. ........
* Merged revisions 79642,79644 via svnmerge fromBenjamin Peterson2010-04-031-3/+14
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79642 | benjamin.peterson | 2010-04-02 20:08:34 -0500 (Fri, 02 Apr 2010) | 1 line split out large test function ........ r79644 | benjamin.peterson | 2010-04-02 20:28:57 -0500 (Fri, 02 Apr 2010) | 1 line give TypeError when trying to set T_STRING_INPLACE ........
* Issue #8014: Fix PyLong_As<c-integer-type> methods not to produce anMark Dickinson2010-03-131-4/+7
| | | | | internal error on non-integer input: they now raise TypeError instead. This is needed for attributes declared via PyMemberDefs.
* Revert an earlier attempt (r76810) to fix the intermittent test_capi ↵Mark Dickinson2010-02-131-15/+0
| | | | failures fixed in r78172.
* Issue #7924: Fix an intermittent 'XXX undetected error' crash inMark Dickinson2010-02-131-0/+2
| | | | | test_capi, due to test_capsule failing to clear an exception. Many thanks to Florent Xicluna for the diagnosis and fix.
* Followup to r77918: fix build under Windows.Antoine Pitrou2010-02-041-1/+2
|
* Merged revisions 77866-77867 via svnmerge fromBenjamin Peterson2010-02-031-4/+15
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77866 | benjamin.peterson | 2010-01-30 17:26:05 -0600 (Sat, 30 Jan 2010) | 1 line move test outside WITH_THREAD section ........ r77867 | benjamin.peterson | 2010-01-30 17:28:38 -0600 (Sat, 30 Jan 2010) | 1 line be robust against test being run over and over (such as -R) ........
* Merged revisions 77916 via svnmerge fromAntoine Pitrou2010-02-021-0/+90
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77916 | antoine.pitrou | 2010-02-02 23:36:17 +0100 (mar., 02 févr. 2010) | 4 lines Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer` fails. Patch by Florent Xicluna. ........
* Merged revisions 77842 via svnmerge fromMark Dickinson2010-01-301-0/+167
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77842 | mark.dickinson | 2010-01-30 10:08:33 +0000 (Sat, 30 Jan 2010) | 4 lines Issue #7767: Add new C-API function PyLong_AsLongLongAndOverflow, a long long variant of PyLong_AsLongAndOverflow. Patch by Case Van Horsen. ........