Anthony Baxter [Thu, 1 Nov 2001 15:34:20 +0000 (15:34 +0000)]
one more for the night.
backport of 2.26:
Make the gc.collect() function respect the collection lock. This fixes
SF bug 476129: "gc.collect sometimes hangs".
Anthony Baxter [Thu, 1 Nov 2001 14:55:03 +0000 (14:55 +0000)]
backport of (merged) 1.43 and 1.44
initregex(): this function is declared void, so the recent change to
return NULL in an error case was itself an error.
initregex(): Check return value of PyErr_Warn() and propagate the exception
(if any.)
Anthony Baxter [Thu, 1 Nov 2001 14:43:51 +0000 (14:43 +0000)]
backport of 2.58:
Fix SF bug #474538: Memory (reference) leak in poller.register (Dave Brueck)
Replace some tortuous code that was trying to be clever but forgot to
DECREF the key and value, by more longwinded but obviously correct
code.
Anthony Baxter [Thu, 1 Nov 2001 14:39:41 +0000 (14:39 +0000)]
backport 2.56 from uncle tim:
Stop adding 3 to FD_SETSIZE -- it makes no sense. If it turns out it
actually does <wink>, perhaps an Insure run will catch it.
Also removed senseless Windows comment.
Anthony Baxter [Thu, 1 Nov 2001 14:37:48 +0000 (14:37 +0000)]
backport barry's 2.54:
select_select(): Closing bug #448351 the easy way, i.e. by changing
the "#ifdef MS_WINDOWS" to "#ifdef SELECT_USES_HEAP" and by
setting SELECT_USES_HEAP when FD_SETSIZE > 1024.
The indirection seems useful since this subtly changes the path
that "normal" Windows programs take (where Timmie sez FD_SETSIZE =
512). If that's a problem for Windows, he has only one place to
change.
Anthony Baxter [Thu, 1 Nov 2001 14:14:26 +0000 (14:14 +0000)]
partial backport of guido's 1.188.
Add sendall() method, which loops until all data is written or an
error occurs, and doesn't return a count. (This is my second patch
from SF patch #474307, with small change to the docstring for send().)
the 'partial' is because 1.188 also added a couple of Py_*_ALLOW_THREADS
wrappers around SSL_read and SSL_write, and I want to check those separately.
This is adding a new method to the socket object, which would normally
be a bad thing to do in a bugfix release - however, in this case, it
allows fixes for a nasty problem that would otherwise have a filthy
filthy fix to Get It Right. Still to-do is to patch the std library
modules to use sendall() where appropriate, rather than send().
Anthony Baxter [Thu, 1 Nov 2001 14:05:52 +0000 (14:05 +0000)]
backport of MvL's 1.180
Test for __sun instead of __sun__, since SUNWspro only defines the latter;
gcc defines both.
...must get sparc box at home out of cupboard for testing this stuff...
Anthony Baxter [Thu, 1 Nov 2001 14:00:11 +0000 (14:00 +0000)]
backport tim's 1.191:
PySocketSock_connect_ex(): On Windows, return the correct Windows exit
code. The patch is from Jeremy, and allows test_asynchat to run again.
Anthony Baxter [Thu, 1 Nov 2001 13:58:16 +0000 (13:58 +0000)]
backport (partially) jeremy's 1.178
Use PySocket_Err() instead of PyErr_SetFromErrno().
The former does the right thing on Windows, the latter does not.
The 'partial' is because the code's changed quite a lot and it's not clear
that the two that are still there of the form
return PyErr_SetFromErrno(SSLErrorObject);
can be replaced with PySocket_Err() - it looks like they need the new
PySSL_SetError, which is a tad large to be comfortable with just checking
in without reading it further.
Anthony Baxter [Thu, 1 Nov 2001 13:14:43 +0000 (13:14 +0000)]
backport of 2.114:
SF patch #459385 (Norman Vine): time.timezone fix for Cygwin.
(skipped whitespace normalisation section of patch - this is a bugfix,
not a beauty contest :)
Anthony Baxter [Thu, 1 Nov 2001 11:30:06 +0000 (11:30 +0000)]
backport fixes from 2.32 and 2.29:
Change the limit on the input size for b2a_base64 to what will fit in
memory, rather than the standard's 57.
This fixes SF bug #473009.
This closes bug #430849 (internal error produced by binascii.a2b_base64)
Fred Drake [Wed, 24 Oct 2001 19:52:14 +0000 (19:52 +0000)]
When describing "import *", add a level of indirection between "*" and the
set of names imported (the "public names"), adding a definition of "public
names" that describes the use of __all__.
This closes SF bug #473986.
Fred Drake [Mon, 22 Oct 2001 14:25:12 +0000 (14:25 +0000)]
Clarify that the resource module does not attempt to mask platform
differences by defining symbols not defined on particular platforms.
This closes SF bug #473433.
Guido van Rossum [Fri, 19 Oct 2001 15:13:51 +0000 (15:13 +0000)]
Merge in selected changes from profile.py on the trunk. Note that
this is *not* a simple-minded merge from the code on the trunk -- that
does too much other stuff to be 100% safe for the 2.1.2 release
(e.g. getting rid of HotProfile and OldProfile, changing some methods
into global functions, a new calibration API).
Add the test_profile.py module which verifies that the profiler works
as expected.
Thomas Heller [Fri, 19 Oct 2001 08:07:19 +0000 (08:07 +0000)]
The version number 1.0.2pre doesn't conform to the strict versioning
guidelines in distutils/version, resulting in failure when trying to
use distutils to install 4Suite (and perhaps other modules).
Fred Drake [Thu, 9 Aug 2001 22:00:32 +0000 (22:00 +0000)]
Remove lines that should never have been checked into this
release21-maint branch; I checked them in erroneously in revision
1.52.4.1 of this file; it looks like that entire revision was
operator error.
This reverts that checkin and closes SF bug #449613.
Jack Jansen [Sun, 29 Jul 2001 21:50:44 +0000 (21:50 +0000)]
These demos used silly refcon values when creating their windows. This effectuively caused Pythons automatic cleanup of windows on refcount reaching zero to be disabled.
Jack Jansen [Sun, 29 Jul 2001 21:23:18 +0000 (21:23 +0000)]
If you double-click a file with creator Pyth but owner != TEXT exit with a warning that this is not a script but an auxiliary document such as a preferrences file or an aplication template. This is a lot better than giving syntax errors on binary data:-)
Fix showstopper SF bug #442983: use of site.addsitedir() was broken
because it references the global dirs_in_sys_path which is deleted.
The fix avoids deleting that global.
(My email through python.org or digicool.com is non-functional at the
moment; use gvanrossum@home.com to reach me.)
Fred Drake [Thu, 19 Jul 2001 03:47:04 +0000 (03:47 +0000)]
Remove some false comments.
Reorganize so the initialization sequences does not bite us in the foot.
(There is no good reason to discard classes that clients may want to
subclass.)
Thomas Wouters [Mon, 16 Jul 2001 16:03:31 +0000 (16:03 +0000)]
Backport of AMK's checkin 2.52:
[Bug #438050]
Include sys/poll.h if it was found by the configure script. The OpenGroup
spec says poll.h is the correct header file to use, so that file is
preferred.
Thomas Wouters [Mon, 16 Jul 2001 15:45:20 +0000 (15:45 +0000)]
Fix SF #441664: Python crash on del of a slice of a mmap
Check for slice/item deletion, which calls slice/item assignment with a NULL
value, and raise a TypeError instead of coredumping. Bugreport and suggested
fix by Alex Martelli.
Thomas Wouters [Fri, 13 Jul 2001 15:10:55 +0000 (15:10 +0000)]
Expand the blob on Solaris to mention passing '-Xc' to compile Python
correctly. Note that 'faulty' should actually be spelled 'fawlty', but I
don't want those bugreports assigned to me ;)
Thomas Wouters [Thu, 12 Jul 2001 12:43:11 +0000 (12:43 +0000)]
Net result of Tim's checkins 2.28 through 2.31:
- SF but #417587: compiler warnings compiling 2.1.
Repaired *some* of the SGI compiler warnings Sjoerd Mullender
reported.
- Minor fiddling related to
SF patch 416251 2.1c1 mmapmodule: unused vrbl cleanup
- Fix the .find() method for memory maps.
1) it didn't obey the "start" parameter (and when it does, we must
validate the value)
2) the return value needs to be an absolute index, rather than
relative to some arbitrary point in the file
(checking CVS, it appears this method never worked; these changes
bring it into line with typical .find() behavior)
- Fix new compiler warnings. Also boost "start" from (C) int to long and
return a (C) long: PyArg_ParseTuple and Py_BuildValue may not let
us get at the size_t we really want, but C int is clearly too small
for a 64-bit box, and both the start parameter and the return value
should work for large mapped files even on 32-bit boxes. The code
really needs to be rethought from scratch (not by me, though ...).
Thomas Wouters [Wed, 11 Jul 2001 22:27:39 +0000 (22:27 +0000)]
Re-do the broken-nice() patch to break less platforms. Hopefully none :P
Also note that it isn't just Linux nice() that is broken: at least FreeBSD
and BSDI also have this problem. os.nice() should probably just be emulated
using getpriority()/setpriority(), if they are available, but that isn't
worth putting in 2.1.1.
Thomas Wouters [Wed, 11 Jul 2001 12:18:24 +0000 (12:18 +0000)]
Backport of Guido's checkins of acconfig.h (1.50), configure.in (1.224) and
readline.c (2.36), and re-generated config.h.in and configure:
SF Patch #432457 by Jason Tishler: support for readline 4.2.
This patch allows the readline module to build cleanly with GNU
readline 4.2 without breaking the build for earlier GNU readline
versions. The configure script checks for the presence of
rl_completion_matches in libreadline.
Thomas Wouters [Wed, 11 Jul 2001 12:15:15 +0000 (12:15 +0000)]
Backport of the socketserver test, including output file (which is still
necessary in the 2.1 branch.) Guido's original checkin message:
A test suite for SocketServer.py that exposes the various bugs just
fixed. Regrettably, this must be run manually -- somehow the I/O
redirection of the regression test breaks the test. When run under
the regression test, this raises ImportError with a warning to that
effect.
Thomas Wouters [Wed, 11 Jul 2001 12:05:49 +0000 (12:05 +0000)]
Backport of Guido's checkin 1.25:
Fix various serious problems:
- The ThreadingTCPServer class and its derived classes were completely
broken because the main thread would close the request before the
handler thread had time to look at it. This was introduced by
Ping's close_request() patch. The fix moves the close_request()
calls to after the handler has run to completion in the BaseServer
class and the ForkingMixIn class; when using the ThreadingMixIn,
closing the request is the handler's responsibility.
- The ForkingUDPServer class has always been been broken because the
socket was closed in the child before calling the handler. I fixed
this by simply not calling server_close() in the child at all.
- I cannot get the UnixDatagramServer class to work at all. The
recvfrom() call doesn't return a meaningful client address. I added
a comment to this effect. Maybe it works on other Unix versions.
- The __all__ variable was missing ThreadingMixIn and ForkingMixIn.
- Bumped __version__ to "0.4".
- Added a note about the test suite (to be checked in shortly).
Thomas Wouters [Wed, 11 Jul 2001 12:03:44 +0000 (12:03 +0000)]
Backport of Tim's checkin 2.178:
SF bug #438295: [Windows] __init__.py cause strange behavior
Probable fix (the bug report doesn't have enough info to say for sure).
find_init_module(): Insist on a case-sensitive match for __init__ files.
Given __INIT__.PY instead, find_init_module() thought that was fine, but
the later attempt to do find_module("__INIT__.PY") didn't and its caller
silently suppressed the resulting ImportError. Now find_init_module()
refuses to accept __INIT__.PY to begin with.
Thomas Wouters [Wed, 11 Jul 2001 11:38:20 +0000 (11:38 +0000)]
Backport Tim's checkin 1.17:
SF patch #440144: Tests and minor bugfix for uu module
decode(): While writing tests for uu.py, Nick Mathewson discovered
that the 'Truncated input file' exception could never get raised,
because its "if not str:" test was actually testing the builtin
function "str", not the local string vrbl "s" as intended.