Commit Graph

9851 Commits

Author SHA1 Message Date
Johannes Gijsbers 7db385eef5 Rewrite rmtree using os.walk to fix bug #1025127:
The shutils.rmtree() implementation uses an excessive amount of memory when
deleting large directory hierarchies. Before actually deleting any files, it
builds up a list of (function, filename) tuples for all the files that it is
going to remove.
2004-10-07 21:10:08 +00:00
Brett Cannon ffa5cf9eae Fix bug introduced by the previous patch by changing TimeRE.__seqToRe() to
accept any iterable instead of only a sliceable object.
2004-10-06 22:48:58 +00:00
Brett Cannon f7948c25a2 Convert a listcomp to a gencomp (was already editing code). 2004-10-06 02:23:14 +00:00
Brett Cannon 4f35c71543 Locale data that contains regex metacharacters are now properly escaped.
Closes bug #1039270.
2004-10-06 02:11:37 +00:00
Brett Cannon b9b5f160ab Fix a small typo in the docstring for system_methodSignature .
Closes bug #1038935.  Thanks Malte Helmert for spotting it.
2004-10-03 23:21:44 +00:00
Vinay Sajip e7d4066cdf Changes made to maintain 1.5.2 compatibility. 2004-10-03 19:12:07 +00:00
Vinay Sajip 2d5fee06e0 Version number updated to 0.4.9.5 2004-10-03 19:10:53 +00:00
Tim Peters ab9b32c077 Whitespace normalization. 2004-10-03 18:35:19 +00:00
David Goodger 1cbf206d32 SF bug #997050: Document, test, & check for non-string values in ConfigParser. Moved the new string-only restriction added in rev. 1.65 to the SafeConfigParser class, leaving existing ConfigParser & RawConfigParser behavior alone, and documented the conditions under which non-string values work. 2004-10-03 15:55:09 +00:00
David Goodger 68a1abdade SF bug #1017864: ConfigParser now correctly handles default keys, processing them with ``ConfigParser.optionxform`` when supplied, consistent with the handling of config file entries and runtime-set options. 2004-10-03 15:40:25 +00:00
Barry Warsaw 1b643596a8 Fix test for FeedParser results. 2004-10-03 04:02:43 +00:00
Barry Warsaw 05bef930fa as_string(): Indicate that this mangles From_ lines. 2004-10-03 03:38:07 +00:00
Barry Warsaw bb11386730 Big email 3.0 API changes, with updated unit tests and documentation.
Briefly (from the NEWS file):

- Updates for the email package:
  + All deprecated APIs that in email 2.x issued warnings have been removed:
    _encoder argument to the MIMEText constructor, Message.add_payload(),
    Utils.dump_address_pair(), Utils.decode(), Utils.encode()
  + New deprecations: Generator.__call__(), Message.get_type(),
    Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
    the Parser constructor.  These will be removed in email 3.1.
  + Support for Python earlier than 2.3 has been removed (see PEP 291).
  + All defect classes have been renamed to end in 'Defect'.
  + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
    added to messages that claim to be multipart but really aren't.
  + Updates to documentation.
2004-10-03 03:16:19 +00:00
Just van Rossum 2cdd608601 removed 2.2 support 2004-10-02 14:06:56 +00:00
Just van Rossum 16c3e08931 use new readPlist() and writePlist() functions 2004-10-02 14:06:18 +00:00
Armin Rigo 974d757af1 Upon insertion, if memory runs out, the deque was left in a corrupted state.
deque_item(): a performance bug: the linked list of blocks was followed
from the left in most cases, because the test (i < (deque->len >> 1)) was
after "i %= BLOCKLEN".

deque_clear(): replaced a call to deque_len() with deque->len; not sure what
this call was here for, nor if all compilers under the sun would inline it.

deque_traverse(): I belive that it could be called by the GC when the deque
has leftblock==rightblock==NULL, because it is tracked before the first block
is allocated (though closely before).  Still, a C extension module subclassing
deque could provide its own tp_alloc that could trigger a GC collection after
the PyObject_GC_Track()...

deque_richcompare(): rewrote to cleanly check for end-of-iterations instead of
relying on deque.__iter__().next() to succeed exactly len(deque) times -- an
assumption which can break if deques are subclassed.  Added a test.

I wonder if the length should be explicitely bounded to INT_MAX, with
OverflowErrors, as in listobject.c.  On 64-bit machines, adding more than
INT_MAX in the deque will result in trouble.  (Note to anyone/me fixing
this: carefully check for overflows if len is close to INT_MAX in the
following functions: deque_rotate(), deque_item(), deque_ass_item())
2004-10-02 13:59:34 +00:00
Just van Rossum 4c3d054d3d Which reminds me, I've had a much improved plistlib.py lying around for
ages. The main improvements are:
- a much more convenient API: readPlist() and writePlist()
- support non-dict top-level objects
2004-10-02 08:40:47 +00:00
Tim Peters 10c7e86454 deque_traverse(): If the deque had one block, and its rightindex was
BLOCKLEN-1, this assert-failed in a debug build, or went wild with a
NULL pointer in a release build.  Reported on c.l.py by Stefan Behnel.
2004-10-01 02:01:04 +00:00
Raymond Hettinger 7b46f6b2a5 Add tests for syntax errors. 2004-09-30 22:29:03 +00:00
Raymond Hettinger 49c522be80 Expand scope to include general mapping protocol tests.
Many of these tests are redundant, but this will ensure
that the mapping protocols all stay in sync.
Also, added a test for dictionary subclasses.
2004-09-30 15:07:29 +00:00
Walter Dörwald 59b23e8b80 Add missing test_dict.py from patch #736962. 2004-09-30 13:46:00 +00:00
Raymond Hettinger 5ea7e31076 Improve test coverage. 2004-09-30 07:47:20 +00:00
Raymond Hettinger ff5dc0ee77 Improve test coverage. 2004-09-29 11:40:50 +00:00
Raymond Hettinger bcab2b25f9 Improve test coverage. 2004-09-29 08:03:17 +00:00
Edward Loper 7d88a58e85 Reverted the addition of a NORMALIZE_NUMBERS option, per Tim Peter's
request.  Tim says that "correct 'fuzzy' comparison of floats cannot
be automated."  (The motivation behind adding the new option
was verifying interactive examples in Python's latex documentation;
several such examples use numbers that don't print consistently on
different platforms.)
2004-09-28 05:50:57 +00:00
Raymond Hettinger 4cda01e260 * Increase test coverage.
* Have groupby() be careful about decreffing structure members.
2004-09-28 04:45:28 +00:00
Edward Loper aec3c9b54f Added a new NORMALIZE_NUMBERS option, which causes number literals in
the expected output to match corresponding number literals in the
actual output if their values are equal (to ten digits of precision).
2004-09-28 04:29:57 +00:00
Raymond Hettinger 6429a4727e Use Py_CLEAR(). Add unrelated test. 2004-09-28 01:51:35 +00:00
Raymond Hettinger 855d9a985b Plug a leak and beef-up test coverage. 2004-09-28 00:03:54 +00:00
Raymond Hettinger 630e5355b5 Rename test for comparision errors. 2004-09-27 23:11:35 +00:00
Raymond Hettinger 63251781d1 Beef-up tests for greater coverage and refcount checking. 2004-09-27 22:48:40 +00:00
Armin Rigo 9f90439817 Patch #1011240: SystemError generated by struct.pack('P', 'foo'). 2004-09-27 19:27:51 +00:00
Armin Rigo b562bc672b Trivial bug fix: deque == [] is not a good way to check if a deque is empty. 2004-09-27 17:49:00 +00:00
Raymond Hettinger ffdb8bb99c Use floor division operator. 2004-09-27 15:29:05 +00:00
Raymond Hettinger 4837a223ee Use floor division operator. 2004-09-27 14:23:40 +00:00
Edward Loper 498a1868e7 - Added a "parser" option to testfile() and DocFileTest(). 2004-09-27 03:42:58 +00:00
Raymond Hettinger aa241e0149 Checkin Tim's fix to an error discussed on python-dev.
Also, add a testcase.

Formerly, the list_extend() code used several local variables to remember
its state across iterations.  Since an iteration could call arbitrary
Python code, it was possible for the list state to be changed.  The new
code uses dynamic structure references instead of C locals.  So, they
are always up-to-date.

After list_resize() is called, its size has been updated but the new
cells are filled with NULLs.  These needed to be filled before arbitrary
iteration code was called; otherwise, that code could attempt to modify
a list that was in a semi-invalid state.  The solution was to change
the ob->size field back to a value reflecting the actual number of valid
cells.
2004-09-26 19:24:20 +00:00
Raymond Hettinger 55593c3ef5 Make the regex pattern easier to read, understand, and modify
by factoring out the common prefix (the delimiter).
2004-09-26 18:56:44 +00:00
Tim Peters 3afaaf2487 Removed debug_script from the public API: no docs, not public. I'm in
the process of writing docs for the other "missing" debug support
functions.
2004-09-26 03:50:06 +00:00
Tim Peters 9d02a7cfa0 Add set_unittest_reportflags() to the public API. Docs will follow
"soon", after I repair the LaTeX I somehow damaged.
2004-09-26 01:50:24 +00:00
Tim Peters 261b28aac6 Removed two undocumented unittest support classes, and one undocumented
unittest support function, from the public interface.  If they're not
documented, they shouldn't be public.
2004-09-26 01:24:23 +00:00
Tim Peters 48983fc484 Removed most of the module docstring. There's too much to explain now,
and the LaTeX docs are in increasingly good shape.
2004-09-25 02:41:28 +00:00
Tim Peters 5a59d88e89 Whitespace normalization. 2004-09-24 23:16:41 +00:00
Johannes Gijsbers 3981511070 Port test_unpack to doctest (patch #736962). 2004-09-24 21:36:52 +00:00
Neil Schemenauer 6bc937cfd2 Add yet more tests for buffer(). 2004-09-24 19:18:42 +00:00
Neil Schemenauer 29302a7867 Add a few more tests for the buffer() object. 2004-09-24 15:35:15 +00:00
Vinay Sajip b2635b2f71 Added log() function 2004-09-24 11:45:52 +00:00
Vinay Sajip 02dd994adf Added exception handling during handler initialization in fileConfig() 2004-09-24 11:45:13 +00:00
Tim Peters 1cc37380b2 Whitespace normalization. 2004-09-24 04:36:47 +00:00
Raymond Hettinger 596ba4d89e Granted Noam Raphael's request for minor improvements to the re module and
its documentation.

* Documented that the compiled re methods are supposed to be more full
  featured than their simpilified function counterparts.

* Documented the existing start and stop position arguments for the
  findall() and finditer() methods of compiled regular expression objects.

* Added an optional flags argument to the re.findall() and re.finditer()
  functions.  This aligns their API with that for re.search() and
  re.match().
2004-09-24 03:41:05 +00:00
Tim Peters 307fa78107 SF bug #513866: Float/long comparison anomaly.
When an integer is compared to a float now, the int isn't coerced to float.
This avoids spurious overflow exceptions and insane results.  This should
compute correct results, without raising spurious exceptions, in all cases
now -- although I expect that what happens when an int/long is compared to
a NaN is still a platform accident.

Note that we had potential problems here even with "short" ints, on boxes
where sizeof(long)==8.  There's #ifdef'ed code here to handle that, but
I can't test it as intended.  I tested it by changing the #ifdef to
trigger on my 32-bit box instead.

I suppose this is a bugfix candidate, but I won't backport it.  It's
long-winded (for speed) and messy (because the problem is messy).  Note
that this also depends on a previous 2.4 patch that introduced
_Py_SwappedOp[] as an extern.
2004-09-23 08:06:40 +00:00
Raymond Hettinger 4533f1fb7f Improve three recipes in the itertools docs. 2004-09-23 07:27:39 +00:00
Raymond Hettinger 513c8bd6f2 Arghh, checked in wrong draft. Replacing with correct one. 2004-09-23 07:00:47 +00:00
Raymond Hettinger 0336e1fe8c Use local variables in StringIO.write().
Makes it easier on the eyes and a bit more snappy.
2004-09-23 06:43:25 +00:00
Phillip J. Eby 7ec642a4d2 Fix for SF bug #1029475 : reload() doesn't work with PEP 302 loaders. 2004-09-23 04:37:36 +00:00
Raymond Hettinger 2c31a058eb SF patch #1031667: Fold tuples of constants into a single constant
Example:
>>> import dis
>>> dis.dis(compile('1,2,3', '', 'eval'))
  0           0 LOAD_CONST               3 ((1, 2, 3))
              3 RETURN_VALUE
2004-09-22 18:44:21 +00:00
Raymond Hettinger ce96d8b684 Bug #1030125: rfc822 __iter__ problem
Add iteration support to the Message class.
2004-09-22 17:17:32 +00:00
Vinay Sajip b9591174df Added getLoggerClass() 2004-09-22 12:39:26 +00:00
Edward Loper a2fc7ec80a - Minor docstring fixes.
- Simplified code to find names for file-based tests.
2004-09-21 03:24:24 +00:00
Edward Loper 4ae900f43b - Changed SampleClass docstrings to test docstring parsing a little
more thouroughly.
2004-09-21 03:20:34 +00:00
Tim Peters bab3e99689 Whitespace normalization. 2004-09-20 19:52:34 +00:00
Raymond Hettinger 61656203cd Import no longer needed. 2004-09-20 18:08:31 +00:00
Skip Montanaro 13dea5a42b Raymond reminded me to use DSU key 2004-09-20 16:43:30 +00:00
Skip Montanaro 41f89a4f3d Sort classes by fully qualified name. In the common case where you are
displaying a set of classes from one module it doesn't matter, but if you
are displaying a large class tree from multiple modules it improves the
display to sort by module.name.
2004-09-20 15:40:38 +00:00
Edward Loper 052d0cd291 - Added "testfile" function, a simple function for running & verifying
all examples in a given text file. (analagous to "testmod")
- Minor docstring fixes.
- Added module_relative parameter to DocTestFile/DocTestSuite, which
  controls whether paths are module-relative & os-independent, or
  os-specific.
2004-09-19 17:19:33 +00:00
Raymond Hettinger 636a6b100f SF patch #1020845: Decimal performance enhancements
(Contributed by Nick Coghlan.)

Various code cleanups and optimizations (saves about 40% on testsuite
execution time and on the telco benchmark).

* caches results of various operations on self (esp. checks for being
  a special value).

* _WorkRep now uses ints and longs for intermediate computations.
2004-09-19 01:54:09 +00:00
Edward Loper 0273f5b6b2 In DocFileTest:
- Fixed bug in handling of absolute paths.
  - If run from an interactive session, make paths relative to the
    directory containing sys.argv[0] (since __main__ doesn't have
    a __file__ attribute).
2004-09-18 20:27:04 +00:00
Martin v. Löwis 725f8c83a2 Patch #1021596: Check for None to determine whether _urandomfd is
uninitialized.
2004-09-18 16:07:58 +00:00
Martin v. Löwis b0c670ce39 Convert boolean results back to strings. Fixes #807871.
Will backport to 2.3.
2004-09-18 16:01:23 +00:00
Martin v. Löwis f3c5611fef Patch #1029061: Always extract member names from the tarinfo. 2004-09-18 09:08:52 +00:00
Martin v. Löwis 39a317890f Patch #1025790: Add status code constants to httplib. 2004-09-18 09:03:49 +00:00
Barry Warsaw 17cb60083c At the cost of a modest (but useful in its own right) change in the semantics
of the Template.delimiter attribute, we make use of the delimiter in the
escaped group, and in the safe_substitute() method more robust.

Now, .delimiter should be the unescaped delimiter literal, e.g. '$' or '&', or
whatever.  The _TemplateMetaclass will re.escape() this value when it builds
the pattern.
2004-09-18 00:06:34 +00:00
Sean Reifschneider 6011a3c874 SF Patch 1022011: Add a command-line argument --no-autoreq, which sets the
"AutoReq: 0" to disable automatic dependency searching.
2004-09-17 08:34:12 +00:00
Sean Reifschneider 57a6a41e54 SF Patch 1022003: Change bdist_rpm _topdir to use
os.path.abspath(self.rpm_base) instead of os.getcwd() + '/' + self.rpm_base
2004-09-17 08:23:22 +00:00
Tim Peters 528ca53b74 SF bug #1028306: date-datetime comparison
Treat comparing a date to a datetime like a mixed-type comparison.
2004-09-16 01:30:50 +00:00
Tim Peters c74298a72b Whitespace normalization. 2004-09-16 00:09:19 +00:00
Brett Cannon 0a1af4aeb0 Remove tabs. 2004-09-15 23:26:23 +00:00
Martin v. Löwis 9996828caa Patch #1026986: Add OpenBSD 3.5 and 3.6 to list of broken systems. 2004-09-15 06:02:54 +00:00
Martin v. Löwis 74a249e1a9 Strip square brackets from IPv6 address. 2004-09-14 21:45:36 +00:00
Skip Montanaro cae14d2714 missed the obvious test case and corresponding fix 2004-09-14 17:55:21 +00:00
Skip Montanaro 10e6e0e61a Search from the end of the host/port combination to find the colon which
separates ip address from the port to accommodate ipv6 addresses.
2004-09-14 16:32:02 +00:00
Walter Dörwald 065a32f550 Make the hint about the None default less ambiguous. 2004-09-14 09:45:10 +00:00
Walter Dörwald 782afc5927 Enhance the docstrings for unicode.split() and string.split()
to make it clear that it is possible to pass None as the
separator argument to get the default "any whitespace" separator.
2004-09-14 09:40:45 +00:00
Raymond Hettinger 6d191113a6 Fix small bugs in Template code.
* The parameterization of "delimiter" was incomplete.
* safe_substitute's code for braced delimiters should only be executed
  when braced is not None.
* Invalid pattern group names now raise a ValueError.  Formerly, the
  convert code would fall off the end and improperly return None.

Beefed-up tests.

* Test delimiter override for all paths in substitute and safe_substitute.
* Alter unittest invocation to match other modules (now it itemizes the
  tests as they are run).
2004-09-14 02:34:08 +00:00
Raymond Hettinger 23f1241dc6 SF #1027105: HardwareRandom should be renamed OSRandom
Renamed the new generator at Trevor's recommendation.
The name HardwareRandom suggested a bit more than it
delivered (no radioactive decay detectors or such).
2004-09-13 22:23:21 +00:00
Barry Warsaw 3e773fb622 The 4th group is now 'invalid' instead of 'bogus'. 2004-09-13 20:53:27 +00:00
Barry Warsaw b5c6b5bfe8 Raymond's good suggestion to re-order the tests in the convert() helper so the
most common paths are tested first.  Also, that 'invalid' is better than
'bogus'.
2004-09-13 20:52:50 +00:00
Barry Warsaw b6234a95c1 substitute(), safe_substitute(): Paul Moore provides a better hack for dealing
with positional arguments.
2004-09-13 15:25:15 +00:00
Barry Warsaw c7cd20c8c6 Added a test for # positional arguments > 1. 2004-09-13 15:24:43 +00:00
Tim Peters 958cc89037 exclude_empty: make the default True for DocTestFinder, and introduce it
with default False for testmod().  The real point of introducing this was
so that output from doctest.master.summarize() would be the same as in
2.3, and doctest.master in 2.4 is a backward-compatability hack used only
by testmod().
2004-09-13 14:53:28 +00:00
Barry Warsaw 302bd589ad Add tests for keyword arguments and combining mapping and keyword arguments. 2004-09-13 14:35:59 +00:00
Barry Warsaw 46b629c101 Accepted Raymond's patch to combine mapping and keyword arguments, with slight
modification.  Also, renamed the positional argument to '__mapping' to further
reduce the chance of duplicate keyword arguments.
2004-09-13 14:35:04 +00:00
Edward Loper 32ddbf7fab Added new parameter exclude_empty to DocTestFinder.__init__, which
controls whether tests are included for objects with empty docstrings.
Defaults to True, to match the behavior of Python 2.3.
2004-09-13 05:47:24 +00:00
Tim Peters c56847878e DocTestFinder._find(): for tests derived from a module __test__ global,
doctest always promised to stick "__test__" in the name.  That got
broken.  Now it's fixed again.
2004-09-13 01:07:12 +00:00
Tim Peters 82076ef194 Reluctantly, rehabilitate doctest.master. 2004-09-13 00:52:51 +00:00
Tim Peters 9661f9ab4f Tester.run___test__(): This couldn't possibly work at all. I'm afraid
the "backward compatibility" here was a joke.
2004-09-12 22:45:17 +00:00
Tim Peters 4be7a92f7f Tester.__init__(): this couldn't possibly work when a module argument
was passed.
2004-09-12 22:39:46 +00:00
Tim Peters 0e9980f75a Whitespace normalization. 2004-09-12 03:49:31 +00:00
Johannes Gijsbers d60e92a48d Document not-completely-obvious behavior in a test. 2004-09-11 21:26:21 +00:00
Tim Peters 17b56379e1 Recover from inspect.getmodule() changes. It returns a module for
functions and methods now, including functions defined inside doctests
in test_doctest.py's recursive doctest'ing.
2004-09-11 17:33:27 +00:00
Johannes Gijsbers 9324526a76 Use __module__ attribute when available instead of using isclass() predicate
(functions and methods have grown the __module__ attribute too). See bug #570300.
2004-09-11 15:53:22 +00:00
Barry Warsaw f43e8bd7b4 Template: remove __slots__ since that interferes with the ability to mix in
Template and unicode classes.
2004-09-10 18:30:42 +00:00
Andrew M. Kuchling 55be9eab38 Typo fix: 'comparisions' is not a word 2004-09-10 12:59:54 +00:00
Martin v. Löwis 23c48a12d9 Patch #808120: Add --force-arch=ARCH to bdist_rpm.py. 2004-09-10 06:32:54 +00:00
Martin v. Löwis 641d64812c Patch #808115: Add script support to bdist_rpm.py. 2004-09-10 06:25:01 +00:00
Raymond Hettinger 1f7d6a633f __slots__ went missing from Template. 2004-09-10 06:21:22 +00:00
Barry Warsaw 12827c1fa9 Many updates to PEP 292 templates. Summary:
- Template no longer inherits from unicode.

- SafeTemplate is removed.  Now Templates have both a substitute() and a
  safe_substitute() method, so we don't need separate classes.  No more
  __mod__() operator.

- Adopt Tim Peter's idea for giving Template a metaclass, which makes the
  delimiter, the identifier pattern, or the entire pattern easy to override
  and document, while retaining efficiency of class-time compilation of the
  regexp.

- More informative ValueError messages which will help a user narrow down the
  bogus delimiter to the line and column in the original string (helpful for
  long triple quoted strings).
2004-09-10 03:08:08 +00:00
Fred Drake 583359ed2e clean up the API a little; exceptions are defined by this module
(needs documentation)
2004-09-09 02:24:13 +00:00
Fred Drake 58ae830fd0 add name that should be considered public to __all__ 2004-09-09 01:49:58 +00:00
Fred Drake 49b4d19172 remove unnecessary override of base class method 2004-09-08 22:58:36 +00:00
Fred Drake 75d9a62fe0 add tests that make sure buffer boundaries are handled properly for SGML comments
(see SF patch #901369)
2004-09-08 22:57:01 +00:00
Brett Cannon 85ae1a69b6 Remove usage of locale.getlocale in favor or setlocale(LC_NUMERIC, None) .
Also added a comment about why the code is bother to see what setlocale thinks
the set locale is.

Closes bug #1023798.
2004-09-08 02:02:41 +00:00
Walter Dörwald 69652035bc SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
decoding incomplete input (when the input stream is temporarily exhausted).
codecs.StreamReader now implements buffering, which enables proper
readline support for the UTF-16 decoders. codecs.StreamReader.read()
has a new argument chars which specifies the number of characters to
return. codecs.StreamReader.readline() and codecs.StreamReader.readlines()
have a new argument keepends. Trailing "\n"s will be stripped from the lines
if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and
PyUnicode_DecodeUTF16Stateful.
2004-09-07 20:24:22 +00:00
Jeremy Hylton 8f00a24229 Remove debugging print (not triggered by test suite) and add XXX comment about how the code should raise a SyntaxError. 2004-09-07 15:36:48 +00:00
Jeremy Hylton 566d934745 compiler.transformer: correct lineno attribute when possible
SF patch #1015989

The basic idea of this patch is to compute lineno attributes for all AST nodes.  The actual
implementation lead to a lot of restructing and code cleanup.

The generated AST nodes now have an optional lineno argument to constructor.  Remove the
top-level asList(), since it didn't seem to serve any purpose.  Add an __iter__ to ast nodes.
Use isinstance() instead of explicit type tests.

Change transformer to use the new lineno attribute, which replaces three lines of code with one.
Use universal newlines so that we can get rid of special-case code for line endings.  Use
lookup_node() in a few more frequently called, but simple com_xxx methods().  Change string
exception to class exception.
2004-09-07 15:28:01 +00:00
Brett Cannon 2ad68e69b9 Ported test__locale to unittest. 2004-09-06 23:30:27 +00:00
Raymond Hettinger 658717ed11 SF #1022953: binascii.a2b_hqx("") raises SystemError
Several functions adopted the strategy of altering a full lengthed
string copy and resizing afterwards.  That would fail if the initial
string was short enough (0 or 1) to be interned.  Interning precluded
the subsequent resizing operation.

The solution was to make sure the initial string was at least two
characters long.

Added tests to verify that all binascii functions do not crater when
given an empty string argument.
2004-09-06 22:58:37 +00:00
Raymond Hettinger 8158e84930 Fix erroneous docstring comment. 2004-09-06 07:04:09 +00:00
Raymond Hettinger c1c43cad63 Fulfill Martin's request to use try/except rather than a "look before
you leap" approach.  Makes the early call to os.urandom() unnecessary.
2004-09-05 00:00:42 +00:00
Raymond Hettinger c4536a1dea Teach a test about the different kinds of functions. 2004-09-04 23:53:20 +00:00
Raymond Hettinger b871763156 SF bug #1022010: Import random fails
* Complete the previous patch by making sure that the MachineRandom
  tests are only run when the underlying resource is available.
2004-09-04 20:13:29 +00:00
Raymond Hettinger ed20ad8473 Change the strategy for coping with time intensive tests from
"all or none" to "all or some".

This provides much greater test coverage without eating much time.
It also makes it more likely that routine regression testing will
unearth bugs.
2004-09-04 20:09:13 +00:00
Tim Peters 1fbf9c5ec1 Added IGNORE_EXCEPTION_DETAIL comparison option. The need is explained
in the new docs.

DocTestRunner.__run:  Separate the determination of the example outcome
from reporting that outcome, to squash brittle code duplication and
excessive nesting.
2004-09-04 17:21:02 +00:00
Tim Peters ba6019691e Added a couple names to __all__. 2004-09-04 15:04:06 +00:00
Gustavo Niemeyer f5a1599ebe Minor aesthetic change in sre_parse.py, as suggested by Mike Coleman. 2004-09-03 20:15:56 +00:00
Raymond Hettinger bdbdfd731d SF bug #1022010: Import random fails
* trap NotImplementedError raised by os.urandom calls when not available
  on a particular system.
2004-09-03 19:09:22 +00:00
Gustavo Niemeyer 0506c64086 Fixing bug #817234, which made SRE get into an infinite loop on
empty final matches with finditer(). New test cases included
for this bug and for #581080.
2004-09-03 18:11:59 +00:00
Gustavo Niemeyer a01a2ee933 Applying modified version of patch #1018386, which fixes
some escaping bugs in SRE.
2004-09-03 17:06:10 +00:00
Andrew M. Kuchling e47c381c62 [Bug #1011606] Only check file descriptors for exceptional conditions if the fd is readable or writable 2004-09-01 14:04:51 +00:00
Tim Peters 3b2cdad4fd Whitespace normalization. 2004-09-01 13:10:32 +00:00
Andrew M. Kuchling 010b887cf6 Missed some occurrences of test_mpz 2004-08-31 13:45:22 +00:00
Andrew M. Kuchling a7313d0543 Remove test output for rotor, xreadline 2004-08-31 13:41:04 +00:00
Andrew M. Kuchling 810b76aebe Remove rotor, xreadlines modules 2004-08-31 13:31:42 +00:00
Andrew M. Kuchling 7297da8a35 Remove test for mpz 2004-08-31 13:29:28 +00:00
Andrew M. Kuchling 163f800095 Remove tests for mpz, rotor, xreadlines 2004-08-31 13:29:03 +00:00
Andrew M. Kuchling f3f1c85858 Remove TERMIOS module 2004-08-31 13:06:16 +00:00
Andrew M. Kuchling 33ad28b68d Use multi-line import 2004-08-31 11:38:12 +00:00
Anthony Baxter 1a4ddaecc7 SF patch #1007189, multi-line imports, for instance:
"from blah import (foo, bar
baz, bongo)"
2004-08-31 10:07:13 +00:00
Tim Peters 7c2a85b2d4 HardwareRandom: Go back to multiplying by 2**-BPF instead of using
ldexp.  Both methods are exact, and return the same results.  Turns out
multiplication is a few (but just a few) percent faster on my box.
They're both significantly faster than using struct with a Q format
to convert bytes to a 64-bit long (struct.unpack() appears to lose due
to the tuple creation/teardown overhead), and calling _hexlify is
significantly faster than doing bytes.encode('hex').  So we appear to
have hit a local minimum (wrt speed) here.
2004-08-31 02:19:55 +00:00
Raymond Hettinger 3fa19d7ff8 Take advantage of the math library's ldexp for assembling a float by
components without division and without roundoff error for properly
sized mantissas (i.e. on systems with 53 or more mantissa bits per
float).  Eliminates the previous implementation's rounding bias as
aptly demonstrated by Tim Peters.
2004-08-31 01:05:15 +00:00
Tim Peters daec961e09 Changed Karatsuba cutoff to match current reality. 2004-08-30 23:18:23 +00:00
Tim Peters 38330fe5ef The distinction between comparison flags and reporting flags isn't unique
to unittest, so make it official:  new module constants COMPARISON_FLAGS
and REPORTING_FLAGS, which are bitmasks or'ing together the relevant
individual option flags.

set_unittest_reportflags():  Reworked to use REPORTING_FLAGS, and
simplified overly complicated flag logic.

class FakeModule:  Removed this; neither documented nor used.
2004-08-30 16:19:24 +00:00
Johannes Gijsbers 4c11f6088a Patch #934356: if a module defines __all__, believe that rather than using
heuristics for filtering out imported names.
2004-08-30 14:13:04 +00:00
Johannes Gijsbers d2a1aa4b1e Whitespace normalization. 2004-08-30 13:39:50 +00:00
Johannes Gijsbers 4a9faa1ea0 Patch #1003640: replace checkline() function parsing with new breakpoint logic:
1) When a breakpoint is set via a function name:
- the breakpoint gets the lineno of the def statement
- a new funcname attribute is attached to the breakpoint

2) bdb.effective() calls new function checkfuncname() to handle:
- def statement is executed: don't break.
- a first executable line of a function with a breakpoint on the lineno of the
def statement is reached: break.

This fixes bugs 976878, 926369 and 875404. Thanks Ilya Sandler.
2004-08-30 13:29:44 +00:00
Johannes Gijsbers ae882f7984 Patch #941486: add os.path.lexists(). Also fix bug #940578 by using lexists in glob.glob. 2004-08-30 10:19:56 +00:00
Raymond Hettinger 356a4599ac Teach the random module about os.urandom().
* Use it for seeding when it is available.
* Provide an alternate generator based on it.
2004-08-30 06:14:31 +00:00
Tim Peters 48bd7f3a71 Whitespace normalization. test_difflib passes again. 2004-08-29 22:38:38 +00:00
Tim Peters afb5f94217 Reverting whitespace normalization. test_difflib fails with it -- the
test depends on invisible trailing whitespace in .py files.  The author will
have to repair that.
2004-08-29 19:33:36 +00:00
Tim Peters 45e77c55ff Whitespace normalization. 2004-08-29 18:47:31 +00:00
Martin v. Löwis a28b3e6dfb Patch #727483: Add AUTH_TYPE and REMOTE_USER. 2004-08-29 16:53:26 +00:00
Martin v. Löwis 061f132898 Patch #973204: Use -rpath instead of -R on Irix and Tru64. 2004-08-29 16:40:55 +00:00
Martin v. Löwis e064b41f5a Patch #914575: difflib side by side diff support, diff.py s/b/s HTML option. 2004-08-29 16:34:40 +00:00
Martin v. Löwis dc3883f671 Patch #934711: Expose platform-specific entropy. 2004-08-29 15:46:35 +00:00
Raymond Hettinger 6ab78cd0c0 SF feature request #992967: array.array objects should support sequences.
Made the constructor accept general iterables.
2004-08-29 07:50:43 +00:00
Tim Peters df7a208ff7 Whitespace normalization. 2004-08-29 00:38:17 +00:00
Jim Fulton fafd874bc8 Added an __iter__ method for test suites. 2004-08-28 15:22:12 +00:00
Jim Fulton 9f556a408b setUp and tearDown functions are now passed the test object 2004-08-28 14:58:31 +00:00
Jim Fulton f54bad4564 - setUp and tearDown functions are now passed the test object
- Added a set_unittest_reportflags to set default reporting flags used
  when running doctests under unittest control.
2004-08-28 14:57:56 +00:00
Tim Peters cca018356d Removed old "if 0:" block for leak detection; wouldn't work anymore anyway. 2004-08-27 15:29:59 +00:00
Tim Peters aef8cfaa28 Don't really need ellipsis doctests for the syntax errors, because
this module imports itself explicitly from test (so the "file names"
current doctest synthesizes for examples don't vary depending on how
test_generators is run).
2004-08-27 15:12:49 +00:00
Edward Loper 0fafacc672 Removed outdated comment 2004-08-27 14:56:58 +00:00
Tim Peters 77dcccca0c Fixed 6 failures due to doctest changes. 2004-08-27 05:44:51 +00:00
Tim Peters 108f137519 test_bug1001011(): Verify that
s.join([t]) is t

for (s, t) in (str, str), (unicode, unicode), and (str, unicode).
For (unicode, str), verify that it's *not* t (the result is promoted
to unicode instead).  Also verify that when t is a subclass of str or
unicode that "the right thing" happens.
2004-08-27 05:36:07 +00:00
Edward Loper 12a4baf5a1 Remove unused method _OutputRedirectingPdb.resume 2004-08-27 04:29:23 +00:00
Edward Loper 2de91ba2ab - Removed redundant call to expandtabs in DocTestParesr.
- Improvements to interactive debugging support:
  - Changed the replacement pdb.set_trace to redirect stdout to the
    real stdout *only* during interactive debugging; stdout from code
    continues to go to the fake stdout.
  - When the interactive debugger gets to the end of an example,
    automatically continue.
  - Use a replacement linecache.getlines that will return source lines
    from doctest examples; this makes the source available to the
    debugger for interactive debugging.
- In test_doctest, use a specialized _FakeOutput class instead of a
  temporary file to fake stdin for the interactive interpreter.
2004-08-27 02:07:46 +00:00
Edward Loper 00f8da77e7 - Added DocTestParser.parse(), which parses a docstring into Examples
and intervening text strings.
- Removed DocTestParser.get_program(): use script_from_examples()
  instead.
- Fixed bug in DocTestParser._INDENT_RE
- Fixed bug in DocTestParser._min_indent
- Moved _want_comment() to the utility function section
2004-08-26 18:05:07 +00:00
Walter Dörwald 57d88e5abd Move test_bug1001011() to string_tests.MixinStrUnicodeTest so that
it can be used for str and unicode. Drop the test for
   "".join([s]) is s
because this is an implementation detail (and doesn't work for unicode)
2004-08-26 16:53:04 +00:00
Tim Peters e7edcb8e22 output_difference(): In fancy-diff cases, the way this split expected &
actual output into lines created spurious empty lines at the ends of
each.  Those matched, but the fancy diffs had surprising line counts (1
larger than expected), and tests kept having to slam <BLANKLINE> into the
expected output to account for this.  Using the splitlines() string method
with keepends=True instead accomplishes what was intended directly.
2004-08-26 05:44:27 +00:00
Martin v. Löwis 4085f030bd Add missing executable option to DummyCommand. 2004-08-26 05:44:02 +00:00
Tim Peters 66cb018c96 Whitespace normalization. 2004-08-26 05:23:19 +00:00
Tim Peters 5b799c1f3d _do_a_fancy_diff(): Pay no attention to the ellipses behind the curtain.
While a fancy diff can be confusing in the presence of ellipses, so far
I'm finding (2-0-0) that it's much more a major aid in narrowing down the
possibilities when an ellipsis-slinging test fails.  So we no longer
refuse to do a fancy diff just because of ellipses.

This isn't ideal; it's just better.
2004-08-26 05:21:59 +00:00
Raymond Hettinger 770acc2bb4 Remove unnecessary line. 2004-08-26 04:29:47 +00:00
Edward Loper ca9111eef3 Changed OutputChecker.output_difference to expect an Example object,
rather than an expected output string.  This gives the
output_difference method access to more information, such as the
indentation of the example, which might be useful.
2004-08-26 03:00:24 +00:00
Edward Loper a89f88d53f Added REPORT_ONLY_FIRST_FAILURE flag, which supresses output after the
first failing example in each test.
2004-08-26 02:45:51 +00:00
Edward Loper 71f55af826 Renamed UNIFIED_DIFF->REPORT_UDIFF; CONTEXT_DIFF->REPORT_CDIFF; and
NDIFF_DIFF->REPORT_NDIFF.  This establishes the naming convention that
all reporting options should begin with "REPORT_" (since reporting
options are a different class from output comparison options; but they
are both set in optionflags).
2004-08-26 01:41:51 +00:00
Edward Loper 5662929a42 Shortened diff output for unified & context diffs 2004-08-26 01:31:56 +00:00
Edward Loper aacf083388 - Changed the output of report_start() and report_unexpected_exception()
to be more consistent with report_failure()
- If `want` or `got` is empty, then print "Expected nothing\n" or
  "Got nothing\n" rather than "Expected:\n" or "Got:\n"
- Got rid of _tag_msg
2004-08-26 01:19:50 +00:00
Dave Cole 3203efb55f Patch #1014930. Expose current parse location to XMLParser. 2004-08-26 00:37:31 +00:00
Raymond Hettinger 0d58e2be0b Minor improvements to the template code.
* Add comment bars segregating this code from the rest.
* Improve readability of the re pattern with indentation and comments on
  the same line.
* Replace the groupdict() and get() pair with a direct call to group()
  which does the same thing.
2004-08-26 00:21:13 +00:00
Edward Loper a6b68327b2 Added an "exc_msg" attribute to Example (containing the expected
exception message, or None if no exception is expected); and moved
exception parsing from DocTestRunner to DocTestParser.  This is
architecturally cleaner, since it moves all parsing work to
DocTestParser; and it should make it easier for code outside
DocTestRunner (notably debugging code) to properly handle expected
exceptions.
2004-08-26 00:05:43 +00:00
Edward Loper 19b1958730 Only recognize the expected output as an exception if it *starts* with
a traceback message.  I.e., examples that raise exceptions may no
longer generate pre-exception output.  This restores the behavior of
doctest in python 2.3.  The ability to check pre-exception output is
being removed because it makes the documentation simpler; and because
there are very few use cases for it.
2004-08-25 23:07:03 +00:00
Martin v. Löwis cae9e673d6 Patch #970015: Replace - by _ in version and release. 2004-08-25 13:04:53 +00:00
Martin v. Löwis cf525241bb Patch #970019: Include version and release in the BuildRoot. 2004-08-25 13:00:34 +00:00
Martin v. Löwis 9f5c0c41ce Patch #736857, #736859: Add -e option to build_scripts. 2004-08-25 11:37:43 +00:00
Martin v. Löwis c11d6f13ae Patch #1014992: Never return more than a line from readline.
Will backport to 2.3.
2004-08-25 10:52:58 +00:00
Barry Warsaw 8bee76106e PEP 292 classes Template and SafeTemplate are added to the string module.
This patch includes test cases and documentation updates, as well as NEWS file
updates.

This patch also updates the sre modules so that they don't import the string
module, breaking direct circular imports.
2004-08-25 02:22:30 +00:00
Tim Peters c885443479 Stop producing or using OverflowWarning. PEP 237 thought this would
happen in 2.3, but nobody noticed it still was getting generated (the
warning was disabled by default).  OverflowWarning and
PyExc_OverflowWarning should be removed for 2.5, and left notes all over
saying so.
2004-08-25 02:14:08 +00:00
Mark Hammond eb619bb80b Fix for [ 1010677 ] thread Module Breaks PyGILState_Ensure(),
and a test case.
When booting a new thread, use the PyGILState API to manage the GIL.
2004-08-24 22:24:08 +00:00
Vinay Sajip fb154171c4 Fixed bug in DatagramHandler.send() 2004-08-24 09:36:23 +00:00
Raymond Hettinger fd2d1f7870 SF Patch #1013667: Cleanup Peepholer Output
* Make a pass to eliminate NOPs.  Produce code that is more readable,
  more compact, and a tiny bit faster.  Makes the peepholer more flexible
  in the scope of allowable transformations.

* With Guido's okay, bumped up the magic number so that this patch gets
  widely exercised before the alpha goes out.
2004-08-23 23:37:48 +00:00
Raymond Hettinger 674f241e9c SF Patch #1007087: Return new string for single subclass joins (Bug #1001011)
(Patch contributed by Nick Coghlan.)

Now joining string subtypes will always return a string.
Formerly, if there were only one item, it was returned unchanged.
2004-08-23 23:23:54 +00:00
Tim Peters dd50cb748a The attempt to shut up deprecation warnings for doctest's own use of
is_private in its tests failed if doctest.py was run directly.  Now
it works.
2004-08-23 22:42:55 +00:00
Tim Peters 4de7c5c103 test_DocTestFinder(): This test failed when test_doctest was run
directly, due to assuming a filename specific to running tests "the
normal way".  +ELLIPSIS to the rescue!
2004-08-23 22:38:05 +00:00
Tim Peters a7def72a08 Moved some test cases from doctest to test_doctest. 2004-08-23 22:13:22 +00:00
Tim Peters 3fa8c2079a Misc cleanups. 2004-08-23 21:43:39 +00:00
Tim Peters b6a04d687d debug_script(): I changed this in haste before to take out the use of
NamedTemporaryFile (which can't work for this function's purposes on
Windows).  Leaving temp files behind wasn't a great idea either, though,
so try to clean up.  At least the test suite no longer leaves any of
these guys behind now.
2004-08-23 21:37:56 +00:00
Martin v. Löwis 31bd529f53 Patch #1014237: Consistently return booleans throughout. 2004-08-23 20:42:35 +00:00
Martin v. Löwis c234a52458 Flush bz2 data even if nothing had been written so far. Fixes #1013882.
Will backport to 2.3.
2004-08-22 21:28:33 +00:00
Martin v. Löwis 70aa1f2095 Fix repr for negative imaginary part. Fixes #1013908. 2004-08-22 21:09:15 +00:00
Tim Peters f82a9ded39 Start deferring to the LaTeX docs for details. I'd like to move the
docstrings toward being a lot shorter, and telling the whole truth in
the manual instead.  This change is an example:  the manual has detailed
explanations of the option names now, so it's Bad to repeat them in
the docstring (two detailed descriptions are certain to get out of synch).
Just listing the names has memory-jogging benefits, though, so that's
still helpful in the docstring.
2004-08-22 20:51:53 +00:00
Tim Peters c6cbab0db4 Added NDIFF_DIFF option. 2004-08-22 19:43:28 +00:00
Tim Peters 75dc5e14ea Type in docstring. 2004-08-22 17:50:45 +00:00
Tim Peters c50491591d _parse_example(): Simplified new code to preserve trailing spaces before
final newline.  Anything to get rid of "l" as a variable name <0.5 wink>.
2004-08-22 17:34:58 +00:00
Martin v. Löwis e09bd93685 Patch #997284: Allow pydoc to work with XP Themes (.manifest file)
Will backport to 2.3.
2004-08-22 16:13:26 +00:00
Martin v. Löwis ac37f3d001 Patch #1009389: Make __credits__ a Unicode object. 2004-08-22 16:08:04 +00:00
Martin v. Löwis 12237b3a19 Replace yield with sequence class. Fixes #1009803. 2004-08-22 16:04:50 +00:00
Jim Fulton 07a349c4ee Bugs fixed:
- Test filenames sometimes had trailing .pyc or .pyo sufixes
    (when module __file__ did).

  - Trailing spaces spaces in expected output were dropped.

New default failure format:

  - Separation of examples from file info makes examples easier to see

  - More vertical separation, improving readability

  - Emacs-recognized file info (also closer to Python exception format)
2004-08-22 14:10:00 +00:00
Kurt B. Kaiser 183403a271 1. If user passes a non-existant filename on the commandline, just open
a new file, don't raise a dialog.  IDLEfork 954928.
2. Refactor EditorWindow.wakeup() to WindowList.ListedToplevel.wakeup() and
   clarify that the Toplevel of an EditorWindow is a WindowList.ListedToplevel.
3. Make a number of improvements to keyboard focus binding.  Improve window
   raising, especially in the debugger.  IDLEfork Bug 763524 (GvR list).
4. Bump idlever to 1.1a3

M Debugger.py
M EditorWindow.py
M FileList.py
M NEWS.txt
M PyShell.py
M WindowList.py
M idlever.py
2004-08-22 05:14:32 +00:00
Tim Peters e594bee535 _ellipsis_match(): Removed special-casing of "...\n". The semantics
are non-obvious either way because the newline character "is invisible",
but it's still there all the same, and it's easier to explain/predict
if that reality is left alone.
2004-08-22 01:47:51 +00:00
Johannes Gijsbers 6abc685a03 Patch #880621: the last message of a Babyl mailbox ends in '\037' instead of
'\037\014\n' (see http://quimby.gnus.org/notes/BABYL) so look for that as well,
so that applications won't get '\037' as the last line of the last message.
2004-08-21 12:30:26 +00:00
Johannes Gijsbers 6d63a8dd09 Patch #1011123: Use urllib.quote() instead of cgi.escape() for encoding the
href attribute in list_directory(). This fixes the links for legal Unix
filenames such as 'a"b'.
2004-08-21 10:43:29 +00:00
Tim Peters 037b3ee44e Patch 1012740: cStringIO's truncate doesn't
truncate() left the stream position unchanged, which meant the
"truncated" data didn't go away:

>>> io.write('abc')
>>> io.truncate(0)
>>> io.write('xyz')
>>> io.getvalue()
'abcxyz'

Patch by Dima Dorfman.
2004-08-21 06:55:43 +00:00
Martin v. Löwis 37af986ebf Bump minimum Python version to 2.1. Fixes #1009803. 2004-08-20 07:31:37 +00:00
Martin v. Löwis 61d77e0d97 Replace tricky and/or with straight-forward if:else: 2004-08-20 06:35:46 +00:00
Martin v. Löwis cd4d297a23 Remove debug print. 2004-08-20 06:19:23 +00:00
Tim Peters a45cacfc1c Whitespace normalization. 2004-08-20 03:47:14 +00:00
Tim Peters 8d7626c23f Stab at SF 1010777: test_queue fails occasionally
test_queue has failed occasionally for years, and there's more than one
cause.

The primary cause in the SF report appears to be that the test driver
really needs entirely different code for thread tests that expect to
raise exceptions than for thread tests that are testing non-exceptional
blocking semantics.  So gave them entirely different code, and added a
ton of explanation.

Another cause is that the blocking thread tests relied in several places
on the difference between sleep(.1) and sleep(.2) being long enough for
the trigger thread to do its stuff sot that the blocking thread could make
progress.  That's just not reliable on a loaded machine.  Boosted the 0.2's
to 10.0's instead, which should be long enough under any non-catastrophic
system conditions.  That doesn't make the test take longer to run, the 10.0
is just how long the blocking thread is *willing* to wait for the trigger
thread to do something.  But if the Queue module is plain broken, such
tests will indeed take 10 seconds to fail now.

For similar (heavy load) reasons, changed threaded-test termination to
be willing to wait 10 seconds for the signal thread to end too.
2004-08-20 03:27:12 +00:00
Tim Peters afe5297b8a Semantic-neutral format and comment changes. 2004-08-20 02:37:25 +00:00
Tim Peters b0a04e1592 Gave _ellipsis_match() an attractive new leading underscore. 2004-08-20 02:08:04 +00:00
Raymond Hettinger 27dbcf2162 Establish policies with respect to 2.3 compatibilty and treated spec
updates as bugfixes.
2004-08-19 22:39:55 +00:00
Raymond Hettinger 6114679099 SF bug #1012315: weakref.WeakValueDictionary should override .has_key()
* Check the found object for a None value during a contains/has_key
  lookup.  Perhaps it will help the OP who is likely suffering from an
  occassional GC or threading object deletion after self.data is checked.

* Complete the previous patch by removing the unnecessary indirection
  for weak dict iterators.  Makes the code cleaner and more readable.
2004-08-19 21:32:06 +00:00
Edward Loper 3a3817f506 Got rid of nooutput() (was used by DocTestCase.debug())
It's redundant, since no output is written anyway: DebugRunner doesn't
generate any output for failures and unexpected exceptions, and since
verbose=False, it won't generate any output for non-failures either.
2004-08-19 19:26:06 +00:00
Edward Loper b7503ff631 Updated __all__ to include every non-underscored class, function, and
constant defined by the module (except the test*() functions, which
should be integrated into test/test_doctest.py, anyway).
2004-08-19 19:19:03 +00:00
Tim Peters 026f8dc103 Now that they've settled down, document doctest directives. 2004-08-19 16:38:58 +00:00
Johannes Gijsbers 3caf9c1edd Port test_zipfile to unittest (patch #736962). 2004-08-19 15:11:50 +00:00
Tim Peters dc5de3bab2 ellipsis_match(): Changed treatment of start- and end-of-string exact
matches to be symmetric.  This makes the algorithm easier to understand.
2004-08-19 14:06:20 +00:00
Tim Peters 26b3ebb515 Replaced the ELLIPSIS implementation with a worst-case linear-time one. 2004-08-19 08:10:08 +00:00
Tim Peters 1cf3aa6e66 ELLIPSIS implementation: an ellipsis couldn't match nothing if it
appeared at the end of a line.  Repaired that.  Also noted that it's
too easy to provoke this implementation into requiring exponential
time, and especially when a test fails.  I'll replace the implementation
with an always-efficient one later.
2004-08-19 06:49:33 +00:00
Brett Cannon caa9798410 Rewrite test_order so as to be more "proper". Originally relied on an
error based on decorating with staticmethod too soon for the code to execute.
This meant that if the test didn't pass it just errored out.  Now if the test
doesn't pass it leads to a failure instead.
2004-08-19 03:48:24 +00:00
Martin v. Löwis babc5ec630 Expand tabs. 2004-08-18 17:47:40 +00:00
Hye-Shik Chang f64700a512 Add support for FreeBSD 6. 2004-08-18 15:13:41 +00:00
Martin v. Löwis 75b9da4aaf Patch #995126: Correct directory size, and generate GNU tarfiles by default. 2004-08-18 13:57:44 +00:00
Martin v. Löwis deacce2c87 Patch #800236: add HTTPResponse.getheaders(). 2004-08-18 12:46:26 +00:00
Johannes Gijsbers c473c99d16 Patch #1006219: let inspect.getsource show '@' decorators and add tests for
this (which are rather ugly, but it'll have to do until test_inspect gets a
major overhaul and a conversion to unittest). Thanks Simon Percivall!
2004-08-18 12:40:31 +00:00
Martin v. Löwis 318a12eb01 Patch #791776: Replace SMTPHandler.date_time with email.Utils.formatdate. 2004-08-18 12:27:40 +00:00
Martin v. Löwis fe84d17a6a Patch #764217: Add nametofont function, exists parameter. 2004-08-18 11:06:45 +00:00
Michael W. Hudson 0ccff074cd This is Mark Russell's patch:
[ 1009560 ] Fix @decorator evaluation order

From the description:

Changes in this patch:

- Change Grammar/Grammar to require
newlines between adjacent decorators.

- Fix order of evaluation of decorators
in the C (compile.c) and python
(Lib/compiler/pycodegen.py) compilers

- Add better order of evaluation check
to test_decorators.py (test_eval_order)

- Update the decorator documentation in
the reference manual (improve description
of evaluation order and update syntax
description)

and the comment:

Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html)

(I'm checking this in for Anthony who was having problems getting SF to
talk to him)
2004-08-17 17:29:16 +00:00
Edward Loper b51b23405b Fixed bug in line-number finding for examples (DocTestParser wasn't
updating line numbers correctly for bare prompts & examples containing
only comments).
2004-08-17 16:37:12 +00:00
Raymond Hettinger f04d8a8898 There are no longer any special case test skips. 2004-08-17 16:34:51 +00:00
Raymond Hettinger 673cb28b2a Remove test of obsolete trim() operation which was supplanted by
normalize() in Draft 1.06 (9 October 2002):

  The normalize operation has been added; it reduces a number to a
  canonical form.  (This replaces the trim operator, which only
  removed trailing fractional zeros.)
2004-08-17 16:27:04 +00:00
Johannes Gijsbers e7691d36b7 Use readline/raw_input() in pydoc.Helper.interact if available and self.input
is sys.stdin. Based on a patch (#726204) by Dmitry Vasiliev and a comment from
Guido in an older patch (#549901).
2004-08-17 13:21:53 +00:00
Thomas Heller 30d0008577 The get_installer_filename() method forgot to return the name it
calculates.  Spotted by Cort Danger Stratton.
2004-08-17 10:15:07 +00:00
Raymond Hettinger 1f65b472c3 SF bug #833957: Ctrl+key combos stop working in IDLE
Make key combinations work with upper and lowercase as is the MS standard.
2004-08-17 08:01:19 +00:00
Raymond Hettinger ba4e47db57 This file is no longer used in version 2.39.
Was supplanted by tointegral.decTest.
2004-08-17 06:56:25 +00:00
Raymond Hettinger 3ee3ed2e80 Add two new files and update remaining tests from the latest update of the
test suite in version 2.39 of dectest.zip.
2004-08-17 06:42:13 +00:00
Raymond Hettinger d6c700a320 Revise max() and min() to comply with the 8/2/2004 update to the specification
(version 1.45):

The max and min operations follow the rules in the current IEEE 754 revision draft:
if one operand is a quiet NaN and the other is number, then the number is always returned
if both operands are finite and equal in numerical value then an ordering is applied:
    if the signs differ then max returns the operand with the positive sign and
    min returns the operand with the negative sign; if the signs are the same then
    the exponent is used to select the result.
2004-08-17 06:39:37 +00:00
Raymond Hettinger f63ba43733 * Dynamically build a list of files to be tested (necessary because
version 2.39 of dectest.zip adds some new test files and because
  some existing test files were getting skipped).
* Remove two docstrings which cluttered unittest's output.
* Simplify a for-loop with a list comprehension.
2004-08-17 05:42:09 +00:00
Barry Warsaw 06fa042034 Test cases and fixes for bugs described in patch #873418: email/Message.py:
del_param fails when specifying a header.
2004-08-16 15:47:34 +00:00
Skip Montanaro d4ff206906 Being bsd-based, darwin/macosx has the same limitation w.r.t. the "echo"
service.
2004-08-16 15:35:54 +00:00