Commit Graph

1561 Commits

Author SHA1 Message Date
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
Michael W. Hudson
db780071b7 backport tim_one's checkin of
revision 2.248 of bltinmodule.c

Docstring for filter():  Someone on the Tutor list reasonably complained
that it didn't tell enough of the truth.
Bugfix candidate (I guess -- it helps and it's harmless).
2002-03-11 10:15:00 +00:00
Michael W. Hudson
f51017d5f7 backport tim_one's checkin of
revision 2.22 of thread_nt.h

SF patch  522961: Leak in Python/thread_nt.h, from Gerald S. Williams.
A file-static "threads" dict mapped thread IDs to Windows handles, but
was never referenced, and entries never got removed.  This gets rid of
the YAGNI-dict entirely.
Bugfix candidate.
2002-03-05 13:56:23 +00:00
Martin v. Löwis
59509f511e Patch #50002: Display line information for bad \x escapes:
- recognize "SyntaxError"s by the print_file_and_line attribute.
- add the syntaxerror attributes to all exceptions in compile.c.
Fixes #221791
2002-03-03 21:32:01 +00:00
Neal Norwitz
ebaaf18711 SF #506611, fix sys.setprofile(), sys.settrace() core dumps
when no arguments are passed
2002-03-03 15:17:07 +00:00
Michael W. Hudson
6ac411e448 backport my checkin of
revision 1.16 of getcopyright.c

date: 2002/02/27 13:29:46;  author: mwh;  state: Exp;  lines: +1 -1
Add 2002 to PSF copyrights.
2002-02-27 13:31:58 +00:00
Michael W. Hudson
d17700cc49 Backport jackjansen's checkin of revision 2.37:
Workaround for what is probably a problem in Apple's gcc: <pthread.h> fails
on a function pointer formal argument called "destructor", which is typedeffed
as a different function pointer type in object.h.
2002-02-23 08:43:03 +00:00
Michael W. Hudson
fa338d7fad Fix a bunch of typos found by nnorwitz. 2002-02-06 17:06:03 +00:00
Michael W. Hudson
7043010028 It's merge time! (well, this is the last one for the moment)
Backport gvanrossum's checkin of revision 2.236:

A tentative fix for SF bug #503837 (Roeland Rengelink):
type.__module__ problems (again?)

This simply initializes the __module__ local in a class statement from
the __name__ global.  I'm not 100% sure that this is the correct fix,
although it usually does the right thing.  The problem is that if the
class statement executes in a custom namespace, the __name__ global
may be taken from __builtins__, in which case it would have the value
__builtin__, or it may not exist at all (if the custom namespace also
has a custom __builtins__), in which case the class statement will
fail.

Nevertheless, unless someone finds a better solution, this is a 2.2.1
bugfix too.

(apparently noone has :()
2002-01-28 16:06:11 +00:00
Michael W. Hudson
23d65ff4e4 It's merge time!
Backport loewis' checkin of revision 2.7 (of dynload_hpux.c):

Test for error status of shl_findsym. Fixes #505417. 2.2.1 candiate.
2002-01-28 15:13:21 +00:00
Michael W. Hudson
44f813a382 Fix for
[ #496154 ] Typos in dynload_beos.c

and on the branch.
2002-01-23 15:53:08 +00:00
Martin v. Löwis
0d21e64409 Include <unistd.h> in Python.h. Fixes #500924. 2002-01-12 11:13:24 +00:00
Michael W. Hudson
5fde86fad5 Backport tim_one's checkin of version 2.302:
SF bug #496549 -Qnew and in-place division "/=".

eval_frame():  Under -Qnew, INPLACE_DIVIDE wasn't getting handed off to
INPLACE_TRUE_DIVIDE (like BINARY_DIVIDE was getting handed off to
BINARY_TRUE_DIVIDE).

Bugfix candidate.
2001-12-28 10:22:15 +00:00
cvs2svn
22768184cb This commit was manufactured by cvs2svn to create branch
'release22-maint'.
2001-12-28 04:27:46 +00:00
Tim Peters
b6d14daa1c SF bug #494668: PUSH() should assert-fail on overflow.
eval_frame():  Added asserts to the top of the eval loop, to verify
that the eval stack pointer is in bounds, plus some comments.
2001-12-19 04:11:07 +00:00
Martin v. Löwis
8d3ce5a6b3 Patch #494384: Disable more Unicode API if Unicode is not used. 2001-12-18 22:36:40 +00:00
Tim Peters
b519638d1e _PyEval_SliceIndex(): explain why a NULL argument is allowed (thanks
to Guido for the revelation).
2001-12-16 19:44:20 +00:00
Tim Peters
cb479e78e0 _PyEval_SliceIndex(): Repaired the comments, and added XXX comments
about its dubious treatment of NULL (also opened a bug report on that,
but don't want to risk changing it this late in the 2.2 game).
2001-12-16 19:11:44 +00:00
Jeremy Hylton
733c8935f9 Fix for SF bug [ #492403 ] exec() segfaults on closure's func_code
Based on the patch from Danny Yoo.  The fix is in exec_statement() in
ceval.c.

There are also changes to introduce use of PyCode_GetNumFree() in
several places.
2001-12-13 19:51:56 +00:00
Jeremy Hylton
2990640d8a Add a comment explaining the st_symbols cache. 2001-12-10 00:53:18 +00:00
Tim Peters
0f2d4b84a6 PySymtableEntry_New(): I'm not sure what this routine is doing, but it
was obviously leaking an int object when whatever the heck it's looking for
was found.  Repaired that.  This accounts for why entering function and
class definitions at an interactive prompt leaked a reference to the
integer 1 each time.
Bugfix candidate.
2001-12-08 23:40:38 +00:00
Jeremy Hylton
0702858d73 Missing DECREFs when exception is raised in sys.excepthook.
Bug fix candidate for 2.1 branch.

(I imagine the other recent leak patches are bug fix candidates, too,
but I forgot to mark mine as such.)
2001-12-07 15:35:35 +00:00
Jack Jansen
e3d7622fb3 Don't fail on importing things with undefined references. Unfortunately we
still fail on importing modules that link with libraries that fail
their initialization code (such as windowing libraries when we don't have
access to the window server) and that is what I really wanted to fix.
2001-12-06 22:58:56 +00:00