summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Added checks for integer overflows, contributed by Google. Some areMartin v. Löwis2008-02-144-12/+121
| | | | | only available if asserts are left in the code, in cases where they can't be triggered from Python code.
* No need to emit co_lnotab item when both offsets are zeros.Amaury Forgeot d'Arc2008-02-041-0/+3
| | | | | | r60579 broke a test test_compile, which seems to test an "implementation detail" IMO. Also test that this correction does not impact the debugger.
* backport of r60575 (issue #1750076): Debugger did not step on every ↵Amaury Forgeot d'Arc2008-02-041-14/+15
| | | | | | | | | | | | | | iteration of a while statement. The mapping between bytecode offsets and source lines (lnotab) did not contain an entry for the beginning of the loop. Now it does, and the lnotab can be a bit larger: in particular, several statements on the same line generate several entries. However, this does not bother the settrace function, which will trigger only one 'line' event. The lnotab seems to be exactly the same as with python2.4.
* #1920: when considering a block starting by "while 0", the compiler ↵Amaury Forgeot d'Arc2008-01-241-1/+4
| | | | | | | | | | | | | | | | | optimized the whole construct away, even when an 'else' clause is present:: while 0: print("no") else: print("yes") did not generate any code at all. Now the compiler emits the 'else' block, like it already does for 'if' statements. Backport of r60265.
* Fix two crashers (borrowed_ref_[34].py from the trunk).Guido van Rossum2008-01-232-2/+11
|
* Issue 1678380: fix a bug identifying -0.0 and 0.0Mark Dickinson2008-01-211-1/+14
|
* Backport of r59241: str.decode fails on very long strings on 64bit platforms.Amaury Forgeot d'Arc2007-11-301-3/+4
| | | | PyArgs_ParseTuple t# and w# formats truncated the lengths to 32bit.
* Backport for issue1265 (pdb bug with "with" statement).Amaury Forgeot d'Arc2007-11-131-7/+12
| | | | | | | | | | | | | | | | | | | | When an unfinished generator-iterator is garbage collected, PyEval_EvalFrameEx is called with a GeneratorExit exception set. This leads to funny results if the sys.settrace function itself makes use of generators. A visible effect is that the settrace function is reset to None. Another is that the eventual "finally" block of the generator is not called. It is necessary to save/restore the exception around the call to the trace function. This happens a lot with py3k: isinstance() of an ABCMeta instance runs def __instancecheck__(cls, instance): """Override for isinstance(instance, cls).""" return any(cls.__subclasscheck__(c) for c in {instance.__class__, type(instance)}) which lets an opened generator expression each time it returns True. And the problem can be reproduced in 2.5 with pure python code.
* Backport 58424:Neal Norwitz2007-10-121-0/+2
| | | | | Fix Coverity 185-186: If the passed in FILE is NULL, uninitialized memory would be accessed.
* Backport 58330:Neal Norwitz2007-10-051-1/+1
| | | | Fix Coverity #158: Check the correct variable.
* Fix #1169: remove docstrings in functions for -OO.Georg Brandl2007-09-191-1/+1
| | | | (backport from rev. 58204)
* Backport fix of #1752175.Georg Brandl2007-08-232-1/+7
|
* Patch #1733960: Allow T_LONGLONG to accept ints.Martin v. Löwis2007-06-091-24/+18
|
* Disallow function calls like foo(None=1).Georg Brandl2007-06-071-4/+9
| | | | | Backport from py3k rev. 55708 by Guido. (backport from rev. 55802)
* Bug #1722484: remove docstrings again when running with -OO.Georg Brandl2007-06-011-1/+2
| | | | (backport from rev. 55732)
* Drop the max stack depth to something that works in 2.6Neal Norwitz2007-05-181-1/+1
|
* Fix bug in marshal where bad data would cause a segfault due toNeal Norwitz2007-05-161-69/+156
| | | | | | lack of an infinite recursion check. Contributed by Damien Miller at Google.
* Fix NonRecursiveMutex on x64. The signature of the ↵Kristján Valur Jónsson2007-05-071-5/+7
| | | | faux-InterlockedCompareExchange function was wrong: It works with LONG and not PVOID objects, and it needs to have the target marked as volatile. Further, it is not needed at all for x64 targets, since that platform always has the real McCoy.
* Undefine the Yield macro after including Python_ast.h where it may cause ↵Kristján Valur Jónsson2007-05-022-0/+4
| | | | conflicts with winbase.h on Windows.
* Fix various minor issues discovered with static analysis using Visual Studio ↵Kristján Valur Jónsson2007-04-212-11/+3
| | | | | | 2005 Team System. Removed obsolete comment, since .dll modules are no longer supported on windows, only .pyd.
* Revert 54813 for 2.5.1 release. Can be applied after 2.5 branch is unfrozen.Neal Norwitz2007-04-161-1/+1
|
* SF #1701207: svnversion_init assertion failedNeal Norwitz2007-04-161-2/+0
| | | | | | Revert bogus asserts (added to the wrong place) from rev 52501. Approved by Anthony.
* Fix a bug when using the __lltrace__ opcode tracer, and a problem sith ↵Kristján Valur Jónsson2007-04-131-1/+1
| | | | signed chars in frameobject.c which can occur with opcodes > 127
* Patch #1682205: a TypeError while unpacking an iterable is no longerGeorg Brandl2007-03-211-5/+3
| | | | | masked by a generic one with the message "unpack non-sequence". (backport from rev. 54480)
* Patch #1642547: Fix an error/crash when encountering syntax errors in ↵Collin Winter2007-03-161-14/+26
| | | | | | complex if statements. Backported from r54404.
* Inline PyImport_GetModulesReloading(). Backport from r54368.Collin Winter2007-03-131-10/+8
|
* Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. ↵Collin Winter2007-03-123-2/+41
| | | | | | Fixed by patch #922167. Backported from r54291.
* Bug #1674503: close the file opened by execfile() in an error condition.Georg Brandl2007-03-061-2/+2
| | | | (backport)
* Patch #1674228: when assigning a slice (old-style), check for theGeorg Brandl2007-03-051-1/+1
| | | | | sq_ass_slice instead of the sq_slice slot. (backport from rev. 54139)
* Fix constantification of None.Raymond Hettinger2007-03-021-5/+9
|
* Fix SF bug #1669182. Handle string exceptions even if unraisable (ie in ↵Neal Norwitz2007-02-261-1/+5
| | | | __del__).
* Backport 53901 and 53902 to prevent crash when there is an error decoding ↵Neal Norwitz2007-02-251-0/+2
| | | | unicode filenames
* Make PyTraceBack_Here use the current thread, not theMartin v. Löwis2007-01-231-1/+1
| | | | frame's thread state. Fixes #1579370.
* Backport trunk revision 53527:Thomas Wouters2007-01-232-6/+9
| | | | | | | | | | | | | SF patch #1630975: Fix crash when replacing sys.stdout in sitecustomize 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....)
* update to (c) years to include 2007Anthony Baxter2007-01-061-1/+1
|
* Backport:Neal Norwitz2007-01-051-1/+2
| | | | | | Prevent crash on shutdown which can occur if we are finalizing and the module dict has been cleared already and some object raises a warning (like in a __del__).
* Backport of r52862.Armin Rigo2006-11-291-1/+3
|
* Backport 52621:Neal Norwitz2006-11-041-0/+1
| | | | Bug #1588287: fix invalid assertion for `1,2` in debug builds.
* Backport 52504:Neal Norwitz2006-10-281-1/+4
| | | | | | Fix bug #1565514, SystemError not raised on too many nested blocks. It seems like this should be a different error than SystemError, but I don't have any great ideas and SystemError was raised in 2.4 and earlier.
* Backport 52501:Neal Norwitz2006-10-281-0/+4
| | | | | | | | Add some asserts. In sysmodule, I think these were to try to silence 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.
* [Bug #1542016] Report PCALL_POP value. This makes the return value of ↵Andrew M. Kuchling2006-10-271-2/+2
| | | | | | | sys.callstats() match its docstring. Backport candidate. Though it's an API change, this is a pretty obscure portion of the API.
* [Backport of r52452]Martin v. Löwis2006-10-271-53/+75
| | | | | | | Patch #1549049: Rewrite type conversion in structmember. Fixes #1545696 and #1566140. The new warnings have been omitted in the backport.
* Fix #1569998: no break inside try statement (outside loop) allowed.Georg Brandl2006-10-081-1/+13
| | | | (backport from rev. 52129)
* Patch #1542451: fix crash with continue in nested try/finallyGeorg Brandl2006-10-081-4/+10
| | | | (backport from rev. 51439)
* Forward-port of r52136: a review of overflow-detecting code.Armin Rigo2006-10-046-27/+37
| | | | | | | | | | | | | | | | | | | | | | | * 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...
* Backport rev. 51972:Georg Brandl2006-09-251-2/+24
| | | | | | | Bug #1557232: fix seg fault with def f((((x)))) and def f(((x),)). These tests should be improved. Hopefully this fixes variations when flipping back and forth between fpdef and fplist.
* Backport rev. 51987: superfluous semicola.Georg Brandl2006-09-251-1/+1
|
* Building with HP's cc on HP-UX turned up a couple of problems.Neal Norwitz2006-09-111-1/+6
| | | | | | | | | | | | | _PyGILState_NoteThreadState was declared as static inconsistently. Make it static as it's not necessary outside of this module. Some tests failed because errno was reset to 0. (I think the tests that failed were at least: test_fcntl and test_mailbox). Ensure that errno doesn't change after a call to Py_END_ALLOW_THREADS. This only affected debug builds. This needs to be ported to HEAD. I'll try to remember to do that tomorrow. (Anyone, feel free to port it.)
* Properly handle a NULL returned from PyArena_New().Neal Norwitz2006-09-111-2/+4
| | | | Klocwork #364. Will port to head.
* Bug #1550983: emit better error messages for erroneous relativeGeorg Brandl2006-09-061-2/+3
| | | | | imports (if not in package and if beyond toplevel package). (backport from rev. 51765)