Skip Montanaro [Fri, 15 Mar 2002 13:52:43 +0000 (13:52 +0000)]
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.
Jack Jansen [Fri, 15 Mar 2002 13:50:54 +0000 (13:50 +0000)]
Skip test_longexp for MacPython on Mac OS X. It triggers a pathological realloc slowdown. Some tests with shorter expressions lead me to the conclusion that it will eventually finish, but it may take a few weeks:-)
Skip Montanaro [Fri, 15 Mar 2002 04:08:38 +0000 (04:08 +0000)]
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.
Guido van Rossum [Thu, 14 Mar 2002 23:05:54 +0000 (23:05 +0000)]
"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).
Guido van Rossum [Thu, 14 Mar 2002 23:03:14 +0000 (23:03 +0000)]
"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.
Skip Montanaro [Thu, 14 Mar 2002 17:35:25 +0000 (17:35 +0000)]
update text to refer to ServerProxy class in preference to Server, which is
only retained for backward compatibility with older versions of the library.
Tim Peters [Wed, 13 Mar 2002 21:51:55 +0000 (21:51 +0000)]
Move to zlib 1.1.4 on Windows (the new version that squashes the "double
free" glitch).
Bugfix candidate -- I'll backpatch this into 2.2.1 later this week.
Fred Drake [Wed, 13 Mar 2002 02:48:24 +0000 (02:48 +0000)]
Extend the list of special characters and magic markup used to produce them
to include various characters used in code samples, URLs, and other special
contexts.
This closes SF bug #525684.
Fred Drake [Wed, 13 Mar 2002 02:44:50 +0000 (02:44 +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).
Fred Drake [Tue, 12 Mar 2002 21:49:44 +0000 (21:49 +0000)]
Change the example code to prefer PyModule_Add*() instead of using the
module dictionary directly. Also, be more careful about not re-initializing
globals in the event of re-initialization of a C extension.
Jack Jansen [Tue, 12 Mar 2002 15:25:52 +0000 (15:25 +0000)]
Add a -Wno-long-double flag to the compile flags on Mac OS X. Fixes bug
525481. (Probably not a 2.2.1 candidate, unless the fix that introduced a
long double into objimpl.h (rev. 2.44) is backported to 2.2.1).
Tim Peters [Tue, 12 Mar 2002 03:04:44 +0000 (03:04 +0000)]
Change Windows file.truncate() to (a) restore the original file position,
and (b) stop trying to prevent file growth.
Beef up the file.truncate() docs.
Change test_largefile.py to stop assuming that f.truncate() moves the
file pointer to the truncation point, and to verify instead that it leaves
the file position alone. Remove the test for what happens when a
specified size exceeds the original file size (it's ill-defined, according
to the Single Unix Spec).
Tim Peters [Mon, 11 Mar 2002 00:24:00 +0000 (00:24 +0000)]
file_truncate(): provide full "large file" support on Windows, by
dropping MS's inadequate _chsize() function. This was inspired by
SF patch 498109 ("fileobject truncate support for win32"), which I
rejected.
libstdtypes.tex: Someone who knows should update the availability
blurb. For example, if it's available on Linux, it would be good to
say so.
test_largefile: Uncommented the file.truncate() tests, and reworked to
do more. The old comment about "permission errors" in the truncation
tests under Windows was almost certainly due to that the file wasn't open
for *write* access at this point, so of course MS wouldn't let you
truncate it. I'd be appalled if a Unixish system did.
CAUTION: Someone should run this test on Linux (etc) too. The
truncation part was commented out before. Note that test_largefile isn't
run by default.
Tim Peters [Sun, 10 Mar 2002 07:59:13 +0000 (07:59 +0000)]
SF patch 499062: Minor typo in test_generators.py.
There's no actual patch there. It's an objection that Guido's example
doesn't actually generator "leaves", so change the comment that says
it does.
Tim Peters [Sat, 9 Mar 2002 04:58:24 +0000 (04:58 +0000)]
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.
Tim Peters [Sat, 9 Mar 2002 00:06:26 +0000 (00:06 +0000)]
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).
Jeremy Hylton [Fri, 8 Mar 2002 21:11:37 +0000 (21:11 +0000)]
Fix for SF bug 516727: MyInt(2) + "3" -> NotImplemented
PyNumber_Add() tries the nb_add slot first, then falls back to
sq_concat. However, tt didn't check the return value of sq_concat.
If sq_concat returns NotImplemented, raise the standard TypeError.
Jeremy Hylton [Fri, 8 Mar 2002 19:35:51 +0000 (19:35 +0000)]
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.
[Bug #491820] Define two abstract methods to shut up Pychecker, and for
documentation purposes. These implementations are the same as the
ones suggested by Skip in the bug report.
[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.
[Bug #523301] ConfigParser.write() produces broken output for values that
were originally rfc822-like line continuations.
Modified version of a patch from Matthias Ralfs.
Jeremy Hylton [Fri, 8 Mar 2002 17:17:33 +0000 (17:17 +0000)]
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 [Fri, 8 Mar 2002 13:43:01 +0000 (13:43 +0000)]
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.
Tim Peters [Fri, 8 Mar 2002 05:43:32 +0000 (05:43 +0000)]
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).
Fred Drake [Fri, 8 Mar 2002 03:15:49 +0000 (03:15 +0000)]
I started writing more documentation on the Scrap module at one point, but
it is difficult to do without a Mac box to try things out on. This expands
on what was there only a little bit; hopefully someone with a Mac can work
on this as well!
Skip Montanaro [Thu, 7 Mar 2002 22:58:02 +0000 (22:58 +0000)]
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.
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.
Fred Drake [Tue, 5 Mar 2002 04:02:39 +0000 (04:02 +0000)]
Remove extra indenatation from sample interpreter session.
Remove whitespace from the middle of an inline RE example; it was OK for
the typeset formats, but LaTeX2HTML is more touchy about this.