summaryrefslogtreecommitdiff
path: root/Python/getargs.c
AgeCommit message (Collapse)AuthorLines
2001-06-27Backport Jeremy's checkin 2.57:Thomas Wouters-9/+7
vgetargs1() and vgetargskeywords(): Replace uses of PyTuple_Size() and PyTuple_GetItem() with PyTuple_GET_SIZE() and PyTuple_GET_ITEM(). The code has already done a PyTuple_Check().
2001-02-12Related to SF bug 132008 (PyList_Reverse blows up).Tim Peters-0/+2
_testcapimodule.c make sure PyList_Reverse doesn't blow up again getargs.c assert args isn't NULL at the top of vgetargs1 instead of waiting for a NULL-pointer dereference at the end
2001-01-25Better error message when non-dictionary received for **kwargJeremy Hylton-2/+7
2001-01-15This patch makes sure that the function name always appears in the errorKa-Ping Yee-26/+35
message, and tries to make the messages more consistent and helpful when the wrong number of arguments or duplicate keyword arguments are supplied. Comes with more tests for test_extcall.py and and an update to an error message in test/output/test_pyexpat.
2000-12-11vgetargskeywords(): Patch for memory leak identified in bug #119862.Barry Warsaw-0/+1
2000-12-01Clarified some of the error messages, esp. "read-only characterGuido van Rossum-17/+16
buffer" replaced by "string or read-only character buffer".
2000-09-26Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake-3/+0
Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
2000-09-21Special case the "s#" PyArg_Parse() token for Unicode objects:Marc-André Lemburg-26/+53
"s#" will now return a pointer to the default encoded string data of the Unicode object instead of a pointer to the raw UTF-16 data. The latter is still available via PyObject_AsReadBuffer(). The patch also adds an optimization for string objects which is based on the fact that string objects return the raw character data for getreadbuffer access and are always single-segment.
2000-09-15Added B format char to Py_BuildValue (same as b,h,i, but makesJack Jansen-1/+1
bgen-generated code work).
2000-09-08This patch hopefully fixes the problem with "es#" and "es" inMarc-André Lemburg-0/+2
PyArg_ParseTupleAndKeywords() and closes bug #113807.
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-08-05Changed H specifier to mean "bitfield", i.e. any value fromJack Jansen-5/+27
-32768..65535 is acceptable. Added B specifier (with values from -128..255). No L added (which would have completed the set) because l already accepts any value (and the letter L is taken for quadwords).
2000-08-03This patch finalizes the move from UTF-8 to a default encoding inMarc-André Lemburg-4/+6
the Python Unicode implementation. The internal buffer used for implementing the buffer protocol is renamed to defenc to make this change visible. It now holds the default encoded version of the Unicode object and is calculated on demand (NULL otherwise). Since the default encoding defaults to ASCII, this will mean that Unicode objects which hold non-ASCII characters will no longer work on C APIs using the "s" or "t" parser markers. C APIs must now explicitly provide Unicode support via the "u", "U" or "es"/"es#" parser markers in order to work with non-ASCII Unicode strings. (Note: this patch will also have to be applied to the 1.6 branch of the CVS tree.)
2000-07-22Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters-95/+12
declarations yet, those come later.
2000-07-16Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters-1/+1
comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-12replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton-1/+1
2000-07-09Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters-20/+17
2000-07-06Added support for H (unsigned short) specifier in PyArg_ParseTuple andJack Jansen-1/+27
Py_BuildValue.
2000-07-01Jack Jansen, Mac patch:Guido van Rossum-0/+3
Include limits.h if we have it.
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-06-28Vladimir Marangozov:Guido van Rossum-8/+8
This patch fixes a problem on AIX with the signed int case code in getargs.c, after Trent Mick's intervention about MIN/MAX overflow checks. The AIX compiler/optimizer generates bogus code with the default flags "-g -O" causing test_builtin to fail: int("10", 16) <> 16L. Swapping the two checks in the signed int code makes the problem go away. Also, make the error messages fit in 80 char lines in the source.
2000-05-09Trent Mick <trentm@activestate.com>:Fred Drake-12/+12
Limit the 'b' formatter of PyArg_ParseTuple to valid values of an unsigned char, i.e. [0,UCHAR_MAX]. It is expected that this is the common usage of 'b'. An OverflowError is raised if the parsed value is outside this range.
2000-05-08Trent Mick:Guido van Rossum-14/+44
Changes the 'b', 'h', and 'i' formatters in PyArg_ParseTuple to raise an Overflow exception if they overflow (previously they just silently overflowed). Changes by Guido: always accept values [0..255] (in addition to [CHAR_MIN..CHAR_MAX]) for 'b' format; changed some spaces into tabs in other code.
2000-05-03Brian Hooper <brian_takashi@hotmail.com>:Fred Drake-0/+32
Added 'u' and 'u#' tags for PyArg_ParseTuple - these turn a PyUnicodeObject argument into a Py_UNICODE * buffer, or a Py_UNICODE * buffer plus a length with the '#'. Also added an analog to 'U' for Py_BuildValue.
2000-04-27Marc-Andre Lemburg:Guido van Rossum-2/+7
Fixed a memory leak found by Fredrik Lundh. Instead of PyUnicode_AsUTF8String() we now use _PyUnicode_AsUTF8String() which returns the string object without incremented refcount (and assures that the so obtained object remains alive until the Unicode object is garbage collected).
2000-03-28Marc-Andre Lemburg:Guido van Rossum-2/+2
The attached patch set includes a workaround to get Python with Unicode compile on BSDI 4.x (courtesy Thomas Wouters; the cause is a bug in the BSDI wchar.h header file) and Python interfaces for the MBCS codec donated by Mark Hammond. Also included are some minor corrections w/r to the docs of the new "es" and "es#" parser markers (use PyMem_Free() instead of free(); thanks to Mark Hammond for finding these). The unicodedata tests are now in a separate file (test_unicodedata.py) to avoid problems if the module cannot be found.
2000-03-28Typo fixed by Mark Hammond.Guido van Rossum-2/+2
2000-03-24Marc-Andre Lemburg:Guido van Rossum-0/+118
Attached you find the latest update of the Unicode implementation. The patch is against the current CVS version. It includes the fix I posted yesterday for the core dump problem in codecs.c (was introduced by my previous patch set -- sorry), adds more tests for the codecs and two new parser markers "es" and "es#".
2000-03-10Marc-Andre Lemburg: support for Unicode strings; 'U' expects a UnicodeGuido van Rossum-1/+23
object.
1999-02-17Patch by Tommy Burnette to accept an arbitrary sequence when "(...)"Guido van Rossum-7/+10
is used in the format string, instead of requiring a tuple. This is in line with the general trend towards accepting arbitrary sequences.
1999-01-25Change rare occurrences of #if HAVE_LONG_LONG to #ifdef.Guido van Rossum-2/+2
1998-10-08Implement new format character 't#'. This is like s#, accepting anGuido van Rossum-0/+25
object that implements the buffer interface, but requires a buffer that contains 8-bit character data. Greg Stein.
1998-08-25Patch by Mark Hammond to support 64-bit ints on MS platforms.Guido van Rossum-6/+6
The MS compiler doesn't call it 'long long', it uses __int64, so a new #define, LONG_LONG, has been added and all occurrences of 'long long' are replaced with it.
1998-08-04Changes for BeOS, QNX and long long, by Chris Herborth.Guido van Rossum-0/+22
1998-05-15Another veeeeeery old patch...Guido van Rossum-9/+11
Date: Thu, 14 Sep 1995 12:18:20 -0400 From: Alan Morse <alan@dvcorp.com> To: python-list@cwi.nl Subject: getargs bug in 1.2 and 1.3 BETA We have found a bug in the part of the getargs code that we added and submitted, and which was incorporated into 1.1. The parsing of "O?" format specifiers is not handled correctly; there is no "else" for the "if" and therefore it can never fail. What's worse, the advancing of the varargs pointer is not handled properly, so from then on it is out of sync, wreaking all sorts of havoc. (If it had failed properly, then the out-of-sync varargs would not have been an issue.) Below is the context diff for the change. Note that I have made a few stylistic changes beyond adding the else case, namely: 1) Making the "O" case follow the convention established by the other format specifiers of getting all their vararg arguments before performing the test, rather than getting some before and some after the test passes. 2) Making the logic of the tests parallel, so the "if" part indicates that the format is accepted and the "else" part indicates that the format has failed. They were inconsistent with each other and with the the other format specifiers. -Alan Morse (amorse@dvcorp.com)
1998-04-10Make new gcc -Wall happyGuido van Rossum-1/+1
1998-01-19Protect PyErr_Format format string argument from overflow (ironically,Guido van Rossum-1/+1
the error was about a bad format string :-).
1997-12-19Oops -- '(' is also a legal start character of a new format...Guido van Rossum-0/+1
1997-12-09Add explicit check for correct next character in format at end ofGuido van Rossum-0/+7
format. This will complain about illegal formats like "O#" instead of ignoring the '#'.
1997-05-05Checkin of Jack's buffer mods.Guido van Rossum-25/+89
Not really checked, but didn't fail any tests either...
1997-05-05Fix old typo PyArgs_VaParse -> PyArg_VaParse.Guido van Rossum-2/+2
(Redoing the checking without merging in Jack's buffer mods.)
1997-04-29Quickly renamed the remaining files -- this directory is done.Guido van Rossum-95/+96
1997-04-11Keep gcc -Wall and Microsoft VC happy.Guido van Rossum-5/+5
1996-12-05Keep gcc -Wall happy.Guido van Rossum-24/+23
1996-10-25New permission notice, includes CNRI.Guido van Rossum-9/+16
1996-08-21Add needed #include <ctype.h>Guido van Rossum-0/+2
1996-08-19Support for keyword arguments (PyArg_ParseTupleAndKeywords) donated byGuido van Rossum-3/+383
Geoff Philbrick <philbric@delphi.hks.com> (slightly changed by me). Also a little change to make the file acceptable to K&R C compilers (HPUX, SunOS 4.x).
1996-07-21Py_complex; and WITHOUT_COMPLEX added to getargs.cGuido van Rossum-2/+4
1996-01-12changes for complex numbersGuido van Rossum-0/+11