Thomas Wouters [Mon, 17 Mar 2003 11:34:43 +0000 (11:34 +0000)]
binascii_a2b_base64: Properly return an empty string if the input was all
invalid, rather than returning a string of random garbage of the
estimated result length. Closes SF patch #703471 by Hye-Shik Chang.
[Backport patch #649762] Fix for asynchat endless loop
When the null string is used as the terminator, it used to be the same
as None, meaning "collect all the data". In the current code, however, it
falls into an endless loop; this change reverts to the old behavior.
Fred Drake [Thu, 6 Mar 2003 16:27:58 +0000 (16:27 +0000)]
Backport patch from revision 2.80:
Fix memory leak: free memory storing the content model passed to the
ElementDeclHandler by Expat.
Fixes SF bug #676990.
Guido van Rossum [Mon, 24 Feb 2003 01:23:03 +0000 (01:23 +0000)]
Backport:
Fix from SF patch #633359 by Greg Chapman for SF bug #610299:
The problem is in sre_compile.py: the call to
_compile_charset near the end of _compile_info forgets to
pass in the flags, so that the info charset is not compiled
with re.U. (The info charset is used when searching to find
the first character at which a match could start; it is not
generated for patterns beginning with a repeat like '\w{1}'.)
Neal Norwitz [Sun, 23 Feb 2003 23:34:37 +0000 (23:34 +0000)]
Backport relevant portions of:
Fix SF bug #691793, Python 2.3a2 build fails on Tru64
Need to make sure that preprocessor directives start in first column.
This means we can't indent code which has preprocessor directives,
nor have a space between [ #include for example.
Backport 1.38:
Fix an old bug in poll(). When a signal is handled while we're
blocked in select(), this will raise select.error with errno set to
EINTR. The except clauses correctly ignores this error, but the rest
of the logic will then call read() for all objects in select's *input*
list of read file descriptors. Then when an object's read_handler()
is naive, it will call recv() on its socket, which will raise an
IOError, and then asyncore decides to close the socket. To fix this,
we simply return in this case.
Backport candidate.
Guido van Rossum [Wed, 19 Feb 2003 03:52:47 +0000 (03:52 +0000)]
Backport of rev 2.199 from trunk.
PyObject_Generic{Get,Set}Attr:
Don't access tp_descr_{get,set} of a descriptor without checking the
flag bits of the descriptor's type. While we know that the main type
(the type of the object whose attribute is being accessed) has all the
right flag bits (or else PyObject_Generic{Get,Set}Attr wouldn't be
called), we don't know that for its class attributes!
Guido van Rossum [Wed, 19 Feb 2003 03:21:21 +0000 (03:21 +0000)]
Backport of rev 2.199 from trunk.
PyObject_Generic{Get,Set}Attr:
Don't access tp_descr_{get,set} of a descriptor without checking the
flag bits of the descriptor's type. While we know that the main type
(the type of the object whose attribute is being accessed) has all the
right flag bits (or else PyObject_Generic{Get,Set}Attr wouldn't be
called), we don't know that for its class attributes!
Guido van Rossum [Thu, 13 Feb 2003 17:06:02 +0000 (17:06 +0000)]
Backport 2.217 and 2.218:
Provide access to the import lock, fixing SF bug #580952. This is
mostly from SF patch #683257, but I had to change unlock_import() to
return an error value to avoid fatal error.
Fred Drake [Tue, 4 Feb 2003 15:13:25 +0000 (15:13 +0000)]
Update to better reflect the usage of struct_time instances throughout;
continuing to call these "time tuples" is misleading at best.
Closes SF bug #671731; backported from rev 1.55.
Neal Norwitz [Sun, 2 Feb 2003 19:59:59 +0000 (19:59 +0000)]
backport:
revision 2.196
date: 2002/12/07 21:39:16; author: tim_one; state: Exp; lines: +27 -28
slot_nb_nonzero(): Another leak uncovered by the sandbox datetime
tests. I found the logic too confusing to follow here, so rewrote more
than was likely absolutely necessary.
Neal Norwitz [Sun, 2 Feb 2003 19:37:32 +0000 (19:37 +0000)]
backport:
revision 2.164
date: 2002/10/29 18:36:40; author: gvanrossum; state: Exp; lines: +12 -13
Since properties are supported here, is possible that
instance_getattr2() raises an exception. Fix all code that made this
assumption.
revision 1.13
date: 2002/12/20 20:13:35; author: theller; state: Exp; lines: +1 -1
Fix an error message in the _winreg module. The error message referred
to a constant in the 'win32con' module, but this constant is also
defined in the _winreg module itself.
Neal Norwitz [Sun, 2 Feb 2003 19:24:38 +0000 (19:24 +0000)]
backport:
revision 1.29
date: 2002/11/21 21:08:39; author: gvanrossum; state: Exp; lines: +14 -8
The _Event class should be more careful with releasing its lock when
interrupted. A try/finally will do nicely. Maybe other classes need
this too, but since they manipulate more state it's less clear that
that is always the right thing, and I'm in a hurry.
revision 1.125
date: 2002/12/17 01:08:06; author: nnorwitz; state: Exp; lines: +6 -1
Fix SF # 641111, Undocumented side effect of eval
Try to clear up confusion about the current globals being copied
into a globals dict passed to eval(). This wording (more or less)
was suggested in bug report. It should probably be made clearer.
revision 1.124
date: 2002/12/17 01:02:57; author: nnorwitz; state: Exp; lines: +78 -0
Fix SF #642742, property() builtin not documented
Added doc for functions new to 2.2: classmethod property staticmethod super
Taken from docstrings. Could use review.
Hope there wasn't a reason why these shouldn't have been added.
Guido van Rossum [Mon, 13 Jan 2003 21:21:00 +0000 (21:21 +0000)]
Backport 1.33 from trunk:
Duh. cmdqueue should be an instance variable, not a class variable.
This was introduced in 1998 in rev. 1.13, where I imported extensive
patches that, I am sad to say, I didn't review as carefully as I
should have.
Since the WH generator never produced zero, it wasn't fair to characterize
this as a fix to a long outstanding bug. Instead, it makes sure that the
methods work as documented with any generator.
Steve Holden [Wed, 8 Jan 2003 21:17:35 +0000 (21:17 +0000)]
Retrospectively fix code to handle IE's additional characters on certain
web transactions more gracefully (through a fairly ugly hack). See bugs
430610 and 427345.
Backport typeobject.c revision 2.201 plus associated tests from 2.3:
Add a refinement to SLOT1BINFULL() that fixes the problem reported in
SF bug #623669: only try (e.g.) __rdiv__ before __div__ if the right
class actually overrides it.
Also backport a test for a feature that broke in 2.3 (__dict__ of a
new-style class with a user-defined metaclass should be a proxy).
Backport typeobject.c revision 2.201 plus associated tests from 2.3:
Add a refinement to SLOT1BINFULL() that fixes the problem reported in
SF bug #623669: only try (e.g.) __rdiv__ before __div__ if the right
class actually overrides it.
Correct long standing bugs in the methods for random distributions.
The range of u=random() is [0,1), so log(u) and 1/x can fail.
Fix by setting u=1-random() or by reselecting for a usable value.
Tim Peters [Mon, 23 Dec 2002 16:26:15 +0000 (16:26 +0000)]
Backporting a small part of the socket.py changes from 2.3: get rid
of the socket wrapper __del__ method. It isn't needed, and it prevents
cyclic structures containing socket objects (primarily on Windows, where
the wrapper is used) from getting garbage-collected. People running
ZEO tests in Zope under Windows are acutely aware of this, as the
test driver prints an ever-growing gc.garbage list after each test.
Backport documentation of left-to-right evaluation order.
Highlight the difference for dictionaries and provide Py2.2.3
users which advanced notice that the evaluation order will
change for Py2.3.
Guido van Rossum [Mon, 16 Dec 2002 22:32:46 +0000 (22:32 +0000)]
try_3way_compare() was returning -1 in one case where it should return
-2 (i.e. an exception was set). (This was already fixed in 2.3
through a different refactoring.)
Worth the release of Pyton 2.2.3? Eventually, I guess...