Commit Graph

7255 Commits

Author SHA1 Message Date
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
Guido van Rossum 9d4270070a Some more expected skips on OSX. 2002-12-03 10:24:56 +00:00
Guido van Rossum 6c7340552c Lose references to knee (no longer exists) and pyclbr (has its own
test suite now).
2002-12-03 09:34:54 +00:00
Guido van Rossum a1962d6efd Get rid of 1.5.2 compatibility hack. :-) 2002-12-03 09:28:36 +00:00
Marc-André Lemburg 0375079e93 Adding Python <= 2.2 support back in. 2002-12-03 08:45:11 +00:00
Guido van Rossum 7f6a439040 Add more sophistication to the comparison between pyclbr output and
real module, by filtering out aliased methods.  This, combined with
the recent fixes to pyclbr, make it possible to enable more tests with
fewer exceptions.
2002-12-03 08:16:50 +00:00
Guido van Rossum 0a6f954766 Another big update, fixing all known bugs related to nesting functions
and classes.  Also add a mini main program that dumps the results for
a given file or module.
2002-12-03 08:14:35 +00:00
Guido van Rossum 7a98e8083c In class bsdTableDB, add class variables db and env (set to None) to
prevent close() called from __del__ from bombing out when __init__()
fails early.
2002-12-02 16:17:46 +00:00
Guido van Rossum 0d366b1418 Fix typo in except clause (_db should be _bsddb). 2002-12-02 16:08:54 +00:00
Guido van Rossum 0ed7aa1e03 Moderately heavy reorganization of pyclbr to fix package-related bugs.
- The _modules cache now uses the full module name.

- The meaning of the (internal!!!) inpackage argument is changed: it
  now is the parent package name, or None.  readmodule() doesn't
  support this argument any more.

- The meaning of the path argument is changed: when inpackage is set,
  the module *must* be found in this path (as is the case for the real
  package search).

- Miscellaneous cleanup, e.g. fixed __all__, changed some comments and
  doc strings, etc.

- Adapted the unit tests to the new semantics (nothing much changed,
  really).  Added some debugging code to the unit tests that print
  helpful extra info to stderr when a test fails (interpreting the
  test failures turned out to be hard without these).
2002-12-02 14:54:20 +00:00
Guido van Rossum c706c28d75 Add a better columnizer to print_topics(). 2002-12-02 13:08:53 +00:00
Guido van Rossum 3b10dc3554 Require 'largefile' resource for Mac OSX as well. 2002-12-02 10:42:30 +00:00
Guido van Rossum bb48465273 On Max OSX, try increasing the stack limit to 2048 so test_re and
test_sre won't die with a SegFault.
2002-12-02 09:56:21 +00:00
Kurt B. Kaiser 5f7c4b34b9 Remove dead code in get_stack().
Modify get_stack() and get_exception to be StackTreeItem methods.
SF Bug 610756.  Neal Norwitz.
2002-12-02 05:08:54 +00:00
Kurt B. Kaiser 491427dfe1 Fix beep.
Then remove annoying beep, not needed with breakpoint highlighting.
2002-12-02 04:41:29 +00:00
Neal Norwitz 6453c1f218 Cleanup:
* Remove unused imports
 * Convert some more 1/0 to True/False
 * Shorten up a long line
2002-11-30 19:18:46 +00:00
Neal Norwitz 539594f2f5 Remove unused import
Remove unused variables since they were the return value from grid(),
which is always None
2002-11-30 19:12:41 +00:00
Neal Norwitz 5b0b00fb21 Convert string exceptions to classes, string exceptions are deprecated 2002-11-30 19:10:19 +00:00
Neal Norwitz 672ce57100 Convert some more 1/0 to True/False 2002-11-30 19:04:07 +00:00
Neal Norwitz f4c4f115d8 Add missing self for method call 2002-11-30 18:49:10 +00:00
Neal Norwitz 3e0edbf4d8 Port Martin von Loewis checkin from Python:
Add --check-tkinter to setup.py. Install IDLE. Fixes #634078.
2002-11-30 17:54:17 +00:00
Neal Norwitz ce8ed1a8d5 Port Martin von Loewis checkin from python: Support sdist. 2002-11-30 17:51:41 +00:00
Kurt B. Kaiser 6e44cc2369 M PyShell.py
M rpc.py

SF Bug 629987: Idle not printing prompts following SyntaxError
2002-11-30 06:18:00 +00:00
Ka-Ping Yee a59ef7bbe0 getdoc():
Remove leading whitespace from first line; remove leading and
    trailing blank lines from docstrings.  (Patch 645938 submitted
    by David Goodger.)
2002-11-30 03:53:15 +00:00
Kurt B. Kaiser 818855939a Correct an error introduced at Rev 1.30. The keyword arg is necessary
to freeze the value of orig_checkcache.  Otherwise infinite recursion.
2002-11-29 22:10:53 +00:00
Andrew M. Kuchling 8e30bcdaaf Fix mode on scripts to have the read bit set (noted by Nicholas Riley) 2002-11-29 19:45:58 +00:00
Michael W. Hudson ade8c8b2c3 Nudge getting __module__ and __name__ for new-style classes so that
the results of *setting* __name__ are not so surprising.

If people can suggest more tests, that'd be grand, or is what's there
sufficient?
2002-11-27 16:29:26 +00:00
Neal Norwitz deaba57009 SF #641170, reST version of Lib/test/README
Convert test/README to reST
2002-11-27 15:47:10 +00:00
Michael W. Hudson 7e7c00db0c I don't know why staring at the email to python-checkins made me
see problems with my code that I didn't see before the checkin, but:

When a subtype .mro() fails, we need to reset the type whose __bases__
are being changed, too.  Fix + test.
2002-11-27 15:40:09 +00:00
Michael W. Hudson 586da8fddd Readjustments to the way we cope with exceptions from subclasses'
mro() methods.  Now any exception aborts the whole __bases__ change.

And more tests.
2002-11-27 15:20:19 +00:00
Andrew M. Kuchling 31ddfb6942 [Part of patch #641685] Add .dylib as an extension for shared libraries 2002-11-27 13:45:26 +00:00
Michael W. Hudson caf17be1b7 I had the inheritance cycle stuff backwards. Oops! 2002-11-27 10:24:44 +00:00
Martin v. Löwis e16e01fac6 Patch #639112: fixes for None locale and tz. 2002-11-27 08:30:25 +00:00
Raymond Hettinger e4827eb2a2 Bring UserDict in-sync with changes to dict.
Constructor accepts optional keyword arguments after a optional items list.
Add fromkeys() as an alternate constructor from an iterable over keys.
Expand related unittests.
2002-11-27 08:29:11 +00:00
Raymond Hettinger e33d3df030 SF Patch 643443. Added dict.fromkeys(iterable, value=None), a class
method for constructing new dictionaries from sequences of keys.
2002-11-27 07:29:33 +00:00
Guido van Rossum a01fa26396 The MRO conflict error message depends on dictionary hash order.
Avoid depending on this in the test.
2002-11-27 04:00:59 +00:00
Fred Drake 4dd0f7ef7a Add a way to say "use any resource except A". For example, to run
allow the use of any resource except bsddb, give the option
"-uall,-bsddb".
2002-11-26 21:44:56 +00:00
Martin v. Löwis 8c8aa5d666 Rename want_objects to wantobjects throughout, for consistency. 2002-11-26 21:39:48 +00:00
Fred Drake 94e7bb7dd6 Use "is" to test type objects, not "==". 2002-11-26 21:28:23 +00:00
Andrew M. Kuchling acd5cb2ff0 Fix for bug #410541: bdist builds bogus .zips
This adds a --relative option to the bdist_dumb command that defaults
to false; if true, the .tar.gz or .zip will be assembled using relative
paths.
2002-11-26 17:45:19 +00:00
Andrew M. Kuchling 40f23e0ddf Part of the fix for bug #410541: add ensure_relative() function 2002-11-26 17:42:48 +00:00
Michael W. Hudson 98bbc49c54 This is my patch:
[ 635933 ] make some type attrs writable

Plus a couple of extra tests beyond what's up there.

It hasn't been as carefully reviewed as it perhaps should, so all readers
are encouraged, nay exhorted, to give this a close reading.

There are still a couple of oddities related to assigning to __name__,
but I intend to solicit python-dev's opinions on these.
2002-11-26 14:47:27 +00:00
Martin v. Löwis ffad633af9 Patch #518625: Return objects in Tkinter. 2002-11-26 09:28:05 +00:00
Guido van Rossum d32047f038 A tweaked version of Jeremy's patch #642489, to produce better error
messages about MRO conflicts.  (Tweaks here: don't print the message,
but compare it with an expected string.)
2002-11-25 21:38:52 +00:00
Raymond Hettinger 35e48d2426 SF 643115: Set._update() had a special case for dictionaries which allowed
non-true values to leak in.  This threw-off equality testing which depends
on the underlying dictionaries having both the same keys and values.
2002-11-25 20:43:55 +00:00
Walter Dörwald 00445d2393 Fix typo in comment. 2002-11-25 17:58:02 +00:00
Gustavo Niemeyer 1456fde6a0 Fixed bug
[#495695] webbrowser.py: selection of browser

* Lib/webbrowser.py
  Only include graphic browsers in _tryorder if DISPLAY is set. Also,
  included skipstone support, as suggested by Fred in the mentioned bug.

* Misc/NEWS
  Mention fix and skipstone inclusion.
2002-11-25 17:25:04 +00:00
Martin v. Löwis d5169bad94 Regenerate from Unicode 3.2.0 to include all First/Last ranges. 2002-11-24 23:10:08 +00:00
Tim Peters 1babdfc48a Reduced memory burden by iterating over the normalization test input
file directly (instead of sucking it all into a list of lines first).
2002-11-24 19:19:09 +00:00
Tim Peters 1b445d3fcf Fiddled things so that test_normalization is expected to be skipped if
and only if the test input file doesn't exist.
2002-11-24 18:53:11 +00:00
Martin v. Löwis 65730a4de8 Delete bsddb from sys.modules if _bsddb cannot be imported. 2002-11-24 08:26:01 +00:00
Tim Peters d332c085ea Skip test_normalization on Windows until it's at least clear why the
data it needs doesn't exist in the project.  If it's a huge file,
maybe the test should be changed to be one of the -u thingies.
2002-11-24 02:40:40 +00:00
Tim Peters b9ac505110 Split long line.
XXX If NormalizationTest.txt is required to run this test, why isn't it
checked into the project?
2002-11-24 02:37:29 +00:00
Tim Peters 77c06fbf94 Whitespace normalization. 2002-11-24 02:35:35 +00:00
Martin v. Löwis 677bde2dd1 Patch #626485: Support Unicode normalization. 2002-11-23 22:08:15 +00:00
Martin v. Löwis 74a530d42d Update character names. 2002-11-23 19:41:01 +00:00
Martin v. Löwis ef7fe2e813 Implement names for CJK unified ideographs. Add name to KeyError output.
Verify that the lookup for an existing name succeeds.
2002-11-23 18:01:32 +00:00
Martin v. Löwis 8579efc86c Add test cases for Hangul syllables. Update output. 2002-11-23 17:11:42 +00:00
Neal Norwitz ca2953ea5c Remove duplicate test 2002-11-23 16:57:00 +00:00
Martin v. Löwis 529ec6a1ee Regenerate. Fixes #618012. 2002-11-23 12:09:28 +00:00
Martin v. Löwis b2c7affbaa Merge with bsddb3 2002.11.23.10.42.36 2002-11-23 11:26:07 +00:00
Just van Rossum a797d8150d Patch #642500 with slight modifications: allow keyword arguments in
dict() constructor. Example:
  >>> dict(a=1, b=2)
  {'a': 1, 'b': 2}
  >>>
2002-11-23 09:45:04 +00:00
Thomas Heller 450cafae28 (This is hopefully the last large, funny checkin message for
bdist_wininst.py we will see.)

Removed the base64 encoded binary contents, wininst.exe must be in the
same directory as this file now.

wininst.exe must be recompiled and commited each time the sources in
PC/bdist_wininst are changed.
2002-11-22 21:08:34 +00:00
Thomas Heller 3a23c3fae1 get_python_version was not imported. 2002-11-22 20:57:20 +00:00
Fred Drake 8bec48316b Two bugs:
- assertRaises() wasn't being called correctly
- test_warning() no longer applies
2002-11-22 20:13:43 +00:00
Tim Peters 78e35f9311 Move Windows Python away from bsddb 1.85 and toward Sleepycat's latest.
The bsddb subproject is gone.
The _bsddb subproject is new.
There are problems here, but I'm out of time to work on this now.  If
anyone can address an XXX comment or two in readme.txt, please do!
2002-11-22 20:00:34 +00:00
Guido van Rossum 44f602dd3b Comment out the warnings about mktemp(). These are too annoying, and
often unavoidable.
2002-11-22 15:56:29 +00:00
Fred Drake 132e0e824b Use False instead of 0. 2002-11-22 14:22:49 +00:00
Martin v. Löwis 4581cfa326 Patch #486438: Make module argument to testmod optional. 2002-11-22 08:23:09 +00:00
Martin v. Löwis f86e8ef33e Patch #550765: Add daemon_threads flag. 2002-11-22 08:08:44 +00:00
Piers Lauder e0273de432 added new IMAP4_stream class; added proxyauth command; added login_cram_md5 method 2002-11-22 05:53:04 +00:00
Raymond Hettinger 54405456e5 Implement dict() style constructor.
Already supported dict() and dict(mapping).
Now supports dict(itemsequence) and
Just van Rossum's new syntax for dict(keywordargs).

Also, added related unittests.

The docs already promise dict-like behavior
so no update is needed there.
2002-11-22 00:07:40 +00:00
Martin v. Löwis d899605e30 Patch #633547: Support plural forms. Do TODOs in test suite. 2002-11-21 21:45:32 +00:00
Guido van Rossum 21b60147e9 The _Event class should be more careful with releasing its lock when
interrupted.  A try/finally will do nicely.  Maybe other classes need
this too, but since they manipulate more state it's less clear that
that is always the right thing, and I'm in a hurry.

Backport candidate.
2002-11-21 21:08:39 +00:00
Andrew M. Kuchling fec3262691 Reflow comment 2002-11-21 20:41:07 +00:00
Martin v. Löwis 69ceb33bac Patch #642019: Recognize gcc-x.y as gcc. 2002-11-21 20:33:24 +00:00
Andrew M. Kuchling cdd215789c Bug #639118 from Ollie Oldham: archiver should use zipfile before zip
Previously archive_util.py attempted to spawn an
        external 'zip' program for the zip action, if this fails, an
        attempt to import zipfile.py is made...

        This bites folks who have 'old' or non-conforming zip
        programs on windows platforms.  This change tries the 'zipfile'
        module first, falling back to spawning a zip process if
        the module isn't available.
2002-11-21 18:33:28 +00:00
Tim Peters 97701b507b _RandomNameSequence(): style guide changes, small speedup, don't
put more in the critical section than absolutely needed, acquire
the mutex before the "try".
2002-11-21 15:59:59 +00:00
Tim Peters 6ef966e1ad _TemporaryFileWrapper: changed self.close_called to a proper bool. 2002-11-21 15:48:33 +00:00
Kurt B. Kaiser 4fc904708b Apply Nicolas Riley's Patch.
[ 634250 ] SearchDialogBase.py fix for Tk 8.4.1

SearchDialogBase refers to the grid 'col' option
considered ambiguous with Python 2.2.2 and Tk 8.4.1.
The correct name is 'column'.
2002-11-21 03:02:17 +00:00
Neal Norwitz 201626e00f Fix SF #640094, on win32 getpass runs into unix_getpass
Make sure we have a UNIX-compatible termios.
Apparently, McMillan Installer made a termios on windows
which caused unix_getpass() to be used instead of win_getpass().

Will backport.
2002-11-20 23:15:54 +00:00
Andrew M. Kuchling 2db92a6ee1 Add missing import 2002-11-20 16:10:29 +00:00
Walter Dörwald 7f82f7955e Add missing documentation for the PEP 293 functionality to
the codecs docstrings.
2002-11-19 21:42:53 +00:00
Walter Dörwald f171540ab8 Change int() so that passing a string, unicode, float or long argument
that is outside the integer range no longer raises OverflowError, but
returns a long object instead.

This fixes SF bug http://www.python.org/sf/635115
2002-11-19 20:49:15 +00:00
Martin v. Löwis 7a3bae410d Replace bsddb3 and _db occurrences. 2002-11-19 17:48:49 +00:00
Martin v. Löwis 1c6b1a2b4e Importing test suite from bsddb3 3.4.0 (with modifications). 2002-11-19 17:47:07 +00:00
Andrew M. Kuchling d448f66317 Add comment to Distutil files about requiring 1.5.2 compatibility, as
suggested by PEP 291.
2002-11-19 13:12:28 +00:00
Martin v. Löwis 6aa4a1f29c Import PyBSDDB 3.4.0. Rename historical wrapper to bsddb185. 2002-11-19 08:09:52 +00:00
Neil Schemenauer fe4f769fb8 Add __mod__ method to UserString. 2002-11-18 16:12:54 +00:00
Neil Schemenauer b981df9943 check for str.__mod__ 2002-11-18 16:12:11 +00:00
Neil Schemenauer ab9e4b76c2 check for unicode.__mod__ 2002-11-18 16:11:34 +00:00
Raymond Hettinger 311f419628 Improve comments. Clarify docs.
Replace "type(0)" with "int".
Replace "while 1" with "while True"
2002-11-18 09:01:24 +00:00
Raymond Hettinger 8ddc176e2e Improve DictMixin.
Replaced docstring with comments.  Prevents subclass contamination.
Added the missing __cmp__() method and a test for __cmp__().
Used try/except style in preference to has_key() followed by a look-up.
Used iteritem() where possible to save creating a long key list and
   to save redundant lookups.
Expanded .update() to look for the most helpful methods first and gradually
   work down to a mininum expected interface.
Expanded documentation to be more clear on how to use the class.
2002-11-18 04:34:10 +00:00
Eric S. Raymond 782d940866 Guard against error if .netrc is missing. 2002-11-17 17:53:12 +00:00
Neal Norwitz c4d047aad3 SF Patch #638825
Fix pychecker warnings, port arg was unused (it was always the default)
Need a global statement for _listener
2002-11-15 23:33:20 +00:00
Neal Norwitz d1cade0d1f SF Patch #638825 logging module
Fix pychecker warnings, remove unused imports and rename root
2002-11-15 23:31:28 +00:00
Tim Peters a1d004af04 Style guide reformats. I saw this test fail on a very heavily loaded
Win98SE box, but whatever the cause, it had scrolled off the DOS box.
(There was just the "test_queue failed" summary at the end of the
regrtest run.)
2002-11-15 19:08:50 +00:00
Raymond Hettinger 903bf90723 SF patch #520382: Expand shelve.py to have a full dictionary interface
and add a mixin to UserDict.py to make it easier to implement a full
dictionary interface.
2002-11-15 08:39:40 +00:00
Raymond Hettinger 7994716b6b SF patch #520382: Expand shelve.py to have a full dictionary interface
and add a mixin to UserDict.py to make it easier to implement a full
dictionary interface.
2002-11-15 06:46:14 +00:00
Guido van Rossum b9ba45894a Checking in Greg Ward's Optik, as optparse.py. This is the most
recent version from Greg's CVS.  I've changed the module docstring,
added a copyright notice, and renamed OptikError to OptParseError.

Still to do are documentation and unit tests.
2002-11-14 22:00:19 +00:00
Guido van Rossum 9a81892100 Fix or disable some tests that were affected by the new C3 MRO
algorithm, and add some new tests for the C3 algorithm.
2002-11-14 19:50:14 +00:00
Tim Peters c293704e93 This uses only one temp file at a time, so use test_support.TESTFN as
the name instead of enduring nanny "security warnings" from
tempfile.mktemp().
2002-11-14 16:23:29 +00:00
Guido van Rossum 3165786dd1 From SF patch 638299 [by Vinaj]: fileConfig() now takes an optional
defaults dictionary parameter which is passed to ConfigParser.
2002-11-14 12:52:17 +00:00
Neal Norwitz a4864a2464 Update the docstring to match the code. Will backport. 2002-11-14 03:31:32 +00:00
Neal Norwitz f539bdeb9c Sync Tix from Mike Clarkson, a maintainer 2002-11-14 02:43:40 +00:00
Andrew M. Kuchling a6483d2e9a Remove 'created by' lines; people can use CVS for this, and the information is often out of date 2002-11-14 02:25:42 +00:00
Neal Norwitz ef67956139 Fix typo in comment 2002-11-14 02:19:44 +00:00
Andrew M. Kuchling f6756e8dd4 Fix docstring typo; remove 'created' line 2002-11-14 01:58:48 +00:00
Andrew M. Kuchling 1cace1a30a [Bug #550364] Use sysconfig.get_python_version() 2002-11-14 01:44:35 +00:00
Andrew M. Kuchling 0ff98b9346 [Bug #550364] Add get_python_version() 2002-11-14 01:43:00 +00:00
Andrew M. Kuchling 9a38dcf057 [Bug #599248] ext module generation problem
If you have source files srcdir1/foo.c and srcdir2/foo.c, the
temporary .o for both files is written to build/temp.<platform>/foo.o.
This patch sets strip_dir to false for both calls to object_filename,
so now the object files are written to temp.<platform>/srcdir1/foo.o
and .../srcdir2/foo.o.

2.2 bugfix candidate
2002-11-14 01:29:00 +00:00
Eric S. Raymond b2db587b11 Make nntplib aware of ~/.netrc credentials; now they get used if they are
present and the caller has not specified a name/password pair.  This change
makes it less likely that a lazy coder will expose sensitive information in a
word-readable script.

Also, make the test a bit smarter.  If NNTPSERVER is defined in the environment
it will go talk to that server rather than look for a possibly nonexistent
local one named 'news'.  Maybe the osession initializer ought to look at
NNTPSERVER rather than requiring a host arg?  Must look around and see how
universal this convention is first.
2002-11-13 23:05:35 +00:00
Jeremy Hylton 4c8be8510b Add some simple tests of the persistence hooks. 2002-11-13 22:10:47 +00:00
Jeremy Hylton 5e0f4e73a9 Remove inst_persistent_id() WANNI (we ain't never needed it).
Add some simple tests of the persistence hooks.
2002-11-13 22:01:27 +00:00
Jeremy Hylton 0e1183ddff remove debugging print 2002-11-13 22:00:02 +00:00
Andrew M. Kuchling 3f1c9a916f Allow unknown keyword arguments to the Extension class, and warn about them. 2002-11-13 20:54:21 +00:00
Jeremy Hylton cd58b8f532 Add getstate and setstate implementation to concrete set classes. 2002-11-13 19:34:26 +00:00
Jeremy Hylton 77628658ca Remove some test code.
The buggy yahoo server was fixed, and the opalgroup test files are
gone.
2002-11-13 17:30:32 +00:00
Jeremy Hylton 22b3a49d3c Fix SF bug #637789: Handle Proxy-Connection header.
Also, remove unused local variable noted by pychecker.
2002-11-13 17:27:43 +00:00
Andrew M. Kuchling 33635aaf93 Back out part of rev. 1.53, restoring the use of the string module.
The two long lines have been reflowed differently; hopefully someone on
BeOS can test them.  Rev. 1.53 also converted string.atoi() to int(); I've
left that alone.
2002-11-13 17:03:05 +00:00
Guido van Rossum 455ab77f34 Get rid of #! lines, references to usage as __main__, README.txt, and
http://www.red-dove.com/python_logging.html.
2002-11-13 16:18:29 +00:00
Guido van Rossum 57102f861d Adding Vinay Sajip's logging package. 2002-11-13 16:15:58 +00:00
Raymond Hettinger c0b4034b81 Improved clarity and thoroughness of docstring.
Added design notes in comments.
Used better variable names.
Eliminated the unsavory "pool[-k:]" which was an aspiring bug (for k==0).
Used if/else to show the two algorithms in parallel style.
Added one more test assertion.
2002-11-13 15:26:37 +00:00
Fred Drake f2928eb017 Fix typo in comment. 2002-11-13 14:38:17 +00:00
Andrew M. Kuchling 8557156717 Update file 2002-11-13 13:26:59 +00:00
Andrew M. Kuchling ea002a1aff Docstring typo fix 2002-11-13 13:25:46 +00:00
Neal Norwitz 80a1bf4b5d Fix SF # 635969, No error "not all arguments converted"
When mwh added extended slicing, strings and unicode became mappings.
Thus, dict was set which prevented an error when doing:
	newstr = 'format without a percent' % string_value

This fix raises an exception again when there are no formats
and % with a string value.
2002-11-12 23:01:12 +00:00
Tim Peters b9099c3df4 SF patch 637176: list.sort crasher
Armin Rigo's Draconian but effective fix for

SF bug 453523: list.sort crasher

slightly fiddled to catch more cases of list mutation.  The dreaded
internal "immutable list type" is gone!  OTOH, if you look at a list
*while* it's being sorted now, it will appear to be empty.  Better
than a core dump.
2002-11-12 22:08:10 +00:00
Raymond Hettinger f24eb35d18 SF patch 629637: Add sample(population, k) method to the random module.
Used for random sampling without replacement.
2002-11-12 17:41:57 +00:00
Martin v. Löwis 3ae84b6389 Allow both string and Unicode objects in levels. 2002-11-09 20:19:12 +00:00
Martin v. Löwis 2411a2dd82 Don't try to convert the test filename to Unicode with -U. 2002-11-09 19:57:26 +00:00
Martin v. Löwis 838a359b95 Search for tix subdirectories. Fixes #564729. Will backport to 2.2. 2002-11-09 19:01:44 +00:00
Tim Peters 44a7910873 I already forgot what I changed -- it wasn't important <wink>. 2002-11-09 06:51:30 +00:00
Tim Peters 63c1081ae3 OK -- all tests pass on Windows now. The rest were due to 3 more
binary-vs-text-mode screwups.
2002-11-09 06:49:43 +00:00
Tim Peters 9de06bd605 More tests run on Windows now. Something is still wrong here, but no
idea what.  Added liberal XXX explanations for the next guy.
2002-11-09 06:45:31 +00:00
Tim Peters 499d09af92 Many changes to get this to pass on Windows, and to make it easier to
figure out what the code was doing.  The fixes were a combination of
closing open files before deletion, opening files in binary mode, and
plain skipping things that can't work on Windows (BaseTest.decompress
uses a process gimmick that doesn't exist on Windows, and, even if it
did, assumes a "bunzip2" executable is on PATH).
2002-11-09 06:31:56 +00:00
Tim Peters 3de75266aa Whitespace normalization. 2002-11-09 05:26:15 +00:00
Tim Peters e7130315a5 Comment out the test docstrings so we can at least tell which tests are
failing.
2002-11-09 05:22:41 +00:00
Tim Peters 230a60c6ec Whitespace normalization. 2002-11-09 05:08:07 +00:00
Tim Peters ae9cbee4da Open at least one binary file in binary mode. This allows a few of the
bz2 tests to pass on Windows; most are still failing.
2002-11-09 04:44:30 +00:00
Guido van Rossum 7cd83ca9ad Another attempt at making the set constructor both safe and fast. [SF
bug 628246]
2002-11-08 17:03:36 +00:00
Andrew M. Kuchling 91e77536e8 [Bug #233259] Ugly traceback for DistutilsPlatformError
Fixed by catching all exceptions that are subclasses of DistutilsError,
  so only the error message will be printed.  You can still get the
  whole traceback by enabling the Distutils debugging mode.
2002-11-08 16:18:24 +00:00
Andrew M. Kuchling 706867c20c Fix comment typo 2002-11-08 15:11:42 +00:00
Michael W. Hudson 006c75265f This is Richie Hindle's patch:
[ 631276 ] Exceptions raised by line trace function

It conflicted with the patches from Armin I just checked it, so I had
to so some bits by hand.
2002-11-08 13:08:46 +00:00
Martin v. Löwis 1f04610b49 Make strip behave as documented. Will backport to 2.2.3. 2002-11-08 12:09:59 +00:00
Tim Peters 0ec1ddcdcf _update(): Commented the new obscurity. Materialized into a tuple
instead of into a list for a bit of speed/space savings.  Reopened the
bug report too (628246), as I'm unclear on why we don't sort out the
cause of the TypeError instead.
2002-11-08 05:26:52 +00:00
Raymond Hettinger 1eb1fb814b Closes SF bug #628246.
The _update method detected mutable elements by trapping TypeErrors.
Unfortunately, this masked useful TypeErrors raised by the iterable
itself.  For cases where it is possible for an iterable to raise
a TypeError, the iterable is pre-converted to a list outside the
try/except so that any TypeErrors propagate through.
2002-11-08 05:03:21 +00:00
Thomas Heller 492620ae5e Use dynamic linking for the SHGetSpecialFolderPath function, it is not
always available on Windows NT. When the function cannot be loaded,
get_special_folder_path raises OSError, "function not available".

Compiled the exe, and rebuilt bdist_wininst.py.
2002-11-07 16:46:19 +00:00
Thomas Heller 8560bb8167 Fix a small bug when sys.argv[0] has an absolute path.
See http://mail.python.org/pipermail/distutils-sig/2002-November/003039.html
2002-11-07 16:41:38 +00:00
Gustavo Niemeyer fbceb01ef0 Fixed bug "[#466200] ability to specify a 'verify' script".
* Lib/distutils/command/bdist_rpm.py
  (bdist_rpm.initialize_options): Included verify_script attribute.
  (bdist_rpm.finalize_package_data): Ensure that verify_script is a filename.
  (bdist_rpm._make_spec_file): Included verify_script in script_options
  tuple.

* Misc/NEWS
  Mention change.
2002-11-06 18:44:26 +00:00
Walter Dörwald 4dbf192f2b Add next() and __iter__() methods to StreamReader, StreamReaderWriter
and StreamRecoder.

This closes SF bug #634246.
2002-11-06 16:53:44 +00:00
Walter Dörwald 07e147667c Make int("...") return a long if an int would overflow.
Also remove the 512 character limitation for int(u"...") and long(u"...").

This closes SF bug #629989.
2002-11-06 16:15:14 +00:00
Andrew M. Kuchling aca49b065b Fix NameError exception ('name' undefined) 2002-11-06 15:40:05 +00:00
Andrew M. Kuchling 9050a517c8 Fix docstring typos 2002-11-06 14:51:20 +00:00
Gustavo Niemeyer 4e7be06a65 Fixed bug #470582, using a modified version of patch #527371,
from Greg Chapman.

* Modules/_sre.c
  (lastmark_restore): New function, implementing algorithm to restore
  a state to a given lastmark. In addition to the similar algorithm used
  in a few places of SRE_MATCH, restore lastindex when restoring lastmark.
  (SRE_MATCH): Replace lastmark inline restoring by lastmark_restore(),
  function. Also include it where missing. In SRE_OP_MARK, set lastindex
  only if i > lastmark.

* Lib/test/re_tests.py
* Lib/test/test_sre.py
  Included regression tests for the fixed bugs.

* Misc/NEWS
  Mention fixes.
2002-11-06 14:06:53 +00:00
Finn Bock 57f0f3475e Skip the test_nocaret test when running as jython. Jython happens to add
a caret in this case too.
2002-11-06 11:45:15 +00:00
Finn Bock 41c570f2e7 Make the test pass for jython where there are no sys.executable. 2002-11-06 11:37:57 +00:00
Chui Tey 5a231c8f79 By default when getting the search menu, the currently highligted
text is the search term.
2002-11-06 02:18:45 +00:00
Barry Warsaw 210bd208eb Implement a `pp' command, which is like `p' except that it
pretty-prints the value of its expression argument.
2002-11-05 22:40:20 +00:00
Barry Warsaw da2525ed2a parse(), _parseheaders(), _parsebody(): A fix for SF bug #633527,
where in lax parsing, the first non-header line after a header block
(e.g. the first line not containing a colon, and not a continuation),
can be treated as the first body line, even without the RFC mandated
blank line separator.

rfc822 had this behavior, and I vaguely remember problems with this,
but can't remember details.  In any event, all the tests still pass,
so I guess we'll find out. ;/

This patch works by returning the non-header, non-continuation line
from _parseheader() and using that as the first header line prepended
to fp.read() if given.  It's usually None.

We use this approach instead of trying to seek/tell the file-like
object.
2002-11-05 21:44:06 +00:00
Barry Warsaw a0a00761a5 test_no_separating_blank_line(): A test for SF bug #633527, no
separating blank line between a header block and body text.

Tests both lax and strict parsing.
2002-11-05 21:36:17 +00:00
Barry Warsaw 847fdbbe71 A message with no separating blank line between the headers and the
body.  A test message for SF bug #633527.
2002-11-05 21:29:47 +00:00
Barry Warsaw 48b0a1c603 test_text_plain_in_a_multipart_digest(): A test of the fix for SF bug
#631350, where a subobject in a multipart/digest isn't a
message/rfc822.
2002-11-05 21:04:52 +00:00
Barry Warsaw 5c9130ec46 _parsebody(): A fix for SF bug #631350, where a subobject in a
multipart/digest isn't a message/rfc822.  This is legal, but counter
to recommended practice in RFC 2046, $5.1.5.

The fix is to look at the content type after setting the default
content type.  If the maintype is then message or multipart, attach
the parsed subobject, otherwise use set_payload() to set the data of
the other object.
2002-11-05 20:54:37 +00:00
Barry Warsaw 00e6a02ef8 Test case, distilled from SF bug #631350, where a subobject in a
multipart/digest isn't a message/rfc822.  This is legal, but counter
to recommended practice in RFC 2046, $5.1.5.
2002-11-05 20:53:18 +00:00
Tim Peters 9288f95cb5 Another round on SF patch 618135: gzip.py and files > 2G
The last round boosted "the limit" from 2GB to 4GB.  This round gets
rid of the 4GB limit.  For files > 4GB, gzip stores just the last 32
bits of the file size, and now we play along with that too.  Tested
by hand (on a 6+GB file) on Win2K.

Boosting from 2GB to 4GB was arguably enough "a bugfix".  Going beyond
that smells more like "new feature" to me.
2002-11-05 20:38:55 +00:00
Jeremy Hylton cd8fdbb3fa Repair inconsistent use of tabs and spaces. 2002-11-05 20:27:17 +00:00
Jeremy Hylton a5f4c071b5 Remove use of string module and reflow a couple of long lines. 2002-11-05 20:11:08 +00:00
Barry Warsaw 8f4dcbd3f6 Bump __version__ (yes, to 2.5 "minus") 2002-11-05 19:56:47 +00:00