summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #10538. Put a reference to the source object in the Py_buffer whenKristján Valur Jónsson2012-03-221-1/+1
| | | | converting the old buffer for PyArgs_ParseTuple with *s
* Issue #8651: PyArg_Parse*() functions raise an OverflowError if the fileVictor Stinner2011-05-031-1/+11
| | | | | doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int (length bigger than 2^31-1 bytes).
* Issue #8651: Fix "z#" format of PyArg_Parse*() function: the size was notVictor Stinner2011-05-031-4/+5
| | | | written if PY_SSIZE_T_CLEAN is defined.
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-1556/+1556
|
* 14 years later, we still don't know what it's for.Antoine Pitrou2010-04-061-10/+0
| | | | | | | | | | | | | | | | | Spotted by the PyPy developers. Original commit is: branch: trunk user: guido date: Mon Aug 19 21:32:04 1996 +0200 files: Python/getargs.c description: [svn r6499] Support for keyword arguments (PyArg_ParseTupleAndKeywords) donated by 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).
* Backported PyCapsule from 3.1, and converted most uses ofLarry Hastings2010-03-251-8/+26
| | | | CObject to PyCapsule.
* Issue #5080: turn the DeprecationWarning from float arguments passedMark Dickinson2010-01-011-2/+19
| | | | | | to integer PyArg_Parse* format codes into a TypeError. Add a DeprecationWarning for floats passed with the 'L' format code, which didn't previously have a warning.
* - Issue #6624: yArg_ParseTuple with "s" format when parsing argument withSean Reifscheider2009-08-011-1/+1
| | | | NUL: Bogus TypeError detail string.
* #5580: no need to use parentheses when converterr() argument is actually a ↵Georg Brandl2009-04-051-1/+1
| | | | type description.
* fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|'Benjamin Peterson2008-12-221-1/+1
|
* #3668: When PyArg_ParseTuple correctly parses a s* format, but raises anAntoine Pitrou2008-08-291-15/+41
| | | | | | | exception afterwards (for a subsequent parameter), the user code will not call PyBuffer_Release() and memory will leak. Reviewed by Amaury Forgeot d'Arc.
* Fix:Neal Norwitz2008-08-241-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * crashes on memory allocation failure found with failmalloc * memory leaks found with valgrind * compiler warnings in opt mode which would lead to invalid memory reads * problem using wrong name in decimal module reported by pychecker Update the valgrind suppressions file with new leaks that are small/one-time leaks we don't care about (ie, they are too hard to fix). TBR=barry TESTED=./python -E -tt ./Lib/test/regrtest.py -uall (both debug and opt modes) in opt mode: valgrind -q --leak-check=yes --suppressions=Misc/valgrind-python.supp \ ./python -E -tt ./Lib/test/regrtest.py -uall,-bsddb,-compiler \ -x test_logging test_ssl test_multiprocessing valgrind -q --leak-check=yes --suppressions=Misc/valgrind-python.supp \ ./python -E -tt ./Lib/test/regrtest.py test_multiprocessing for i in `seq 1 4000` ; do LD_PRELOAD=~/local/lib/libfailmalloc.so FAILMALLOC_INTERVAL=$i \ ./python -c pass done At least some of these fixes should probably be backported to 2.5.
* Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple,Martin v. Löwis2008-08-121-9/+123
| | | | | | | by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-31/+31
| | | | | | | 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-31/+31
|
* Patch #1691070 from Roger Upole: Speed up PyArg_ParseTupleAndKeywords() and ↵Christian Heimes2008-02-261-154/+109
| | | | | | 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.
* Whitespace normalizationNeal Norwitz2008-02-261-6/+6
|
* Issue #1521: on 64bit platforms, str.decode fails on very long strings.Amaury Forgeot d'Arc2007-11-301-3/+4
| | | | | | The t# and w# formats were not correctly handled. Will backport.
* Forward-port of r52136,52138: a review of overflow-detecting code.Armin Rigo2006-10-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | * unified the way intobject, longobject and mystrtoul handle values around -sys.maxint-1. * in general, trying to entierely avoid overflows in any computation involving signed ints or longs is extremely involved. Fixed a few simple cases where a compiler might be too clever (but that's all guesswork). * more overflow checks against bad data in marshal.c. * 2.5 specific: fixed a number of places that were still confusing int and Py_ssize_t. Some of them could potentially have caused "real-world" breakage. * list.pop(x): fixing overflow issues on x was messy. I just reverted to PyArg_ParseTuple("n"), which does the right thing. (An obscure test was trying to give a Decimal to list.pop()... doesn't make sense any more IMHO) * trying to write a few tests...
* Fix typo.Walter Dörwald2006-09-211-1/+1
|
* Introduce an upper bound on tuple nesting depth inGeorg Brandl2006-08-091-0/+3
| | | | C argument format strings; fixes rest of #1523610.
* Part of bug #1523610: fix miscalculation of buffer length.Georg Brandl2006-07-261-2/+10
| | | | | Also add a guard against NULL in converttuple and add a test case (that previously would have crashed).
* Argh. "integer" is a very confusing word ;)Georg Brandl2006-06-081-2/+2
| | | | | Actually, checking for INT_MAX and INT_MIN is correct since the format code explicitly handles a C "int".
* Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds ↵Georg Brandl2006-06-081-2/+2
| | | | checking.
* C++ compiler cleanup: cast...Skip Montanaro2006-04-181-2/+2
|
* Make Py_BuildValue, PyObject_CallFunction andMartin v. Löwis2006-04-141-0/+12
| | | | PyObject_CallMethod aware of PY_SSIZE_T_CLEAN.
* SF Bug #1454485, array.array('u') could crash the interpreter whenNeal Norwitz2006-04-141-5/+2
| | | | | | | | passing a string. Martin already fixed the actual crash by ensuring Py_UNICODE is unsigned. As discussed on python-dev, this fix removes the possibility of creating a unicode string from a raw buffer. There is an outstanding question of how to fix the crash in 2.4.
* Add a test for Py_ssize_t. Correct typo in getargs.c.Georg Brandl2006-04-131-2/+2
|
* avoid C++ name mangling for the _Py.*SizeT functionsAnthony Baxter2006-04-121-0/+6
|
* Fix C99-ism, and add XXX to commentThomas Wouters2006-03-011-1/+1
|
* Use %zd format characters for Py_ssize_t types.Thomas Wouters2006-03-011-6/+6
|
* Use Py_ssize_t for PyArg_UnpackTuple arguments.Martin v. Löwis2006-03-011-2/+2
|
* Revert backwards-incompatible const changes.Martin v. Löwis2006-02-271-10/+11
|
* Based on discussion with Martin and Thomas on python-checkinsNeal Norwitz2006-02-201-1/+1
| | | | add a Py_SAFE_DOWNCAST() to make the code correct.
* Fix compiler warning on amd64. We can't use zd here since this isNeal Norwitz2006-02-191-2/+2
| | | | ultimately going to snprintf() not the python string formatter. Right?
* Use Py_ssize_t to count theMartin v. Löwis2006-02-161-2/+2
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-60/+202
|
* typoGeorg Brandl2006-01-201-1/+1
|
* Remove extra parensNeal Norwitz2005-12-191-1/+1
|
* Fix SF bug #1072182, problems with signed characters.Neal Norwitz2005-12-191-4/+4
| | | | Most of these can be backported.
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-46/+44
| | | | | | | | | | | | | | | | | | | In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
* Complete format code support in getargs.c::skipitem(), which is called whenGeorg Brandl2005-09-141-59/+39
| | | | evaluating keyword arguments.
* Disallow keyword arguments for type constructors that don't use them.Georg Brandl2005-08-261-0/+26
| | | | (fixes bug #1119418)
* I suppose a bug report or even a fix would be a better response, butMichael W. Hudson2005-03-301-1/+2
| | | | | commit a yelp about a noted flaw the error messages for METH_KEYWORDS functions under some circumstances.
* Revert previous checkin on getargs 'L' code. Try to convert allMartin v. Löwis2005-03-031-1/+0
| | | | | numbers in PyLong_AsLongLong, and update test suite accordingly. Backported to 2.4.
* Clear internal call error in 'L' format. Fixes #723201.Martin v. Löwis2005-03-031-0/+1
| | | | Backported to 2.4.
* FixMichael W. Hudson2004-08-071-9/+7
| | | | | | | | | [ 991812 ] PyArg_ParseTuple can miss errors with warnings as exceptions as suggested in the report. This is definitely a 2.3 candidate (as are most of the checkins I've made in the last month...)
* Add PyArg_VaParseTupleAndKeywords(). Document this function andBrett Cannon2004-07-101-0/+36
| | | | | | PyArg_VaParse(). Closes patch #550732. Thanks Greg Chapman.
* Patch #684981: Add cleanup capability for argument parsers. Fixes 501716.Martin v. Löwis2003-05-031-28/+90
|
* Roll back changes to 'h' format code -- too much breaks. OtherGuido van Rossum2003-04-181-5/+5
| | | | changes stay.