summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
Commit message (Collapse)AuthorAgeFilesLines
* This patch makes sure that the function name always appears in the errorKa-Ping Yee2001-01-151-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.
* vgetargskeywords(): Patch for memory leak identified in bug #119862.Barry Warsaw2000-12-111-0/+1
|
* Clarified some of the error messages, esp. "read-only characterGuido van Rossum2000-12-011-17/+16
| | | | buffer" replaced by "string or read-only character buffer".
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-261-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.
* Special case the "s#" PyArg_Parse() token for Unicode objects:Marc-André Lemburg2000-09-211-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.
* Added B format char to Py_BuildValue (same as b,h,i, but makesJack Jansen2000-09-151-1/+1
| | | | bgen-generated code work).
* This patch hopefully fixes the problem with "es#" and "es" inMarc-André Lemburg2000-09-081-0/+2
| | | | PyArg_ParseTupleAndKeywords() and closes bug #113807.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Changed H specifier to mean "bitfield", i.e. any value fromJack Jansen2000-08-051-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).
* This patch finalizes the move from UTF-8 to a default encoding inMarc-André Lemburg2000-08-031-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.)
* Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters2000-07-221-95/+12
| | | | declarations yet, those come later.
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-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 ;)
* replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton2000-07-121-1/+1
|
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-091-21/+18
|
* Added support for H (unsigned short) specifier in PyArg_ParseTuple andJack Jansen2000-07-061-1/+27
| | | | Py_BuildValue.
* Jack Jansen, Mac patch:Guido van Rossum2000-07-011-0/+3
| | | | Include limits.h if we have it.
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Vladimir Marangozov:Guido van Rossum2000-06-281-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.
* Trent Mick <trentm@activestate.com>:Fred Drake2000-05-091-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.
* Trent Mick:Guido van Rossum2000-05-081-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.
* Brian Hooper <brian_takashi@hotmail.com>:Fred Drake2000-05-031-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.
* Marc-Andre Lemburg:Guido van Rossum2000-04-271-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).
* Marc-Andre Lemburg:Guido van Rossum2000-03-281-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.
* Typo fixed by Mark Hammond.Guido van Rossum2000-03-281-2/+2
|
* Marc-Andre Lemburg:Guido van Rossum2000-03-241-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#".
* Marc-Andre Lemburg: support for Unicode strings; 'U' expects a UnicodeGuido van Rossum2000-03-101-1/+23
| | | | object.
* Patch by Tommy Burnette to accept an arbitrary sequence when "(...)"Guido van Rossum1999-02-171-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.
* Change rare occurrences of #if HAVE_LONG_LONG to #ifdef.Guido van Rossum1999-01-251-2/+2
|
* Implement new format character 't#'. This is like s#, accepting anGuido van Rossum1998-10-081-0/+25
| | | | | object that implements the buffer interface, but requires a buffer that contains 8-bit character data. Greg Stein.
* Patch by Mark Hammond to support 64-bit ints on MS platforms.Guido van Rossum1998-08-251-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.
* Changes for BeOS, QNX and long long, by Chris Herborth.Guido van Rossum1998-08-041-0/+22
|
* Another veeeeeery old patch...Guido van Rossum1998-05-151-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)
* Make new gcc -Wall happyGuido van Rossum1998-04-101-1/+1
|
* Protect PyErr_Format format string argument from overflow (ironically,Guido van Rossum1998-01-191-1/+1
| | | | the error was about a bad format string :-).
* Oops -- '(' is also a legal start character of a new format...Guido van Rossum1997-12-191-0/+1
|
* Add explicit check for correct next character in format at end ofGuido van Rossum1997-12-091-0/+7
| | | | | format. This will complain about illegal formats like "O#" instead of ignoring the '#'.
* Checkin of Jack's buffer mods.Guido van Rossum1997-05-051-25/+89
| | | | Not really checked, but didn't fail any tests either...
* Fix old typo PyArgs_VaParse -> PyArg_VaParse.Guido van Rossum1997-05-051-2/+2
| | | | (Redoing the checking without merging in Jack's buffer mods.)
* Quickly renamed the remaining files -- this directory is done.Guido van Rossum1997-04-291-95/+96
|
* Keep gcc -Wall and Microsoft VC happy.Guido van Rossum1997-04-111-5/+5
|
* Keep gcc -Wall happy.Guido van Rossum1996-12-051-24/+23
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-10/+17
|
* Add needed #include <ctype.h>Guido van Rossum1996-08-211-0/+2
|
* Support for keyword arguments (PyArg_ParseTupleAndKeywords) donated byGuido van Rossum1996-08-191-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).
* Py_complex; and WITHOUT_COMPLEX added to getargs.cGuido van Rossum1996-07-211-2/+4
|
* changes for complex numbersGuido van Rossum1996-01-121-0/+11
|
* don't overwrite error already set (e.g. from O&)Guido van Rossum1995-01-211-1/+3
|
* Added 1995 to copyright message.Guido van Rossum1995-01-041-2/+2
| | | | | | bltinmodule.c: fixed coerce() nightmare in ternary pow(). modsupport.c (initmodule2): pass METH_FREENAME flag to newmethodobject(). pythonrun.c: move flushline() into and around print_error().
* Lots of changes, most minor (fatal() instead of abort(), use ofGuido van Rossum1995-01-021-8/+16
| | | | | | err_fetch/err_restore and so on). But... NOTE: import.c has been rewritten and all the DL stuff is now in the new file importdl.c.