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.
Tim Peters [Sun, 3 Mar 2002 23:17:02 +0000 (23:17 +0000)]
Python no longer compiled on Windows, due to #include file confusion
over SEP, ALTSEP and MAXPATHLEN.
Patched up posixmodule.c for MSVC, but unsure what the story is now on
other non-Unixish platforms -- the preprocessor maze has no exit <wink>.
Martin v. Löwis [Sun, 3 Mar 2002 21:30:27 +0000 (21:30 +0000)]
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
OS/2 EMX port changes (Modules part of patch #450267):
Modules/
posixmodule.c
- use SEP,ALTSEP #defines instead of hard coded path separator chars
- use EMX specific variants of chdir2(),getcwd() that support drive letters
- OS/2+EMX spawnv(),spawnve() support
- EMX specific popen[234]() derived from Win32 popen[234]() code
Tim Peters [Sat, 2 Mar 2002 08:43:19 +0000 (08:43 +0000)]
Whether platform malloc(0) returns NULL has nothing to do with whether
platform realloc(p, 0) returns NULL, so MALLOC_ZERO_RETURNS_NULL can
be correctly undefined yet realloc(p, 0) can return NULL anyway.
Prevent realloc(p, 0) doing free(p) and returning NULL via a different
hack. Would probably be better to get rid of MALLOC_ZERO_RETURNS_NULL
entirely.
Tim Peters [Sat, 2 Mar 2002 04:33:09 +0000 (04:33 +0000)]
For clarity, change _longobject to build directly from PyObject_VAR_HEAD
instead of faking it by hand. It *is* a var object, and nothing but
hysterical raisins to pretend it's an oddball.
Barry Warsaw [Fri, 1 Mar 2002 22:39:14 +0000 (22:39 +0000)]
Added PortableUnixMailbox to the __all__ variable, and in the __main__
section use this class instead of UnixMailbox as per the comments in
the latter's class.
SF patch 514641 (Naofumi Honda) - Negative ob_size of LongObjects
Due to the bizarre definition of _PyLong_Copy(), creating an instance
of a subclass of long with a negative value could cause core dumps
later on. Unfortunately it looks like the behavior of _PyLong_Copy()
is quite intentional, so the fix is more work than feels comfortable.
This fix is almost, but not quite, the code that Naofumi Honda added;
in addition, I added a test case.