summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
AgeCommit message (Collapse)AuthorLines
2010-05-21Issue #5753: A new C API function, :cfunc:`PySys_SetArgvEx`, allowsAntoine Pitrou-2/+8
embedders of the interpreter to set sys.argv without also modifying sys.path. This helps fix `CVE-2008-5983 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-925/+925
2010-03-03Revert a nonexistent docstring typo, r42805.Florent Xicluna-1/+1
2010-01-31Issue #7819: Check sys.call_tracing() arguments types.Victor Stinner-1/+1
py3k was already patched by issue #3661.
2010-01-27Issue #7766: Change sys.getwindowsversion() return value to a named tuple ↵Eric Smith-13/+62
and add the additional members returned in an OSVERSIONINFOEX structure. The new members are service_pack_major, service_pack_minor, suite_mask, and product_type.
2009-10-24Issue #7117 (backport py3k float repr) continued:Mark Dickinson-0/+10
Add sys.float_repr_style attribute ('short' if short float repr is in used; 'legacy' otherwise).
2009-06-29Update docstrings for sys.getdlopenflags() and sys.setdlopenflags().Alexandre Vassalotti-10/+12
2009-05-25handle errors from _PyObject_LookupSpecial when __get__ failsBenjamin Peterson-4/+6
2009-05-23support building with subversion 1.7 #6094Benjamin Peterson-1/+1
2009-05-09convert some more special methods to use _PyObject_LookupSpecialBenjamin Peterson-12/+7
2009-03-20Issue #4258: Use 30-bit digits for Python longs, on 64-bit platforms.Mark Dickinson-0/+4
Backport of r70459.
2009-02-06Implement issue #4285, convert sys.version_info to a namedEric Smith-20/+79
tuple. Patch by Ross Light.
2009-01-12Issue #4915: Port sysmodule to Windows CE.Martin v. Löwis-3/+12
2008-07-10Added garbage collector overhead and optional default return value toRobert Schuppenies-13/+46
sys.getsizeof.
2008-07-10Fixed Issue3122 and extended sys.getsizeof tests for built-in types.Robert Schuppenies-11/+10
2008-07-06- Issue #2862: Make int and float freelist management consistent with otherGregory P. Smith-20/+0
freelists. Changes their CompactFreeList apis into ClearFreeList apis and calls them via gc.collect().
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-19/+19
http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
2008-06-01Some style nits. Also clarify in the docstrings what __sizeof__ does.Georg Brandl-2/+2
2008-06-01Issue #2898: Added sys.getsizeof() to retrieve size of objects in bytes.Robert Schuppenies-0/+41
2008-06-01New environment variable PYTHONIOENCODING.Martin v. Löwis-20/+0
2008-05-26Renamed PyString to PyBytesChristian Heimes-19/+19
2008-05-20Patch #2488: Add sys.maxsize.Martin v. Löwis-0/+3
2008-05-08Fix sys.flags to properly expose bytes_warning.Brett Cannon-2/+2
Closes issue #2790.
2008-05-06Implemented PEP 370Christian Heimes-5/+5
2008-04-27A little reformating of Py3k warningsBenjamin Peterson-1/+1
2008-04-27Use PyErr_WarnPy3k throughoutBenjamin Peterson-4/+2
2008-04-18Fix indentation in sysmodule.cBenjamin Peterson-4/+4
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.