Restore the test of the random module after including "Random" in the
ignore tuple.
The line, "from _random import Random as CoreGenerator", fools the test
code which expects CoreGenerator.__name__ to be "CoreGenerator" instead
of "Random".
This test depends on the exact ordering produced by the WichmannHill
random number generator. Altered it a bit to use the old generator
and restore the test.
Tim Peters [Sun, 29 Dec 2002 23:46:40 +0000 (23:46 +0000)]
Taught the Windows build about _randommodule.c. This is compiled
into the core DLL, since it's not much code and lots of stuff uses
it (e.g., try getting a tempfile name without it).
Tim Peters [Sun, 29 Dec 2002 23:44:49 +0000 (23:44 +0000)]
A start at non-trivial (== DST-aware) tests of timezone conversion.
Guido has in mind an easier way for users to code this stuff, but the
only tests we have now are for fixed-offset tzinfo classes, and this
stuff is extremely delicate in the endcases (read the new test code
for why: there are holes in time <wink>).
Kurt B. Kaiser [Sun, 29 Dec 2002 22:03:38 +0000 (22:03 +0000)]
M EditorWindow.py
M PyShell.py
1. PyShell Rev 1.39, EditorWindow Rev 1.37 fix was not handling a
multiline prompt.
2. The same fix introduced a bug where hitting <enter> at a previous
prompt-only line would copy the prompt to the iomark.
3. Move the setting of sys.ps1 earlier, into PyShell.main(), to allow
this code to work before a shell is started up.
4. If cursor is on the input line in the prompt, and you hit <enter>,
process the line instead of complaining.
5. If line has no stdin range (this includes the last line before shell
restart) strip any prompt before recalling.
Incorporate Skip's suggestion to use SciPy's validation test near
equality. Note, there is another flavor that compares to a given
number of significant digits rather than decimal places. If there
is a demand, that could be added at a later date.
SF patch #659536: Use PyArg_UnpackTuple where possible.
Obtain cleaner coding and a system wide
performance boost by using the fast, pre-parsed
PyArg_Unpack function instead of PyArg_ParseTuple
function which is driven by a format string.
Tim Peters [Sat, 28 Dec 2002 21:56:08 +0000 (21:56 +0000)]
Apparently FreeBSD enables some HW floating-point exceptions by default.
This can cause core dumps when Python runs. Python relies on the 754-
(and C99-) mandated default "non-stop" mode for FP exceptions. This
patch from Ben Laurie disables at least one FP exception on FreeBSD at
Python startup time.
Tim Peters [Fri, 27 Dec 2002 00:41:11 +0000 (00:41 +0000)]
Make comparison and subtraction of aware objects ignore tzinfo if the
operands have identical tzinfo members (meaning object identity -- "is").
I misunderstood the intent here, reading wrong conclusion into
conflicting clues.
Tim Peters [Thu, 26 Dec 2002 05:01:19 +0000 (05:01 +0000)]
Added tests to ensure that timetz comparison, and datetimetz
subtraction, work as documented. In the Python implementation,
they weren't calling utcoffset() if both operands had the same
tzinfo object. That's fine if it so happens that the shared
tzinfo object returns a fixed offset (independent of operand),
but can give wrong results if that's not so, and the latter
obtains in a tzinfo subclass instance trying to model both
standard and daylight times. The C implementation was already
doing this "correctly", so we're just adding tests to verify it.
Jack Jansen [Wed, 25 Dec 2002 22:45:28 +0000 (22:45 +0000)]
If you entered a pathname for a nonexisting file to a FSSpec constructor
on OSX then the actual error (file not found) was obscured by the
error message that tried to be helpful about the allowed arguments. Fixed.
Jack Jansen [Wed, 25 Dec 2002 22:31:28 +0000 (22:31 +0000)]
Changed folder name for apps from Python to MacPython-$(VERSION) (for a
normal 2.3 framework install) and MacPython-OSX-$(VERSION) (for the
experimental Jaguar addon install).
Kurt B. Kaiser [Tue, 24 Dec 2002 06:36:19 +0000 (06:36 +0000)]
M PyShell.py
M idle
M idle.py
M idle.pyw
M setup.py
Switch back to installing IDLE as a package. The IDLE GUI and the
subprocess will both attempt to start up via the package mechanism, but if
IDLE is not yet installed it is possible to run by calling python idle.py
in the IDLE source directory, or to add the source directory to sys.path.
One advantage of doing it this way is IDLE stays off sys.path.
Kurt B. Kaiser [Tue, 24 Dec 2002 00:57:22 +0000 (00:57 +0000)]
1. RPC stack levels were not pruned from traceback unless IDLE was started
from its source directory.
2. Replace final traceback '?' with '-toplevel-'
3. Remove duplicated import boolcheck
Tim Peters [Mon, 23 Dec 2002 22:21:52 +0000 (22:21 +0000)]
Brought the strftime explanation into synch with the plain-text sandbox
docs, and moved its section to the end (before the "C API" section,
which latter doesn't really belong in the Library manual).
Guido van Rossum [Mon, 23 Dec 2002 16:30:00 +0000 (16:30 +0000)]
Last week we discussed adding this module to the standard library.
Here's a draft. I have no immediate use for it, but I'd like this to
be available for experimentation. I may withdraw it or change it
radically up to and including the release of Python 2.3b1.
Kurt B. Kaiser [Mon, 23 Dec 2002 03:31:49 +0000 (03:31 +0000)]
M MANIFEST.in
M PyShell.py
M idlever.py
M setup.py
1. Update MANIFEST.in to include all non-pure Python files
2. PyShell and idlever reflect Rev 0.9a0
3. setup.py modified to install IDLE as a collection of modules with
a .pth file living at the idlelib level in site-packages. This was
done to make it easier to run from the source directory prior to
installing IDLE. This approach may change back to the package
technique depending on what happens with the Mac installation
development.
Tim Peters [Sun, 22 Dec 2002 20:58:42 +0000 (20:58 +0000)]
I give up: unless I write my own strftime by hand, datetime just can't
be trusted with years before 1900, so now we raise ValueError if a date or
datetime or datetimetz .strftime() method is called with a year before
1900.
Tim Peters [Sun, 22 Dec 2002 20:34:46 +0000 (20:34 +0000)]
Python's strftime implementation does strange things with the year,
such that the datetime tests failed if the envar PYTHON2K was set.
This is an utter mess, and the datetime module's strftime functions
inherit it. I suspect that, regardless of the PYTHON2K setting, and
regardless of platform limitations, the datetime strftime wrappers
will end up delivering nonsense results (or bogus exceptions) for
any year before 1900. I should probably just refuse to accept years
earlier than that -- else we'll have to implement strftime() by hand.
Tim Peters [Sun, 22 Dec 2002 18:10:22 +0000 (18:10 +0000)]
classify_object(): Renamed more meaningfully, to classify_utcoffset().
Also changed logic so that instances of user-defined subclasses of date,
time, and datetime are called OFFSET_NAIVE instead of OFFSET_UNKNOWN.
Tim Peters [Sun, 22 Dec 2002 03:43:39 +0000 (03:43 +0000)]
Implemented a Wiki suggestion:
{timetz,datetimetz}.{utcoffset,dst}() now return a timedelta (or None)
instead of an int (or None).
tzinfo.{utcoffset,dst)() can now return a timedelta (or an int, or None).
Curiously, this was much easier to do in the C implementation than in the
Python implementation (which lives in the Zope3 code tree) -- the C code
already had lots of hair to extract C ints from offset objects, and used
C ints internally.