summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
AgeCommit message (Collapse)AuthorLines
2008-04-13Fix a bug in PySys_HasWarnOption() where it was not properly checking theBrett Cannon-1/+1
length of the list storing the warning options.
2008-04-12Re-implement the 'warnings' module in C. This allows for usage of theBrett Cannon-0/+8
'warnings' code in places where it was previously not possible (e.g., the parser). It could also potentially lead to a speed-up in interpreter start-up if the C version of the code (_warnings) is imported over the use of the Python version in key places. Closes issue #1631171.
2008-03-25Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl-2/+2
EOL 80 limit and supply more alternatives in warning messages.
2008-03-24Added quick hack for bzrChristian Heimes-2/+2
2008-03-24Added quick hack for bzrChristian Heimes-1/+8
2008-03-21#2358: add py3k warning to sys.exc_clear().Georg Brandl-1/+9
2008-02-04Patch #1953Christian Heimes-13/+34
I implemented the function sys._compact_freelists() and C API functions PyInt_/PyFloat_CompactFreeList() to compact the pre-allocated blocks of ints and floats. They allow the user to reduce the memory usage of a Python process that deals with lots of numbers. The patch also renames sys._cleartypecache to sys._clear_type_cache
2008-01-30The previous change was causing a segfault after multiple calls to ↵Christian Heimes-3/+3
Py_Initialize() and Py_Finalize().
2008-01-30Fixed some references leaks in sys.Christian Heimes-21/+17
2008-01-27Added clear cache methods to clear the internal type lookup cache for ref ↵Christian Heimes-0/+13
leak test runs.
2008-01-20#1648: add sys.gettrace() and sys.getprofile().Georg Brandl-0/+42
2008-01-15Typo fixesAndrew M. Kuchling-2/+2
2008-01-14Applied patch #1816: sys.flags patchChristian Heimes-3/+94
2008-01-07Patch #602345 by Neal Norwitz and me: add -B option and ↵Georg Brandl-0/+3
PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
2007-12-01Feature #1534Christian Heimes-0/+2
Added PyFloat_GetMax(), PyFloat_GetMin() and PyFloat_GetInfo() to the float API. Added a dictionary sys.float_info with information about the internal floating point type to the sys module.
2007-11-27Expose Py_Py3kWarningFlag as sys.py3kwarning as discussed in #1504Christian Heimes-0/+2
Also added a warning.warnpy3k() as convenient method for Python 3.x related deprecation warnings.
2007-04-16SF #1701207, Fix bogus assertion (and test it!)Neal Norwitz-2/+2
2007-01-23SF patch #1630975: Fix crash when replacing sys.stdout in sitecustomizeThomas Wouters-3/+3
When running the interpreter in an environment that would cause it to set stdout/stderr/stdin's encoding, having a sitecustomize that would replace them with something other than PyFile objects would crash the interpreter. Fix it by simply ignoring the encoding-setting for non-files. This could do with a test, but I can think of no maintainable and portable way to test this bug, short of adding a sitecustomize.py to the buildsystem and have it always run with it (hmmm....)
2006-10-28Add some asserts. In sysmodule, I think these were to try to silenceNeal Norwitz-0/+4
some warnings from Klokwork. They verify the assumptions of the format of svn version output. The assert in the thread module helped debug a problem on HP-UX.
2006-10-04Forward-port of r52136,52138: a review of overflow-detecting code.Armin Rigo-1/+1
* unified the way intobject, longobject and mystrtoul handle values around -sys.maxint-1. * in general, trying to entierely avoid overflows in any computation involving signed ints or longs is extremely involved. Fixed a few simple cases where a compiler might be too clever (but that's all guesswork). * more overflow checks against bad data in marshal.c. * 2.5 specific: fixed a number of places that were still confusing int and Py_ssize_t. Some of them could potentially have caused "real-world" breakage. * list.pop(x): fixing overflow issues on x was messy. I just reverted to PyArg_ParseTuple("n"), which does the right thing. (An obscure test was trying to give a Decimal to list.pop()... doesn't make sense any more IMHO) * trying to write a few tests...
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.