Commit Graph

2521 Commits

Author SHA1 Message Date
Mark Dickinson
2bebadfe51 Issue 1678380: fix a bug identifying -0.0 and 0.0 2008-01-21 21:54:47 +00:00
Amaury Forgeot d'Arc
8334a4fc31 Backport of r59241: str.decode fails on very long strings on 64bit platforms.
PyArgs_ParseTuple t# and w# formats truncated the lengths to 32bit.
2007-11-30 21:53:17 +00:00
Amaury Forgeot d'Arc
c572dc3752 Backport for issue1265 (pdb bug with "with" statement).
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.
2007-11-13 22:43:05 +00:00
Neal Norwitz
163048ed12 Backport 58424:
Fix Coverity 185-186:  If the passed in FILE is NULL, uninitialized memory
would be accessed.
2007-10-12 03:59:09 +00:00
Neal Norwitz
14f848bb22 Backport 58330:
Fix Coverity #158: Check the correct variable.
2007-10-05 03:45:42 +00:00
Georg Brandl
dfecfdb23e Fix #1169: remove docstrings in functions for -OO.
(backport from rev. 58204)
2007-09-19 06:37:26 +00:00
Georg Brandl
eec47f3556 Backport fix of #1752175. 2007-08-23 18:08:33 +00:00
Martin v. Löwis
2276885acd Patch #1733960: Allow T_LONGLONG to accept ints. 2007-06-09 08:01:33 +00:00
Georg Brandl
73c958aced Disallow function calls like foo(None=1).
Backport from py3k rev. 55708 by Guido.
 (backport from rev. 55802)
2007-06-07 13:23:28 +00:00
Georg Brandl
ba871a06fb Bug #1722484: remove docstrings again when running with -OO.
(backport from rev. 55732)
2007-06-01 11:33:45 +00:00
Neal Norwitz
ce15dce421 Drop the max stack depth to something that works in 2.6 2007-05-18 05:12:22 +00:00
Neal Norwitz
dc78cc6f7c Fix bug in marshal where bad data would cause a segfault due to
lack of an infinite recursion check.

Contributed by Damien Miller at Google.
2007-05-16 20:09:36 +00:00
Kristján Valur Jónsson
b4c285a25b Fix NonRecursiveMutex on x64. The signature of the 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. 2007-05-07 18:28:12 +00:00
Kristján Valur Jónsson
00b0a9e5b2 Undefine the Yield macro after including Python_ast.h where it may cause conflicts with winbase.h on Windows. 2007-05-02 16:02:48 +00:00
Kristján Valur Jónsson
5e4e31f76a Fix various minor issues discovered with static analysis using Visual Studio 2005 Team System.
Removed obsolete comment, since .dll modules are no longer supported on windows, only .pyd.
2007-04-21 12:46:49 +00:00
Neal Norwitz
03c566a268 Revert 54813 for 2.5.1 release. Can be applied after 2.5 branch is unfrozen. 2007-04-16 06:19:52 +00:00
Neal Norwitz
16b7b53ad0 SF #1701207: svnversion_init assertion failed
Revert bogus asserts (added to the wrong place) from rev 52501.

Approved by Anthony.
2007-04-16 06:12:02 +00:00
Kristján Valur Jónsson
9d9fbb4359 Fix a bug when using the __lltrace__ opcode tracer, and a problem sith signed chars in frameobject.c which can occur with opcodes > 127 2007-04-13 22:09:59 +00:00
Georg Brandl
8a10ea4613 Patch #1682205: a TypeError while unpacking an iterable is no longer
masked by a generic one with the message "unpack non-sequence".
 (backport from rev. 54480)
2007-03-21 09:00:55 +00:00
Collin Winter
7d9ac78384 Patch #1642547: Fix an error/crash when encountering syntax errors in complex if statements.
Backported from r54404.
2007-03-16 04:12:48 +00:00
Collin Winter
2a98ff8eed Inline PyImport_GetModulesReloading(). Backport from r54368. 2007-03-13 23:04:29 +00:00
Collin Winter
e19d7a3c0a Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Backported from r54291.
2007-03-12 16:49:23 +00:00
Georg Brandl
15e138a0dc Bug #1674503: close the file opened by execfile() in an error condition.
(backport)
2007-03-06 12:16:52 +00:00
Georg Brandl
0ea891603d Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot.
 (backport from rev. 54139)
2007-03-05 22:28:13 +00:00
Raymond Hettinger
d882e36f45 Fix constantification of None. 2007-03-02 19:19:05 +00:00