Jack Jansen [Mon, 27 Aug 2001 14:01:05 +0000 (14:01 +0000)]
Refer to the toolbox modules by their official name (Carbon.AE), not the internal name (_AE). This can slow things down (once) but it's the only way I can get things to work on OSX, OS9 dynamically loaded and OS9 frozen.
Jack Jansen [Mon, 27 Aug 2001 13:59:35 +0000 (13:59 +0000)]
When we're freezing to sourcecode and one of the modules is a dynamic module that is in a package we freeze that module at toplevel (outside any package). Not optimal, but there is little more we can do as config.c has no way to specify a builtin module has to be dumped into a package.
Jack Jansen [Mon, 27 Aug 2001 10:55:41 +0000 (10:55 +0000)]
- A forgotten "from Carbon".
- Made the "killed unknown window" code dependent on a global var,
so you can easily turn the behaviour off for IDE debugging.
Barry Warsaw [Mon, 27 Aug 2001 03:11:09 +0000 (03:11 +0000)]
Two improvements suggested by Greg Stein:
PyString_FromFormatV(): In the final resize at the end, we can use
PyString_AS_STRING() since we know the object is a string and can
avoid the typechecking.
PyString_FromFormat(): GS sez: "For safety/propriety, you should call
va_end() on the vargs variable."
Tim Peters [Sat, 25 Aug 2001 03:02:28 +0000 (03:02 +0000)]
PyString_FromFormatV: Massage platform %p output to match what gcc does,
at least in the first two characters. %p is ill-defined, and people will
forever commit bad tests otherwise ("bad" in the sense that they fall
over (at least on Windows) for lack of a leading '0x'; 5 of the 7 tests
in test_repr.py failed on Windows for that reason this time around).
Barry Warsaw [Fri, 24 Aug 2001 19:11:57 +0000 (19:11 +0000)]
Quick and dirty fix for test_extcall failures trigged by Guido's
recent classobject.c change. When calling an unbound method with no
instances as first argument, the error message has changed. The
message now contains the class name, but the output text being
compared to is too generic, so skip printing it.
Guido van Rossum [Fri, 24 Aug 2001 18:48:27 +0000 (18:48 +0000)]
Improve the error message issued when an unbound method is called with
an inappropriate first argument. Now that there are more ways for
this to fail, make sure to report the name of the class of the
expected instance and of the actual instance.
Barry Warsaw [Fri, 24 Aug 2001 18:37:32 +0000 (18:37 +0000)]
Added lots of tests for reprs of "simple" objects, such as file,
lambda (anonymous functions?), function, xrange, buffer, cell (need to
fill in), and (some) descriptor types.
Also added a new test case for testing repr truncation fixes.
Barry Warsaw [Fri, 24 Aug 2001 18:32:06 +0000 (18:32 +0000)]
PyString_FromFormat() and PyString_FromFormatV(): Largely ripped from
PyErr_Format() these new C API methods can be used instead of
sprintf()'s into hardcoded char* buffers. This allows us to fix
many situation where long package, module, or class names get
truncated in reprs.
PyString_FromFormat() is the varargs variety.
PyString_FromFormatV() is the va_list variety
Original PyErr_Format() code was modified to allow %p and %ld
expansions.
Many reprs were converted to this, checkins coming soo. Not
changed: complex_repr(), float_repr(), float_print(), float_str(),
int_repr(). There may be other candidates not yet converted.
Guido van Rossum [Fri, 24 Aug 2001 15:23:20 +0000 (15:23 +0000)]
Change the getset type to take an optional third function argument:
the delete function. (Question: should the attribute name also be
recorded in the getset object? That makes the protocol more work, but
may give us better error messages.)
Guido van Rossum [Fri, 24 Aug 2001 10:17:36 +0000 (10:17 +0000)]
getset_descr_set(): guard against deletion (indicated by a set call
with a NULL value), in a somewhat lame way: call the set() function
with one argument. Should I add a 3rd function, 'del', instead?
Tim Peters [Thu, 23 Aug 2001 22:56:21 +0000 (22:56 +0000)]
SF bug [#454456] int overflow code needs tests.
Added tests for boundary cases in magical PEP 237 int->long auto-overflow,
but nothing here addresses the rest of the bug report so left it open.
Tim Peters [Thu, 23 Aug 2001 22:31:37 +0000 (22:31 +0000)]
float_pow: Put *all* of the burden on the libm pow in normal
cases.
powu: Deleted.
This started with a nonsensical error msg:
>>> x = -1.
>>> import sys
>>> x**(-sys.maxint-1L)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: negative number cannot be raised to a fractional power
>>>
The special-casing in float_pow was simply wrong in this case (there's
not even anything peculiar about these inputs), and I don't see any point
to it in *any* case: a decent libm pow should have worst-case error under
1 ULP, so in particular should deliver the exact result whenever the exact
result is representable (else its error is at least 1 ULP). Thus our
special fiddling for integral values "shouldn't" buy anything in accuracy,
and, to the contrary, repeated multiplication is less accurate than a
decent pow when the true result isn't exactly representable. So just
letting pow() do its job here (we may not be able to trust libm x-platform
in exceptional cases, but these are normal cases).
Greg Ward [Thu, 23 Aug 2001 20:53:27 +0000 (20:53 +0000)]
Patch #449054 to implement PEP 250. The standard install directory for
modules and extensions on Windows is now $PREFIX/Lib/site-packages.
Includes backwards compatibility code for pre-2.2 Pythons. Contributed
by Paul Moore.
Barry Warsaw [Thu, 23 Aug 2001 16:14:45 +0000 (16:14 +0000)]
Implement some suggestions by Laura Creighton.
ChipWidget.__init__(): Added a message area just below the color
name. Both the message and name widgets are now FLAT, DISABLED
Entry widgets instead of Labels. This allows users to
copy-n-paste the color names or color specs. Also, the contents
of both widgets are now driven by StringVars.
set_color(): This only sets the chip color; it does not set the name
widgets.
set_name(): New method which only sets the name widget contents.
set_message(): New method which only sets the message widget contents.
ChipViewer.update_yourself(): Set the color, name, and message for
each chip as follows: the first line always contains the color
spec in #rrggbb format. The second line will contain the color
name, but slightly differently for each widget. For the Selected
widget, if the color exactly matches the Nearest color, the name
is shown, otherwise the message field will be empty. The name
field of the Nearest widget will always contain the color name.
Jack Jansen [Thu, 23 Aug 2001 13:51:46 +0000 (13:51 +0000)]
The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package.
Guido van Rossum [Thu, 23 Aug 2001 02:58:07 +0000 (02:58 +0000)]
When an inlined operation on two small ints causes overflow, don't
raise the exception here -- call the generic function (which may
convert the arguments to long and try again).
Ka-Ping Yee [Tue, 21 Aug 2001 06:53:01 +0000 (06:53 +0000)]
Enhancements:
- file URL now starts with "file://" (standard) rather than "file:"
- new optional argument 'context' to enable()
- repeated variable names don't have their values shown twice
- dotted attributes are shown; missing attributes handled reasonably
- highlight the whole logical line even if it has multiple physical lines
- use nice generator interface to tokenize
- formatting fixed so that it looks good in lynx, links, and w3m too
Skip Montanaro [Tue, 21 Aug 2001 04:23:21 +0000 (04:23 +0000)]
This is supposed to help configure better sort out the various libdb
incarnations. It's probably not quite sufficient, but should be better than
the status quo...
Barry Warsaw [Mon, 20 Aug 2001 22:33:46 +0000 (22:33 +0000)]
Removed --have-resources flag in favor of the more granular -u/--use
flag, which specifies external or resource intensive tests to
perform. This is used by test_largefile and test_socket_ssl.
-u/--use takes a comma separated list of flags, currently supported:
largefile, network.
usage(): New function. Note that the semantics of main() have changed
slightly; instead of returning an error code, it raises a
SystemExit (via sys.exit()) with the given error code.
main(): use_large_resources => use_resources
Also, added support for long-option alternative to the short
options.
_expectations: Added test_socket_ssl to the list of expectedly skipped
tests.
Barry Warsaw [Mon, 20 Aug 2001 22:29:23 +0000 (22:29 +0000)]
use_large_resources => use_resources
requires(): New function which can be used to `assert' that a specific
-u/--use resource flag is present. Raises a TestSkipped if not.
This is used in test_largefile and test_socket_ssl to enable
external or resource consumptive tests that are normally
disabled.
Barry Warsaw [Mon, 20 Aug 2001 22:26:24 +0000 (22:26 +0000)]
SSL_dealloc(): Apply the change suggested in SF bug #425370 which
changes the order of the free calls to be the reverse of the alloc
calls. Closes that bug.
Fred Drake [Mon, 20 Aug 2001 21:24:19 +0000 (21:24 +0000)]
Deal more appropriately with bare ampersands and pointy brackets; this
module has to deal with "class" HTML-as-deployed as well as XHTML, so we
cannot be as strict as XHTML allows.
This closes SF bug #453059, but uses a different fix than suggested in
the bug comments.