Commit Graph

1583 Commits

Author SHA1 Message Date
Michael W. Hudson
51e80dfd02 Backport my checkin of revision 2.264 of Python/compile.c:
Clamp code objects' tp_compare result to [-1, 1].

Bugfix candidate.
2002-10-07 11:30:07 +00:00
Michael W. Hudson
5e40e74bbe This is Armin Rigo's patch:
[ 617309 ] getframe hook (Psyco #1)

Forward port candidate.
2002-10-07 09:47:21 +00:00
Michael W. Hudson
ddd3f0ea7b This is Armin Rigo's patch:
[ 617311 ] Tiny profiling info (Psyco #2)

Forward port candidate.
2002-10-07 09:40:20 +00:00
Michael W. Hudson
b397f21432 This is Armin Rigo's patch:
[ 617312 ] debugger-controlled jumps (Psyco #3)

Forward port candidate, I guess.
2002-10-07 09:37:26 +00:00
Martin v. Löwis
067010f7fa Patch #618347: Work around Solaris pthread.h bug. 2002-10-04 10:16:27 +00:00
Michael W. Hudson
9c5a508eec Fix for the recursion_level bug Armin Rigo reported in sf
patch #617312, both on the trunk and the 22-maint branch.

Also added a test case, and ported the test_trace I wrote for HEAD
to 2.2.2 (with all those horrible extra 'line' events ;-).
2002-10-02 13:13:45 +00:00
Michael W. Hudson
7c2778f423 Backport mhammond's 2.14:
Fix bug [ 549731 ] Unicode encoders appears to leak references.

Python 2.2.1 bugfix candidate.
2002-09-30 10:52:21 +00:00
Martin v. Löwis
7433ef5cee Add encoding in LookupError. Fixes #615013. 2002-09-26 16:04:31 +00:00
Michael W. Hudson
44ed841fec backport theller's checkin of
revision 1.74 of marshal.c

Whitespace normalization.
2002-09-24 11:56:45 +00:00
Michael W. Hudson
78e179cdcf backport theller's checkin of
revision 1.73 of marshal.c

Fix SF 588452: debug build crashes on marshal.dumps([128] * 1000).
See there for a description.

Added test case.

Bugfix candidate for 2.2.x, not sure about previous versions:
probably low priority, because virtually no one runs debug builds.
2002-09-24 11:55:54 +00:00
Michael W. Hudson
070fe1680a backport nowonder's checkin of
revision 2.265 of bltinmodule.c

date: 2002/08/27 16:58:00;  author: nowonder;  state: Exp;  lines: +1 -1

execfile should call PyErr_SetFromErrnoWithFilename instead of
simply PyErr_SetFromErrno

This closes bug 599163.
2002-09-24 11:23:05 +00:00
Guido van Rossum
2992e13268 Backported 1.39 and 1.40 from trunk:
1.39:
Fix SF bug 610610 (reported by Martijn Pieters, diagnosed by Neal Norwitz).

The switch in Exception__str__ didn't clear the error if
PySequence_Size() raised an exception.  Added a case -1 which clears
the error and falls through to the default case.

1.40:
Two more cases of switch(PySequence_Size()) without checking for case -1.
(Same problem as last checkin for SF bug 610610)
Need to clear the error and proceed.
2002-09-23 21:19:44 +00:00
Neal Norwitz
677ed2cb68 SF bug # 557028, illegal use of malloc/free
This only applies to 2.2.  Use PyMem_Malloc/Free instead of malloc/free.
2002-08-11 15:40:35 +00:00
Neil Schemenauer
3d6247a3e3 Remove calls to 2.1 GC API (they are noops). 2002-08-05 14:46:29 +00:00
Martin v. Löwis
59b5b4720b Patch #554716: Use __va_copy where available. 2002-07-28 10:21:31 +00:00
Fred Drake
ed06e07dc9 Fix the docstring for sys.getrefcount().
Closes SF bug #571759.
2002-06-20 21:35:02 +00:00
Fred Drake
2c5d1ab857 PyModule_AddObject(): Added missing exceptions.
Closes SF bug #523473.
2002-06-17 17:16:34 +00:00
Guido van Rossum
9d21cd7e1a Backport:
SF bug 567538: Generator can crash the interpreter (Finn Bock).

This was a simple typo.  Strange that the compiler didn't catch it!
Instead of WHY_CONTINUE, two tests used CONTINUE_LOOP, which isn't a
why_code at all, but an opcode; but even though 'why' is declared as
an enum, comparing it to an int is apparently not even worth a
warning -- not in gcc, and not in VC++. :-(
2002-06-12 03:48:46 +00:00
Neal Norwitz
f79e084e38 Fix SF #561858 Assertion with very long lists
if co_stacksize was > 32767 (the maximum value
which can be stored in 16 bits (signed)),
the PyCodeObject would be written wrong.
So on the second import (reading the .pyc)
would cause a crash.

Since we can't change the PYC magic, we
go on (silently), but don't write the file.
This means everything will work, but
a .pyc will not be written and the file will need
to be parsed on each import.

I will backport.
2002-06-01 18:26:22 +00:00
Anthony Baxter
911933704e backport tim_one's patch:
Repair widespread misuse of _PyString_Resize.  Since it's clear people
don't understand how this function works, also beefed up the docs.  The
most common usage error is of this form (often spread out across gotos):

	if (_PyString_Resize(&s, n) < 0) {
		Py_DECREF(s);
		s = NULL;
		goto outtahere;
	}

The error is that if _PyString_Resize runs out of memory, it automatically
decrefs the input string object s (which also deallocates it, since its
refcount must be 1 upon entry), and sets s to NULL.  So if the "if"
branch ever triggers, it's an error to call Py_DECREF(s):  s is already
NULL!  A correct way to write the above is the simpler (and intended)

	if (_PyString_Resize(&s, n) < 0)
		goto outtahere;

Bugfix candidate.

Original patch(es):
python/dist/src/Python/bltinmodule.c:2.253
2002-04-30 04:05:33 +00:00
Michael W. Hudson
1f828b6297 This may well be my final checkin before 2.2.1.
If you think I've forgotten something, now is a good
time to howl (although I won't read the howl for a good
few hours 'cause I'm going home).

backport lemburg's checkin of
    revision 2.158 of pythonrun.c

Move Unicode finalization further down in the chain.
Fixes bug #525620.
2002-04-08 17:00:54 +00:00
Guido van Rossum
5b172978bb Add bool(), True, False (as ints) for backwards compatibility. 2002-04-08 13:31:12 +00:00
Guido van Rossum
919c066be2 Backport to 2.2.1:
This is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).

The fix makes it possible to call PyObject_GC_UnTrack() more than once
on the same object, and then move the PyObject_GC_UnTrack() call to
*before* the trashcan code is invoked.

BUGFIX CANDIDATE!
2002-03-29 14:47:18 +00:00
Guido van Rossum
fe34d0facd Backport to 2.2.1.
Fix an issue that was reported in but unrelated to the main problem of
SF bug 535905 (Evil Trashcan and GC interaction).

The SETLOCAL() macro should not DECREF the local variable in-place and
then store the new value; it should copy the old value to a temporary
value, then store the new value, and then DECREF the temporary value.
This is because it is possible that during the DECREF the frame is
accessed by other code (e.g. a __del__ method or gc.collect()) and the
variable would be pointing to already-freed memory.

BUGFIX CANDIDATE!
2002-03-28 20:18:48 +00:00
Michael W. Hudson
6ce28c36ad backport nascheme's checkin of
revision 2.102 of sysmodule.c

Fix wording of sys.exit docstring.  Close SF bug 534113.
2002-03-25 12:33:56 +00:00