Tim Peters [Wed, 24 Oct 2001 20:22:40 +0000 (20:22 +0000)]
SF bug #473525 pyclbr broken
As the comments in the module implied, pyclbr was easily confused by
"strange stuff" inside single- (but not triple-) quoted strings. It
isn't anymore. Its behavior remains flaky in the presence of nested
functions and classes, though.
Bugfix candidate.
Fred Drake [Wed, 24 Oct 2001 19:50:31 +0000 (19:50 +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.
Martin v. Löwis [Wed, 24 Oct 2001 17:10:49 +0000 (17:10 +0000)]
Check for HP/UX curses problems. Define _XOPEN_SOURCE_EXTENDED and
STRICT_SYSV_CURSES when compiling curses module on HP/UX. Generalize
access to _flags on systems where WINDOW is opaque. Fixes bugs
#432497, #422265, and the curses parts of #467145 and #473150.
Martin v. Löwis [Wed, 24 Oct 2001 14:36:00 +0000 (14:36 +0000)]
Include netdb.h to detect getaddrinfo. Work around problem with getaddrinfo
not properly processing numeric IPv4 addresses. Fixes V5.1 part of #472675.
Jack Jansen [Tue, 23 Oct 2001 22:26:16 +0000 (22:26 +0000)]
Got this to work in MacPython. The code is #ifdef macintosh style (to match the existing #ifdef MS_WINDOWS), but eventually ifdeffing on configure features is probably better.
Guido van Rossum [Tue, 23 Oct 2001 21:42:45 +0000 (21:42 +0000)]
Apply the first chunk of the second patch from SF bug #471720:
ThreadingMixIn/TCPServer forgets close (Max Neunhöffer).
This ensures that handle_error() and close_request() are called when
an error occurs in the thread.
(I am not applying the second chunk of the patch, which moved the
finish() call into the finally clause in BaseRequestHandler's __init__
method; that would be a semantic change that I cannot accept at this
point - the data would be sent even if the handler raised an
exception.)
Tim Peters [Tue, 23 Oct 2001 02:21:52 +0000 (02:21 +0000)]
SF bug [#473864] doctest expects spurios space.
Repair unlikely surprise due to magical softspace attr and the use of
print with a trailing comma in doctest examples.
Bugfix candidate.
Fred Drake [Mon, 22 Oct 2001 21:45:25 +0000 (21:45 +0000)]
Fixed denial-of-weak-ref-support test; Jeremy changed the error message
used by the weakref code since he didn't like the word "referencable".
Is it really necessary to be more specific than to test for TypeError here,
though?
Patch #473187: Add a test script that exercises most of the functions in
the curses module. It's not run automatically; '-u curses' must be
specified as an argument to regrtest
Fred Drake [Mon, 22 Oct 2001 15:07:16 +0000 (15:07 +0000)]
Do a little bit more to try and add <link> elements to the header, not that
Mozilla 0.9.5 can make intelligent use of them. Specifically, this causes
the "Acknowledgements" and "Global Module Index" pages to acquire "up"
links in the Mozilla "Site Navigation Bar".
This partially responds to SF bug #469772.
Fred Drake [Mon, 22 Oct 2001 14:18:23 +0000 (14:18 +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 [Mon, 22 Oct 2001 02:00:09 +0000 (02:00 +0000)]
Fix for SF bug #472940: can't getattr() attribute shown by dir()
There really isn't a good reason for instance method objects to have
their own __dict__, __doc__ and __name__ properties that just delegate
the request to the function (callable); the default attribute behavior
already does this.
The test suite had to be fixed because the error changes from
TypeError to AttributeError.
Guido van Rossum [Mon, 22 Oct 2001 00:43:43 +0000 (00:43 +0000)]
Methods of built-in types now properly check for keyword arguments
(formerly these were silently ignored). The only built-in methods
that take keyword arguments are __call__, __init__ and __new__.
Fredrik Lundh [Sun, 21 Oct 2001 16:47:57 +0000 (16:47 +0000)]
rewrote the pattern.sub and pattern.subn methods in C
removed (conceptually flawed) getliteral helper; the new sub/subn code
uses a faster code path for literal replacement strings, but doesn't
(yet) look for literal patterns.
added STATE_OFFSET macro, and use it to convert state.start/ptr to
char indexes
Guido van Rossum [Sun, 21 Oct 2001 00:44:31 +0000 (00:44 +0000)]
Big internal change that should have no external effects: unify the
'slotdef' structure typedef and 'struct wrapperbase'. By adding the
wrapper docstrings to the slotdef structure, the slotdefs array can
serve as the data structure that drives add_operators(); the wrapper
descriptor contains a pointer to slotdef structure. This replaces
lots of custom code from add_operators() by a loop over the slotdefs
array, and does away with all the tab_xxx tables.
Add two forgotten 'break' statements
Allow passing strings to the .border() method
Correct some error messages ("1 or 4" -> "1 to 4")
Bump version number
Tweak code formatting
Update my e-mail address
Fred Drake [Fri, 19 Oct 2001 17:22:29 +0000 (17:22 +0000)]
When stating that some parameters to makefile() are similar to the open()
parameters, given a hyperlink to the right part of the documentation to
make it easier to look those up. Also, refer to the file() function/
constructor instead of open() now that that is where the actual docs for
those parameters live.
This closes SF bug #472004.
Barry Warsaw [Fri, 19 Oct 2001 05:35:40 +0000 (05:35 +0000)]
Last minute updates for changes since 2.2a4. Unless Fred wants to add
anything about the hotshot profiler, this file is ready for the 2.2b1
Windows build.
Barry Warsaw [Fri, 19 Oct 2001 04:06:39 +0000 (04:06 +0000)]
Another merge from mimelib:
_handle_multipart(): If there is an epilogue and the epilogue does
not itself start with a newline, add a newline before writing the
epilogue. Closes SF bug #472481.
Guido van Rossum [Fri, 19 Oct 2001 02:01:31 +0000 (02:01 +0000)]
SF patch #470578: Fixes to synchronize unicode() and str()
This patch implements what we have discussed on python-dev late in
September: str(obj) and unicode(obj) should behave similar, while
the old behaviour is retained for unicode(obj, encoding, errors).
The patch also adds a new feature with which objects can provide
unicode(obj) with input data: the __unicode__ method. Currently no
new tp_unicode slot is implemented; this is left as option for the
future.
Note that PyUnicode_FromEncodedObject() no longer accepts Unicode
objects as input. The API name already suggests that Unicode
objects do not belong in the list of acceptable objects and the
functionality was only needed because
PyUnicode_FromEncodedObject() was being used directly by
unicode(). The latter was changed in the discussed way:
One thing left open to discussion is whether to leave the
PyUnicode_FromObject() API as a thin API extension on top of
PyUnicode_FromEncodedObject() or to turn it into a (macro) alias
for PyObject_Unicode() and deprecate it. Doing so would have some
surprising consequences though, e.g. u"abc" + 123 would turn out
as u"abc123"...
[Marc-Andre didn't have time to check this in before the deadline. I
hope this is OK, Marc-Andre! You can still make changes and commit
them on the trunk after the branch has been made, but then please mail
Barry a context diff if you want the change to be merged into the
2.2b1 release branch. GvR]
Guido van Rossum [Fri, 19 Oct 2001 01:18:43 +0000 (01:18 +0000)]
SF patch #443759: Add Interface to readline's add_history
This was submitted by Moshe, but apparently he's too busy to check it
in himself. He wrote:
Here is a function in GNU readline called add_history,
which is used to manage the history list. Though Python
uses this function internally, it does not expose it to
the Python programmer. This patch adds direct interface
to this function with documentation.
This could be used by friendly modules to "seed" the
history with commands.
Martin v. Löwis [Thu, 18 Oct 2001 21:24:04 +0000 (21:24 +0000)]
Move dlfcn.h block out of NetBSD block, assuming that NetBSD before
199712 didn't have dlfcn.h, or that it wouldn't conflict with the other
stuff defined.