summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
Commit message (Collapse)AuthorAgeFilesLines
* remove support for missing ANSI C header files (limits.h, stddef.h, etc).Skip Montanaro2004-02-101-4/+0
|
* Py_Finalize(): disabled the second call of cyclic gc, and added extensiveTim Peters2003-12-011-2/+27
| | | | | | | comments about why both calls to cyclic gc here can cause problems. I'll backport to 2.3 maint. Since the calls were introduced in 2.3, that will be the end of it.
* Getting rid of all the code inside #ifdef macintosh too.Jack Jansen2003-11-201-14/+0
|
* Getting rid of support for the ancient Apple MPW compiler.Jack Jansen2003-11-191-12/+0
|
* Patch #804543: strdup saved locales. Backported to 2.3.Martin v. Löwis2003-11-131-1/+2
|
* Simplify and speedup uses of Py_BuildValue():Raymond Hettinger2003-10-121-1/+1
| | | | | | * Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a)
* Fix refcounting and cut & paste error (?) in last checkin.Michael W. Hudson2003-08-111-3/+1
| | | | This should go onto release23-maint, too.
* Move initialization of sys.std{in,out}.encoding to Py_Initialize.Martin v. Löwis2003-08-091-15/+51
| | | | | Verify that the encoding actually exists. Fixes #775985. Will backport to 2.3.
* Correct previous patch looking for warnings module: sys.modules, notMark Hammond2003-07-161-1/+1
| | | | sys.__modules__.
* Fix [ 771097 ] frozen programs fail due to implicit import of "warnings".Mark Hammond2003-07-151-5/+36
| | | | | | If the initial import of warnings fails, clear the error. When the module is actually needed, if the original import failed, see if it has managed to find its way to sys.modules yet and if so, remember it.
* PyGILState cleanup was too early - destructors called via module cleanup may ↵Mark Hammond2003-04-221-5/+5
| | | | use the API.
* handle_system_exit(): This leaked the current exception info, inTim Peters2003-04-191-4/+16
| | | | | | | particular leaving the traceback object (and everything reachable from it) alive throughout shutdown. The patch is mostly from Guido. Bugfix candidate.
* New PyGILState_ API - implements pep 311, from patch 684256.Mark Hammond2003-04-191-0/+15
|
* _Py_PrintReferences(): Changed to print object address at start of eachTim Peters2003-04-171-2/+9
| | | | | | | | | | | | | | | new line. New pvt API function _Py_PrintReferenceAddresses(): Prints only the addresses and refcnts of the live objects. This is always safe to call, because it has no dependence on Python's C API. Py_Finalize(): If envar PYTHONDUMPREFS is set, call (the new) _Py_PrintReferenceAddresses() right before dumping final pymalloc stats. We can't print the reprs of the objects here because too much of the interpreter has been shut down. You need to correlate the addresses displayed here with the object reprs printed by the earlier PYTHONDUMPREFS call to _Py_PrintReferences().
* - New C API PyGC_Collect(), same as calling gc.collect().Guido van Rossum2003-04-171-0/+8
| | | | | - Call this in Py_Finalize(). - Expand the Misc/NEWS text on PY_LONG_LONG.
* A missing piece of the PEP 269 patch: add PyParser_SetError(), aGuido van Rossum2003-04-171-0/+9
| | | | wrapper around err_input().
* Trimmed trailing whitespace.Tim Peters2003-04-171-10/+10
|
* Py_Finalize(): Reverted recent changes that tried to move theTim Peters2003-04-171-8/+11
| | | | | | | | PYTHONDUMPREFS output after most teardown. Attempts to use PYTHONDUMPREFS with the Zope3 test suite died with Py_FatalError(), since _Py_PrintReferences() can end up executing arbitrary Python code (for objects that override __repr__), and that requires an intact interpreter.
* - pythunrun.c, Py_Finalize(): move the call to _Py_PrintReferences()Guido van Rossum2003-04-151-8/+8
| | | | | | | | | | | | | | | | | | | even farther down, to just before the call to _PyObject_DebugMallocStats(). This required the following changes: - pystate.c, PyThreadState_GetDict(): changed not to raise an exception or issue a fatal error when no current thread state is available, but simply return NULL without raising an exception (ever). - object.c, Py_ReprEnter(): when PyThreadState_GetDict() returns NULL, don't raise an exception but return 0. This means that when printing a container that's recursive, printing will go on and on and on. But that shouldn't happen in the case we care about (see first bullet). - Updated Misc/NEWS and Doc/api/init.tex to reflect changes to PyThreadState_GetDict() definition.
* Move the call to _Py_PrintReferences() a bit further down. ThisGuido van Rossum2003-04-151-7/+12
| | | | | prevents it from showing stuff (like codec state) that is cleared when the interpreter state is cleared.
* Move declaration of enc to scope where it is usedNeal Norwitz2003-04-101-2/+1
|
* Fixed SF bug #663074. The codec system was using global staticGustavo Niemeyer2003-03-191-8/+0
| | | | | | | | | variables to store internal data. As a result, any atempts to use the unicode system with multiple active interpreters, or successive interpreter executions, would fail. Now that information is stored into members of the PyInterpreterState structure.
* Declare all variables at the start of their scope.Fred Drake2003-03-051-1/+1
|
* Always initialize Py_FileSystemDefaultEncoding on Unix in Py_Initialize,Martin v. Löwis2003-03-051-0/+28
| | | | | and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding. Adjust test case.
* Addendum to #683658:Just van Rossum2003-02-251-2/+2
| | | | | | import warnings.py _after_ site.py has run. This ensures that site.py is again the first .py to be imported, giving it back full control over sys.path.
* Fix bug 683658 - PyErr_Warn may cause import deadlock.Mark Hammond2003-02-191-0/+11
|
* - Finally fixed the bug in compile() and exec where a string endingGuido van Rossum2003-02-131-6/+2
| | | | | | | | | with an indented code block but no newline would raise SyntaxError. This would have been a four-line change in parsetok.c... Except codeop.py depends on this behavior, so a compilation flag had to be invented that causes the tokenizer to revert to the old behavior; this required extra changes to 2 .h files, 2 .c files, and 2 .py files. (Fixes SF bug #501622.)
* MacPython-OS9 has had an abort() function for quite a while now, so there's ↵Jack Jansen2003-01-241-3/+0
| | | | no reason to stall in an endless loop, just call abort() on a fatal error.
* Patch #671459: Invoke import hooks in Py_NewInterpreter.Martin v. Löwis2003-01-221-0/+1
|
* Since the *_Init() are private, prefix with _, suggested by SkipNeal Norwitz2002-12-311-2/+2
|
* SF #561244, Micro optimizationsNeal Norwitz2002-12-301-0/+6
| | | | | | Initialize the small integers and __builtins__ in startup. This removes some if conditions. Change XDECREF to DECREF for values which shouldn't be NULL.
* PEP 302 + zipimport:Just van Rossum2002-12-301-0/+2
| | | | | | | | | | | | | - new import hooks in import.c, exposed in the sys module - new module called 'zipimport' - various changes to allow bootstrapping from zip files I hope I didn't break the Windows build (or anything else for that matter), but then again, it's been sitting on sf long enough... Regarding the latest discussions on python-dev: zipimport sets pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as /path/to/Archive.zip/subdir/ are supported again.
* Added missing casts.Jack Jansen2002-12-131-2/+2
|
* Constify filenames and scripts. Fixes #651362.Martin v. Löwis2002-12-111-41/+41
|
* Remove _Py_ResetReferences. Fixes bug #529750 "Circular reference makesNeil Schemenauer2002-11-171-4/+0
| | | | | | Py_Init crash". refchain cannot be cleared because objects can live across Py_Finalize() and Py_Initialize() if they are kept alive by circular references.
* If we have a filename and __main__.__file__ hasn't already been set,Fred Drake2002-10-171-1/+11
| | | | | set it. Closes SF issue #624729.
* s/_alloca/alloca/g; Windows doesn't need the former, at least not unlessTim Peters2002-10-051-2/+2
| | | | __STDC__ is defined (or something like that ...).
* provide less mysterious error messages when seeing end-of-line inSkip Montanaro2002-08-151-0/+6
| | | | | single-quoted strings or end-of-file in triple-quoted strings. closes patch 586561.
* Patch #534304: Implement phase 1 of PEP 263.Martin v. Löwis2002-08-041-0/+13
|
* _Py_AskYesNo(): Removed this function. It was defined only in aTim Peters2002-07-091-20/+0
| | | | Py_TRACE_REFS build, but wasn't referenced.
* Fix SF Bug 564931: compile() traceback must include filename.Thomas Heller2002-07-091-2/+27
|
* The Py_REF_DEBUG/COUNT_ALLOCS/Py_TRACE_REFS macro minefield: addedTim Peters2002-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | more trivial lexical helper macros so that uses of these guys expand to nothing at all when they're not enabled. This should help sub- standard compilers that can't do a good job of optimizing away the previous "(void)0" expressions. Py_DECREF: There's only one definition of this now. Yay! That was that last one in the family defined multiple times in an #ifdef maze. Py_FatalError(): Changed the char* signature to const char*. _Py_NegativeRefcount(): New helper function for the Py_REF_DEBUG expansion of Py_DECREF. Calling an external function cuts down on the volume of generated code. The previous inline expansion of abort() didn't work as intended on Windows (the program often kept going, and the error msg scrolled off the screen unseen). _Py_NegativeRefcount calls Py_FatalError instead, which captures our best knowledge of how to abort effectively across platforms.
* Patch #569753: Remove support for WIN16.Martin v. Löwis2002-06-301-3/+3
| | | | Rename all occurrences of MS_WIN32 to MS_WINDOWS.
* Ignore SIGXFSZ.Jeremy Hylton2002-04-231-0/+3
| | | | | | | | | | | | The SIGXFSZ signal is sent when the maximum file size limit is exceeded (RLIMIT_FSIZE). Apparently, it is also sent when the 2GB file limit is reached on platforms without large file support. The default action for SIGXFSZ is to terminate the process and dump core. When it is ignored, the system call that caused the limit to be exceeded returns an error and sets errno to EFBIG. Python always checks errno on I/O syscalls, so there is nothing to do with the signal.
* _PyObject_DebugDumpStats: renamed to _PyObject_DebugMallocStats.Tim Peters2002-04-131-0/+5
| | | | | | Added code to call this when PYMALLOC_DEBUG is enabled, and envar PYTHONMALLOCSTATS is set, whenever a new arena is obtained and once late in the Python shutdown process.
* Move Unicode finalization further down in the chain.Marc-André Lemburg2002-04-081-5/+5
| | | | Fixes bug #525620.
* Get rid of another use of PyArg_Parse()Neal Norwitz2002-04-011-2/+2
|
* Disable the parser hacks that enabled the "yield" keyword using a futureNeil Schemenauer2002-03-221-11/+13
| | | | statement.
* Patch #50002: Display line information for bad \x escapes:Martin v. Löwis2002-03-031-1/+1
| | | | | | - recognize "SyntaxError"s by the print_file_and_line attribute. - add the syntaxerror attributes to all exceptions in compile.c. Fixes #221791
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-4/+0
|