Commit Graph

25240 Commits

Author SHA1 Message Date
Tim Peters d684415572 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.
2002-12-22 20:58:42 +00:00
Tim Peters 83b85f1d6c 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.
2002-12-22 20:34:46 +00:00
Tim Peters 14b6941197 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.
2002-12-22 18:10:22 +00:00
Tim Peters 855fe88b24 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.
2002-12-22 03:43:39 +00:00
Kurt B. Kaiser 18091540db Add configuration for packaging. 2002-12-22 01:48:28 +00:00
Kurt B. Kaiser ff002b9305 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.
2002-12-21 21:39:11 +00:00
Kurt B. Kaiser dd70e1be91 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
2002-12-21 21:03:06 +00:00
Martin v. Löwis 9c36c29156 Use wcscoll for _locale.strcoll if available. 2002-12-21 18:34:06 +00:00
Tim Peters b92bb71be8 Added test to ensure that non-string result from dst() raises TypeError. 2002-12-21 17:44:07 +00:00
Tim Peters fb8472c79c Changes sufficient so that pickles written by the Python implementation
can be read by the C implementation.  I don't really understand this.
2002-12-21 05:04:42 +00:00
Kurt B. Kaiser f39f59a5f2 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.
2002-12-20 22:40:30 +00:00
Thomas Heller e1d18f52c3 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.

Bugfix candidate.
2002-12-20 20:13:35 +00:00
Kurt B. Kaiser 4ba6067d6b Remove debugging statement checked in by accident, ah, carelessness. 2002-12-20 19:37:09 +00:00
Kurt B. Kaiser 83a3560527 "'foo' in str" not implemented in Python 2.2, only single character lookup 2002-12-20 17:18:03 +00:00
Tim Peters 8ed8320827 Fixed longstanding bug in the description of strftime's %W code. 2002-12-20 17:15:39 +00:00
Tony Lownds 582fa882d2 *** empty log message *** 2002-12-20 04:26:00 +00:00
Tony Lownds f53dec2e4e 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.
2002-12-20 04:24:43 +00:00
Guido van Rossum 24475896dd Fix what I believe is a bug: when removing all previous handlers,
should copy the handlers list because it's being modified by the loop.
2002-12-20 01:54:21 +00:00
Tim Peters 328fff7214 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.
2002-12-20 01:31:27 +00:00
Kurt B. Kaiser d0e2926d2a Panel Bar on the Bottom is Probably More Common 2002-12-20 01:22:01 +00:00
Kurt B. Kaiser a137cc9cb7 Updated. 2002-12-20 01:19:47 +00:00
Jack Jansen 77e8ad4684 Always use self->ob_type->tp_free when freeing an object. 2002-12-19 23:34:40 +00:00
Jack Jansen 6810f92d4d The extension module macfs has been replaced by a pure Python version. 2002-12-19 23:27:58 +00:00
Jack Jansen e87663306a Added the last missing bits of functionality, and fixed a nasty bug where we
could overwrite memory.
2002-12-19 23:26:58 +00:00
Jack Jansen 4235e71acc A replacement for the macfs extension module, implemented with normal
(generated) Carbon module functionality.

Not 100% complete yet, but at least the IDE doesn't crash on startup.
2002-12-19 23:26:07 +00:00
Jack Jansen 4f0e05f738 Gone: the constants have been moved to macfs.py (which, upon import, also
poses as MACFS for backward compatibility).
2002-12-19 23:24:37 +00:00
Jack Jansen f955784f0c Regenerated with inheritance-aware xxxx_Check() macros. 2002-12-19 21:24:35 +00:00
Jack Jansen 5bb2f6497f Always output an inheritance-aware version of the xxxx_Check() macro. Also
fixed that macro to actually work:-)
2002-12-19 20:37:32 +00:00
Martin v. Löwis 03d00d51ba Fix if-then-else-fi structure. 2002-12-19 19:03:31 +00:00
Neal Norwitz ee65e22646 Fix bug introduced by SF patch #643835, Set Next Statement for Python debuggers
blockstack_top could be 0 when blockstack[blockstack_top-1]
was referenced (ie blockstack[-1]) which crashed on hpux.
Patch & fix by Richie Hindle
2002-12-19 18:16:57 +00:00
Martin v. Löwis 7e4cfcb6bc Unsupport --without-universal-newlines. 2002-12-19 16:21:49 +00:00
Neal Norwitz 93344ab036 Update/correct comment 2002-12-19 15:24:11 +00:00
Neal Norwitz 802926482c Provide mechanism to deprecate functions, types, and struct members.
It would be nice to support other compilers besides gcc.
2002-12-19 15:12:26 +00:00
Kurt B. Kaiser d5e1cef92f If Edit window has not been saved, offer to save if user tries to Run or
Check the module.
2002-12-19 03:25:34 +00:00
Neal Norwitz dfb8086760 Fix another long vs int mismatch. test_datetime now passes on alpha 2002-12-19 02:30:56 +00:00
Tim Peters 0b0f41cf1f Fixed typo in string. 2002-12-19 01:44:38 +00:00
Neal Norwitz c296c63c73 Fix crash on alphas due to mismatch between 'l' format and int variables. 2002-12-19 00:42:03 +00:00
Neal Norwitz 91787cb4b3 Undefine MIN and MAX before defining
Some systems (HPUX at least) already define MIN/MAX for us
2002-12-18 23:33:35 +00:00
Neal Norwitz 8feeabb975 SF # 654974, fix unchecked return values in structseq
Check return values after memory allocation.
Also use Py_True instead of PyInt_FromLong(1) for bool value.

Backport candidate.
2002-12-18 23:20:39 +00:00
Jack Jansen 543c9253cd - Added rawdata initializers
- Added support for optional FSSpecs and FSRefs to the Alias routines.
  NewAlias and friends are still functions, though, not methods.
2002-12-18 23:17:26 +00:00
Tim Peters ba873472d2 delta_str(): Purged last uses of sprintf (in favor of PyOS_snprintf). 2002-12-18 20:19:21 +00:00
Raymond Hettinger 72a6ddb5ee Expand log() tests to include long integers. 2002-12-18 16:13:16 +00:00
Andrew M. Kuchling ca2623a2f9 Check in current, unfinished, draft of datetime docs
(Fred, don't bother to add to lib.tex or to proofread this yet.)
2002-12-18 14:59:11 +00:00
Fred Drake e0f02f0826 Fix some small markup nits. 2002-12-18 02:07:14 +00:00
Neal Norwitz 3e93b4d222 Fix typo spotted by Richie Hindle 2002-12-18 01:20:29 +00:00
Neal Norwitz 06982221bb SF # 654960, remove unnecessary static variable
The static variable (implicit) was not necessary.
The c_globals can be None or True now.
2002-12-18 01:18:44 +00:00
Jack Jansen 1795f29b4b Fixed silly typo.
Added comment (to myself) on what still needs to be done.
2002-12-17 23:29:27 +00:00
Jack Jansen 58fc91f947 This module will shortly replace the builtin module macfs. It is not
complete yet, but it should work. It will be finished (and renamed)
shortly.
2002-12-17 23:28:24 +00:00
Greg Ward 3ebf56c60f Two more typo fixes. 2002-12-17 23:27:41 +00:00
Jack Jansen ae63756bf8 Include Finder.h too in the list of header files to parse: the finder
constants have tradiationally been in MACFS.py.
2002-12-17 22:22:57 +00:00