Jack Jansen [Mon, 5 Nov 2001 14:44:23 +0000 (14:44 +0000)]
Carbon Event Manager module donated by Donovan Preston. Checked in as I received them (except for namechange), these will not work as-is, that'll be fixed in a later checkin.
Tim Peters [Sun, 4 Nov 2001 23:09:40 +0000 (23:09 +0000)]
long_true_divide(): decref its converted arguments. test_long_future.py
run in an infinite loop no longer grows. Thanks to Neal Norwitz for
determining that test leaked!
Tim Peters [Sun, 4 Nov 2001 19:26:58 +0000 (19:26 +0000)]
Part of SF bug #478003 possible memory leaks in err handling.
PyNode_CompileSymtable: if symtable_init() fails, free the memory
allocated for the PyFutureFeatures struct.
Tim Peters [Sun, 4 Nov 2001 07:29:31 +0000 (07:29 +0000)]
Rehabilitated the fast-path richcmp code, and sped it up. It wasn't
helping for types that defined tp_richcmp but not tp_compare, although
that's when it's most valuable, and strings moved into that category
since the fast path was first introduced. Now it helps for same-type
non-Instance objects that define rich or 3-way compares.
For all the edits here, the rest just amounts to moving the fast path from
do_richcmp into PyObject_RichCompare, saving a layer of function call
(measurable on my box!). This loses when NESTING_LIMIT is exceeded, but I
don't care about that (fast-paths are for normal cases, not pathologies).
Also added a tasteful <wink> label to get out of PyObject_RichCompare, as
the if/else nesting in this routine was getting incomprehensible.
Barry Warsaw [Sun, 4 Nov 2001 03:04:25 +0000 (03:04 +0000)]
Two bug fixes for problems reported by Sverre:
__getaddr(): Watch out for empty addresses that can happen when
something like "MAIL FROM:<CR>" is received. This avoids the
IndexError and rightly returns an SMTP syntax error.
parseargs(): We didn't handle the 2-arg case where both the localspec
and the remotespec were provided on the command line.
Tim Peters [Sat, 3 Nov 2001 19:35:43 +0000 (19:35 +0000)]
Improved error msg when a symbolic group name is redefined. Added docs
and NEWS. Bugfix candidate? That's a dilemma for Anthony <wink>: /F
did fix a longstanding bug here, but the fix can cause code to raise an
exception that previously worked by accident.
Just van Rossum [Fri, 2 Nov 2001 19:17:16 +0000 (19:17 +0000)]
- rearranged some imports
- removed default button drawing code: this doesn't work well
under OSX. Needs to be replaced by SetWindowDefaultButton()
calls, once we have those.
Tim Peters [Thu, 1 Nov 2001 23:59:56 +0000 (23:59 +0000)]
float_divmod(): the code wasn't sick enough to stop the MS optimizer
from optimizing away mod's sign adjustment when mod == 0; so it got
the intended result only in the debug build.
Jack Jansen [Thu, 1 Nov 2001 23:17:35 +0000 (23:17 +0000)]
We always install the Sioux menubar, in stead of only when no menubar
was installed previously. This fixes bug #476904, but I'm not 100%
sure it doesn't break anything else. But if it does I'll notice tomorrow
when I try to build GRiNS:-)
Tim Peters [Thu, 1 Nov 2001 23:12:27 +0000 (23:12 +0000)]
SF bug #477221: abs and divmod act oddly with -0.0
Try to ensure that divmod(-0.0, 1.0) -> (-0.0, +0.0) across platforms.
It always did on Windows, and still does. It didn't on Linux. Alas,
there's no platform-independent way to write a test case for this.
Bugfix candidate.
Tim Peters [Thu, 1 Nov 2001 21:51:15 +0000 (21:51 +0000)]
float_abs() again: Guido pointed out that this could screw up in the
presence of NaNs. So pass the issue on to the platform libm fabs();
after all, fabs() is a std C function because you can't implement it
correctly in portable C89.
Fred Drake [Thu, 1 Nov 2001 20:26:12 +0000 (20:26 +0000)]
PyFunction_Call() did not check the result of PyObject_Repr() for NULL, and
should just avoid calling it in the first place to avoid waiting for a repr
of a large object like a dict or list. The result of PyObject_Repr() was
being leaked as well.
Bugfix candidate!
Add has_finalizer predictate function. Use it when deciding which
objects to save in gc.garbage. This should be the last change needed to
fix SF bug 477059: "__del__ on new classes vs. GC".
Note that this change slightly changes the behavior of the collector.
Before, if a cycle was found that contained instances with __del__
methods then all instance objects in that cycle were saved in
gc.garbage. Now, only objects with __del__ methods are saved in
gc.garbage.
Jack Jansen [Thu, 1 Nov 2001 14:44:15 +0000 (14:44 +0000)]
The import check in setup.py fails on Mac OS X for Carbon-based modules
if you are not building while logged in to the console (you cannot
connect to the window server, so the Carbon library doesn't initialize).
Added a quick hack to skip the import test, with a warning, for modules
linked against Carbon.
SF bug #477059 (my own): __del__ on new classes vs. GC.
When moving objects with a __del__ attribute to a special list, look
for __del__ on new-style classes with the HEAPTYPE flag set as well.
(HEAPTYPE means the class was created by a class statement.)
Jack Jansen [Wed, 31 Oct 2001 12:11:48 +0000 (12:11 +0000)]
Link the core with CoreServices, not with Carbon, and don't use any Carbon
routines. As of 10.1 using Carbon will crash Python if no window server is
available (ssh connection, console mode, MacOSX Server). This fixes bug
#466907.
A result of this mod is that the default 8bit encoding on OSX is now ASCII,
for the time being. Also, the extension modules that need the Carbon
framework now explicitly include it in setup.py.
Tim Peters [Tue, 30 Oct 2001 23:20:46 +0000 (23:20 +0000)]
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Jack Jansen on python-dev.
Add simple test case.
Move vereq() from test_descr to test_support (it's handy!).
Jack Jansen [Tue, 30 Oct 2001 22:48:36 +0000 (22:48 +0000)]
Mod by Donovan Preston to allow MacPython to live in a Python.app bundle and understand the __main__.py convention used there for applets. This gives us applets that work on both OS9 and OSX! (Although "applet" may not be the correct word for something that is going to be multimegabyte:-).
But: the code is currently disabled, as it requires CodeWarrior 7 and I'm still using 6.
Tim Peters [Tue, 30 Oct 2001 21:09:55 +0000 (21:09 +0000)]
SF bug #474077 2.2b1: Error compiling extns with BCC
Removed "#undef HAVE_HYPOT" line from Borland config, as suggested.
Whether this will break some other Borland usage is a good question I
can't answer.
Fred Drake [Tue, 30 Oct 2001 16:28:46 +0000 (16:28 +0000)]
Always use --dvips-safe when generating HTML for the standard documentation
since we do not have anything that causes dvips to be run except when
PostScript is specifically requested, which is a separate target.
Fred Drake [Tue, 30 Oct 2001 16:09:51 +0000 (16:09 +0000)]
Add a new option, --dvips-safe, which sets the $DVIPS_SAFE option in
LaTeX2HTML. This is not safe to do in general (for the reasons LaTeX2HTML
protects against dvips to begin with), but is safe if we do not actually
need to run dvips. Note that we also assume it is safe if the user
specifically requests PostScript generation. See the comments for further
explanation.
Guido van Rossum [Tue, 30 Oct 2001 03:17:30 +0000 (03:17 +0000)]
Fix SF bug #456386: test_commands regression failure (Andrew Dalke)
test_commands does not work on IRIX
It assumes the output of "ls /bin/ls" is a line
that starts with a '-'. On IRIX that file is
a symbolic link, so the first character is an l.
This causes test_getstatus to fail.