summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Marc-Andre Lemburg:Guido van Rossum2000-04-111-4/+17
| | | | | | | Added special case to unicode(): when being passed a Unicode object as first argument, return the object as-is. Raises an exception when given a Unicode object *and* an encoding name.
* Patch by Vladimir Marangozov to include the function name whenGuido van Rossum2000-04-101-2/+6
| | | | | | | comparing code objects. This give sless surprising results in -Optimized code. It also sorts code objects by name, now. [I changed the patch to hash() slightly to touch fewer lines.]
* Skip Montanaro: add string precisions to calls to PyErr_FormatGuido van Rossum2000-04-102-2/+4
| | | | to prevent possible buffer overruns.
* Vladimir Marangozov: This fixes the line number in the stringGuido van Rossum2000-04-071-4/+2
| | | | | representation of code objects when optimization is on (python -O). It was always reported as -1 instead of the real lineno.
* Marc-Andre's third try at this bulk patch seems to work (except thatGuido van Rossum2000-04-052-13/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | his copy of test_contains.py seems to be broken -- the lines he deleted were already absent). Checkin messages: New Unicode support for int(), float(), complex() and long(). - new APIs PyInt_FromUnicode() and PyLong_FromUnicode() - added support for Unicode to PyFloat_FromString() - new encoding API PyUnicode_EncodeDecimal() which converts Unicode to a decimal char* string (used in the above new APIs) - shortcuts for calls like int(<int object>) and float(<float obj>) - tests for all of the above Unicode compares and contains checks: - comparing Unicode and non-string types now works; TypeErrors are masked, all other errors such as ValueError during Unicode coercion are passed through (note that PyUnicode_Compare does not implement the masking -- PyObject_Compare does this) - contains now works for non-string types too; TypeErrors are masked and 0 returned; all other errors are passed through Better testing support for the standard codecs. Misc minor enhancements, such as an alias dbcs for the mbcs codec. Changes: - PyLong_FromString() now applies the same error checks as does PyInt_FromString(): trailing garbage is reported as error and not longer silently ignored. The only characters which may be trailing the digits are 'L' and 'l' -- these are still silently ignored. - string.ato?() now directly interface to int(), long() and float(). The error strings are now a little different, but the type still remains the same. These functions are now ready to get declared obsolete ;-) - PyNumber_Int() now also does a check for embedded NULL chars in the input string; PyNumber_Long() already did this (and still does) Followed by: Looks like I've gone a step too far there... (and test_contains.py seem to have a bug too). I've changed back to reporting all errors in PyUnicode_Contains() and added a few more test cases to test_contains.py (plus corrected the join() NameError).
* Marc-Andre Lemburg: Error reporting in the codec registry and lookupGuido van Rossum2000-03-311-12/+46
| | | | mechanism is enhanced to be more informative.
* Thomas Heller fixes a typo in an error message.Guido van Rossum2000-03-311-1/+1
|
* rename args variable in CALL_FUNCTION to callargs (avoids nameJeremy Hylton2000-03-311-8/+11
| | | | | | override) add missing DECREFs in error handling code of CALL_FUNCTION
* Change traceback error message to "most recent call last" fromGuido van Rossum2000-03-311-1/+1
| | | | "innermost last". The latter was mysterious to newbies.
* Use modern PyArg_ParseTuple style, with function names.Guido van Rossum2000-03-311-8/+8
| | | | (Mostly.)
* Use modern PyArg_ParseTuple style, with function names.Guido van Rossum2000-03-311-8/+8
|
* Two fixes for extended call syntax:Jeremy Hylton2000-03-301-12/+21
| | | | | | | If a non-tuple sequence is passed as the *arg, convert it to a tuple before checking its length. If named keyword arguments are used in combination with **kwargs, make a copy of kwargs before inserting the new keys.
* eval_code2(): Oops, in the last checkin, we shouldn't check forBarry Warsaw2000-03-291-6/+2
| | | | | PyErr_Occurred(), just set x=NULL and break. Oh, and make Jeremy stop nagging me about the "special" indentation for this block.
* eval_code2(): In the extended calling syntax opcodes, you must checkBarry Warsaw2000-03-291-0/+8
| | | | | | the return value of PySequence_Length(). If an exception occurred, the returned length will be -1. Make sure this doesn't get obscurred, and that the bogus length isn't used.
* remove reference (vestigal) to CALL_FUNCTION_STARJeremy Hylton2000-03-291-1/+1
|
* slightly modified version of Greg Ewing's extended call syntax patchJeremy Hylton2000-03-283-142/+223
| | | | | | | | | | | | | | | | | | | | | | | executive summary: Instead of typing 'apply(f, args, kwargs)' you can type 'f(*arg, **kwargs)'. Some file-by-file details follow. Grammar/Grammar: simplify varargslist, replacing '*' '*' with '**' add * & ** options to arglist Include/opcode.h & Lib/dis.py: define three new opcodes CALL_FUNCTION_VAR CALL_FUNCTION_KW CALL_FUNCTION_VAR_KW Python/ceval.c: extend TypeError "keyword parameter redefined" message to include the name of the offending keyword reindent CALL_FUNCTION using four spaces add handling of sequences and dictionaries using extend calls fix function import_from to use PyErr_Format
* 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:Guido van Rossum2000-03-241-8/+6
| | | | | | Andy Robinson noted a core dump in the codecs.c file. This was introduced by my latest patch which fixed a memory leak in codecs.c. The bug causes all successful codec lookups to fail.
* On 17-Mar-2000, Marc-Andre Lemburg said:Barry Warsaw2000-03-201-2/+12
| | | | | | | | | | | | | Attached you find an update of the Unicode implementation. The patch is against the current CVS version. I would appreciate if someone with CVS checkin permissions could check the changes in. The patch contains all bugs and patches sent this week and also fixes a leak in the codecs code and a bug in the free list code for Unicode objects (which only shows up when compiling Python with Py_DEBUG; thanks to MarkH for spotting this one).
* Christian Tismer's "trashcan" patch:Guido van Rossum2000-03-131-0/+2
| | | | | | | | Added wrapping macros to dictobject.c, listobject.c, tupleobject.c, frameobject.c, traceback.c that safely prevends core dumps on stack overflow. Macros and functions in object.c, object.h. The method is an "elevator destructor" that turns cascading deletes into tail recursive behavior when some limit is hit.
* Marc-Andre Lemburg: add new unicode filesGuido van Rossum2000-03-101-1/+2
|
* Marc-Andre Lemburg: add calls to initialize and finalize Unicode andGuido van Rossum2000-03-101-0/+18
| | | | Codec registry.
* Marc-Andre Lemburg: support marshalling Unicode objects (code 'u').Guido van Rossum2000-03-101-5/+42
|
* Marc-Andre Lemburg: support for Unicode strings; 'U' expects a UnicodeGuido van Rossum2000-03-101-1/+23
| | | | object.
* Marc-Andre Lemburg: support for Unicode string literals (u"...", ur"...").Guido van Rossum2000-03-101-3/+22
|
* Marc-Andre Lemburg: added new builtin functions unicode() andGuido van Rossum2000-03-101-5/+78
| | | | | unichr(); changed ord() to support Unicode strings; added new exception UnicodeError; fixed a typo in doc string for buffer().
* Python Codec Registry and support functions, written by Marc-AndreGuido van Rossum2000-03-101-0/+382
| | | | Lemburg.
* Mark discovered a bug in his patch: he didn't *use* PyExc_WindowsErrorGuido van Rossum2000-03-021-1/+1
| | | | in PyErr_SetFromWindowsErrWithFilename() like he intended to... :-)
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-293-21/+21
| | | | PyArg_ParseTuple() format string arguments as possible.
* Allow using long integers as slice indexesAndrew M. Kuchling2000-02-231-2/+34
|
* Remove comment that Guido agree's doesn't make sense:Fred Drake2000-02-211-2/+0
| | | | | PyEval_EvalCode() is *not* a "backward compatible interface", it's the one to use!
* Mark pointed out a buglet in his patch: i < _sys_nerr isn't strongGuido van Rossum2000-02-211-1/+1
| | | | | enough, it could be negative. Add i > 0 test. (Not i >= 0; zero isn't a valid error number.)
* Patch by Mark Hammond:Guido van Rossum2000-02-171-15/+75
| | | | | | | | | | * Changes to a recent patch by Chris Tismer to errors.c. Chris' patch always used FormatMessage() to get the error message passing the error code from errno - but errno and FormatMessage use a different numbering scheme. The main reason the patch looked OK was that ENOFILE==ERROR_FILE_NOT_FOUND - but that is about the only shared error code :-). The MS CRT docs tell you to use _sys_errlist()/_sys_nerr. My patch does also this, and adds a very similar function specifically for win32 error codes.
* Changes by Mark Hammond related to the new WindowsError exception.Guido van Rossum2000-02-171-0/+6
|
* Patch by Jack Jansen:Guido van Rossum2000-02-141-0/+12
| | | | | | If we attempt to import a dynamic module in a newer (or older) version of Python give an error message tailored to the situation (Python too new/old).
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-202-1/+5
| | | | compilation on NT Alpha. Mostly added casts etc.
* Fix a bug in exec_statement() noted incidentally by Tim Peters inGuido van Rossum2000-01-121-20/+13
| | | | | | | | | PR#175 -- when exec is passed a code object, it didn't sync the locals from the dictionary back into their fast representation. Also took the time to remove some repetitive code there and to do the syncing even when an exception is raised (since a partial effect should still be synced).
* Adjusted apply() docstring based on comments from Gerrit HollFred Drake1999-12-231-3/+4
| | | | <gerrit.holl@pobox.com>.
* Cleanup patches from Greg Stein:Guido van Rossum1999-12-2211-75/+64
| | | | | | | | | | | | | | | | | | | * in import.c, #ifdef out references to dynamic loading based on HAVE_DYNAMIC_LOADING * clean out the platform-specific crud from importdl.c. [ maybe fold this function into import.c and drop the importdl.c file? Greg.] * change GetDynLoadFunc's "funcname" parameter to "shortname". change "name" to "fqname" for clarification. * each GetDynLoadFunc now creates its own funcname value. WARNING: as I mentioned previously, we may run into an issue with a missing "_" on some platforms. Testing will show this pretty quickly, however. * move pathname munging into dynload_shlib.c
* Vladimir Marangozov:Guido van Rossum1999-12-211-1/+1
| | | | | | Here's a patch that avoids a warning caused by the "const char* pathname" declaration for _PyImport_GetDynLoadFunc (in dynload_aix). The "aix_load" function's 1st arg is prototyped as "char *pathname".
* For Windows, need to add #include <windows.h>.Guido van Rossum1999-12-201-0/+1
|
* Support for selecting the correct dynload_<platform>.c file.Guido van Rossum1999-12-201-0/+12
| | | | This is part of a set of patches by Greg Stein.
* In _PyImport_Init(), dynamically construct the table of legal suffixesGuido van Rossum1999-12-201-5/+33
| | | | | | | from two static tables (one standard, one provided by the platform's dynload_*.c variant). This is part of a set of patches by Greg Stein.
* Some rearrangements for the importdl.c restructuring.Guido van Rossum1999-12-201-2/+27
| | | | This is part of a set of patches by Greg Stein.
* Moved most of the platform-specific code to dynload_<platform>.c files.Guido van Rossum1999-12-201-1029/+26
| | | | | | (A few nite remain, these will probably disappear soon.) This is part of a set of patches by Greg Stein.
* The old platform-specific contents of importdl.c, broken down into oneGuido van Rossum1999-12-2010-0/+1347
| | | | | | | file per platform (really: per style of Dl API; e.g. all platforms using dlopen() are grouped together in dynload_shlib.c.). This is part of a set of patches by Greg Stein.
* The cleanup code in com-init() at label fail_0000 should removeGuido van Rossum1999-12-201-1/+1
| | | | c_varnames, not c_lnotab.
* Patch by Vladimir Marangozov, inspired by a bug report from GaryGuido van Rossum1999-11-161-1/+7
| | | | | | | Duzan, for AIX, to support C++ objects with static initializers, when using the genuine IBM C++ compiler (namely xlC/xlC_r). See accompanying patches to configure.in and acconfig.h.