Jack Jansen [Mon, 18 Mar 2002 15:54:29 +0000 (15:54 +0000)]
Backport of _CFmodule.c 1.11 and _Winmodule 1.8:
Lurking bug found by patch for 531291: FSSpecs should be passed to
Py_BuildValue by address, not by value.
Jack Jansen [Mon, 18 Mar 2002 15:38:24 +0000 (15:38 +0000)]
Backport of _Resmodule.c 1.10 and ressupport.py 1.20:
Some of the newer routines return an OSErr, like most toolbox calls,
in stead of depending on ResError(). Second half of fix for #531291.
Guido van Rossum [Mon, 18 Mar 2002 03:05:36 +0000 (03:05 +0000)]
Fix for SF bug 528132 (Armin Rigo): classmethod().__get__() segfault
The proper fix is not quite what was submitted; it's really better to
take the class of the object passed rather than calling PyMethod_New
with NULL pointer args, because that can then cause other core dumps
later.
I also added a testcase for the fix to classmethods() in test_descr.py.
update text to refer to ServerProxy class in preference to Server, which is
only retained for backward compatibility with older versions of the library.
So there is some merit in slogging through ~4800 lines of cvs log.
Bring tempfile.py up to date from the trunk. There have been three
checkins (all by Tim):
SF bug #509805 tempfile.gettempdir not threadsafe
This is an ancient race when multiple threads call gettempdir() (or
anything relying on it) for the first time.
Fixed x-platform via the Big Hammer of rearranging the code to serialize
the first calls. Subsequent calls are as fast as before.
Note that the Python test suite can't provoke this bug: it requires
setting up multiple threads making the very first calls into tempfile,
but the test suite uses tempfile several times before getting to
test_threadedtempfile.
Bugfix candidate.
[and]
New TemporaryFile implementation for Windows: this doesn't need a
TemproraryFileWrapper wrapper anymore, and should be immune from the
problem that a temp file inherited by a spawned process caused an
attempt to close the temp file in the spawning process to blow
up (the unlink in TemporaryFileWrapper.close() blew up with a
"Permission denied" error because, despite that the temp file got
closed in the spawning process, the spawned process still had it open
by virtue of C-level file descriptor inheritance). In context,
that bug took days to figure out <wink/sigh>.
[and]
Thanks to Detlef Lannert for pointing out a typo in the code that
uses _DummyMutex on platforms without threads.
The first and third of these are pretty clearly bugfixes; I think the
second is too.
backport bwarsaw's checkin of
revision 4.7 of python-mode.el
(py-honor-comment-indentation, py-compute-indentation): Fix the
implementation to match the documentation for
py-honor-comment-indentation w.r.t. not nil or t value. In that case
it should still ignore ## for indentation purposes. Closes SF bug
#523825, w/ patch provided by Christian Stork (mod'd by Barry).
backport montanaro's checkin of
revision 1.24 of calendar.py
make _localized_name instances work more like the tuples they replaced. In
particular, negative indexes work and they are limited by the actual length
of the names they represent (weekday and month names). This closes bug
#503202.
[and then]
Corrected _localized_name.__getitem__ based on code in patch 503202 (which I
thought was just a bug report, so didn't notice - doh!). This handles
slicing, which v 1.23 didn't.
backport gvanrossum's checkin of
revision 1.121 of test_descr.py
"Fix" for SF bug #520644: __slots__ are not pickled.
As promised in my response to the bug report, I'm not really fixing
it; in fact, one could argule over what the proper fix should do.
Instead, I'm adding a little magic that raises TypeError if you try to
pickle an instance of a class that has __slots__ but doesn't define or
override __getstate__. This is done by adding a bozo __getstate__
that always raises TypeError.
Bugfix candidate (also the checkin to typeobject.c, of course).
backport gvanrossum's checkin of
revision 2.129 of typeobject.c
"Fix" for SF bug #520644: __slots__ are not pickled.
As promised in my response to the bug report, I'm not really fixing
it; in fact, one could argule over what the proper fix should do.
Instead, I'm adding a little magic that raises TypeError if you try to
pickle an instance of a class that has __slots__ but doesn't define or
override __getstate__. This is done by adding a bozo __getstate__
that always raises TypeError.
Fred Drake [Sat, 16 Mar 2002 05:10:22 +0000 (05:10 +0000)]
Clarify the descriptions of the positive and negative lookbehind assertions.
Added examples of positive lookbehind assertions.
This closes SF bug #529708.
Fred Drake [Sat, 16 Mar 2002 04:52:55 +0000 (04:52 +0000)]
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
change the installed version on either of the machines I use to format the
docs. Instead, use a compatibility hack to support both versions. This is
also better for external users of the Python styles.
Fred Drake [Fri, 15 Mar 2002 23:18:05 +0000 (23:18 +0000)]
Revise the markup related to the grammar productions to increase the
level of predictability. This is not really "good" markup, but is arguably
better than we had before.
This closes SF bug #523117.
backport akuchling's checkin of
revision 1.29 of asyncore.py
[Bug #517554] When a signal happens during the select call in
asyncore.poll, the select fails with EINTR, which the
code catches. However, the code fails to clear the
r/w/e arrays (like poll3 does), which means it acts as
if every descriptor had received all possible events.
backport akuchling's checkin of
revision 1.39 of ConfigParser.py
[Bug #523301] ConfigParser.write() produces broken output for values that
were originally rfc822-like line continuations.
Modified version of a patch from Matthias Ralfs.
Fred Drake [Wed, 13 Mar 2002 02:45:58 +0000 (02:45 +0000)]
Change the way \textasciitilde is implemented so it works more consistently
(dropping tildes into data that still goes through LaTeX-like processing is
a bad idea).
backport tim_one's checkin of
revision 2.111 of floatobject.c
SF bug 525705: [2.2] underflow raise OverflowException.
Another year in the quest to out-guess random C behavior.
Added macros Py_ADJUST_ERANGE1(X) and Py_ADJUST_ERANGE2(X, Y). The latter
is useful for functions with complex results. Two corrections to errno-
after-libm-call are attempted:
1. If the platform set errno to ERANGE due to underflow, clear errno.
Some unknown subset of libm versions and link options do this. It's
allowed by C89, but I never figured anyone would do it.
2. If the platform did not set errno but overflow occurred, force
errno to ERANGE. C89 required setting errno to ERANGE, but C99
doesn't. Some unknown subset of libm versions and link options do
it the C99 way now.
Bugfix candidate, but hold off until some Linux people actually try it,
with and without -lieee. I'll send a help plea to Python-Dev.
backport tim_one's checkin of
revision 2.28 of cmathmodule.c
SF bug 525705: [2.2] underflow raise OverflowException.
Another year in the quest to out-guess random C behavior.
Added macros Py_ADJUST_ERANGE1(X) and Py_ADJUST_ERANGE2(X, Y). The latter
is useful for functions with complex results. Two corrections to errno-
after-libm-call are attempted:
1. If the platform set errno to ERANGE due to underflow, clear errno.
Some unknown subset of libm versions and link options do this. It's
allowed by C89, but I never figured anyone would do it.
2. If the platform did not set errno but overflow occurred, force
errno to ERANGE. C89 required setting errno to ERANGE, but C99
doesn't. Some unknown subset of libm versions and link options do
it the C99 way now.
Bugfix candidate, but hold off until some Linux people actually try it,
with and without -lieee. I'll send a help plea to Python-Dev.
backport tim_one's checkin of
revision 2.45 of pyport.h
SF bug 525705: [2.2] underflow raise OverflowException.
Another year in the quest to out-guess random C behavior.
Added macros Py_ADJUST_ERANGE1(X) and Py_ADJUST_ERANGE2(X, Y). The latter
is useful for functions with complex results. Two corrections to errno-
after-libm-call are attempted:
1. If the platform set errno to ERANGE due to underflow, clear errno.
Some unknown subset of libm versions and link options do this. It's
allowed by C89, but I never figured anyone would do it.
2. If the platform did not set errno but overflow occurred, force
errno to ERANGE. C89 required setting errno to ERANGE, but C99
doesn't. Some unknown subset of libm versions and link options do
it the C99 way now.
Bugfix candidate, but hold off until some Linux people actually try it,
with and without -lieee. I'll send a help plea to Python-Dev.
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).
backport jhylton's checkin of
revision 2.97 of abstract.c
Fix for SF bug 516727: MyInt(2) + "3" -> NotImplemented
PyNumber_Add() tries the nb_add slot first, then falls back to
sq_concat. However, it didn't check the return value of sq_concat.
If sq_concat returns NotImplemented, raise the standard TypeError.
backport jhylton's checkin of
revision 1.45 of httplib.py
SF bug report #405939: wrong Host header with proxy
In August, Greg said this looked good, so I'm going ahead with it.
The fix is different from the one in the bug report. Instead of using
a regular expression to extract the host from the url, I use
urlparse.urlsplit.
Martin commented that the patch doesn't address URLs that have basic
authentication username and password in the header. I don't see any
code anywhere in httplib that supports this feature, so I'm not going
to address it for this fix.
I presume most of the fixes currently hitting the tree should go into
2.2.1, but it would be nice if people remembered to comment on their
fixes' applicability!
backport akuchling's checkin of
revision 1.26 of webchecker.py
[Bug #512799] urllib.splittype() returns a 2-tuple. (Reported by seb bacon)
backport jhylton's checkin of
revision 2.33 of cStringIO.c
Fix SF bug #526518
The doc string for cStringIO suggested that str() of a StringIO object
was equivalent to getvalue(). This was never true, so repair the doc
string. (doctest would have helped here.)
Jack Jansen [Sun, 10 Mar 2002 21:33:19 +0000 (21:33 +0000)]
Backport of 1.22:
Use waste included with CW in stead of separate package.
(But a truer log message would have been "updated to current version of waste",
as in MachoPython we use a normal standalone separate Waste distribution).
Jack Jansen [Sun, 10 Mar 2002 21:29:55 +0000 (21:29 +0000)]
Backport of 1.9 (missed last time around):
Changes by Donovan Preston (and a few minor ones by me) to make IDE run under
MachoPython. Mainly making sure we don't call routines that don't exist
and representing pathnames in a os.separator-neutral format.
backport jackjansen's checkin of
revision 1.294 of configure.in
revision 1.285 of configure
When testing for availability of pthreads without special compiler options
or libraries also look for thread_detach. SGI has thread_create in libc
but complete pthread support only in -lpthread. Fixes #522393.
backport montanaro's checkin of
revision 1.58 of pydoc.py
add repr_str as alias for repr_string in both HTMLRepr and TextRepr classes
- reflects the change in type("").__name__ between 2.1 and 2.2. The
__name__ field is used to find a method to call for particular types.
backport tim_one's checkin of
revision 2.38 of mmapmodule.c
SF bug 515943: searching for data with \0 in mmap.
mmap_find_method(): this obtained the string to find via s#, but it
ignored its length, acting as if it were \0-terminated instead.
Someone please run on Linux too (the extended test_mmap works on Windows).
backport tim_one's checkin of
revision 1.20 of test_mmap.py
SF bug 515943: searching for data with \0 in mmap.
mmap_find_method(): this obtained the string to find via s#, but it
ignored its length, acting as if it were \0-terminated instead.
Someone please run on Linux too (the extended test_mmap works on Windows).
After some thinking, I decided to move all of this across onto
the branch. I don't think it can break code, so the only risk
is introducing new bugs. In that vein, can I ask -checkins readers
who have time to carefully look this over, check my refcounts &c?
TIA.
backport my checkin of
revision 1.5 of structseq.c
Apply (my) patch:
[ 526072 ] pickling os.stat results round II
structseq's constructors can now take "invisible" fields in a dict.
Gave the constructors better error messages.
their __reduce__ method puts these fields in a dict.
(this is all in aid of getting os.stat_result's to pickle portably)
Also fixes
[ 526039 ] devious code can crash structseqs
Thought needed about how much of this counts as a bugfix. Certainly
#526039 needs to be fixed.