summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-784/+784
| | | | | | | | | | 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-10/+17
| | | | | | | | | | | | | | | | | | | | | 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 ........
* Merged revisions 72357,72367 via svnmerge fromCollin Winter2010-02-031-0/+9
| | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72357 | benjamin.peterson | 2009-05-05 14:09:21 -0700 (Tue, 05 May 2009) | 4 lines fix running test_capi with -R :: Also, fix a refleak in the test that was preventing running. :) ........ r72367 | benjamin.peterson | 2009-05-05 16:00:48 -0700 (Tue, 05 May 2009) | 1 line tabify :( ........
* Merged revisions 68099 via svnmerge fromHirokazu Yamamoto2008-12-311-0/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68099 | hirokazu.yamamoto | 2008-12-31 14:47:19 +0900 | 1 line Just inserted blank line. ........
* Merged revisions 68097 via svnmerge fromHirokazu Yamamoto2008-12-311-1/+2
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68097 | hirokazu.yamamoto | 2008-12-31 14:24:37 +0900 | 1 line Fixed compile error on windows. ........
* Merged revisions 68051 via svnmerge fromNick Coghlan2008-12-301-0/+101
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68051 | nick.coghlan | 2008-12-30 11:18:48 +1000 (Tue, 30 Dec 2008) | 1 line Issue #4701: implicitly call PyType_Ready from PyObject_Hash ........
* Merged revisions ↵Benjamin Peterson2008-12-271-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 67898,67904-67907,67912,67918,67920-67921,67923-67924,67927,67930,67932,67943 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r67898 | benjamin.peterson | 2008-12-21 15:00:53 -0600 (Sun, 21 Dec 2008) | 1 line compute DISTVERSION with patchlevel.py ........ r67904 | benjamin.peterson | 2008-12-22 14:44:58 -0600 (Mon, 22 Dec 2008) | 1 line less attitude ........ r67905 | benjamin.peterson | 2008-12-22 14:51:15 -0600 (Mon, 22 Dec 2008) | 1 line fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|' ........ r67906 | benjamin.peterson | 2008-12-22 14:52:53 -0600 (Mon, 22 Dec 2008) | 1 line add NEWS note ........ r67907 | benjamin.peterson | 2008-12-22 16:12:19 -0600 (Mon, 22 Dec 2008) | 1 line silence compiler warning ........ r67912 | georg.brandl | 2008-12-23 06:37:21 -0600 (Tue, 23 Dec 2008) | 2 lines Fix missing "svn" command. ........ r67918 | georg.brandl | 2008-12-23 09:44:25 -0600 (Tue, 23 Dec 2008) | 2 lines Markup fix. ........ r67920 | benjamin.peterson | 2008-12-23 14:09:28 -0600 (Tue, 23 Dec 2008) | 1 line use a global variable, so the compiler doesn't optimize the assignment out ........ r67921 | benjamin.peterson | 2008-12-23 14:12:33 -0600 (Tue, 23 Dec 2008) | 1 line make global static ........ r67923 | benjamin.peterson | 2008-12-24 09:10:27 -0600 (Wed, 24 Dec 2008) | 1 line #4736 BufferRWPair.closed shouldn't try to call another property as a function ........ r67924 | benjamin.peterson | 2008-12-24 10:10:05 -0600 (Wed, 24 Dec 2008) | 1 line pretend exceptions don't exist a while longer ........ r67927 | benjamin.peterson | 2008-12-26 17:26:30 -0600 (Fri, 26 Dec 2008) | 1 line python version is included in file name now ........ r67930 | hirokazu.yamamoto | 2008-12-26 22:19:48 -0600 (Fri, 26 Dec 2008) | 2 lines Issue #4740: Use HIGHEST_PROTOCOL in pickle test. (There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2) ........ r67932 | alexandre.vassalotti | 2008-12-27 00:36:10 -0600 (Sat, 27 Dec 2008) | 5 lines Remove unnecessary casts related to unicode_decode_call_errorhandler. Make the _PyUnicode_Resize macro a static function. These changes are needed to avoid breaking strict aliasing rules. ........ r67943 | alexandre.vassalotti | 2008-12-27 04:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines Fix bogus unicode tests in pickletester. ........
* Merged revisions 66891 via svnmerge fromAmaury Forgeot d'Arc2008-10-141-0/+4
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r66891 | amaury.forgeotdarc | 2008-10-14 23:47:22 +0200 (mar., 14 oct. 2008) | 5 lines #4122: On Windows, Py_UNICODE_ISSPACE cannot be used in an extension module: compilation fails with "undefined reference to _Py_ascii_whitespace" Will backport to 2.6. ........
* #3643 add a few more checks to _testcapi to prevent segfaultsBenjamin Peterson2008-08-231-4/+20
| | | | | Author: Victor Stinner Reviewer: Benjamin Peterson
* Added garbage collector overhead and optional default return value toRobert Schuppenies2008-07-101-0/+1
| | | | sys.getsizeof.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-3/+3
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-3/+3
|
* Rename the test_traceback_print() function to traceback_print() to preventBrett Cannon2008-04-281-3/+3
| | | | test_capi from automatically calling the function.
* Fix a bug introduced by the warnings rewrite where tracebacks were beingBrett Cannon2008-04-281-0/+19
| | | | | | improperly indented. Closes issue #2699.
* Patch #1691070 from Roger Upole: Speed up PyArg_ParseTupleAndKeywords() and ↵Christian Heimes2008-02-261-0/+18
| | | | | | improve error msg My tests don't show the promised speed up of 10%. The code is as fast as the old code for simple cases and slightly faster for complex cases with several of args and kwargs. But the patch simplifies the code, too.
* Reformat some ugly code.Georg Brandl2008-01-211-26/+39
|
* Patch #1720595: add T_BOOL to the range of structmember types.Georg Brandl2008-01-211-2/+5
| | | | Patch by Angelo Mottola, reviewed by MvL, tests by me.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-1/+1
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-3/+2
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Patch #1733960: Allow T_LONGLONG to accept ints.Martin v. Löwis2007-06-091-3/+27
| | | | Will backport to 2.5.
* Fix crash in test on HP-UX. Apparently, it's not possible to delete a lock ifNeal Norwitz2006-10-281-0/+3
| | | | | | it's held (even by the current thread). Will backport.
* Get DBL_MAX from float.h not values.h. Will backport.Martin v. Löwis2006-10-271-3/+1
|
* Check for values.h. Will backport.Martin v. Löwis2006-10-271-0/+2
|
* Patch #1549049: Rewrite type conversion in structmember.Martin v. Löwis2006-10-271-8/+121
| | | | Fixes #1545696 and #1566140. Will backport to 2.5.
* Change fix for segfaulting property(), add a NEWS entry and a test.Georg Brandl2006-08-041-0/+9
|
* Part of bug #1523610: fix miscalculation of buffer length.Georg Brandl2006-07-261-0/+11
| | | | | Also add a guard against NULL in converttuple and add a test case (that previously would have crashed).
* Remove lie in new comment.Tim Peters2006-05-131-3/+1
|
* Teach PyString_FromFormat, PyErr_Format, and PyString_FromFormatVTim Peters2006-05-131-4/+43
| | | | | | | | | | | | about "%u", "%lu" and "%zu" formats. Since PyString_FromFormat and PyErr_Format have exactly the same rules (both inherited from PyString_FromFormatV), it would be good if someone with more LaTeX Fu changed one of them to just point to the other. Their docs were way out of synch before this patch, and I just did a mass copy+paste to repair that. Not a backport candidate (this is a new feature).
* correct function signatureSkip Montanaro2006-04-181-1/+1
|
* Add a test for Py_ssize_t. Correct typo in getargs.c.Georg Brandl2006-04-131-11/+21
|
* Add PY_SSIZE_T_MIN/MAX to _testcapi.Georg Brandl2006-04-131-0/+2
|
* Fix some warnings on HP-UX when using cc/aCCNeal Norwitz2006-04-101-2/+2
|
* Try to repair at least one segfault on the Mac buildbot,Tim Peters2006-03-211-12/+42
| | | | | | | | | | | | | | | | | | | | | | as diagnosed by Nick Coghlan. test_capi.py: A test module should never spawn a thread as a side effect of being imported. Because this one did, the segfault one of its thread tests caused didn't occur until a few tests after test_regrtest.py thought test_capi was finished. Repair that. Also join() the thread spawned at the end, so that test_capi is truly finished when regrtest reports that it's done. _testcapimodule.c test_thread_state(): this spawns a couple of non-threading.py threads, passing them a PyObject* argument, but did nothing to ensure that those threads finished before returning. As a result, the PyObject* _could_ (although this was unlikely) get decref'ed out of existence before the threads got around to using it. Added explicit synchronization (via a Python mutex) so that test_thread_state can reliably wait for its spawned threads to finish.
* Add tests for the C APIs PyCodec_IncrementalEncoder() andWalter Dörwald2006-03-181-0/+24
| | | | PyCodec_IncrementalDecoder().
* Move test code out of xxmodule and into _testcapimodule.c where it belongs.Neal Norwitz2006-03-151-0/+13
| | | | Will backport.
* Merge ssize_t branch.Martin v. Löwis2006-02-151-1/+2
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Fix silly leak in test used in test_exceptions.Michael W. Hudson2003-08-151-0/+1
|
* New support functions for test_getargs2.Thomas Heller2003-04-241-69/+70
| | | | | Theres now a separate function for each of the format codes b, B, H, I, k, i, l, L, K.
* Get test_capi & test_getargs2 to pass on alphasNeal Norwitz2003-04-221-6/+19
| | | | | | * UINT_MAX -> ULONG_MAX since we are dealing with longs * ParseTuple needs &int for 'i' and &long for 'l' There may be a better way to do this, but this works.
* New PyGILState_ API - implements pep 311, from patch 684256.Mark Hammond2003-04-191-0/+47
|
* SF # 595026: support for masks in getargs.c.Thomas Heller2003-04-171-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New functions: unsigned long PyInt_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); unsigned long PyLong_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *); New and changed format codes: b unsigned char 0..UCHAR_MAX B unsigned char none ** h unsigned short 0..USHRT_MAX H unsigned short none ** i int INT_MIN..INT_MAX I * unsigned int 0..UINT_MAX l long LONG_MIN..LONG_MAX k * unsigned long none L long long LLONG_MIN..LLONG_MAX K * unsigned long long none Notes: * New format codes. ** Changed from previous "range-and-a-half" to "none"; the range-and-a-half checking wasn't particularly useful. New test test_getargs2.py, to verify all this.
* Rename LONG_LONG to PY_LONG_LONG. Fixes #710285.Martin v. Löwis2003-03-291-5/+5
|
* _PyLong_NumBits(): The definition of this was too specific to the quirkyTim Peters2003-01-311-21/+27
| | | | | | | | | needs of pickling longs. Backed off to a definition that's much easier to understand. The pickler will have to work a little harder, but other uses are more likely to be correct <0.5 wink>. _PyLong_Sign(): New teensy function to characterize a long, as to <0, ==0, or >0.
* Added new private API function _PyLong_NumBits. This will be used at theTim Peters2003-01-281-2/+39
| | | | | | | start for the C implemention of new pickle LONG1 and LONG4 opcodes (the linear-time way to pickle a long is to call _PyLong_AsByteArray, but the caller has no idea how big an array to allocate, and correct calculation is a bit subtle).
* Replace DL_IMPORT with PyMODINIT_FUNC and remove "/export:init..." linkMark Hammond2002-07-231-1/+1
| | | | | command line for Windows builds. This should allow MSVC to import and build the Python MSVC6 project files without error.
* Switch to using METH_NOARGS where possible.Fred Drake2002-04-011-38/+18
| | | | Convert to use PyModule_*() instead of manipulating the module dict directly.
* Fixed "u#" parser marker to pass through Unicode objects as-is withoutMarc-André Lemburg2002-01-091-0/+50
| | | | | | going through the buffer interface API. Added tests for this to the _testcapi module and updated docs.
* sprintf -> PyOS_snprintf in some "obviously safe" cases.Tim Peters2001-11-281-2/+3
| | | | | Also changed <>-style #includes to ""-style in some places where the former didn't make sense.