summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
AgeCommit message (Collapse)AuthorLines
2006-07-21Handle allocation failures gracefully. Found with failmalloc.Neal Norwitz-39/+34
Many (all?) of these could be backported.
2006-07-10After approval from Anthony, merge the tim-current_framesTim Peters-0/+17
branch into the trunk. This adds a new sys._current_frames() function, which returns a dict mapping thread id to topmost thread stack frame.
2006-06-06_PySys_Init(): It's rarely a good idea to size a buffer to theTim Peters-1/+1
exact maximum size someone guesses is needed. In this case, if we're really worried about extreme integers, then "cp%d" can actually need 14 bytes (2 for "cp" + 1 for \0 at the end + 11 for -(2**31-1)). So reserve 128 bytes instead -- nothing is actually saved by making a stack-local buffer tiny.
2006-06-05Add 3 more bytes to a buffer to cover constants in string and null byte on ↵Brett Cannon-1/+1
top of 10 possible digits for an int. Closes bug #1501223.
2006-05-29Make use of METH_O and METH_NOARGS where possible.Georg Brandl-2/+2
Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
2006-04-18C++ compiler cleanup: extern "C" a couple declarations, cast int to size_tSkip Montanaro-1/+9
2006-04-12Ignore the references to the dummy objects used as deleted keysArmin Rigo-3/+2
in dicts and sets when computing the total number of references.
2006-04-03Bug #1421664: Set sys.stderr.encodingMartin v. Löwis-0/+5
2006-03-09Try to be a bit more consistent on all platforms:Neal Norwitz-1/+4
python . python < . both print a message, return non-zero and do not core dump.
2006-03-07Change int to Py_ssize_t in several places.Martin v. Löwis-1/+1
Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows.
2006-03-04Use Py_ssize_t for _Py_RefTotal.Neal Norwitz-1/+1
I tried to handle Win64 properly, but please review.
2006-03-02Fix minor docstring typo.Brett Cannon-1/+1
2006-02-16Use Py_ssize_t to count theMartin v. Löwis-1/+2
2006-02-15Merge ssize_t branch.Martin v. Löwis-1/+1
2006-01-19Check return result from Py_InitModule*(). This API can fail.Neal Norwitz-0/+2
Probably should be backported.
2006-01-06svnversion_init(): Use standard layout for function defn.Tim Peters-1/+2
2006-01-06Trimmed trailing whitespace.Tim Peters-20/+20
2006-01-05Drop sys.build_number. Add sys.subversion.Martin v. Löwis-2/+84
2005-12-18Expose Subversion revision number (calculated via "svnversion .") to Python.Barry Warsaw-0/+3
Add C API function Py_GetBuildNumber(), add it to the interactive prompt banner (i.e. Py_GetBuildInfo()), and add it as the sys.build_number attribute. The build number is a string instead of an int because it may contain a trailing 'M' if there are local modifications.
2005-10-20Merge ast-branch to headJeremy Hylton-1/+1
This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
2005-10-03SF bug #887946, segfault if redirecting directoryNeal Norwitz-0/+9
Also provide a warning if a directory is passed on the command line. Add minimal command line test. Will backport.
2005-09-15patch [ 1119423 ] python -c readlink()s and stat()s '-c'Georg Brandl-3/+3
2005-01-27Partially revert #1074011; don't try to fflush stdin.Martin v. Löwis-1/+10
Backported to 2.3 and 2.4.
2005-01-23Flush std{in,out,err} before closing it. Fixes #1074011.Martin v. Löwis-3/+10
Will backport to 2.4 and 2.3.
2004-08-12This is my patch:Michael W. Hudson-1/+1
[ 1005891 ] support --with-tsc on PPC plus a trivial change to settscdump's docstring and a Misc/NEWS entry.
2004-06-13Remove compiler warningNeal Norwitz-1/+1
2004-06-08Patch #510695: Add TSC profiling for the VM.Martin v. Löwis-0/+30
2004-03-24Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin-8/+8
2004-03-24Enable the profiling of C functions (builtins and extensions)Nicholas Bastin-3/+4
2003-08-09Move initialization of sys.std{in,out}.encoding to Py_Initialize.Martin v. Löwis-18/+0
Verify that the encoding actually exists. Fixes #775985. Will backport to 2.3.
2003-07-06New function sys.getcheckinterval(), to complement setcheckinterval().Tim Peters-0/+12
2003-05-10Patch #612627: Add encoding attribute to file objects, and determineMartin v. Löwis-0/+43
the terminal encoding on Windows and Unix.
2003-05-03Patch #708495: Port more stuff to OpenVMS.Martin v. Löwis-0/+19
2003-04-09- New function sys.call_tracing() allows pdb to debug codeGuido van Rossum-0/+19
recursively. - pdb has a new command, "debug", which lets you step through arbitrary code from the debugger's (pdb) prompt.
2003-03-05Always initialize Py_FileSystemDefaultEncoding on Unix in Py_Initialize,Martin v. Löwis-0/+20
and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding. Adjust test case.
2003-03-01- New function sys.exc_clear() clears the current exception. This isGuido van Rossum-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!
2003-02-19- sys.path[0] (the directory from which the script is loaded) is nowGuido van Rossum-2/+10
turned into an absolute pathname, unless it is the empty string. (SF patch #664376, by Skip Montanaro.)
2003-02-05Small function call optimization and special build option for call stats.Jeremy Hylton-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.
2003-01-08Patch #664376: sys.path[0] should contain absolute pathname.Thomas Heller-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.
2002-10-08Add os.path.supports_unicode_filenames for all platforms,Mark Hammond-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.
2002-09-03replace thread state objects' ticker and checkinterval fields with twoSkip Montanaro-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
2002-09-03expose PYTHON_API_VERSION macro as sys.api_version. Closes patch # 601456.Skip Montanaro-0/+3
2002-07-07Rearranged and added comments to object.h, to clarify many thingsTim Peters-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.
2002-06-30Patch #569753: Remove support for WIN16.Martin v. Löwis-2/+0
Rename all occurrences of MS_WIN32 to MS_WINDOWS.
2002-06-26Got rid of an extraneous semicolon.Jack Jansen-1/+1
2002-06-20Fix the docstring for sys.getrefcount().Fred Drake-2/+3
Closes SF bug #571759.
2002-06-09Patch #505375: Make doc strings optional.Martin v. Löwis-30/+53
2002-03-27Change sys_exit to use METH_VARARGS.Neal Norwitz-2/+5
sys.exit() now requires 0-1 arguments. Previously 2+ arguments were allowed.
2002-03-23Fix wording of sys.exit docstring. Close SF bug 534113.Neil Schemenauer-1/+1
2002-03-03SF #506611, fix sys.setprofile(), sys.settrace() core dumpsNeal Norwitz-2/+2
when no arguments are passed