summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Add new parser error code, E_OVERFLOW. This error is returned whenJeremy Hylton2000-06-201-0/+3
| | | | | | the number of children of a node exceeds the max possible value for the short that is used to count them. The Python runtime converts this parser error into the SyntaxError "expression too long."
* mark SyntaxError__str__ as METH_VARARGSJeremy Hylton2000-06-201-1/+1
|
* Added a new debug method sys.gettotalrefcount(), which returns the total ↵Mark Hammond2000-06-201-1/+14
| | | | | | number of references on all Python objects. This is only enabled when Py_TRACE_REFS is defined (which includes default debug builds under Windows). Also removed a redundant cast from sys.getrefcount(), as discussed on the patches list.
* Christopher Fandrich <cfandrich@8cs.com>:Fred Drake2000-06-201-3/+6
| | | | Fix memory leak in initializing __debug__.
* Marc-Andre Lemburg <mal@lemburg.com>:Marc-André Lemburg2000-06-071-10/+10
| | | | | | Changed the API names for setting the default encoding. These are now in line with the other hooks API names (no underscores).
* The standard exception classes. Moved here from ../Modules/_exceptions.cBarry Warsaw2000-05-261-0/+994
|
* Added exceptions.o to the list of object to build in this subdir.Barry Warsaw2000-05-261-1/+2
|
* All the exception building related stuff has been moved out of thisBarry Warsaw2000-05-251-190/+1
| | | | | | | | | | | | module and into _exceptions.c. This includes all the PyExc_* globals, the bltin_exc table, init_class_exc(), fini_instances(), finierrors(). Renamed _PyBuiltin_Init_1() to _PyBuiltin_Init() since the two phase initializations are necessary any more. Removed as obsolete _PyBuiltin_Init_2(), _PyBuiltin_Fini_1() and _PyBuiltin_Fini_2().
* Py_Initialize(): Now that standard exceptions are builtin, we don'tBarry Warsaw2000-05-251-11/+11
| | | | | | | | | | need two phase init or fini of the builtin module. Change the call of _PyBuiltin_Init_1() to _PyBuiltin_Init(). Add a call to init_exceptions(). Py_Finalize(): Don't call _PyBuiltin_Fini_1(). Instead call fini_exceptions() but move this to before the thread state is cleared.
* bltin_exc: Removed the leaf_exc flag in the structure, which was onlyBarry Warsaw2000-05-251-35/+29
| | | | used to build the fallback string-based exception.
* Bill Tutt:Guido van Rossum2000-05-111-1/+24
| | | | | Calling Sleep(0) for a spinlock can cause a priority inversion, adding comments to explain what's going on.
* At Bob Kahn's request, add CNRI to the copyright string (but not toGuido van Rossum2000-05-101-1/+5
| | | | the notice yet).
* 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.
* M.-A. Lemburg <mal@lemburg.com>:Fred Drake2000-05-091-0/+37
| | | | | | Added APIs to allow setting and querying the system's current string encoding: sys.set_string_encoding() and sys.get_string_encoding().
* M.-A. Lemburg <mal@lemburg.com>:Fred Drake2000-05-091-9/+5
| | | | | | | Moved some docs to the include file. Added a NULL check to _PyCodec_Lookup() to make it core dump safe.
* M.-A. Lemburg <mal@lemburg.com>:Fred Drake2000-05-091-2/+2
| | | | | Fixed docs according to the new behaviour (the Unicode encoding is no longer fixed to UTF-8).
* Trent Mick:Guido van Rossum2000-05-081-11/+14
| | | | | Change static slice_index() to extern _PyEval_SliceIndex() (with different return value interpretation: 0 for failure, 1 for success).
* 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.
* Andy Dustman: add GNU pth user-space thread support.Guido van Rossum2000-05-082-0/+332
|
* Quick fix by Mark Hammond -- Yakov changed a dprintf call but it wasGuido van Rossum2000-05-051-1/+1
| | | | referencing an undefined variable, so we better change it back.
* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru,Guido van Rossum2000-05-041-25/+113
| | | | | | | | | | | | | | | | | | who wrote: Here's the new version of thread_nt.h. More particular, there is a new version of thread lock that uses kernel object (e.g. semaphore) only in case of contention; in other case it simply uses interlocked functions, which are faster by the order of magnitude. It doesn't make much difference without threads present, but as soon as thread machinery initialised and (mostly) the interpreter global lock is on, difference becomes tremendous. I've included a small script, which initialises threads and launches pystone. With original thread_nt.h, Pystone results with initialised threads are twofold worse then w/o threads. With the new version, only 10% worse. I have used this patch for about 6 months (with threaded and non-threaded applications). It works remarkably well (though I'd desperately prefer Python was free-threaded; I hope, it will soon).
* Add useless 'return 1' to prtrace() to shut up VC++.Guido van Rossum2000-05-041-0/+1
|
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-037-19/+18
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* A bit of cleanup:Guido van Rossum2000-05-031-34/+5
| | | | | | | | | - When 'import exceptions' fails, don't suggest to use -v to print the traceback; this doesn't actually work. - Remove comment about fallback to string exceptions. - Remove a PyErr_Occurred() check after all is said and done that can never trigger. - Remove static function newstdexception() which is no longer called.
* 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.
* PyErr_GivenExceptionMatches(): Check for err==NULL and exc==NULL andBarry Warsaw2000-05-021-2/+6
| | | | | | | | | | return 0 (exceptions don't match). This means that if an ImportError is raised because exceptions.py can't be imported, the interpreter will exit "cleanly" with an error message instead of just core dumping. PyErr_SetFromErrnoWithFilename(), PyErr_SetFromWindowsErrWithFilename(): Don't test on Py_UseClassExceptionsFlag.
* _PyBuiltin_Init_2(): Remove the misleading comment.Barry Warsaw2000-05-021-1/+0
|
* initerrors(): Remove this function. String-based standard exceptionsBarry Warsaw2000-05-021-96/+4
| | | | | | | | | | | | | are no longer supported (i.e. -X option is removed). _PyBuiltin_Init_1(): Don't call initerrors(). This does mean that it is possible to raise an ImportError before that exception has been initialized, say because exceptions.py can't be found, or contains bogosity. See changes to errors.c for how this is handled. _PyBuiltin_Init_2(): Don't test Py_UseClassExceptionsFlag, just go ahead and initialize the class-based standard exceptions. If this fails, we throw a Py_FatalError.
* Py_UseClassExceptionsFlag is deprecated. We keep the C variable for CBarry Warsaw2000-05-021-1/+1
| | | | API consistency, but nothing sets it or checks it now.
* Ignore a bunch of generated files.Barry Warsaw2000-05-021-0/+2
|
* Marc-Andre Lemburg:Guido van Rossum2000-05-011-8/+20
| | | | | | | | | | | Changed all references to the MAGIC constant to use a global pyc_magic instead. This global is initially set to MAGIC, but can be changed by the _PyImport_Init() function to provide for special features implemented in the compiler which are settable using command line switches and affect the way PYC files are generated. Currently this change is only done for the -U flag.
* Marc-Andre Lemburg:Guido van Rossum2000-05-011-0/+1
| | | | Added Py_UnicodeFlag for use by the -U command line option.
* Marc-Andre Lemburg:Guido van Rossum2000-05-011-1/+1
| | | | | | | Support for the new -U command line option option: with the option enabled the Python compiler interprets all "..." strings as u"..." (same with r"..." and ur"...").
* Robin Becker: The following patch seems to fix a module case bug inGuido van Rossum2000-05-011-4/+4
| | | | | 1.6a2 caused by wrong return values in routine allcaps83. [GvR: I also changed the case for end-s>8 to return 0.]
* As Marc-Andre Lemburg points out, the magic number needs to changeGuido van Rossum2000-04-281-1/+1
| | | | because we've added Unicode marshalling to the repertoire.
* Charles G Waldman:Guido van Rossum2000-04-281-36/+49
| | | | | | | | Follow a suggestion in an /*XXX*/ comment [in com_add()] to speed up compilation by using supplemental dictionaries to keep track of names and constants, eliminating quadratic behavior. With this patch in place, the time to import a 5000-line file with lots of constants [at the global level] is reduced from 20 seconds to under 3 on my system.
* Brian Hooper <brian_takashi@hotmail.com>:Fred Drake2000-04-281-1/+31
| | | | | | | | | | | Here's a patch which changes modsupport to add 'u' and 'u#', to support building Unicode objects from a null-terminated Py_UNICODE *, and a Py_UNICODE * with length, respectively. [Conversion from 'U' to 'u' by Fred, based on python-dev comments.] Note that the use of None for NULL values of the Py_UNICODE* value is still in; I'm not sure of the conclusion on that issue.
* Mark Hammond: For Windows debug builds, we now only offer to dumpGuido van Rossum2000-04-271-1/+5
| | | | | | remaining object references if the environment variable PYTHONDUMPREFS exists. The default behaviour caused problems for background or otherwise invisible processes that use the debug build of Python.
* 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).
* Jack Jansen: The new version of the GUSI i/o library on the MacintoshGuido van Rossum2000-04-242-5/+5
| | | | has a few slightly different calls from the old one.
* Jack Jansen: Posix threads are now supported on the Macintosh too.Guido van Rossum2000-04-241-0/+4
|
* Charles Waldman writes:Guido van Rossum2000-04-211-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | """ Running "test_extcall" repeatedly results in memory leaks. One of these can't be fixed (at least not easily!), it happens since this code: def saboteur(**kw): kw['x'] = locals() d = {} saboteur(a=1, **d) creates a circular reference - d['x']['d']==d The others are due to some missing decrefs in ceval.c, fixed by the patch attached below. Note: I originally wrote this without the "goto", just adding the missing decref's where needed. But I think the goto is justified in keeping the executable code size of ceval as small as possible. """ [I think the circular reference is more like kw['x']['kw'] == kw. --GvR]
* Fix PR#7 comparisons of recursive objectsJeremy Hylton2000-04-141-0/+2
| | | | | Note that comparisons of deeply nested objects can still dump core in extreme cases.
* Simplify creation of the version_info value for clarity, perFred Drake2000-04-131-6/+7
| | | | suggestion from Greg Stein.
* Capitulate, changing version_info to a 5-tuple:Fred Drake2000-04-131-12/+18
| | | | | | major, minor, micro, level, serial Values are now monotonically increasing with each new release.
* Define version_info to be a tuple (major, minor, micro, level); levelFred Drake2000-04-131-1/+19
| | | | | | is a string "a2", "b1", "c1", or '' for a final release. Added version_info and hexversion to the module docstring.
* M.-A. Lemburg <mal@lemburg.com>:Fred Drake2000-04-131-2/+23
| | | | | Fixed problem with Unicode string concatenation: u = (u"abc" u"abc") previously dumped core.
* When refering to Unicode characters in exception messages andFred Drake2000-04-131-5/+5
| | | | | docstrings, the documentation guidelines call for "Unicode", not "unicode". Comply.
* ord: provide better error messagesJeremy Hylton2000-04-121-8/+19
|
* 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.