Commit Graph

7523 Commits

Author SHA1 Message Date
Kurt B. Kaiser e7a161e60c M configDialog.py
M configHelpSourceEdit.py

1. Attach configHelpSourceEdit error dialogs to parent to avoid Tk root
   pop-ups.
2. Make configHelpSourceEdit OK button the default and bind <Return>.
3. Reformat configHelpSourceEdit.
4. ConfigDialog.SaveAllChangedConfig() had a bug which caused additional
   help sources to be deleted when other config items were changed.
4. Uniform capitalization in configDialog.
5. Update configDialog doc string.
2003-01-10 20:13:57 +00:00
Barry Warsaw 9149aeb842 Python 2.1's string module doesn't have ascii_letters, so let's just
hard code it.  We want this module to work with Python 2.1 for now.
2003-01-10 19:28:15 +00:00
Barry Warsaw a21bdeae51 Cleanups, and conversion of assert to assertEqual() 2003-01-10 19:03:29 +00:00
Kurt B. Kaiser 114713d194 1. Make finding Python help docs more robust, including the installed
configuation.
2. Make sure that os.startfile() is used to open both Python help docs
   and Extra Help docs on the Windows platforms.
2003-01-10 05:07:24 +00:00
Tim Peters 37f398282b Got rid of the timetz type entirely. This was a bit trickier than I
hoped it would be, but not too bad.  A test had to change:
time.__setstate__() can no longer add a non-None tzinfo member to a time
object that didn't already have one, since storage for a tzinfo member
doesn't exist in that case.
2003-01-10 03:49:02 +00:00
Kurt B. Kaiser a5e8bb94e5 Default the OK key in the Save Before Run dialog. 2003-01-10 03:06:30 +00:00
Just van Rossum f07518ac22 support unicode in menu items 2003-01-09 23:18:39 +00:00
Just van Rossum 6706c4d5fd cleaned up Jack's Mac OS9 changes 2003-01-09 22:27:10 +00:00
Walter Dörwald 0cb27dd023 Make the test scripts work again with narrow Python builds. 2003-01-09 11:38:50 +00:00
Just van Rossum 4e051d459d add newline to source before compilation 2003-01-09 10:47:20 +00:00
Walter Dörwald 30537a46ac Add a few test cases to increase code coverage:
From:
 69.73% of 294 source lines executed in file ./Modules/_codecsmodule.c
 79.47% of 487 source lines executed in file Python/codecs.c
 78.45% of 3643 source lines executed in file Objects/unicodeobject.c

To:
 70.41% of 294 source lines executed in file ./Modules/_codecsmodule.c
 82.75% of 487 source lines executed in file Python/codecs.c
 80.76% of 3638 source lines executed in file Objects/unicodeobject.c

This actually unearthed a bug in the handling of None
values in PyUnicode_EncodeCharmap.
2003-01-08 23:22:13 +00:00
Walter Dörwald 395bb49555 Add a test that exercises the error handling part of
PyUnicode_EncodeDecimal().
2003-01-08 23:02:34 +00:00
Tim Peters 6757c1e856 SF patch 661583: Remove old code from lib\os.py
A patch from Andrew Wilkinson to change some bizarre old exec statements
specific to NT and CE.
2003-01-08 21:20:57 +00:00
Tim Peters 0bf60bd67f Utterly minimal changes to collapse datetimetz into datetime, and timetz
into time.  This is little more than *exporting* the datetimetz object
under the name "datetime", and similarly for timetz.  A good implementation
of this change requires more work, but this is fully functional if you
don't stare too hard at the internals (e.g., right now a type named
"datetime" shows up as a base class of the type named "datetime").  The
docs also need extensive revision, not part of this checkin.
2003-01-08 20:40:01 +00:00
Steve Holden 8a978f7cde Fix bug 427345 [related to IE's additional input on POST request]. 2003-01-08 18:53:18 +00:00
Jack Jansen 472e7db5c0 Various tweaks to make the test work on the Mac. 2003-01-08 16:37:03 +00:00
Jack Jansen b11ce9b96c Always define getenv(), as suggested by Guido. This means that os.getenv() is also defined for MacPython-OS9 (even though it doesn't actually do anything useful), and it shouldn't hurt on other platforms. 2003-01-08 16:33:40 +00:00
Jack Jansen 52941a8348 Test that chmod() actually exists before calling it (it doesn't on MacOS9). 2003-01-08 16:33:16 +00:00
Jack Jansen 27d19c40bc Removed the SetDates warning. The warning is in the readme, and the print statement was too obtrusive (it appeared during the installation process, and the user needed to close the resulting window manually). 2003-01-08 16:32:29 +00:00
Jack Jansen 746096576b quashed another case of the 32-bit warning. 2003-01-08 16:32:09 +00:00
Jack Jansen 6797514557 Updated the list of expected skips for MacPython-OS9. 2003-01-08 16:31:11 +00:00
Jack Jansen 2918ae8fe6 n the Mac the frozen import that should fail actually succeeds, and we know it, so skip the test in stead of confusing the end user. 2003-01-08 16:30:54 +00:00
Jack Jansen ce92147cc8 Added the Mac to platforms that don't have user/group/other modes.
Set the limit for the number of open files to 32 if platform==mac.
2003-01-08 16:30:34 +00:00
Fred Drake 7511bd957d - be explicit: audio data files should be opened in binary mode
- ossaudiodev.open() raises IOError, not ossaudiodev.error, for cases
  which get mapped to TestSkipped
2003-01-08 07:09:43 +00:00
Guido van Rossum dca3f2f54a Enable building and testing of ossaudiodev for Linux. 2003-01-08 01:23:01 +00:00
Guido van Rossum 373c7412f2 Fix for SF bug #642358: only provide a new with a __dict__ or
__weaklist__ descriptor if we added __dict__ or __weaklist__,
respectively.  With unit test.
2003-01-07 13:41:37 +00:00
Raymond Hettinger 145a4a0f10 Much clearer when super() is used. 2003-01-07 10:25:55 +00:00
Raymond Hettinger ef30dc872b Revert change 1.37.
The nanoseconds saved by using dict.fromkeys aren't
worth the loss in clarity.  Linear searches live on.
2003-01-07 02:09:16 +00:00
Raymond Hettinger 625812f618 SF patch #662433: Fill arraymodule's tp_iter and sq_contains slots 2003-01-07 01:58:52 +00:00
Barry Warsaw 4e68a1ec6c CHARSETS, ALIASES, CODEC_MAP: SF feature request 633543, Korean
support and other charset defaults.  See also:

http://article.gmane.org/gmane.comp.python.mime.devel/250

(this just commits the last bit of the article that wasn't part of
email 2.4.3.)
2003-01-07 00:29:07 +00:00
Guido van Rossum 613f24fd73 Add a test for a feature added in rev. 2.82 of typeobject.c:
- SLOT1BINFULL() macro: changed this to check for __rop__ overriding
  __op__, like binary_op1() in abstract.c -- the latter only calls the
  slot function once if both types use the same slot function, so the
  slot function must make both calls -- which it already did for the
  __op__, __rop__ order, but not yet for the __rop__, __op__ order
  when B.__class__ is a subclass of A.__class__.

Also test the refinement added in rev. 2.201 that fixes the problem
reported in SF bug #623669.

Also test a similar provision in abstract.c's binary_op1().
2003-01-06 23:00:59 +00:00
Guido van Rossum 2720b0dff8 Add some print statements in verbose mode to announce that the newest
tests are run.  (All tests in this module should have one of these at
the top.)
2003-01-06 21:26:44 +00:00
Skip Montanaro f09b88ee2f * add mms (windows media) as another scheme
* reformat schemes to 80 columns
2003-01-06 20:27:03 +00:00
Guido van Rossum 4f37418d02 Disable the rexec test now that rexec is out of grace. 2003-01-06 16:03:43 +00:00
Guido van Rossum 38abbf5560 Remove bastion test output 2003-01-06 16:02:12 +00:00
Guido van Rossum 11ae4e20e0 Disable the Bastion test now that Bastion is out of grace. 2003-01-06 15:45:11 +00:00
Guido van Rossum 34a2e08586 Sabotage rexec.py. It is not safe since the new-style classes. 2003-01-06 15:43:34 +00:00
Andrew M. Kuchling b8c7b9f0cc Translate spaces in the machine name to underscores
(Power Macintosh -> Power_Macintosh)
2003-01-06 13:28:12 +00:00
Raymond Hettinger f2128b004c Used dictionaries rather than lists for membership testing. 2003-01-06 12:30:53 +00:00
Just van Rossum 077c5823d1 always also search on sys.path for res files 2003-01-06 11:15:05 +00:00
Neal Norwitz 68b539ef9c SF feature #618024, urlparse fails on imap:// 2003-01-06 06:58:31 +00:00
Neal Norwitz 4f442372cc SF feature #618024, urlparse fails on imap:// 2003-01-06 06:51:36 +00:00
Neal Norwitz b9ef4aea5e SF #651082, tarfile module implementation from Lars Gustäbel 2003-01-05 23:19:43 +00:00
Just van Rossum 66d16baf71 - squashed bare except in rmtree()
- improved readability of rmtree; removed silly apply()
2003-01-05 19:44:11 +00:00
Neal Norwitz 502b9e1fbb At least one Solaris box in the snake farm only supports "C" locale.
Adding try/except allows the test to pass
2003-01-05 18:15:23 +00:00
Raymond Hettinger 3dd990c53a Move the statistical tests for four distributions into the unittest suite. 2003-01-05 09:20:06 +00:00
Raymond Hettinger 15ec3731cf Add a test case. 2003-01-05 01:08:34 +00:00
Greg Ward 5bd844e20f Tweak __version__ -- the current code is between Optik 1.4 and 1.4.1. 2003-01-04 21:54:26 +00:00
Just van Rossum 8afa3a3092 module to run commands in a Terminal.app window 2003-01-04 21:44:21 +00:00
Guido van Rossum 5e1222be57 Add Shockwave Flash.
(backport candidate?)
2003-01-04 14:11:38 +00:00
Raymond Hettinger 73ced7ee99 Correct long standing bugs in the methods for random distributions.
The range of u=random() is [0,1), so log(u) and 1/x can fail.
Fix by setting u=1-random() or by reselecting for a usable value.

Will backport.
2003-01-04 09:26:32 +00:00
Tim Peters adf642038e A new implementation of astimezone() that does what we agreed on in all
cases, plus even tougher tests of that.  This implementation follows
the correctness proof very closely, and should also be quicker (yes,
I wrote the proof before the code, and the code proves the proof <wink>).
2003-01-04 06:03:15 +00:00
Raymond Hettinger 8ec78814c1 Test an edge case for sample(). 2003-01-04 05:55:11 +00:00
Raymond Hettinger 8b9aa8dbba Remove the random=None nonsense from sample() before it gets set in stone.
It was once available so that faster generators could be substituted.  Now,
that is less necessary and preferrably done via subclassing.

Also, clarified and shortened the comments for sample().
2003-01-04 05:20:33 +00:00
Kurt B. Kaiser 1061e7270b M AutoExpand.py
M Bindings.py
M EditorWindow.py
M PyShell.py
M config-keys.def
M configHandler.py
M help.txt

1. Annotate the shell window with last restart boundary upon restart.
2. Provide a shell menu entry and hot key (F6) to jump to the last
   restart boundary.
3. Add a new shell menu feature to restart the shell.
4. Update the help menu to add these features.
5. Update the help menu to put text in same order as the menus.
6. Correct a capitalization inconsistency on the Edit menu: Expand Word
7. Rename the "Debug" menu to be "Shell": it's doing more now.
8. Rearrange the "Shell" menu to make the StackViewer entries adjacent.
9. Add a get_geometry method to EditorWindow, which may be of use in
   making window positions persisent.
10. Make <ctrl-v> the "Classic Windows" paste key.
11. Restore decorum on the Help menu by removing "Advice".  As Guido said,
    things will never be the same.  Thanks, David!
2003-01-04 01:43:53 +00:00
Martin v. Löwis 25c7b50e8f Convert Tcl path objects to strings. Fixes #661357.
Provide .string attribute and __unicode for Tcl_Objs.
2003-01-04 00:08:09 +00:00
Walter Dörwald 8fa8972d80 Remove a list comprehension, because a loop over the list
is done afterwards anyway, so what the list comp does
can be done in the loop.
2003-01-03 21:06:46 +00:00
Walter Dörwald 51cc72c6c0 Pass the strict argument from read() on to readfp(), so the
file content ends up in the correct dict.
2003-01-03 21:02:36 +00:00
Walter Dörwald bb51ed333b Fix read_mime_types() so that it returns a dict as documented.
This fixes a bug reported as http://www.python.org/sf/661630,
which was introduced in the patch http://www.python.org/sf/554192.
2003-01-03 19:33:17 +00:00
Neal Norwitz 61cdac6d3d Fix SF #659228, 'realpath' function missing from os.path
Also added realpath = abspath for os2emx, similar to windows/mac
which also don't really implement realpath.

Backport candidate, I think?
2003-01-03 18:01:57 +00:00
Andrew M. Kuchling 51a6a4c835 [Patch #658094 ] PEP 301 implementation
Add the 'register' distutils command
2003-01-03 15:29:28 +00:00
Andrew M. Kuchling 282e2c36ba [Patch #658094] PEP 301 implementation
Add 'classifiers' keyword to DistributionMetadata
2003-01-03 15:24:36 +00:00
Just van Rossum 9a3129c148 Fix for bug #661136
Lesson learned: kids should not be allowed to use API's starting
with an underscore :-/
zipimport in 2.3a1 is even more broken than I thought: I attemped
to _PyString_Resize a string created by PyString_FromStringAndSize,
which fails for strings with length 0 or 1 since the latter returns
an interned string in those cases. This would cause a SystemError
with empty source files (and no matching pyc) in the zip archive.
I rewrote the offending code to simply allocate a new buffer and
avoid _PyString_Resize altogether.
Added a test that would've caught the problem.
2003-01-03 11:18:56 +00:00
Michael W. Hudson 8d0ffe0126 Remove debugging prints. 2003-01-03 10:25:20 +00:00
Barry Warsaw 3d597812b6 Jack complained that on test_crlf_separation() was failing on MacOS9
because the test file, msg_26.txt which has \r\n line endings, was
getting munged by cvs, which knows to do line ending conversions for
text files.  But we want \r\n to be preserved on all platforms, so we
cvs admin'd the file to be -kb (binary), which means we have to open
the file in binary mode to preserve these line ends.  Hopefully this
will be the end of the thrashing on this issue (but probably not).

Test passes on *nix now, and Tim confirms it passes on Windows.  We'll
leave it to Jack to test MacOS.
2003-01-02 22:48:36 +00:00
Tim Peters 397301eccb The tzinfo methods utcoffset() and dst() must return a timedelta object
(or None) now.  In 2.3a1 they could also return an int or long, but that
was an unhelpfully redundant leftover from an earlier version wherein
they couldn't return a timedelta.  TOOWTDI.
2003-01-02 21:28:08 +00:00
Skip Montanaro 4abd5f0fce Allow list sort's comparison function to explicitly be None. See SF patch
661092.
2003-01-02 20:51:08 +00:00
Kurt B. Kaiser fe8496ca03 1. Remove obsolete, incorrect comment on non-package installation
2. Add more .txt files to installation
3. Fix the reference to Visual Python, s/b VPython
2003-01-02 20:33:26 +00:00
Tim Peters 710fb1548a astimezone() internals: if utcoffset() returns a duration, complain if
dst() returns None (instead of treating that as 0).
2003-01-02 19:35:54 +00:00
Kurt B. Kaiser e23ca3c35a Improve exception handling. 2003-01-02 17:09:34 +00:00
Neal Norwitz b4a2df0c8d SF #660795
Add a test for logging from Vinay Sajip (module author)
2003-01-02 14:56:39 +00:00
Just van Rossum 109ecbf7a5 Replaced imp.set_frozenmodules() cruft with proper zipimport support.
This work uncovered the zipimport bug in 2.3a1 -- wish I'd had time to
do this before the release :-(.
2003-01-02 13:13:01 +00:00
Just van Rossum d35c6db526 Ugh, zipimport is virtually broken in 2.3a1 :-( It worked by accident in
the test set as it only tested with a zip archive in the current directory,
but it doesn't work at all for packages when the zip archive was specified
as an absolute path. It's a real embarrassing bug: a strchr call should
have been strrchr; fever apparently implies dyslexia.

Second stupid bug: the zipimport test failed with a name error
__importer__ (which I had renamed to __loader__ everywhere but here).
I would've sworn I ran the test after that change but that can't be true.
What I don't understand that noone reported a failing test_zipimport.py
before the release of 2.3a1.
2003-01-02 12:55:48 +00:00
Andrew MacIntyre c6fff897d7 EMX fork() emulation not good enough to cope with test_socketserver 2003-01-02 12:49:00 +00:00
Anthony Baxter 4cedc1e84e Clearing out old patch queue. Patch #558547, make SocketServer more
robust. This makes socketserver's close() method callable repeatedly
without error - similar to other file-like objects.
2003-01-02 03:07:48 +00:00
Tim Peters f36151556f A quicker astimezone() implementation, rehabilitating an earlier
suggestion from Guido, along with a formal correctness proof of the
trickiest bit.  The intricacy of the proof reveals how delicate this
is, but also how robust the conclusion:  correctness doesn't rely on
dst() returning +- one hour (not all real time zones do!), it only
relies on:

1. That dst() returns a (any) non-zero value if and only if daylight
   time is in effect.

and

2. That the tzinfo subclass implements a consistent notion of time zone.

The meaning of "consistent" was a hidden assumption, which is now an
explicit requirement in the docs.  Alas, it's an unverifiable (by the
datetime implementation) requirement, but so it goes.
2003-01-01 21:51:37 +00:00
Neal Norwitz 4e8f5492c5 Revert last change -- test works on HPUX again after Martin's checkin
to 'properly configure the slave terminal'

See SF patch # 656590 for the details.
2003-01-01 14:53:27 +00:00
Martin v. Löwis 14e73b1864 Expose I_ constants. Auto-detect stropts.h. Properly configure the slave terminal. 2003-01-01 09:51:12 +00:00
Tim Peters 36087edc05 The failure of the last-second addition to the timezone coversion test is
understood now:  it can't work.  Added comments explaining why (it's "the
usual"-- unrepresentable hours in local time --but in a slightly different
guise).
2003-01-01 04:18:51 +00:00
Kurt B. Kaiser 50e9c4ff55 More installation info. Bump alpha version. 2003-01-01 01:14:13 +00:00
Kurt B. Kaiser 38f11101d8 Debugger was tracing through rpc.py when IDLEfork was not started
from its source directory.  Generalize the "workaround" (though
the latter seems a reasonable solution?) to handle this.
2003-01-01 00:26:41 +00:00
Kurt B. Kaiser 7cca3d8ef0 Improve exception handling. 2002-12-31 23:18:00 +00:00
Barry Warsaw b1dcbd223e Make two tests non-locale-dependent 2002-12-31 19:27:45 +00:00
Jeremy Hylton 1856541142 Replace all but one explicit emit('SET_LINENO') with call to set_lineno().
Remove broken code in visitDict().  I assume the code was trying to
add set lineno events for each line of a dict constructor, but I think
it was using the wrong object (node instead of k or v).
2002-12-31 18:26:17 +00:00
Tony Lownds cf94ee817c Don't let the docstring end up in __main__.__doc__ 2002-12-31 18:22:37 +00:00
Barry Warsaw bc38baffbd test01_close_dbenv_before_db(): Added an XXX comment that this test is
BerkeleyDB version dependent.
2002-12-31 18:21:43 +00:00
Neal Norwitz 0aae2b07d7 Comment out test, since it hangs on HPUX, still investigating 2002-12-31 18:21:11 +00:00
Jeremy Hylton accb62b28e SF patch [ 597919 ] compiler package and SET_LINENO
A variety of changes from Michael Hudson to get the compiler working
with 2.3.  The primary change is the handling of SET_LINENO:

# The set_lineno() function and the explicit emit() calls for
# SET_LINENO below are only used to generate the line number table.
# As of Python 2.3, the interpreter does not have a SET_LINENO
# instruction.  pyassem treats SET_LINENO opcodes as a special case.

A few other small changes:
 - Remove unused code from pycodegen and pyassem.
 - Fix error handling in parsermodule.  When PyParser_SimplerParseString()
   fails, it sets an exception with detailed info.  The parsermodule
   was clobbering that exception and replacing it was a generic
   "could not parse string" exception.  Keep the original exception.
2002-12-31 18:17:44 +00:00
Kurt B. Kaiser 2cb540253b Update (slightly) for Alpha release 2002-12-31 18:12:04 +00:00
Martin v. Löwis 64aa5f6982 Remove bogus test; the master is not a terminal on Solaris and HP-UX. 2002-12-31 18:05:15 +00:00
Kurt B. Kaiser 085ce5a77a Move history to HISTORY.txt 2002-12-31 17:57:44 +00:00
Kurt B. Kaiser f5934dd5f8 Update for Alpha 0 Release 2002-12-31 17:56:18 +00:00
Tim Peters 521fc15e62 A new, and much hairier, implementation of astimezone(), building on
an idea from Guido.  This restores that the datetime implementation
never passes a datetime d to a tzinfo method unless d.tzinfo is the
tzinfo instance whose method is being called.  That in turn allows
enormous simplifications in user-written tzinfo classes (see the Python
sandbox US.py and EU.py for fully fleshed-out examples).

d.astimezone(tz) also raises ValueError now if d lands in the one hour
of the year that can't be expressed in tz (this can happen iff tz models
both standard and daylight time).  That it used to return a nonsense
result always ate at me, and it turned out that it seemed impossible to
force a consistent nonsense result under the new implementation (which
doesn't know anything about how tzinfo classes implement their methods --
it can only infer properties indirectly).  Guido doesn't like this --
expect it to change.

New tests of conversion between adjacent DST-aware timezones don't pass
yet, and are commented out.

Running the datetime tests in a loop under a debug build leaks 9
references per test run, but I don't believe the datetime code is the
cause (it didn't leak the last time I changed the C code, and the leak
is the same if I disable all the tests that invoke the only function
that changed here).  I'll pursue that next.
2002-12-31 17:36:56 +00:00
Fred Drake e2c649126e Further cleanup of exceptions. All interpolation-related exceptions
now derive from InterpolationError, which is not raised directly (only
subclasses get raised).  This matches what the docs already said.
2002-12-31 17:23:27 +00:00
Tony Lownds d8a6c5f4f4 Keep __main__ namespace clean 2002-12-31 16:52:44 +00:00
Just van Rossum e29310a2b3 patch attached to sf item #643711:
any_missing() returns less bogus missing modules.

- I've rewritten scan_code() more or less from scratch,
factored bits and pieces out for readability.
- keep track of global assignments and failed imports per
module; use this to determine whether the Y in "from X
import Y" is a submodule or just a global name. This is not
100% doable: you can't tell which symbols are imported when
doing a star import of a non-Python module short of actually
importing it.
- added a new method to ModuleFinder: any_missing_maybe(),
which returns *two* lists, one with certain misses, one with
possible misses. The possible misses are *very* often false
alarms, so it's useful to keep this list separate.
any_misses() now simply returns the union of
any_missing_maybe().

TODO: documentation, test_modulefinder.py
2002-12-31 16:33:00 +00:00
Just van Rossum 41c554fbec moving modulefinder.py to the standard library 2002-12-31 16:27:33 +00:00
Kurt B. Kaiser 6655e4bc27 Whitespace Normalization 2002-12-31 16:03:23 +00:00
Martin v. Löwis 96a60e4af5 Patch #658927: Add getctime to os.path.
Document that getatime and getmtime may return floats.
2002-12-31 13:11:54 +00:00
Andrew MacIntyre c70a8e411f OS/2 EMX has no popen2.Popen3 even though bunzip2 is available 2002-12-31 11:28:22 +00:00
Andrew MacIntyre fd07e7dda7 add list of expected skips for the OS/2 EMX port 2002-12-31 11:26:50 +00:00
Fred Drake b456e4f25b Make sure PrettyPrinter methods that mirror the module-level
convenience functions isreadable() and isrecursive() work the same way
as the convenience functions.
2002-12-31 07:16:16 +00:00
Fred Drake 397b615056 - PrettyPrinter.isreadable(), .isrecursive():
Pass the right number of args to .format().  (Caught by
    pychecker.)
- Protect the global namespace more carefully.
- Don't use the types module now that we don't need to.
2002-12-31 07:14:18 +00:00
Fred Drake 5478219e11 Add a test that InterpolationError is constructed properly and raised
when expected.  Only applies to the ConfigParser and SafeConfigParser
classes, not RawConfigParser.
2002-12-31 06:57:25 +00:00
Fred Drake 00dc5a93c1 ConfigParser._interpolate(): Pass the missing key to the
InterpolationError constructor, not the KeyError exception itself.
    (Caught by the new InterpolationError test.)

SafeConfigParser._interpolate_some():  Pass the right number of
    arguments to the InterpolationError constructor.
    (Caught by pychecker.)
2002-12-31 06:55:41 +00:00
Guido van Rossum 0146f419b4 Fix name error, found by pychecker. 2002-12-31 01:08:35 +00:00
Neal Norwitz d8b5e3fda1 Tix update from Mike Clarkson (maintainer) 2002-12-30 23:52:01 +00:00
Fred Drake 8d5dd98a2e - added InterpolationSyntaxError to __all__
- added docstring to exceptions
2002-12-30 23:51:45 +00:00
Neal Norwitz ce1d944b6b Add missing InterpolationSyntaxError.
XXX Not sure this is correct.
2002-12-30 23:38:47 +00:00
Neal Norwitz 6ec0a8ab93 sys was already imported, remove second import 2002-12-30 23:36:02 +00:00
Fred Drake a872595f31 - prefer "import ... as" to "import / (assignments) / del" for most things
- when the thread module isn't available, subsequent attempts to import
  threading should not suceed
2002-12-30 23:32:50 +00:00
Jack Jansen acda3394bb Updated the expected skips for MacOSX. 2002-12-30 23:03:13 +00:00
Jack Jansen 06f0cef1ca Skip this test on MacOSX: the locale support is too minimal to make
it pass.
2002-12-30 23:02:55 +00:00
Guido van Rossum a0934246d3 Use the dummy_thread module in Queue.py and tempfile.py.
tempfile.py already contained code to let it run without threads present;
for Queue.py this is considered a useful feature too.
2002-12-30 22:36:09 +00:00
Guido van Rossum ad50ca91a9 Brett Cannon's dummy_thread and dummy_threading modules (SF patch
622537), with some nitpicking editorial changes.
2002-12-30 22:30:22 +00:00
Neal Norwitz 5efc50d8af Fix SF #658820, regex fixes for _strptime (Brett Cannon)
Disallow zero for days and months
2002-12-30 22:23:12 +00:00
Jack Jansen 0940c6267a These were somehow never added to CVS. 2002-12-30 22:14:35 +00:00
Just van Rossum 52e14d640b PEP 302 + zipimport:
- new import hooks in import.c, exposed in the sys module
- new module called 'zipimport'
- various changes to allow bootstrapping from zip files

I hope I didn't break the Windows build (or anything else for that
matter), but then again, it's been sitting on sf long enough...

Regarding the latest discussions on python-dev: zipimport sets
pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as
/path/to/Archive.zip/subdir/ are supported again.
2002-12-30 22:08:05 +00:00
Jack Jansen 60087fb450 Moved most of Mac/Lib hierarchy to Lib/plat-mac: it can be used both
in MacPython-OS9 and MacPython-OSX (or the equivalent unix Python on
Mac OS X). The only items remaining in Mac/Lib are modules that are
meaningful only for MacPython-OS9 (CFM stuff, MacPython preferences
in resources, etc).
2002-12-30 22:04:23 +00:00
Guido van Rossum c262a1f51c Add __all__. (Brett Cannon.) 2002-12-30 21:59:55 +00:00
Barry Warsaw 9a0d779c7d Port BerkeleyDB 4.1 support from the pybsddb project. bsddb is now at
version 4.1.1 and works with up to BerkeleyDB 4.1.25.
2002-12-30 20:53:52 +00:00
Barry Warsaw 0a26235e67 Add some missing tests. Should now test everything that pybsddb's
test suite tests.
2002-12-30 20:53:18 +00:00
Tim Peters bad8ff089a A step on the way to making tzinfo classes writable by mortals: get rid
of the timetz case.  A tzinfo method will always see a datetimetz arg,
or None, now.  In the former case, it's still possible that it will get
a datetimetz argument belonging to a different timezone.  That will get
fixed next.
2002-12-30 20:52:32 +00:00
Barry Warsaw 74859f3aa6 Template for future tests. 2002-12-30 20:44:16 +00:00
Neil Schemenauer 3ea60c2a7a Match new sequence behavior. User defined types now behave better as and
with sequences.
2002-12-30 20:21:15 +00:00
Barry Warsaw 10ee7a7f15 test_bad_8bit_header(): Tests for optional argument `errors'. See SF
bug #648119.
2002-12-30 19:14:38 +00:00
Barry Warsaw f4fdff715a Header.__init__(), .append(): Add an optional argument `errors' which
is passed straight through to the unicode() and ustr.encode() calls.
I think it's the best we can do to address the UnicodeErrors in badly
encoded headers such as is described in SF bug #648119.
2002-12-30 19:13:00 +00:00
Barry Warsaw 72261c9dfb Actually, make this 2.5a1 since it will include API changes that may
need more vetting, and it will be included in Python 2.3a1.
2002-12-30 19:08:38 +00:00
Barry Warsaw 207d1c2065 Bump to 2.5 2002-12-30 17:45:41 +00:00
Barry Warsaw f29ffbdbf5 TestMIMEAudio.setUp(): Use the email package's copy of the audio test
file, needed because some binary distros (read RPMs) don't include the
test module in their standard Python package.  This eliminates an
external dependency and closes SF bug # 650441.
2002-12-30 17:45:02 +00:00
Barry Warsaw c99c08c764 A copy of the audio test file from Lib/test, needed because some
binary distros (read RPMs) don't include the test module in their
standard Python package.  This eliminates an external dependency and
closes SF bug # 650441.
2002-12-30 17:44:27 +00:00
Tim Peters 31cc3156e7 Added tests that conversion to our own timezone is always an identity,
and that conversion to "timezone" None is the same as stripping the
tzinfo member.
2002-12-30 17:37:30 +00:00
Barry Warsaw ba97659f5f parsedate_tz(): Fix SF bug #552345, optional FWS between the comma and
the day in an RFC 2822 date.
2002-12-30 17:21:36 +00:00
Barry Warsaw 795833fbc6 test_parsedate_compact(): A test for optional FWS between the comma
and the day number in an RFC 2822 date specification.  See bug
#552345.
2002-12-30 17:20:53 +00:00
Tim Peters 1024bf8364 Beefed up the timezone conversion test by adding a phony UTC zone that's
west of the US zones getting converted, and also by using Eastern "as if"
it were UTC (wrt Pacific), and vice versa.
2002-12-30 17:09:40 +00:00
Barry Warsaw 5c8fef903d A code cleansing pass 2002-12-30 16:43:42 +00:00
Barry Warsaw 1fb22bb24f Port rfc822.py changes that didn't make it into this copy,
specifically that dots are allowed in obs-phrase.  This fixes parsing
of dots in realnames.
2002-12-30 16:21:07 +00:00
Barry Warsaw edb59c1ee8 test_name_with_dots(): A new test to ensure that we're implementing
RFC 2822's rules w.r.t. dots in the realname part of address fields.
2002-12-30 16:19:52 +00:00
Marc-André Lemburg 63b482cefb String tests should test 8-bit strings :-) 2002-12-30 10:50:32 +00:00
Raymond Hettinger e401b6fc55 Last checkin was missing the tuple comma.
The new "substr in str" feature masked the error.
2002-12-30 07:21:32 +00:00
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
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
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
Raymond Hettinger 72a6ddb5ee Expand log() tests to include long integers. 2002-12-18 16:13:16 +00:00
Kurt B. Kaiser 92b5ca37c2 M ColorDelegator.py
M PyShell.py
M ScriptBinding.py

1. Update ScriptBinding.py to highlight a syntax error in the Edit window,
   and place the cursor on the error.  Add a syntax check to the
   Run Script event instead of waiting until the script tries to run and
   raises a syntax error in the shell, forcing the user to navigate back
   to the Edit window to fix it.
2. Modify tag_config's appropriately in PyShell.py and ColorDelegator.py
3. Some minor clean-up in ScriptBinding.py
2002-12-17 21:16:12 +00:00
Andrew M. Kuchling 6cd77126b4 No point in warning about needing re module; remove helpful message 2002-12-17 18:59:51 +00:00
Andrew M. Kuchling 3c76ad0f8d Fix comment typo 2002-12-17 18:56:26 +00:00
Michael W. Hudson cfd3884882 This is Richie Hindle's patch
[ 643835 ] Set Next Statement for Python debuggers

with a few tweaks by me: adding an unsigned or two, mentioning that
not all jumps are allowed in the doc for pdb, adding a NEWS item and
a note to whatsnew, and AuCTeX doing something cosmetic to libpdb.tex.
2002-12-17 16:15:34 +00:00
Neal Norwitz f680cc460c Update doc for getboolean() to match code (ie, returning True/False)
Convert remaining uses of 1/0 to True/False
2002-12-17 01:56:47 +00:00
Kurt B. Kaiser 1bdca5e051 In Shell:
1. If a tab is entered at the prompt, allow it to be backspaced away.
2. Eliminate the beep when hitting <enter> at the prompt.
2002-12-16 22:25:10 +00:00
Tim Peters cfd4a8b639 Made this a little more compatible w/ the sandbox version, which is
still needed to test the Python implementatino.
2002-12-16 21:12:37 +00:00
Tim Peters 2a799bf77a datetime escapes the sandbox. The Windows build is all set. I leave it
to others to argue about how to build it on other platforms (on Windows
it's in its own DLL).
2002-12-16 20:18:38 +00:00
Gustavo Niemeyer 78429a6aa6 Fixing bug
[#448679] Left to right

* Python/compile.c
  (com_dictmaker): Reordered evaluation of dictionaries to follow strict
  LTR evaluation.

* Lib/compiler/pycodegen.py
  (CodeGenerator.visitDict): Reordered evaluation of dictionaries to
  follow strict LTR evaluation.

* Doc/ref/ref5.tex
  Documented the general LTR evaluation order idea.

* Misc/NEWS
  Documented change in evaluation order of dictionaries.
2002-12-16 13:54:02 +00:00
Gustavo Niemeyer d5ae01a803 Applying patch
[#636769] Fix for major rexec bugs

* Lib/rexec.py
  (FileBase): Added 'xreadlines' and '__iter__' to allowed file methods.
  (FileWrapper.__init__): Removed unnecessary self.f variable, which gave
  direct access to the file object.
  (RExec): Added 'xreadlines' and '_weakref' to allowed modules.
  (RExec.r_open): Convert string subclasses to a real string classes
  before doing comparisons with mode parameter.

* Lib/ihooks.py
  (BasicModuleImporter.import_module/reload/unload): Convert the module
  name to a real string before working with it.
  (ModuleImporter.import_module/import_it/reload): Convert the module
  name to a real strings before working with it.

* Misc/NEWS
  Document the change.
2002-12-16 13:11:57 +00:00
Kurt B. Kaiser 822a77fcc7 M EditorWindow.py
M PyShell.py

Idlefork SF Bug 440383 - IDLE goes into beep loop
Fix loop in EditorWindow.newline_and_indent_event() and
in addition fix submission of >>> prompt to PyParse.Parser

Eliminate extra attribute EditorWindow.auto_indent
2002-12-16 02:07:11 +00:00
Raymond Hettinger 866964c3a3 Apply SF patch 652930: Add optional base argument to math.log(x[, base]). 2002-12-14 19:51:34 +00:00
Kurt B. Kaiser bfed346259 M Debugger.py
M IOBinding.py
M PyShell.py

* Could not remove last set of saved breakpoints from a file
* Starting with empty edit window, could not load a file
* Multiple adjacent breakpoints were saved as one breakpoint
* Storing breakpoints whenever a file is closed can get them out
  of synch with the saved version of a file.  Only store them when the
  file is saved.
* Add comment on current limitations on file editing in the presence of
  breakpoints.
* Replace get_current_breaks() with update_breakpoints(), add an update to
  PyShellEditorWindow.breakpoints, which is the master breakpoint data
  structure, and which is used to reload the subprocess debugger.
* Revert Debugger.Debugger.load_breakpoints() to use editwin.breakpoints.
  It is easier to debug the debugger if the breakpoint list in IDLE is
  identical to the list in the subprocess debugger and is transferred when
  the subprocess debugger is restarted, because this list can be easily
  queried.
* Cleanup some linespacing and comments in IOBinding.py
2002-12-14 04:38:51 +00:00
Guido van Rossum 3bbc0eea10 Tighten the tests for assignment to __bases__: disallow empty tuple. 2002-12-13 17:49:38 +00:00
Chui Tey 067d734f9e Prevent debugger from stepping into Idle rpc code 2002-12-12 20:53:19 +00:00
Martin v. Löwis de3337913f Patch #536661: Improve performance of splitext. Add test_macpath. 2002-12-12 20:30:20 +00:00
Martin v. Löwis 00b6127097 Patch #650653: Raise always value error if the table is not 256 bytes long. 2002-12-12 20:03:19 +00:00
Kurt B. Kaiser e54710bd72 M CallTipWindow.py
M CallTips.py

Calltip fetch was erroring when an Edit window was used without a Shell.
Also, fix CallTipWindow.py so test code will run and add a comment about a
bug which causes the calltip window to override all others.
2002-12-12 19:15:39 +00:00
Walter Dörwald 7e5c6a02eb Change issubclass() so that recursive tuples (directly or indirectly
containing class objects) are allowed as the second argument.
This makes issubclass() more similar to isinstance() where recursive
tuples are allowed too.
2002-12-12 19:14:08 +00:00
Jason Tishler e4a070a320 Patch #551960: Add check for setrlimit() support
test_resource calls resource.setrlimit() to change the file size limits.
This fails on Cygwin, which supports setrlimit() and getrlimit(), just not
changing that particular setting. (The same would apply to any other
platform that has those functions but not that particular feature.)

Since getrlimit() works and setrlimit() can be used for other reasons, a
check for ValueError was added to that part of the test.
2002-12-12 18:13:36 +00:00
Marc-André Lemburg b28de0d79f Patch to make _codecs a builtin module. This is necessary since
Python 2.3 will support source code encodings which rely on the
builtin codecs being available to the parser.

Remove struct dependency from codecs.py
2002-12-12 17:37:50 +00:00
Greg Ward afd44de812 Hardcode the recognized whitespace characters to the US-ASCII whitespace
chars.  See the comment for rationale.
2002-12-12 17:24:35 +00:00
Walter Dörwald d9a6ad3beb Enhance issubclass() and PyObject_IsSubclass() so that a tuple is
supported as the second argument. This has the same meaning as
for isinstance(), i.e. issubclass(X, (A, B)) is equivalent
to issubclass(X, A) or issubclass(X, B). Compared to isinstance(),
this patch does not search the tuple recursively for classes, i.e.
any entry in the tuple that is not a class, will result in a
TypeError.

This closes SF patch #649608.
2002-12-12 16:41:44 +00:00
Just van Rossum b083cb3901 Patch #651621, approved by MvL.
This patch allows ZipFile.writestr() to be called with
an archive file name instead of a ZipInfo instance:

z = ZipFile("myarchive.zip", "w")
z.writestr("foo/baz/file.ext", data)
z.close()

I found the old writestr() method very inconvenient
for simple (but common) things.

If called with a file name instead of a ZipInfo
instance, the date_time is set to the current date/time,
which makes sense to me for anonymous data.
2002-12-12 12:23:32 +00:00
Greg Ward 0e88c9f65d Tweak generation of unicode_whitespace_trans -- clearer, more
efficient.  Suggested by MAL.
2002-12-11 13:54:20 +00:00
Raymond Hettinger 0efa17c943 Clean-up test class for DictMixin. 2002-12-11 07:16:06 +00:00
Kurt B. Kaiser 39c7b45964 Update to reflect current implementation. 2002-12-11 04:42:39 +00:00
Kurt B. Kaiser f06eed08a8 Rework the command line interface, incorporating the shell/edit
configuration selection. Rework the usage message to match.

Also some minor code polishing.
2002-12-11 04:42:04 +00:00
Tim Peters efc4b12169 Added test_ossaudiodev to expected skips on Windows. 2002-12-10 18:47:56 +00:00
Greg Ward 55a8790c41 Aesthetic tweakery: factor read_sound_file() out of play_sound_file(). 2002-12-10 16:27:35 +00:00
Greg Ward 36dacfa49c Initial revision is rev 1.8 of test_linuxaudiodev.py, with
the obvious s/linuxaudiodev/ossaudiodev/ change made.
2002-12-10 16:24:21 +00:00
Neal Norwitz 731a986dfa Upgrade to Tix-8.1.4 from Mike Clarkson (the maintainer) 2002-12-10 02:18:49 +00:00
Tim Peters bca1cbc6f8 SF 548651: Fix the METH_CLASS implementation.
Most of these patches are from Thomas Heller, with long lines folded
by Tim.  The change to test_descr.py is from Guido.  See the bug report.

Not a bugfix candidate -- METH_CLASS is new in 2.3.
2002-12-09 22:56:13 +00:00
Greg Ward c7e3c5e306 Add test_unicode() to ensure that 1) textwrap doesn't crash on unicode
input, and 2) unicode input means unicode output.  This closes
SF bug #622831.
2002-12-09 16:32:41 +00:00
Greg Ward 24cbbcb57f Added test_initial_whitespace() to ensure that SF bug #622849 is fixed.
Change LongWordTestCase.setUp() -- remove leading whitespace from
  text string.
Comment fix.
2002-12-09 16:27:15 +00:00
Greg Ward ab73d46e45 Fix SF bug #622849: in _wrap_chunks(), ensure that leading whitespace in
the input string is always preserved.
2002-12-09 16:26:05 +00:00
Greg Ward 2e74541d7e Fix SF bug #622831 (I think): add unicode_whitespace_trans class
attribute, and modify _munge_whitespace() to recognize Unicode strings
and use unicode_whitespace_trans to munge them.  Still need to add a
test to make sure I've really fixed the bug.
2002-12-09 16:23:08 +00:00
Skip Montanaro 123dc8ef72 self.binary -> self._binary to remove it from the public interface -
suggestion by Raymond Hettinger.
2002-12-08 21:25:00 +00:00
Skip Montanaro 3bf99e3e87 Add support for binary pickles to the shelve module. In some situations
this can result in significantly smaller files.  All classes as well as the
open function now accept an optional binary parameter, which defaults to
False for backward compatibility.  Added a small test suite, updated the
libref documentation (including documenting the exported classes and fixing
a few other nits) and added a note about the change to Misc/NEWS.
2002-12-08 18:36:24 +00:00
Raymond Hettinger 065c06a622 Add another test which exercises the whole suite with a
heapsort and verifies the result against list.sort().
2002-12-07 10:33:42 +00:00
Raymond Hettinger c2e095f6f4 Fix typo in abstract.c which caused __rpow__ to not be invoked.
Added related testcase.
Closes SF bug #643260.
2002-12-07 10:05:27 +00:00
Raymond Hettinger c1ac194e94 Clarify and speedup test. 2002-12-07 09:25:05 +00:00
Raymond Hettinger babc83a27a Cleaned up test (removing bogus argument list). 2002-12-07 09:04:29 +00:00
Raymond Hettinger e03e5b1f91 Remove assumption that cls is a subclass of dict.
Simplifies the code and gets Just van Rossum's example to work.
2002-12-07 08:10:51 +00:00
Kurt B. Kaiser 0930c43e43 M PyShell.py
1. Format and print exceptions raised in user code.

M rpc.py
1. Additional debug messages in rpc.py
2. Move debug message enable switch from SocketIO to Client and Server
   to allow separate activation.
3. Add indication of origin (client or server) to debug message
4. Add sequence number to appropriate debug messages

5. Pass string exception arg as a string rather than a tuple.
2002-12-06 21:45:24 +00:00
Martin v. Löwis 468742878f Patch #649184: Update to tix-8.1.4 RC3. 2002-12-06 10:33:45 +00:00
Michael W. Hudson a69c030c15 The final tweaks before closing
[ 633152 ] list slice ass ignores subtypes of list

Allow arbitrary sequences on the RHS of extended slices.
2002-12-05 21:32:32 +00:00
Jason Tishler e257ec9ef7 Patch #648998: test_commands ACL patch
Although motived by Cygwin, this patch will prevent
test_commands from failing on Unixes that support
ACLs. For example, the following is an excerpt from
the Solaris ls manpage:

	...
	-rwxrwxrwx+ 1 smith dev 10876 May 16 9:42 part2

	The plus sign indicates that there is an ACL associated
	with the file.
	...
2002-12-05 20:18:39 +00:00
Tim Peters b0f89e05ad Add a Cygwin skip mentioned by Jason Tishler. 2002-12-05 17:20:25 +00:00
Jason Tishler 2511594060 Patch #551977: Regression exceptions for cygwin
This patch updates regrtest.py to understand which
tests are normally skipped under Cygwin. The list of
tests was verified with the Cygwin Python maintainer.
2002-12-05 15:18:15 +00:00
Raymond Hettinger b02bb5ed0a Replace BadInternalCall with TypeError. Add a test case. Fix whitespace.
Just van Rossum showed a weird, but clever way for pure python code to
trigger the BadInternalCall.  The C code had assumed that calling a class
constructor would return an instance of that class; however, classes that
abuse __new__ can invalidate that assumption.
2002-12-04 07:32:25 +00:00
Tim Peters b4ee4eb3b3 Rearrange test_socket_ssl so that a skip is expected iff the network
resource isn't enabled or the socket module doesn't support ssl.
2002-12-04 03:26:57 +00:00
Kurt B. Kaiser 6eadc6cf7e Enable Check Module 2002-12-03 23:09:23 +00:00
Kurt B. Kaiser 318016be65 Don't use Alt-Fn or Ctrl-Fn keys, reserved for desktop changes in Unix.
Zoom becomes Alt-H  "height"
Check Module becomes Alt-X  "syntax"
2002-12-03 20:34:43 +00:00