Commit Graph

7183 Commits

Author SHA1 Message Date
Raymond Hettinger ecccafb2d4 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".
2002-12-30 07:04:47 +00:00
Raymond Hettinger 4c47bd5e60 Temporarily comment out a test that crashes upon the introduction of
the _random subclass for Random.
2002-12-30 03:01:25 +00:00
Raymond Hettinger dd24a9f363 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.
2002-12-30 00:46:09 +00:00
Tim Peters 621818b318 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>).
2002-12-29 23:44:49 +00:00
Raymond Hettinger 40f6217092 SF patch 658251: Install a C implementation of the Mersenne Twister as the
core generator for random.py.
2002-12-29 23:03:38 +00:00
Kurt B. Kaiser 5e65ce671c Remove some old debugging print statements. 2002-12-29 22:48:52 +00:00
Kurt B. Kaiser 4ada7ad3bc 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.
2002-12-29 22:03:38 +00:00
Marc-André Lemburg 79f57833f3 Patch for bug #659709: bogus computation of float length
Python 2.2.x backport candidate. (This bug has been around since
Python 1.6.)
2002-12-29 19:44:06 +00:00
Raymond Hettinger c7b076928c 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.
2002-12-29 17:59:24 +00:00
Andrew M. Kuchling 8c6e0ec16a Bug #599248: strip directories when building Python. Out-of-tree builds should work again. 2002-12-29 17:00:57 +00:00
Andrew M. Kuchling 4464432d8c Suppress unsafe *Cookie class warnings 2002-12-29 16:45:06 +00:00
Andrew M. Kuchling 7877a76107 Patch #655760: add warnings when the unsafe *Cookie classes are instantiated 2002-12-29 16:44:31 +00:00
Martin v. Löwis 5b26abb37a Gracefully delay runtime error up to 1s. Add .willdispatch(). 2002-12-28 09:23:09 +00:00
Tim Peters 60c76e4016 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.
2002-12-27 00:41:11 +00:00
Guido van Rossum 9a40c1c299 Add XXX about Winsock error values 2002-12-26 18:22:54 +00:00
Guido van Rossum 9647b5240c Also skip testHostnameRes() if gethostbyaddr() raises an exception. 2002-12-26 17:04:45 +00:00
Guido van Rossum 71e02946ff Skip testHostnameRes() if gethostbyname() raises an exception. 2002-12-26 16:55:15 +00:00
Neal Norwitz 490602d629 Fix julian day problem with strptime. Note: XXX about using 0, suggestions? 2002-12-26 16:19:52 +00:00
Tim Peters 4c0db788e2 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.
2002-12-26 05:01:19 +00:00
Raymond Hettinger e11b510a5b SF 658405: calendar.py to rely on the datetime module instead of the time
module.

The code is shorter, more readable, faster, and dramatically increases the
range of acceptable dates.

Also, used the floor division operator in leapdays().
2002-12-25 16:37:19 +00:00
Tim Peters 80475bb4d2 Implemented datetime.astimezone() and datetimetz.astimezone(). 2002-12-25 07:40:55 +00:00
Tim Peters 6578dc925f Whitespace normalization. 2002-12-24 18:31:27 +00:00
Tony Lownds e1bebe9cb0 boolcheck cannot be deleted here. 2002-12-24 17:22:53 +00:00
Tony Lownds b693f8e4fa Move boolcheck before import of other IDLE modules 2002-12-24 17:21:43 +00:00
Neal Norwitz 78ce6b10ed Add test for SF #658106. Will backport. 2002-12-24 15:26:42 +00:00
Kurt B. Kaiser f4f4276815 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.

Developed in collaboration with Tony Lownds.
2002-12-24 06:36:19 +00:00
Tim Peters 12bf339aea Implemented .replace() methods for date, datetime, datetimetz, time and
timetz.
2002-12-24 05:41:27 +00:00
Kurt B. Kaiser a2a3cb23de IDLE should exit if it fails to connect with the execution server
subprocess.  Currently it opens a dead shell window.
2002-12-24 03:33:12 +00:00
Kurt B. Kaiser 11220fad1d 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
2002-12-24 00:57:22 +00:00
Kurt B. Kaiser d375abeb1a Uniform Capitalization in Menus 2002-12-24 00:51:05 +00:00
Kurt B. Kaiser 74d93c81c1 Remove debugging connection message 2002-12-23 22:51:03 +00:00
Tony Lownds 1fc1fe840e Make this script execute using pythonw 2002-12-23 18:36:14 +00:00
Tony Lownds b0bfd0f4aa Revert to revision 1.3; Mac OS X has a platform specific startup script, macosx_main.py 2002-12-23 18:12:41 +00:00
Tony Lownds 103ee91410 Move boolcheck to PyShell 2002-12-23 18:11:28 +00:00
Tim Peters cae330e449 Don't rebind True and False. 2002-12-23 16:50:58 +00:00
Guido van Rossum a4deda0d11 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.
2002-12-23 16:30:00 +00:00
Kurt B. Kaiser 710fa6c6df Alt-H was conflicting with the Help menu on Windows.
Let's try Alt-2....
2002-12-23 03:35:27 +00:00
Kurt B. Kaiser da4d3c1e85 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.
2002-12-23 03:31:49 +00:00
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 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
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
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
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