[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.
Tim Peters [Thu, 28 Feb 2002 21:34:34 +0000 (21:34 +0000)]
SF patch 522961: Leak in Python/thread_nt.h, from Gerald S. Williams.
A file-static "threads" dict mapped thread IDs to Windows handles, but
was never referenced, and entries never got removed. This gets rid of
the YAGNI-dict entirely.
Bugfix candidate.
Tim Peters [Thu, 28 Feb 2002 19:38:51 +0000 (19:38 +0000)]
PyGC_Head: Use "long double" instead of "double" as the worst-case
alignment gimmick. David Abrahams notes that the standard "long double"
actually requires stricter alignment than "double" on some Tru64 box.
On my box and yours <wink>, it's the same, so no harm done on most
boxes.
Martin v. Löwis [Thu, 28 Feb 2002 15:24:47 +0000 (15:24 +0000)]
Correct various errors:
- Use substring search, not re search for user-agent and paths.
- Consider * entry last. Unquote, then requote URLs.
- Treat empty Disallow as "allow everything".
Add test cases. Fixes #523041
Guido van Rossum [Tue, 26 Feb 2002 22:39:23 +0000 (22:39 +0000)]
SF patch #523169, by Samuele Pedroni.
There were never tests for the fact that list() always returns a *new*
list object, even when the argument is a list, while tuple() may
return a reference to the argument when it is a tuple. Now there are.
Andrew MacIntyre [Tue, 26 Feb 2002 11:41:34 +0000 (11:41 +0000)]
OS/2 EMX port changes (Python part of patch #450267):
Python/
dynload_shlib.c // EMX port emulates dlopen() etc. for DL extensions
import.c // changes to support 8.3 DLL name limit (VACPP+EMX)
// and case sensitive import semantics
importdl.h
thread_os2.h
Andrew MacIntyre [Tue, 26 Feb 2002 11:36:35 +0000 (11:36 +0000)]
OS/2 EMX port changes (Objects part of patch #450267):
Objects/
fileobject.c
stringobject.c
unicodeobject.c
This commit doesn't include the cleanup patches for stringobject.c and
unicodeobject.c which are shown separately in the patch manager. Those
patches will be regenerated and applied in a subsequent commit, so as
to preserve a fallback position (this commit to those files).
Guido van Rossum [Mon, 25 Feb 2002 23:23:24 +0000 (23:23 +0000)]
canonic(): Fix by Edward K Ream to make breakpoints work better on
Windows: apply normcase() as well as abspath(). (Note: this isn't
needed to make IDLE work, but it's a good idea anyway.)
Tim Peters [Sat, 23 Feb 2002 04:40:15 +0000 (04:40 +0000)]
SF bug #501591: dir() doc is old
Bugfix candidate.
+ Updated dir() description to match actual 2.2 behavior.
+ Replaced the dir(sys) example with dir(struct), because the former
was way out of date and is bound to change frequently, while the
latter is stable.
+ Added a note cautioning that dir() is supplied primarily for
convenience at an interactive prompt (hoping to discourage its
use as the foundation of introspective code outside the core).
Andrew MacIntyre [Fri, 22 Feb 2002 11:06:30 +0000 (11:06 +0000)]
Create and populate OS/2 EMX port platform specific library directory:
Lib/plat-os2emx/
IN.py
SOCKET.py
grp.py
pwd.py // pwd module that can process real passwd files
regen
Thomas Heller [Wed, 20 Feb 2002 08:01:19 +0000 (08:01 +0000)]
First version which runs an install-script (specified by the
--install-script ... command line option to bdist_wininst) at the end
of the installation and at the start of deinstallation. Output
(stdout, stderr) of the script (if any) is displayed in the last
screen at installation, or in a simple message box at deinstallation.
sys.argv[1] for the script will contain '-install' at installation
time or '-remove' at deinstallation time.
The installation script runs in an environment (embedded by the
bdist_wininst runtime) where an additional function is available as
builtin:
Tim Peters [Tue, 19 Feb 2002 04:25:19 +0000 (04:25 +0000)]
Somebody made list.__dict__ grow a '__doc__' key, but apparently didn't
run the test suite afterwards. Either that, or whether '__doc__' shows
up is platform-dependent!