Jack Jansen [Fri, 29 Mar 2002 21:26:04 +0000 (21:26 +0000)]
Completely revamped newline handling. PyEdit is now newline-preserving
(if a single newline convention is used in the sourcefile), and the
"save options" has a newline style radio button.
The creator radio button also has the new choices PythonW and None.
Jack Jansen [Fri, 29 Mar 2002 21:23:47 +0000 (21:23 +0000)]
Allow file without filetype as long as they end in ".py".
Added a -D flag (can really only be specified on OSX commandline) to not
revector sys.stderr, for debugging the IDE itself. Not sure whether
this should stay.
Fred Drake [Thu, 28 Mar 2002 23:12:09 +0000 (23:12 +0000)]
Move some of the longer example code to external fragments, and
include them using \verbatiminput. This has the advantage that pages
can still break at reasonable places, and examples that go longer than
a page won't get cut off.
Make a few small markup adjustments for consistency.
Explain that PyObject_New() is not a C function but a polymorphic
beast that returns a pointer to the type that's passed as the first
arg.
Explain why type objects use the PyObject_VAR_HEAD.
Jeremy Hylton [Thu, 28 Mar 2002 23:01:56 +0000 (23:01 +0000)]
Fix getcomments() so that it doesn't fail with TypeErrors.
It appears that getcomments() can get called for classes defined in
C. Since these don't have source code, it can't do anything useful.
A function buried many levels deep was raising a TypeError that was
not caught.
Guido van Rossum [Thu, 28 Mar 2002 20:34:59 +0000 (20:34 +0000)]
This is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).
The fix makes it possible to call PyObject_GC_UnTrack() more than once
on the same object, and then move the PyObject_GC_UnTrack() call to
*before* the trashcan code is invoked.
Guido van Rossum [Thu, 28 Mar 2002 20:17:52 +0000 (20:17 +0000)]
Fix an issue that was reported in but unrelated to the main problem of
SF bug 535905 (Evil Trashcan and GC interaction).
The SETLOCAL() macro should not DECREF the local variable in-place and
then store the new value; it should copy the old value to a temporary
value, then store the new value, and then DECREF the temporary value.
This is because it is possible that during the DECREF the frame is
accessed by other code (e.g. a __del__ method or gc.collect()) and the
variable would be pointing to already-freed memory.
Tim Peters [Thu, 28 Mar 2002 07:32:11 +0000 (07:32 +0000)]
PYMALLOC_DEBUG routines: The "check API family" gimmick was going nowhere
fast, and just cluttered the code. Get rid of it for now. If a compelling
case can be made for it, easy to restore it later.
Fred Drake [Thu, 28 Mar 2002 05:33:33 +0000 (05:33 +0000)]
Introduce two new flag bits that can be set in a PyMethodDef method
descriptor, as used for the tp_methods slot of a type. These new flag
bits are both optional, and mutually exclusive. Most methods will not
use either. These flags are used to create special method types which
exist in the same namespace as normal methods without having to use
tedious construction code to insert the new special method objects in
the type's tp_dict after PyType_Ready() has been called.
If METH_CLASS is specified, the method will represent a class method
like that returned by the classmethod() built-in.
If METH_STATIC is specified, the method will represent a static method
like that returned by the staticmethod() built-in.
These flags may not be used in the PyMethodDef table for modules since
these special method types are not meaningful in that case; a
ValueError will be raised if these flags are found in that context.
Barry Warsaw [Tue, 26 Mar 2002 20:27:35 +0000 (20:27 +0000)]
__init__(): We'll try to be more RFC 2821 compliant by providing for a
better local_hostname default. According to RFC 2821, it is
recommended that the fqdn hostname be provided in the EHLO/HELO verb
and if that can't be calculated, to use a domain literal.
The rationale for this change is documented in SF patch #497736 which
also had privacy concerns about leaking the fqdn in the EHLO/HELO. We
decided this wasn't a big concern because no user data is leaked, and
the IP will always be leaked. The local_hostname argument is provided
for those clients that are super paranoid.
Using localhost.localdomain may break some strict smtp servers so we
decided against using it as the default.
Skip Montanaro [Mon, 25 Mar 2002 21:44:07 +0000 (21:44 +0000)]
remove unqualified excepts - catch ImportError when trying to import
readline and get rid of string exception fallback when showing syntax
errors.
see bug 411881
Jack Jansen [Mon, 25 Mar 2002 15:32:01 +0000 (15:32 +0000)]
Due to interaction between the MSL C library and the GUSI I/O library I can get reads from sockets to work consistently either for unbuffered binary files or for buffered binary files, but not for both:-(
The workaround is to force socket.makefile() to disable buffering for binary files.
Tim Peters [Mon, 25 Mar 2002 06:55:57 +0000 (06:55 +0000)]
Remove bug.py. This is something I sent to Guido via email in or before
'94, demonstrating a thread bug that was later repaired via Python growing
an internal import lock. It's of no current interest, and the now-std
test_threaded_import.py is pretty much the same test.