Commit Graph

4805 Commits

Author SHA1 Message Date
Steven M. Gava 28ccc2463e removed some cruft 2001-08-12 01:14:55 +00:00
Tim Peters a6a4f27ef7 _Condition.wait(): never sleep longer than the timeout time remaining,
and even if we have a long time left to wait, try the lock at least 20
times/second.
2001-08-12 00:41:33 +00:00
Jack Jansen dbc363ce35 The test assumed that the local pathname convention for "foo" would sort before "foo/bar", which is not true on the mac (where they are "foo" and ":foo:bar", respectively; ":foo" would be fine too, but "foo" is the preferred spelling). Fixed by sorting the output. 2001-08-11 23:22:43 +00:00
Jeremy Hylton d5d8fc559c Replace all type comparisons with isinstance() calls 2001-08-11 21:44:46 +00:00
Steven M. Gava c01e30f072 repair posix fonts fix 2001-08-11 15:48:13 +00:00
Martin v. Löwis 58682b7fe5 Only catch the errors that can actually occur, as reported in bug #411881. 2001-08-11 15:02:57 +00:00
Steven M. Gava abdfc4147d support for help menu changes 2001-08-11 07:46:26 +00:00
Steven M. Gava 5b3ac8f98f some re-design 2001-08-11 07:45:28 +00:00
Steven M. Gava 6b1ab255c2 supports about changes 2001-08-11 07:44:28 +00:00
Steven M. Gava 0ba4df89ab adjust help menu bindings 2001-08-11 07:42:37 +00:00
Fred Drake cd112f5546 Added tests for rich comparison operator functions.
Converted tests to PyUnit.
2001-08-11 03:21:35 +00:00
Guido van Rossum e45763a8e6 Add test for SF bug #442833 (multiple inheritance). 2001-08-10 21:28:46 +00:00
Guido van Rossum 61cf780b6d The message accompanying the TypeError exception on a readonly
attribute changed again.
2001-08-10 21:25:24 +00:00
Andrew M. Kuchling f4aa684132 [Bug #414032] Make the 'sdist' command work when the distribution contains
libraries.  This is done by adding a .get_source_files() method,
    contributed by Rene Liebscher and slightly modified.
Remove an unused local variable spotted by PyChecker
2001-08-10 20:24:33 +00:00
Guido van Rossum 6d94627f1e Allow AttributeError as well as TypeError for attribute-less objects. 2001-08-10 19:42:38 +00:00
Andrew M. Kuchling 13f4ea25d4 Remove unused variable 2001-08-10 19:00:41 +00:00
Andrew M. Kuchling 5079fe07fe Fix typo caught by PyChecker 2001-08-10 19:00:15 +00:00
Andrew M. Kuchling 665f248806 Add forgotten import 2001-08-10 18:59:59 +00:00
Fred Drake 981a1787b7 Wrap a comment to fit in 80 columns.
Use construction-syntax for an exception to make the argument easier
to read.
2001-08-10 18:59:30 +00:00
Andrew M. Kuchling db988b1ed3 Use .get_license() 2001-08-10 18:50:11 +00:00
Andrew M. Kuchling fa7dc57d6c [Bug #412271, bug #449009] Use 'license' as the attribute name,
though 'licence' is still supported for backward-compatibility
   (Should I add a warning to get_licence(), or not bother?)

Also fixes an UnboundLocalError noticed by PyChecker
2001-08-10 18:49:23 +00:00
Andrew M. Kuchling fcfc8d5c0e Patch #441091 from Finn Bock: the more advanced flush options are not
available in java, so only use the advanced flush options if they
  are defined in the zlib module.
2001-08-10 15:50:11 +00:00
Guido van Rossum 315cd29ecf Disable the sub() optimization until Fredrik has time to look into SF
bug #449000, "re.sub(r'\n', ...) broke".  This was Fredrik's
suggestion -- he's on vacation and said he wouldn't be able to work on
this until next week.
2001-08-10 14:56:54 +00:00
Guido van Rossum e056e4d15c Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke. 2001-08-10 14:52:48 +00:00
Jeremy Hylton a8b5f7d178 Remove hard-coded NT constants that are already defined in errno on NT.
Wrap some long lines.
Remove unnecessary tuple unpack.
2001-08-10 14:30:35 +00:00
Martin v. Löwis 9b75dca192 Expose nl_langinfo through locale where available. 2001-08-10 13:58:50 +00:00
Tim Peters ab9ba27dc0 Whitespace normalization. 2001-08-09 21:40:30 +00:00
Tim Peters c7ca3ffba3 Skip test_mhlib on Windows -- too many Unix assumptions. 2001-08-09 21:34:54 +00:00
Guido van Rossum e4deb959cc Fix two bugs detected by PyChecker: there's no need for redundant
"import MacOS", and there *is* a need for "import operator".
2001-08-09 21:22:15 +00:00
Andrew M. Kuchling 6386a4c846 Import UnknownFileError 2001-08-09 21:02:34 +00:00
Andrew M. Kuchling 106ffdb672 Import the errno module 2001-08-09 20:59:53 +00:00
Andrew M. Kuchling affadeb9fd Use correct variable name 2001-08-09 20:57:46 +00:00
Fred Drake eaa77e2ca1 Added tests for operator.floordiv() and operator.truediv(). 2001-08-09 20:23:08 +00:00
Guido van Rossum 3720261729 Restore the test for 'object' that I removed when object was
uninstantiable.  All is well now.
2001-08-09 19:45:21 +00:00
Guido van Rossum a995c91243 Use type(x).__name__ to get the name of the type instead of parsing
repr(type(x)).
2001-08-09 18:56:27 +00:00
Guido van Rossum 0263c80b90 Unittests for mhlib, by Nick Mathewson. 2001-08-09 18:18:08 +00:00
Tim Peters 55c12d4d5b SF patch #403640: incomplete proxy handling in URLLIB
Look specific to Windows.  Don't know whether it works.
2001-08-09 18:04:14 +00:00
Guido van Rossum f0713d3f4d SF Patch #420725 by Walter Doerwald:
For local files urllib.py doesn't return the MIME
  headers that the documentation says it does:

  http://www.python.org/doc/current/lib/module-
  urllib.html#l2h-2187 states that "When the method is
  local-file, returned headers will include a Date
  representing the file's last-modified time, a Content-
  Length giving file size, and a Content-Type containing
  a guess at the file's type"

  But in Python 2.1 the only header that gets returned
  is the Content-Type:

  >>> import urllib
  >>> f = urllib.urlopen("gurk.txt")
  >>> f.info().headers
  ['Content-Type: text/plain\n']
2001-08-09 17:43:35 +00:00
Martin v. Löwis c8718c13e8 Patch #403514: precompute _subst_format_str to avoid a call to
string.join() on each invocation of _bind.
2001-08-09 16:57:33 +00:00
Guido van Rossum 3c7a25a4d9 Applied SF patch #438424 by Josh Cogliati:
Python's logolike module turtle.py did not display
the turtle except when actually drawing lines.
This patch changes the turtle.py module so that
it displays the turtle at all times when tracing is
on. This is similar to the the way that logo works.
When tracing is off the turtle will not be displayed.
2001-08-09 16:42:07 +00:00
Martin v. Löwis dbdcb0fc3a Regenerate for glibc 2.2.3. 2001-08-09 12:48:17 +00:00
Martin v. Löwis 4414933f62 Regenerate for Solaris 8. 2001-08-09 12:33:32 +00:00
Martin v. Löwis 8cc965c1fb Patch #448474: Add support for tell() and seek() to gzip.GzipFile. 2001-08-09 07:21:56 +00:00
Guido van Rossum 64deef2b17 A test suite for binary operators, disguised as a rational number
class.
2001-08-08 22:27:20 +00:00
Greg Ward 034cbf1350 Typo fix (spelling mistake in error message). 2001-08-08 20:55:10 +00:00
Martin v. Löwis ff88556af6 Patch #449083: Use builtins to initalize the module. 2001-08-08 16:02:01 +00:00
Steve Purcell e00dde2087 Merged in bugfix from PyUnit CVS for problem reported by Gary Todd.
If 'unittest.py' was run from the command line with the name of a test
case class as a parameter, it failed with an ugly error. (Which was a
shame, because the documentation says you can do that.)

The problem was the old 'is the class X that you imported from me the same
as my class X?' gotcha.
2001-08-08 07:57:26 +00:00
Tim Peters a38d2608bc Regenerated token.py to account for new DOUBLESLASH and DOUBLESLASHEQUAL. 2001-08-08 06:35:56 +00:00
Guido van Rossum 96204f5e49 Add new tokens // and //=, in support of PEP 238. 2001-08-08 05:04:07 +00:00
Guido van Rossum 4668b000a1 Implement PEP 238 in its (almost) full glory.
This introduces:

- A new operator // that means floor division (the kind of division
  where 1/2 is 0).

- The "future division" statement ("from __future__ import division)
  which changes the meaning of the / operator to implement "true
  division" (where 1/2 is 0.5).

- New overloadable operators __truediv__ and __floordiv__.

- New slots in the PyNumberMethods struct for true and floor division,
  new abstract APIs for them, new opcodes, and so on.

I emphasize that without the future division statement, the semantics
of / will remain unchanged until Python 3.0.

Not yet implemented are warnings (default off) when / is used with int
or long arguments.

This has been on display since 7/31 as SF patch #443474.

Flames to /dev/null.
2001-08-08 05:00:18 +00:00
Steven M. Gava 074c9d2b20 beginning of work on the conf. handling smarts 2001-08-08 01:30:38 +00:00
Jeremy Hylton 54e99e8b3b Fix SF bug [ #447370 ] typo in urllib2.py
Also fix another bug caught by pychecker-- HTTPError() raised when
redirect limit exceed did not pass an fp object.  Had to change method
to keep fp object around until it's certain that the error won't be
raised.

Remove useless line in do_proxy().
2001-08-07 21:12:25 +00:00
Guido van Rossum 16fd3381d4 Apply two small changes to the Windows code, according to SF bug
#427345.  These are supposed to support binary data and avoid
buffering problems on Windows.
2001-08-07 19:55:10 +00:00
Fred Drake 56b5fdd295 Remove make_re() function; this is no longer needed since _sre and pcre
are now allowed by ok_builtin_modules.  This effectively backs out
revision 1.26.

This closes SF bug #448546.
2001-08-07 19:49:15 +00:00
Fred Drake c9fadf991c Add a test that xml.sax.saxutils.XMLGenerator does the right thing
when quoting attribute values that contain single & double quotes.

This provides the rest of the regression test for SF bug #440351.
2001-08-07 19:17:06 +00:00
Fred Drake dad91dd1e9 Make sure XMLGenerator uses quoteattr() instead of escape() to quote
attribute values.  Just using escape() can (and always has) led to broken
XML being generated.  This makes sure it always produces the right thing.

This actually closes SF bug #440351.
2001-08-07 19:14:46 +00:00
Guido van Rossum 288cd2cb69 Fix the test so it uses IterableUserDict for the "for x in dict" test. 2001-08-07 17:50:06 +00:00
Guido van Rossum 2050b65e84 Remove the __iter__ method from the UserDict class -- it can silently
break old code (in extreme cases).  See SF bug #448153.

Add a new subclass IterableUserDict that has the __iter__ method.

Note that for new projects, unless backwards compatibility with
pre-2.2 Python is required, subclassing 'dictionary' is recommended;
UserDict might become deprecated.
2001-08-07 17:40:42 +00:00
Guido van Rossum c5943b1c8c Add the NannyNag exception class and the process_tokens() function to
__all__, to indicate these are implied as part of the public API.

IDLE's "Check Module" command uses this, and it broke once already
because the reset_globals() and tokeneater() functions were deleted
when Neil converted this to using the generator API of tokenizer.
(See SF bug #448835.)
2001-08-07 17:19:25 +00:00
Guido van Rossum 15d86c6297 Remove the test for the 'object' type -- it can no longer be
instantiated.  (Its use as a base class is adequately tested by other
tests.)
2001-08-07 16:53:42 +00:00
Jeremy Hylton cd738364ce silence warnings about import * 2001-08-07 16:38:19 +00:00
Steven M. Gava 230e5789e5 more fleshing out, this time primarily the 'general' page 2001-08-07 03:28:25 +00:00
Piers Lauder e02f904cbf fix for Bug ID 448100 - "test code using NL instead of CRNL" 2001-08-05 10:43:03 +00:00
Steven M. Gava f213ccb5d1 began font / indentation page 2001-08-05 08:00:28 +00:00
Greg Ward cbce202f82 Hack to workaround bug #445984: attempt to import _socket before
starting the test suite proper.  If _socket fails to build, that will
make this test fail with an ImportError -- handled by the test harness
as "no such module _socket" -- instead of an AttributeError deep in
CGIHTTPServer.
2001-08-04 22:22:19 +00:00
Steven M. Gava 60fc707be5 further work on keybinding page 2001-08-04 13:58:22 +00:00
Tim Peters c173137391 Derived from SF patch #446899 Permit import of .pyw under Windows, from
David Bolen.
2001-08-04 08:12:36 +00:00
Fred Drake eeee4ec4f1 Refactor so that it is easier to work with alternate MIME types databases,
and programmatically extend the database in different ways.

This closes the SF bug (feature request) #439710.
2001-08-03 21:01:44 +00:00
Tim Peters e861365dab Don't use any characters C doesn't guarantee are safe for text-mode files.
This should stop the bizarre translations Jack was getting from Mac CVS.
2001-08-03 20:40:18 +00:00
Fred Drake 84bb9d8dc4 Fix stupid bug: when migrating these tests from the Zope repository, the
names of the test methods were not changed from the Zope-standard "check"
names to the Python-standard "test_" names, so the tests were not actually
being run.

Added test of hexadecimal character references as a regression check for
SF bug #445196.
2001-08-03 19:53:01 +00:00
Fred Drake 1d4601d306 Change some comments into docstrings.
Fix handling of hexadecimal character references (legal in XHTML) so that
they are properly interpreted as character references.
This fixes SF bug #445196.
2001-08-03 19:50:59 +00:00
Jack Jansen fffd7224df The test opened the binary test data files in text mode! Fixed. 2001-08-03 13:04:03 +00:00
Steven M. Gava 952d0a57d8 further work on config dialog, particularly highligthing config 2001-08-03 04:43:44 +00:00
Fred Drake 4fd06e0170 Make sure that WeakValueDictionary[] raises KeyError instead of TypeError
for keys that are not in the dictionary.
2001-08-03 04:11:27 +00:00
Fred Drake c916cdc5ca Miscellaneous minor cleanups. 2001-08-02 20:03:12 +00:00
Tim Peters d342c62961 This test failed under python -O.
rewrite_file():  Delete both .pyc and .pyo leftovers, and explicitly close
the new source file after writing to it.
2001-08-02 17:23:11 +00:00
Guido van Rossum 394a47b268 Unit test for improved package import semantics.
Original by Alex Coventry (in SF patch #441791), adapted to the
standard regression test framework.
2001-08-02 14:14:20 +00:00
Martin v. Löwis 02d893cfae Patch #444359: Remove unused imports. 2001-08-02 07:15:29 +00:00
Tim Peters 6d6c1a35e0 Merge of descr-branch back into trunk. 2001-08-02 04:15:00 +00:00
Tim Peters 722d78f18a s/endswith/startswith/ 2001-08-01 20:23:18 +00:00
Tim Peters 66e1a254a1 Rewritten version of Finn Bock's SF patch #446907 (Allow jython to
complete test_import).
2001-08-01 19:38:56 +00:00
Guido van Rossum b363c1f445 Turn an octal constant into a hex constant. 2001-08-01 18:17:23 +00:00
Steven M. Gava b9d07b5a8b A more lightweight (and read only) way to view help text
until the new help system is implemented. Removed some
commented cruft.
2001-07-31 11:11:38 +00:00
Steven M. Gava d721c48165 indentation style changed to match existing source 2001-07-31 10:46:53 +00:00
Steven M. Gava 885c0bbd54 improve viewfile handling
indentation style changed to match existing source
2001-07-31 10:44:35 +00:00
Martin v. Löwis 6cd441d129 Add dead imports of modules that are "magically" imported. 2001-07-31 08:54:55 +00:00
Martin v. Löwis bbe500e5d3 Remove obsolete entries from regen scripts. 2001-07-31 08:47:55 +00:00
Martin v. Löwis 2ad2569c72 Initialize msg to avoid unbound locals. 2001-07-31 08:40:21 +00:00
Steven M. Gava 7d9ed726fb activate new about dialog for testing 2001-07-31 07:01:47 +00:00
Steven M. Gava 646c65c117 removed redundant separate idlfefork ver 2001-07-31 07:00:39 +00:00
Steven M. Gava 44d3d1a394 some new dialogs and support files for new about and configuration implementations 2001-07-31 06:59:02 +00:00
Guido van Rossum 3fc9582821 Amazing. This would open the sound file in text mode. Fixed.
SF bug  #446219.
2001-07-31 06:27:07 +00:00
Tim Peters 108efac24e test_codeup should not have had an expected-output file; removing it. 2001-07-30 23:10:44 +00:00
Jeremy Hylton b7a7731e01 Add tests for getattr() and hasattr() with non-string args 2001-07-30 22:49:11 +00:00
Fred Drake c974bf4dc2 Get the whitespace right! 2001-07-30 22:41:23 +00:00
Jeremy Hylton 5121e7de11 Fix for SF bug [ #443866 ] Evaluating func_code causing core dump
Add test that calls eval with a code object that has free variables.
2001-07-30 21:55:29 +00:00
Jeremy Hylton e3c37d660f Ugly fix used when pyexpat is not available.
If pyexpat is not available and more than one attempt is made to load
an expat-based xml parser, an empty xml.parser.expat module will be
created.  This empty module will confuse xml.sax.expatreader into
thinking that pyexpat is available.

The ugly fix is to verify that the expat module actually defines the
names that are imported from pyexpat.
2001-07-30 21:49:22 +00:00
Jeremy Hylton 3c19ec4eab Fix when pyexpat not built
Import pyexpat first so that import error occurs when it is not
available.
2001-07-30 21:47:25 +00:00
Martin v. Löwis 3bd071e3f7 Patch #442866: Tests for codeop.py. 2001-07-30 12:30:08 +00:00
Martin v. Löwis 27c430e54e Patch #445538: add completion for pstats.py sort cmd. 2001-07-30 10:21:13 +00:00