summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
AgeCommit message (Collapse)AuthorLines
2001-11-21backport of 2.90:Anthony Baxter-0/+5
Patch number #422106 by Greg Ball, to fix segmentation fault in sys.displayhook.
2001-04-10Updated version of RISCOS support. SF patch 411213 by Dietmar SchwertbergerGuido van Rossum-0/+4
2001-03-23Add sys.excepthook.Ka-Ping Yee-11/+47
Update docstring and library reference section on 'sys' module. New API PyErr_Display, just for displaying errors, called by excepthook. Uncaught exceptions now call sys.excepthook; if that fails, we fall back to calling PyErr_Display directly. Also comes with sys.__excepthook__ and sys.__displayhook__.
2001-01-13Neil discovered a bad DECREF on warnoptions, that caused repeatedGuido van Rossum-2/+1
re-initializing Python (Py_Finalize() followed by Py_Initialize()) to blow up quickly. With the DECREF removed I can't get it to fail any more. (Except it still leaks, but that's probably a separate issue.)
2001-01-11stdout is sometimes a macro; use "outf" instead.Greg Stein-5/+5
Submitted by: Mark Favas <m.favas@per.dem.csiro.au>
2001-01-11Implementation of PEP-0217.Moshe Zadka-0/+46
This closes the PEP, and patch 103170
2000-12-15Add definitions for PySys_ResetWarnOptions() andGuido van Rossum-0/+39
PySys_AddWarnOption().
2000-12-06_getframe(): New sys module function for getting at the stack frame.Barry Warsaw-0/+37
Implements and closes SF patch #102106, with Guido's suggested documentation changes.
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-08-31add user-modifiable recursion_limitJeremy Hylton-3/+51
ceval.c: define recurion_limit (static), default value is 2500 define Py_GetRecursionLimit and Py_SetRecursionLimit raise RuntimeError if limit is exceeded PC/config.h: remove plat-specific definition sysmodule.c: add sys.(get|set)recursionlimit
2000-08-31_PySys_Init(): When setting up sys.version_info, use #if/#elif.../#endifFred Drake-6/+3
instead of four #if/#endif blocks. This shortens the code and improves readability.
2000-08-16_PySys_Init(): Fix another Insure discovered memory leak; the PyStringBarry Warsaw-1/+2
created from the "big"/"little" constant needs to be decref'd.
2000-08-15Guido pointed out that all names in the sys module have no underscore,Fred Drake-4/+5
2000-08-14The attempt to protect against MS_WIN16 compilers that do not support longFred Drake-1/+2
string literals has not been tested on an MS_WIN16 platform; the trailing ";" was inside the #ifndef MS_WIN16, which should cause an error (missing semi-colon) when compiled with that symbol #defined.
2000-08-14Add a byte_order value to the sys module. The value is "big" forFred Drake-0/+13
big-endian machines and "little" for little-endian machines.
2000-07-24Create a new section of pyport.h to hold all external function declarationsThomas Wouters-1/+0
for systems that are missing those declarations from system include files. Start by moving a pointy-haired ones from their previous locations to the new section. (The gethostname() one, for instance, breaks on several systems, because some define it as (char *, size_t) and some as (char *, int).) I purposely decided not to include the summary of used #defines like Tim did in the first section of pyport.h. In my opinion, the number of #defines likedly to be used by this section would make such an overview unwieldy. I would suggest documenting the non-obvious ones, though.
2000-07-22Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters-77/+20
declarations yet, those come later.
2000-07-09Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters-4/+4
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-06-28Trent Mick's Win64 changes: size_t vs. int or long; also some overflowGuido van Rossum-1/+1
tests.
2000-06-20Added a new debug method sys.gettotalrefcount(), which returns the total ↵Mark Hammond-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.
2000-06-07Marc-Andre Lemburg <mal@lemburg.com>:Marc-André Lemburg-10/+10
Changed the API names for setting the default encoding. These are now in line with the other hooks API names (no underscores).
2000-05-09M.-A. Lemburg <mal@lemburg.com>:Fred Drake-0/+37
Added APIs to allow setting and querying the system's current string encoding: sys.set_string_encoding() and sys.get_string_encoding().
2000-04-13Simplify creation of the version_info value for clarity, perFred Drake-6/+7
suggestion from Greg Stein.
2000-04-13Capitulate, changing version_info to a 5-tuple:Fred Drake-12/+18
major, minor, micro, level, serial Values are now monotonically increasing with each new release.
2000-04-13Define version_info to be a tuple (major, minor, micro, level); levelFred Drake-1/+19
is a string "a2", "b1", "c1", or '' for a final release. Added version_info and hexversion to the module docstring.
2000-03-31Use modern PyArg_ParseTuple style, with function names.Guido van Rossum-8/+8
(Mostly.)
2000-02-29Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum-1/+1
PyArg_ParseTuple() format string arguments as possible.
1999-10-05In PySys_GetObject(), it's possible that tstate->interp->sysdict isGuido van Rossum-0/+2
NULL. In that case, return NULL rather than dumping core. This fixes PR#91, submitted by Lele Gaifax.
1999-01-27_PySys_Init(): Nailed small memory leak. The stringobject created forBarry Warsaw-0/+1
sys.version was missing a Py_XDECREF().
1999-01-14Jim Ahlstrom patch: the module doc string is too long for 16-bit VCGuido van Rossum-1/+5
1.5. Omit the second part.
1999-01-03Add sys.hexversion, which is an integer encoding the version in hexadecimal.Guido van Rossum-0/+2
In other words, hex(sys.hexversion) == 0x010502b2 for Python 1.5.2b2. This is derived from the new variable PY_VERSION_HEX defined in patchlevel.h. (Cute, eh?)
1998-10-12Patches for mywrite() by Marc Lemburg: save/restore the error stateGuido van Rossum-3/+6
reliably; check return value of vsprintf().
1998-08-06Gack. The module doc string is too long for VC++ 5.0.Guido van Rossum-2/+5
However two string literals concatenated are fine! Hope this doesn't break other platforms.
1998-06-27Added doc strings. Maybe the doc string for the module itself is a bitGuido van Rossum-7/+102
long, but it sure helps!
1998-05-12New APIs to write to sys.stdout or sys.stderr using a printf-like interface.Guido van Rossum-0/+90
Adapted from code submitted by Just van Rossum. PySys_WriteStdout(format, ...) PySys_WriteStderr(format, ...) The first function writes to sys.stdout; the second to sys.stderr. When there is a problem, they write to the real (C level) stdout or stderr; no exceptions are raised (but a pending exception may be cleared when a new exception is caught). Both take a printf-style format string as their first argument followed by a variable length argument list determined by the format string. *** WARNING *** The format should limit the total size of the formatted output string to 1000 bytes. In particular, this means that no unrestricted "%s" formats should occur; these should be limited using "%.<N>s where <N> is a decimal number calculated so that <N> plus the maximum size of other formatted text does not exceed 1000 bytes. Also watch out for "%f", which can print hundreds of digits for very large numbers.
1998-02-19Make backup copies of stdin, stdout, stderr as __stdin__, __stdout__,Guido van Rossum-0/+4
__stderr__. These will be used by the import cleanup.
1997-11-04Get rid of another reference to _PyImport_Inittab (now a static array)Guido van Rossum-2/+2
that should be PyImport_Inittab (a new pointer initialized to point to the array).
1997-09-29Get DLL version from a variable.Guido van Rossum-1/+3
1997-08-07Remove unised variableGuido van Rossum-1/+0
1997-08-02The last of the mass checkins for separate (sub)interpreters.Guido van Rossum-24/+26
Everything should now work again. See the comments for the .h files mass checkin (e.g. pystate.h) for more detail.
1997-07-19Removed a bunch of extern declarations of functions that are nowGuido van Rossum-7/+0
properly declared in Python.h.
1997-05-22Set sys.executable to full path of python (from argv[0]).Guido van Rossum-0/+4
1997-05-20Use #ifdef in stead of #if (Jack)Guido van Rossum-1/+1
1997-05-05Massive changes for separate thread state management.Guido van Rossum-9/+30
All per-thread globals are moved into a struct which is manipulated separately.
1997-04-29Oops, forgot one: inittab.Guido van Rossum-2/+2
1997-04-29Quickly renamed.Guido van Rossum-143/+147
1997-04-25Expand one level of symbolic link in sys.argv[0] before inserting itsGuido van Rossum-8/+41
dirname in sys.path. This means that you can create a symbolic link foo in /usr/local/bin pointing to /usr/yourname/src/foo/foo.py, and then invoking foo will insert /usr/yourname/src/foo in sys.path, not /usr/local/bin. This makes it easier to have multifile programs (before, the program would have to do an os.readlink(sys.argv[0]) itself and insert the resulting directory in sys.path -- Grail does this). Note that the expansion is only used for sys.path; sys.argv[0] is still the original, unadorned filename (/usr/local/bin/foo in the example).
1997-01-24Added optional interface for dynamic execution profile (to be gatheredGuido van Rossum-2/+11
in ceval.c).