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.
Kurt B. Kaiser [Sat, 21 Dec 2002 21:39:11 +0000 (21:39 +0000)]
When IDLE is installed and run from a startup script, the script's
directory becomes sys.path[0]. What is wanted is the directory from which
IDLE was called.
Insert the current working directory in the path if it isn't there
already.
Kurt B. Kaiser [Sat, 21 Dec 2002 21:03:06 +0000 (21:03 +0000)]
M PyShell.py
M idle
M setup.py
To be able to run from the source directory or from an installed version
of IDLE, and also to allow the subprocess to find run(), Python needs to
have the idlelib package on its path.
1. Modify setup.py to supply a .pth file living at same level as idlelib
2. Move boolcheck to PyShell.py
3. Remove boolcheck and path setting code from the "idle" script
Kurt B. Kaiser [Fri, 20 Dec 2002 22:40:30 +0000 (22:40 +0000)]
Update the setup file:
1. Make it easier to change the package and script installation names.
2. Update the text files transferred to include the .def and new .txt
files.
3. Update the description and long description, change email to
python-dev, update the url to point at sourceforge.
4. Rename the build and install classes for clarity.
Thomas Heller [Fri, 20 Dec 2002 20:13:35 +0000 (20:13 +0000)]
Fix an error message in the _winreg module. The error message referred
to a constant in the 'win32con' module, but this constant is also
defined in the _winreg module itself.
Tony Lownds [Fri, 20 Dec 2002 04:24:43 +0000 (04:24 +0000)]
Update way a subprocess is launched for Mac OS X.
Another applet mechanism has been developed for Python on Mac OS X and
trying to use the -c "__import__('run').main()" trick is just not working.
macosx_main.py is a new file which should be used as the startup file for
Mac OS X applet bundles. This startup file understands a -p option, which
when seen will start run.main(). When running as an applet, this seems like
the best approach.
Tim Peters [Fri, 20 Dec 2002 01:31:27 +0000 (01:31 +0000)]
format_utcoffset(): The natural type of the buflen arg is size_t, so
used that.
wrap_strftime(): Removed the most irritating uses of buf.
TestDate.test_ordinal_conversions(): The C implementation is fast enough
that we can afford to check the endpoints of every year. Also added
tm_yday tests at the endpoints.
Jack Jansen [Wed, 18 Dec 2002 23:17:26 +0000 (23:17 +0000)]
- Added rawdata initializers
- Added support for optional FSSpecs and FSRefs to the Alias routines.
NewAlias and friends are still functions, though, not methods.