summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove compiler warningNeal Norwitz2004-06-131-1/+1
|
* Patch #510695: Add TSC profiling for the VM.Martin v. Löwis2004-06-081-0/+30
|
* Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin2004-03-241-8/+8
|
* Enable the profiling of C functions (builtins and extensions)Nicholas Bastin2004-03-241-3/+4
|
* Move initialization of sys.std{in,out}.encoding to Py_Initialize.Martin v. Löwis2003-08-091-18/+0
| | | | | Verify that the encoding actually exists. Fixes #775985. Will backport to 2.3.
* New function sys.getcheckinterval(), to complement setcheckinterval().Tim Peters2003-07-061-0/+12
|
* Patch #612627: Add encoding attribute to file objects, and determineMartin v. Löwis2003-05-101-0/+43
| | | | the terminal encoding on Windows and Unix.
* Patch #708495: Port more stuff to OpenVMS.Martin v. Löwis2003-05-031-0/+19
|
* - New function sys.call_tracing() allows pdb to debug codeGuido van Rossum2003-04-091-0/+19
| | | | | | recursively. - pdb has a new command, "debug", which lets you step through arbitrary code from the debugger's (pdb) prompt.
* Always initialize Py_FileSystemDefaultEncoding on Unix in Py_Initialize,Martin v. Löwis2003-03-051-0/+20
| | | | | and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding. Adjust test case.
* - New function sys.exc_clear() clears the current exception. This isGuido van Rossum2003-03-011-4/+37
| | | | | | rarely needed, but can sometimes be useful to release objects referenced by the traceback held in sys.exc_info()[2]. (SF patch #693195.) Thanks to Kevin Jacobs!
* - sys.path[0] (the directory from which the script is loaded) is nowGuido van Rossum2003-02-191-2/+10
| | | | | turned into an absolute pathname, unless it is the empty string. (SF patch #664376, by Skip Montanaro.)
* Small function call optimization and special build option for call stats.Jeremy Hylton2003-02-051-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | -DCALL_PROFILE: Count the number of function calls executed. When this symbol is defined, the ceval mainloop and helper functions count the number of function calls made. It keeps detailed statistics about what kind of object was called and whether the call hit any of the special fast paths in the code. Optimization: When we take the fast_function() path, which seems to be taken for most function calls, and there is minimal frame setup to do, avoid call PyEval_EvalCodeEx(). The eval code ex function does a lot of work to handle keywords args and star args, free variables, generators, etc. The inlined version simply allocates the frame and copies the arguments values into the frame. The optimization gets a little help from compile.c which adds a CO_NOFREE flag to code objects that don't have free variables or cell variables. This change allows fast_function() to get into the fast path with fewer tests. I measure a couple of percent speedup in pystone with this change, but there's surely more that can be done.
* Patch #664376: sys.path[0] should contain absolute pathname.Thomas Heller2003-01-081-0/+12
| | | | | | | | This fixes the problem on Windows - that's the only system where I can test it. It leaves sys.argv alone and only changes sys.path[0] to an absolute pathname.
* Add os.path.supports_unicode_filenames for all platforms,Mark Hammond2002-10-081-0/+37
| | | | | | sys.getwindowsversion() on Windows (new enahanced Tim-proof <wink> version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries.
* replace thread state objects' ticker and checkinterval fields with twoSkip Montanaro2002-09-031-2/+1
| | | | | | | | | | globals, _Py_Ticker and _Py_CheckInterval. This also implements Jeremy's shortcut in Py_AddPendingCall that zeroes out _Py_Ticker. This allows the test in the main loop to only test a single value. The gory details are at http://python.org/sf/602191
* expose PYTHON_API_VERSION macro as sys.api_version. Closes patch # 601456.Skip Montanaro2002-09-031-0/+3
|
* Rearranged and added comments to object.h, to clarify many thingsTim Peters2002-07-071-2/+3
| | | | | | | | | | | that have taken me "too long" to reverse-engineer over the years. Vastly reduced the nesting level and redundancy of #ifdef-ery. Took a light stab at repairing comments that are no longer true. sys_gettotalrefcount(): Changed to enable under Py_REF_DEBUG. It was enabled under Py_TRACE_REFS, which was much heavier than necessary. sys.gettotalrefcount() is now available in a Py_REF_DEBUG-only build.
* Patch #569753: Remove support for WIN16.Martin v. Löwis2002-06-301-2/+0
| | | | Rename all occurrences of MS_WIN32 to MS_WINDOWS.
* Got rid of an extraneous semicolon.Jack Jansen2002-06-261-1/+1
|
* Fix the docstring for sys.getrefcount().Fred Drake2002-06-201-2/+3
| | | | Closes SF bug #571759.
* Patch #505375: Make doc strings optional.Martin v. Löwis2002-06-091-30/+53
|
* Change sys_exit to use METH_VARARGS.Neal Norwitz2002-03-271-2/+5
| | | | sys.exit() now requires 0-1 arguments. Previously 2+ arguments were allowed.
* Fix wording of sys.exit docstring. Close SF bug 534113.Neil Schemenauer2002-03-231-1/+1
|
* SF #506611, fix sys.setprofile(), sys.settrace() core dumpsNeal Norwitz2002-03-031-2/+2
| | | | when no arguments are passed
* Fix spelling mistakes. Bugfix candidates.Neal Norwitz2002-01-291-3/+3
|
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-4/+0
|
* mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, toTim Peters2001-12-031-8/+1
| | | | | | | | | | | | | | | use wrappers on all platforms, to make this as consistent as possible x- platform (in particular, make sure there's at least one \0 byte in the output buffer). Also document more of the truth about what these do. getargs.c, seterror(): Three computations of remaining buffer size were backwards, thus telling PyOS_snprintf the buffer is larger than it actually is. This matters a lot now that PyOS_snprintf ensures there's a trailing \0 byte (because it didn't get the truth about the buffer size, it was storing \0 beyond the true end of the buffer). sysmodule.c, mywrite(): Simplify, now that PyOS_vsnprintf guarantees to produce a \0 byte.
* mywrite(): The test for trouble in PyOS_vsnprintf was wrong on bothTim Peters2001-12-021-3/+10
| | | | | ends. Also, when there is trouble, ensure the buffer has a traiing 0 byte.
* Use PyOS_vsnprintf() and check its return value.Jeremy Hylton2001-11-281-2/+9
| | | | | | If it returns -1 (which indicates overflow on old Linux platforms and perhaps on Windows) or size greater than buffer, write a message indicating that the previous message was truncated.
* Include sys_getdefaultencoding in #ifdef Py_USING_UNICODE. Fixes #479571.Martin v. Löwis2001-11-091-2/+2
|
* Convert getrefcount() to METH_O, and sys_excepthook() to useFred Drake2001-10-241-6/+3
| | | | PyArg_UnpackTuple().
* Rationalize the events passed to the profiler (no changes for the tracer).Fred Drake2001-10-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The profiler does not need to know anything about the exception state, so we no longer call it when an exception is raised. We do, however, make sure we *always* call the profiler when we exit a frame. This ensures that timing events are more easily isolated by a profiler and finally clauses that do a lot of work don't have their time mis-allocated. When an exception is propogated out of the frame, the C callback for the profiler now receives a PyTrace_RETURN event with an arg of NULL; the Python-level profile hook function will see a 'return' event with an arg of None. This means that from Python it is impossible for the profiler to determine if the frame exited with an exception or if it returned None, but this doesn't matter for profiling. A C-based profiler could tell the difference, but this doesn't seem important. ceval.c:eval_frame(): Simplify the code in two places so that the profiler is called for every exit from a frame and not for exceptions. sysmodule.c:profile_trampoline(): Make sure we don't expose Python code to NULL; use None instead.
* Patch #445762: Support --disable-unicodeMartin v. Löwis2001-08-171-0/+10
| | | | | | | | - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
* Patch #427190: Implement and use METH_NOARGS and METH_O.Martin v. Löwis2001-08-161-45/+29
|
* Patch number #422106 by Greg Ball, to fix segmentationMoshe Zadka2001-07-231-0/+5
| | | | | | | fault in sys.displayhook. Please check this in on the 2.2a1 branch (or whatever is necessary to get it working next release)
* Patch #412229: Add functions sys.getdlopenflags and sys.setdlopenflags.Martin v. Löwis2001-07-181-0/+52
| | | | Add dlopenflags to PyInterpreterState, and use it in dlopen calls.
* Revise the interface to the profiling and tracing support for theFred Drake2001-06-271-13/+110
| | | | | | | | | | | | | | | | | | Python interpreter. This change adds two new C-level APIs: PyEval_SetProfile() and PyEval_SetTrace(). These can be used to install profile and trace functions implemented in C, which can operate at much higher speeds than Python-based functions. The overhead for calling a C-based profile function is a very small fraction of a percent of the overhead involved in calling a Python-based function. The machinery required to call a Python-based profile or trace function been moved to sysmodule.c, where sys.setprofile() and sys.setprofile() simply become users of the new interface. As a side effect, SF bug #436058 is fixed; there is no longer a _PyTrace_Init() function to declare.
* Encode surrogates in UTF-8 even for a wide Py_UNICODE.Martin v. Löwis2001-06-271-0/+4
| | | | | | | Implement sys.maxunicode. Explicitly wrap around upper/lower computations for wide Py_UNICODE. When decoding large characters with UTF-8, represent expected test results using the \U notation.
* Instead of initializing & interning the strings passed to the profileFred Drake2001-06-161-0/+6
| | | | | | | and trace functions lazily, which incurs extra argument pushing and checks in the C overhead for profiling/tracing, create the strings semi-lazily when the Python code first registers a profile or trace function. This simplifies the trampoline into the profile/trace functions.
* Updated version of RISCOS support. SF patch 411213 by Dietmar SchwertbergerGuido van Rossum2001-04-101-0/+4
|
* Add sys.excepthook.Ka-Ping Yee2001-03-231-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__.
* Neil discovered a bad DECREF on warnoptions, that caused repeatedGuido van Rossum2001-01-131-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.)
* stdout is sometimes a macro; use "outf" instead.Greg Stein2001-01-111-5/+5
| | | | Submitted by: Mark Favas <m.favas@per.dem.csiro.au>
* Implementation of PEP-0217.Moshe Zadka2001-01-111-0/+46
| | | | This closes the PEP, and patch 103170
* Add definitions for PySys_ResetWarnOptions() andGuido van Rossum2000-12-151-0/+39
| | | | PySys_AddWarnOption().
* _getframe(): New sys module function for getting at the stack frame.Barry Warsaw2000-12-061-0/+37
| | | | | Implements and closes SF patch #102106, with Guido's suggested documentation changes.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* add user-modifiable recursion_limitJeremy Hylton2000-08-311-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
* _PySys_Init(): When setting up sys.version_info, use #if/#elif.../#endifFred Drake2000-08-311-6/+3
| | | | | instead of four #if/#endif blocks. This shortens the code and improves readability.