Commit Graph

5986 Commits

Author SHA1 Message Date
Michael W. Hudson 3704644acb Use types.StringTypes instead of (types.StringType, types.UnicodeType) --
works better (at all!) in --disable-unicode builds.

Bugfix candidate, probably.
2002-05-20 14:30:06 +00:00
Michael W. Hudson 9c373061ad tolerate --disable-unicode... 2002-05-20 14:24:53 +00:00
Michael W. Hudson 7c6a4ad78f More mindless --disable-unicode proofing. 2002-05-20 14:22:28 +00:00
Michael W. Hudson 286225b548 easy --disable-unicode proofing. 2002-05-20 14:15:42 +00:00
Barry Warsaw 6d86f8302f A test message w/ CRLF line endings 2002-05-19 23:53:38 +00:00
Barry Warsaw e0d85c834a Add two new tests of recent email package fixes: CRLF line endings,
and explicit maxlinelen arguments to the Header constructor.
2002-05-19 23:52:54 +00:00
Barry Warsaw 7e21b6792b I've thought about it some more, and I believe it is proper for the
email package's Parser to handle the three common line endings.
Certain protocols such as IMAP define CRLF line endings and it doesn't
make sense for the client app to have to normalize the line endings
before handing it message off to the Parser.

_parsebody(): Be more flexible in the matching of line endings for
finding the MIME separators.  Accept any of \r, \n and \r\n.  Note
that we do /not/ change the line endings in the payloads, we just
accept any of those three around MIME boundaries.
2002-05-19 23:51:50 +00:00
Barry Warsaw 812031b955 Fixed a bug in the splitting of lines, and improved the splitting for
single byte character sets.  Also fixed a semantic problem with the
constructor's default arguments.  Specifically,

__init__(): Change the maxlinelen argument default to None instead of
MAXLINELEN.  The semantics should have been (and now are) that if
maxlinelen is given it is always honored.  If it isn't given, but
header_name is given, then the maximum line length is calculated.  If
neither are given then the default 76 characters is used.

_split(): If the character set is a single byte character set then we
can split the line at the maxlinelen because we know that encoding the
header won't increase its length.  If the charset isn't a single byte
charset then we use the quicker divide-and-conquer line splitting
algorithm as before.
2002-05-19 23:47:53 +00:00
Barry Warsaw 8c1aac2476 Complete a merge of the mimelib project and the Python cvs codebases
for the email package.  The former is now just a shell project that
has some extra files for packaging for independent use (e.g. setup.py
and README).

Added a compatibility layer so that the same API can be used in Python
2.1 and 2.2/2.3 with the major differences shuffled off into helper
modules (_compat21.py and _compat22.py).

Also bumped the package version number to 2.0.3 for some fixes to be
checked in momentarily.
2002-05-19 23:44:19 +00:00
Raymond Hettinger 2ae87539aa Added Mitchell Surface's regression tests for base64. Closes patch #550002. 2002-05-18 00:25:10 +00:00
Michael W. Hudson 8bf46e4e7a This is patch
[ 555382 ] test_array v.s. --disable-unicode

+ MvL's suggestions.  Just the 32 failing tests in --disable-unicode builds
now...
2002-05-15 13:04:53 +00:00
Raymond Hettinger d1fa3db52d Added docstrings excerpted from Python Library Reference.
Closes patch 556161.
2002-05-15 02:56:03 +00:00
Chui Tey 55956c9361 Fixed bug: Split RPC message into two parts instead of three 2002-05-14 23:45:14 +00:00
Fred Drake 30d59baecd Simplify code to remove an unnecessary test. 2002-05-14 15:50:11 +00:00
Guido van Rossum 570764ddce Use spaces, not tabs for indents.
Raymond Hettinger, beware!  This caused the Unix install to fail!
2002-05-14 14:08:12 +00:00
Raymond Hettinger 2d2b51bf22 Added tests for new degree/radian conversions. 2002-05-14 08:51:33 +00:00
Raymond Hettinger b760efb08d Closes patch 529408 deprecating random.stdgamma(). 2002-05-14 06:40:34 +00:00
Barry Warsaw bdc8289e06 smtp_RCPT(): Removed a somewhat embarrassing debugging line, found by
Scot Stevenson.  Could be a bug fix candidate, but probably doesn't
matter much unless a certain blue-nosed cat suddenly becomes corporeal
and starts emailing some stmp.py (sic) fronted mailer.
2002-05-14 02:13:30 +00:00
Raymond Hettinger ca6cdc2c02 Closes SF bug 527139. Moved temp variables inside guard. 2002-05-13 23:40:14 +00:00
Guido van Rossum 4402241450 Jim Fulton reported a segfault in dir(). A heavily proxied object
returned a proxy for __class__ whose __bases__ was also a proxy.  The
merge_class_dict() helper for dir() assumed incorrectly that __bases__
would always be a tuple and used the in-line tuple API on the proxy.

I will backport this to 2.2 as well.
2002-05-13 18:29:46 +00:00
Guido van Rossum df4dabd5d2 SF 554663. Add OpenBSD3. Bugfix candidate if anyone cares. 2002-05-13 14:58:02 +00:00
Guido van Rossum 6a1bd39d8e SF 554073. Fix typo in error reporting of unrecognized character
following IAC.  Bugfix candidate if anyone cares.
2002-05-13 14:55:33 +00:00
Michael W. Hudson e1c67d1dc0 Make StringIO work in --disable-unicode builds... 2002-05-13 09:42:16 +00:00
Raymond Hettinger 64108afa60 Adds tests for degrees() and radians() functions added to mathmodule.
Closes patch 552452 and feature request 426539.
2002-05-13 03:55:01 +00:00
Tim Peters 39a86c2188 SF bug 555042: zip() may trigger MemoryError.
NOT a bugfix candidate:  this is a fix to an optimization introduced
in 2.3.
2002-05-12 07:19:38 +00:00
Raymond Hettinger e874fc304e Closes SF patch 553277. Per GvR, reverting to original patch -- the way to
test if 'callable' has not been supplied is to test for None instead of
False.  The previous correction to 'if callable()' was wrong because an unusable
callback would be ignored rather than raising an exception.
2002-05-12 05:53:51 +00:00
Jeremy Hylton e037665f99 Use isinstance() in preference to comparison of type by is. 2002-05-10 21:00:35 +00:00
Martin v. Löwis a8dd0941b8 Patch #553277: Accept callbacks that are callable, not callbacks that are true. 2002-05-08 08:56:33 +00:00
Andrew M. Kuchling 0b5c11252d Prevent convert_path from crashing if the path is an empty string. Bugfix candidate. 2002-05-06 13:57:19 +00:00
Tim Peters 46c04e140c random.gauss() uses a piece of hidden state used by nothing else,
and the .seed() and .whseed() methods failed to reset it.  In other
words, setting the seed didn't completely determine the sequence of
results produced by random.gauss().  It does now.  Programs repeatedly
mixing calls to a seed method with calls to gauss() may see different
results now.

Bugfix candidate (random.gauss() has always been broken in this way),
despite that it may change results.
2002-05-05 20:40:00 +00:00
Fred Drake e08fda912f Remove all tests that rely on deprecated-in-2.2 features of xrange objects.
"What's New in Python 2.2" documented that these would be removed in
Python 2.3.
2002-05-02 18:40:31 +00:00
Martin v. Löwis a066f46b9b Patch 550804: Make os.environ.copy() return a copy. 2002-05-02 17:39:19 +00:00
Fred Drake e0e890a4da Added regression tests for xrange object attributes.
See SF bug #551285.
2002-05-02 16:07:44 +00:00
Fred Drake 485f340d52 Buffer-object repitition and concatenation has worked all along; add a test
to make avoid regression.
2002-05-02 04:27:20 +00:00
Fred Drake 7f781c9aab Add Pickler.clear_memo() so the pickle and cPickle modules are more similar. 2002-05-01 20:33:53 +00:00
Andrew MacIntyre e41abab33b Fred's recent changes to support "-u all" resulted in subset resource
selections (eg "-u network") being ignored.
2002-04-30 12:11:04 +00:00
Tim Peters 67d687a114 builtin_zip(): Take a good guess at how big the result list will be,
and allocate it in one gulp.

This isn't a bugfix, it's just a minor optimization that may or may not
pay off.
2002-04-29 21:27:32 +00:00
Tim Peters 81b9251d59 Mostly in SequenceMatcher.{__chain_b, find_longest_match}:
This now does a dynamic analysis of which elements are so frequently
repeated as to constitute noise.  The primary benefit is an enormous
speedup in find_longest_match, as the innermost loop can have factors
of 100s less potential matches to worry about, in cases where the
sequences have many duplicate elements.  In effect, this zooms in on
sequences of non-ubiquitous elements now.

While I like what I've seen of the effects so far, I still consider
this experimental.  Please give it a try!
2002-04-29 01:37:32 +00:00
Guido van Rossum 7dab2426ca - New builtin function enumerate(x), from PEP 279. Example:
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
  The argument can be an arbitrary iterable object.
2002-04-26 19:40:56 +00:00
Fred Drake d451ec1cdb Clean up uses of some deprecated features.
Reported by Neal Norwitz on python-dev.
2002-04-26 02:29:55 +00:00
Thomas Heller 69d31b749d Pass the full pathname to MSVC when compiling a debug version. This
allows the debugger to find the source without asking the user to
browse for it.
2002-04-25 17:29:45 +00:00
Thomas Heller 378498dad6 Append the PC specific include 'PC' and library 'PCBuild' directories
under NT - this allows distutils to work with the CVS version or the
source distribution.

Wrap a long line.
2002-04-25 17:26:37 +00:00
Thomas Heller e65008038e Fix trivial typo. 2002-04-25 17:03:30 +00:00
Neil Schemenauer 3b04d635a2 Add more tests for abstract isinstance() and issubclass(). 2002-04-24 03:33:02 +00:00
Tim Peters 1e33ffa5c7 test_resource has no chance of running on Windows. 2002-04-23 23:09:02 +00:00
Tim Peters e12cda9840 test_mmap started breaking on Windows, only when run after test_bsddb.
On Win2K it thought 'foo' started at byte offset 0 instead of at the
pagesize, and on Win98 it thought 'foo' didn't exist at all.  Somehow
or other this is related to the new "in memory file" gimmicks in
bsddb, but the old bsddb we use on Windows sucks so bad anyway I don't
want to bother digging deeper.  Flushing the file in test_mmap after
writing to it makes the problem go away, so good enough.
2002-04-23 23:07:28 +00:00
Barry Warsaw 906569de24 Unit tests for the changes in abstract.c version 2.101. The debug
build's "undetected error" problems were originally detected with
extension types, but we can whitebox test the same situations with
new-style classes.
2002-04-23 22:48:42 +00:00
Barry Warsaw 5ca537473b Rewrote the PyUnit description so that it now recommends to use
run_suite() instead of run_unittest().  Best practice is to plan for
multiple test classes.
2002-04-23 21:39:00 +00:00
Jeremy Hylton 74ce77f0e6 Add tests for the recent resource module change.
Also add a test that Python doesn't die with SIGXFSZ if it exceeds the
file rlimit.  (Assuming this will also test the behavior when the 2GB
limit is exceed on a platform that doesn't have large file support.)
2002-04-23 20:21:22 +00:00
Barry Warsaw 8570013357 Whitespace normalization. Unka Timmy would be proud. 2002-04-23 18:18:43 +00:00