Commit Graph

8777 Commits

Author SHA1 Message Date
Martin v. Löwis f9b08b8e60 Patch #785689: Use basename in usage. Backported to 2.3. 2003-10-31 13:05:21 +00:00
Martin v. Löwis 48440b7c27 Patch #: Add POP3 over SSL support. 2003-10-31 12:52:35 +00:00
Raymond Hettinger c40b7afee2 Update test to include "sorted" in dir(list). 2003-10-29 07:23:57 +00:00
Raymond Hettinger 0a9b9da0c3 Add list.sorted() classmethod. 2003-10-29 06:54:43 +00:00
Neal Norwitz 9920430107 SF #775057, fix IDLE problem in about dialog
If the file doesn't exist, the code to display an error message was broken
Will backport.
2003-10-28 21:57:10 +00:00
Armin Rigo 9c8f7eafca Fixed dis.disassemble_string().
Added dis.findlinestarts().
SF bug 811294
2003-10-28 12:17:25 +00:00
Armin Rigo 2b3eb4062c Deleting cyclic object comparison.
SF patch 825639
http://mail.python.org/pipermail/python-dev/2003-October/039445.html
2003-10-28 12:05:48 +00:00
Andrew M. Kuchling 0f10343410 Docstring fix: XHTML 1.0 entities are supported 2003-10-27 15:47:48 +00:00
Martin v. Löwis 11892ecd6d Patch #817854: Add missing operations for SSLFile. Fixes #792101.
Backported to 2.3.
2003-10-27 14:07:53 +00:00
Steve Purcell cca3491dbe Another instance of the same typo. 2003-10-26 16:38:16 +00:00
Raymond Hettinger d591f666de Replace the window() example with pairwise() which demonstrates tee(). 2003-10-26 15:34:50 +00:00
Raymond Hettinger f0c5aec85f Minor improvements to itertools.tee():
* tee object is no longer subclassable
* independent iterators renamed to "itertools.tee_iterator"
* fixed doc string typo and added entry in the module doc string
2003-10-26 14:25:56 +00:00
Steve Purcell 397b45d4ba Incorporated patch 819077, from George Yoshida:
* Fixed typo in docstring for 'failUnlessAlmostEqual()'

* Removed unnecessary use of 'float()' for time values.

* Removed apparently unnecessary import of unittest. At some point in
  the distant past I believe it was necessary otherwise the 'TestCase'
  that a module saw was not the same as the 'TestCase' seen within
  'unittest', and the user's TestCase subclasses were not recognised as
  subclasses of the TestCase seen within unittest. Seems not to be
  necessary now.
2003-10-26 10:41:03 +00:00
Martin v. Löwis 23b44a39ce Patch #812378: Normalize white space. 2003-10-24 20:09:23 +00:00
Andrew M. Kuchling 10a444965d [Bug #822668] tarfile raises an exception if the tarfile is gzipped and is too large; the gzip filesize should be written out mod 2**32. (Reported by Johan Fredrik Ohman) 2003-10-24 17:38:34 +00:00
Armin Rigo 1b3c04b510 Fixed bug introduced in revision 1.27 2003-10-24 17:15:29 +00:00
Walter Dörwald 4894c30626 Fix a bug in the memory reallocation code of PyUnicode_TranslateCharmap().
charmaptranslate_makespace() allocated more memory than required for the
next replacement but didn't remember that fact, so memory size was growing
exponentially every time a replacement string is longer that one character.
This fixes SF bug #828737.
2003-10-24 14:25:28 +00:00
Raymond Hettinger 6a5b027742 Added itertools.tee()
It works like the pure python verion except:
* it stops storing data after of the iterators gets deallocated
* the data queue is implemented with two stacks instead of one dictionary.
2003-10-24 08:45:23 +00:00
Martin v. Löwis d4210bc718 Patch #813200: Quote executable path on Windows. Fixes #811082.
Backported to 2.3.
2003-10-23 15:55:28 +00:00
Guido van Rossum 38443c1513 Remove unneeded import. 2003-10-22 17:22:18 +00:00
Raymond Hettinger 97aa32b467 Replace a reduce() with sum(). 2003-10-22 16:49:01 +00:00
Andrew M. Kuchling 7cebbf39a9 Add docstring 2003-10-22 14:38:54 +00:00
Andrew M. Kuchling 6c2871e707 [Part of patch #648322] Delete the poll2() function, which uses a 'poll' extension module that was once part of Medusa. Contributed by Kjetil Jacobsen 2003-10-22 14:38:27 +00:00
Andrew M. Kuchling f9ca409292 [Bug #758241] When you use asyncore with a non-default map, methods
of the dispatcher object break.  e.g. if you close() the object, it
  tries to remove itself from the default map, not from the map the
  dispatcher was created with.

  The patch, from Stephane Ninin, records the map as an attribute of
  the dispatcher instance.

2.3 bugfix candidate.
2003-10-22 13:48:27 +00:00
Jeremy Hylton fcefd0d2a5 Apply patch 823328 -- support for rfc 2617 digestion authentication.
The patch was tweaked slightly.  It's get a different mechanism for
generating the cnonce which uses /dev/urandom when possible to
generate less-easily-guessed random input.

Also rearrange the imports so that they are alphabetical and
duplicates are eliminated.

Add a few XXX comments about things left undone and things that could
be improved.
2003-10-21 18:07:07 +00:00
Fred Drake 8c4da53afe Make both items() methods return lists; one had changed to return an
iterator where it probably shouldn't have.
Closes SF bug #818861.
2003-10-21 16:45:00 +00:00
Guido van Rossum 571720811b Show microseconds, milliseconds or seconds, whichever is most natural,
rather than showing weird numbers like 8.4e+03 usec.
2003-10-20 23:38:28 +00:00
Walter Dörwald f0dfc7ac5c Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
2003-10-20 14:01:56 +00:00
Martin v. Löwis 9e62ff287b Patch #822994: Consolidate tests for self.closed. 2003-10-18 10:20:42 +00:00
Gustavo Niemeyer ad3fc44ccb Implemented non-recursive SRE matching. 2003-10-17 22:13:16 +00:00
Raymond Hettinger 6b59f5f3fd Let library modules use the new keyword arguments for list.sort(). 2003-10-16 05:53:16 +00:00
Raymond Hettinger 42b1ba31af * list.sort() now supports three keyword arguments: cmp, key, and reverse.
key provides C support for the decorate-sort-undecorate pattern.
  reverse provide a stable sort of the list with the comparisions reversed.

* Amended the docs to guarantee sort stability.
2003-10-16 03:41:09 +00:00
Jeremy Hylton d0e2705f3f Open results files, which contain binary pickles, in binary mode.
Remove fallback code that tries to read marshal data from a results
file, since this module never writes marshal data.
2003-10-14 20:12:06 +00:00
Brett Cannon 2bfb94c871 Add test__locale to expected skip list for Darwin. 2003-10-13 04:27:47 +00:00
Martin v. Löwis d662548c72 Patch #810914: Return absolute path for mkstemp. Fixes #810408.
This should not be backported to 2.3, as it might break backwards
compatibility.
2003-10-12 17:37:01 +00:00
Raymond Hettinger 411c602349 Minor fixup. "Random" was listed twice in __all__. 2003-10-12 17:14:11 +00:00
Brett Cannon 8da2a52dd6 See rev. 1.42 for log message 2003-10-12 04:29:10 +00:00
Brett Cannon 82860df417 see rev. 1.13 for log message 2003-10-12 04:29:10 +00:00
Guido van Rossum 80bd5ca722 Ouch. Remove debug code containing obscenities. :-) 2003-10-10 23:05:41 +00:00
Guido van Rossum b427c00376 The fullmodname() function chopped off the first character if the
module existed in the current directory.  Fix this.  Backport
candidate (I presume).
2003-10-10 23:02:01 +00:00
Barry Warsaw b97f0b7654 TCPServer: Fixed typo in class docstring. 2003-10-09 23:48:52 +00:00
Barry Warsaw 3aaad5079b TCPServer: Fixed typo in class docstring.
Backport candidate.
2003-10-09 22:44:05 +00:00
Martin v. Löwis f563c8bbac Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Backported to 2.3. 2003-10-06 21:34:33 +00:00
Jeremy Hylton 0a4a50dd85 SF patch [ 816787 ] urllib2.URLError don't calll IOError.__init__
Not sure if this fix is great, but it's probably a small improvement.
2003-10-06 05:15:13 +00:00
Jeremy Hylton 504de6bd2c Fix for SF bug [ 817156 ] invalid \U escape gives 0=length unistr. 2003-10-06 05:08:26 +00:00
Raymond Hettinger dbe3d280e7 Adopt Christian Stork's suggested argument order for the logic quantifiers.
Adopt Jeremy Fincher's suggested function name, "any", instead of "some".
2003-10-05 16:47:36 +00:00
Raymond Hettinger 2f726e9093 SF bug #812202: randint is always even
* Added C coded getrandbits(k) method that runs in linear time.
* Call the new method from randrange() for ranges >= 2**53.
* Adds a warning for generators not defining getrandbits() whenever they
  have a call to randrange() with too large of a population.
2003-10-05 09:09:15 +00:00
Barry Warsaw b8c787606c GNUTranslations._parse(): Initialize local variable k so that if the
first line of a header section isn't an RFC-ish header, it's just
ignored instead of throwing an UnboundLocalError.

Backport candidate.
2003-10-04 02:28:31 +00:00
Skip Montanaro 0b87444b1b tweak the docstring to not be so focused on 1.6. 2003-10-03 14:05:26 +00:00
Skip Montanaro dffeed3ffa Make the fieldnames argument optional in the DictReader. If self.fieldnames
is None, the next row read is used as the fieldnames.  In the common case,
this means the programmer doesn't need to know the fieldnames ahead of time.
The first row of the file will be used.  In the uncommon case, this means
the programmer can set the reader's fieldnames attribute to None at any time
and have the next row read as the next set of fieldnames, so a csv file can
contain several "sections", each with different fieldnames.
2003-10-03 14:03:01 +00:00
Gregory P. Smith be0db8b125 bsddb3 4.2.2, adds DBCursor.get_current_size() method to return the length
of the current value without reading the value itself.
2003-10-01 06:48:51 +00:00
Steve Purcell 3a01b7d66e Removed redundant 'return' statement. (Issue 813159) 2003-09-30 09:25:32 +00:00
Gregory P. Smith 1eb41e22ab Use a threadsafe private DBEnv for each bsddb compatibility interface
db that is opened.  DB_THREAD and DB_INIT_LOCK allow for multithreaded
access.  DB_PRIVATE prevents the DBEnv from using the filesystem
(making it only usable by this process; and in this implementation
using one DBEnv per bsddb database)
2003-09-27 23:00:19 +00:00
Raymond Hettinger 9edae346dd Fix typo in the comments. 2003-09-24 03:57:36 +00:00
Raymond Hettinger 3778f40389 Add more identity tests. 2003-09-24 03:56:07 +00:00
Thomas Heller 84ef153c74 Let IDLE use the HTMLHelp docs on Windows, if found.
Already 'backported' to release23-maint.
2003-09-23 20:53:10 +00:00
Raymond Hettinger 9a80c5dbc4 Added codec for bz2 compression. 2003-09-23 20:21:01 +00:00
Steve Purcell 3198275ace Topical change: use 'startswith()' to identify test methods with a
given prefix rather than comparing a slice.
2003-09-23 08:41:53 +00:00
Tim Peters b8b60ea0c9 PlaySoundTest.test_alias_nofallback(): Simplified the coding by using
assertRaises.

NOT a bugfix candidate.
2003-09-22 18:41:53 +00:00
Tim Peters 086e56205c PlaySoundTest.test_alias_fallback(): Disabled this test, and explained
why in a new comment.  My home Win98SE box is one of the "real systems"
alluded to (my system "default sound" appears to have vanished sometime
in the last month, that's certainly not a Python bug, and the MS
PlaySound docs are correct in their explanation of what happens then).

Bugfix candidate.  If someone can still sneak it into 2.3.1, that would
be good.
2003-09-22 18:38:53 +00:00
Walter Dörwald e46d14cd2c Avoid list as a variable name. 2003-09-22 12:43:16 +00:00
Steve Purcell 7e74384af5 - Fixed loading of tests by name when name refers to unbound
method (PyUnit issue 563882, thanks to Alexandre Fayolle)
- Ignore non-callable attributes of classes when searching for test
  method names (PyUnit issue 769338, thanks to Seth Falcon)
- New assertTrue and assertFalse aliases for comfort of JUnit users
- Automatically discover 'runTest()' test methods (PyUnit issue 469444,
  thanks to Roeland Rengelink)
- Dropped Python 1.5.2 compatibility, merged appropriate shortcuts from
  Python CVS; should work with Python >= 2.1.
- Removed all references to string module by using string methods instead
2003-09-22 11:08:12 +00:00
Raymond Hettinger 175a6ac114 Improve and expand identity tests. 2003-09-21 08:14:11 +00:00
Gregory P. Smith 41631e8f66 Adds basic support for BerkeleyDB 4.2.x. Compiles and passes tests; new
features in BerkeleyDB not exposed.  notably: the DB_MPOOLFILE interface
has not yet been wrapped in an object.

Adds support for building and installing bsddb3 in python2.3 that has
an older version of this module installed as bsddb without conflicts.
The pybsddb.sf.net build/packaged version of the module uses a
dynamicly loadable module called _pybsddb rather than _bsddb.
2003-09-21 00:08:14 +00:00
Gregory P. Smith cec1b3f6a7 Maintain backwards compatibility with python < 2.3 by dynamically
adding the iterator interface for python >= 2.3.
2003-09-20 23:51:34 +00:00
Tim Peters 0aab002057 SF patch 809915: Fix bogus address to hopefully always break.
test_bad_address():  Recover from that VeriSign thought it would boost
its corporate coffers to start resolving http://www.sadflkjsasadf.com/.

Bugfix candidate -- although the bug is more VeriSign's than Python's!
2003-09-20 22:16:26 +00:00
Tim Peters c7c516aa51 test__locale (two underscores) can't pass on Windows: RADIXCHAR doesn't
exist, and neither do any of the specific 5-letter locale names the test
is looking for.
2003-09-20 22:06:13 +00:00
Martin v. Löwis c6bb6c0f8c Patch #707167: Pass dircache exceptions to the caller. Fixes #682813.
Not backported because of behaviour change.
2003-09-20 15:52:21 +00:00
Martin v. Löwis 7bdc484c97 Patch #808362: Fix typos. 2003-09-20 11:09:28 +00:00
Martin v. Löwis dc14ab13c4 Patch #793559: Reset __starttext_tag. Fixes #709491. Backported to 2.3. 2003-09-20 10:58:38 +00:00
Martin v. Löwis cb3062e3c0 Patch #805976: Add DOTBOX and UNDERLINE. 2003-09-20 10:52:56 +00:00
Raymond Hettinger 7a70ea4135 SF patch #806246: use basestring where possible
(Contributed by George Yoshida.)
2003-09-17 05:50:59 +00:00
Raymond Hettinger 2d72b5d707 Test __all__ for unittest.py 2003-09-16 04:37:39 +00:00
Steve Purcell d75e7e4342 Explicitly define public symbols via __all__: see discussion with Raymond
Hettinger in comments for issue 804115
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=804115&group_id=5470
2003-09-15 11:01:21 +00:00
Raymond Hettinger d55111f791 * Converted test to unittest format.
* Expanded coverage.
2003-09-13 05:51:09 +00:00
Raymond Hettinger 2e9da6020e The previous change works much faster (one lookup per key) when
iteritems() is defined.
2003-09-13 03:18:34 +00:00
Raymond Hettinger 91dd19db6f SF bug #804115: bad argument handling(unittest.py) 2003-09-13 02:58:00 +00:00
Raymond Hettinger 42a61ed277 Simplify doctest of tee(). 2003-09-13 01:01:34 +00:00
Martin v. Löwis cbe81f2a72 Patch #793021: Implement htmllib.HTMLParser.reset. Fixes #711632.
Backported to 2.3.
2003-09-12 16:38:00 +00:00
Martin v. Löwis 1b699a5f00 Patch #790000: Allow os.access to handle Unicode file name. 2003-09-12 16:25:38 +00:00
Raymond Hettinger deadbf50e4 SF #662923
Add support for the iterator and mapping protocols.
For Py2.3, this was done for shelve, dumbdbm and other mapping objects, but
not for bsddb and dbhash which were inadvertently missed.
2003-09-12 06:33:37 +00:00
Jeremy Hylton b7b1db9191 Oops. Really fix the indentation problem this time. 2003-09-10 20:19:54 +00:00
Jeremy Hylton d7fb676023 Fix inconsistent mix of tabs and spaces that caused test to fail. 2003-09-10 19:57:31 +00:00
Skip Montanaro 4997a69fe4 display link to module docs when it looks like the object module is a core
module
2003-09-10 16:47:51 +00:00
Kurt B. Kaiser 62685d36aa Python Bug 775061
1. Remove "idle" script, it lives in Tools/scripts/ now.
2. Remove shebang from idle.py, should be called explicitly.
3. Remove obsolete test code from rpc.py; needs unit test.
2003-09-10 02:42:18 +00:00
Raymond Hettinger a098b33c93 Add an example to address a common question of how to split iterators. 2003-09-08 23:58:40 +00:00
Raymond Hettinger 9d50d91e77 Set the warnings stacklevel to two. 2003-09-08 19:16:36 +00:00
Tim Peters f1827cfaab SF bug 801631: file.truncate fault on windows.
file_truncate():  C doesn't define what fflush(fp) does if fp is open
for update, and the preceding I/O operation on fp was input.  On Windows,
fflush() actually changes the current file position then.  Because
Windows doesn't support ftruncate() directly, this not only caused
Python's file.truncate() to change the file position (contra our docs),
it also caused the file not to change size.

Repaired by getting the initial file position at the start, restoring
it at the end, and tossing all the complicated micro-efficiency checks
trying to avoid "provably unnecessary" seeks.  file.truncate() can't
be a frequent operation, and seeking to the current file position has
got to be cheap anyway.

Bugfix candidate.
2003-09-07 03:30:18 +00:00
Skip Montanaro 3f7a94824e **kwds arg was missing from __init__ for Dict{Reader,Writer} classes.
will backport.
2003-09-06 19:52:12 +00:00
Raymond Hettinger 66d09f1b30 SF bug #801342: Bug (documentation or real, your choice) in random.sample.
random.sample() uses one of two algorithms depending on the ratio of the
sample size to the population size.  One of the algorithms accepted any
iterable population argument so long as it defined __len__().  The other
had a stronger requirement that the population argument be indexable.

While it met the documentation specifications which insisted that the
population argument be a sequence, it made random.sample() less usable
with sets.  So, the second algorithm was modified to coerce non-indexable
iterables and dictionaries into a tuple before proceeding.
2003-09-06 04:25:54 +00:00
Raymond Hettinger b859c070ef SF bug #800796: Difference between hash() and __hash__()
slice(5).__hash__() now raises a TypeError.
2003-09-05 14:27:30 +00:00
Martin v. Löwis f5b93736a2 Patch #798145: Return correct information from nl_langinfo(RADIXCHAR).
Will backport to 2.3.
2003-09-04 18:24:47 +00:00
Martin v. Löwis 8ad1dd7df1 Catch locale.error as well. Fixes #788378. Will backport to 2.3. 2003-09-03 05:13:14 +00:00
Barry Warsaw 2e31ce2514 test_get_param_with_semis_in_quotes(): Test case for SF bug #794466.
Backport candidate.
2003-09-03 04:10:52 +00:00
Barry Warsaw a74e868857 A fix for parsing parameters when there are semicolons inside the
quotes.  Fixes SF bug #794466, with the essential patch provided by
Stuart D. Gathman.  Specifically,

_parseparam(), _get_params_preserve(): Use the parsing function that
takes quotes into account, as given (essentially) in the bug report's
test program.

Backport candidate.
2003-09-03 04:08:13 +00:00
Fred Drake 6f7b213dda use the long names for re compilation options; this makes it easier to
figure out what the code is doing
2003-09-02 16:01:07 +00:00
Andrew M. Kuchling f19f8610fa Modernize code a bit: use isinstance instead of type(); return True/False 2003-09-02 11:52:06 +00:00
Andrew M. Kuchling 0ec5288d09 [Patch #759208] Fix has_key emulation to not raise KeyError 2003-09-02 11:44:44 +00:00
Raymond Hettinger f70e076042 Only apply case-insensitivity test on appropriate platforms.' test_filecmp.py 2003-09-02 06:59:21 +00:00
Raymond Hettinger eeca37e0b5 SF bug #453515: filecmp.dircmp case sensitivity bug 2003-09-02 05:42:02 +00:00
Raymond Hettinger 5f8b0b1fd4 SF 798269: bug fix for doctest (sf bug id: 798254
(Contributed by Alexander Belopolsky.)

Doctest would crash when encountering unbound methods:
  class A:
    def f(self): pass

  class C(A):
    g = A.f
2003-09-02 02:09:05 +00:00
Raymond Hettinger 5d2e777787 SF patch #736962: Port tests to unittest (Part 2)
(Contributed by Walter Dörwald.)

* Convert test_slice.py to unittest format
* Expand the test coverage.
2003-09-02 01:53:01 +00:00
Raymond Hettinger 99c2d531d1 SF patch #790443: add SafeConfigParser to __all__
(Contributed by George Yoshida.)
2003-09-01 23:30:44 +00:00
Raymond Hettinger 6d362b25c5 SF bug #785222: zlib monotonic test
For smaller datasets, it is not always true the increasing the compression
level always results in better compression.  Removed the test which made
this invalid assumption.
2003-08-31 04:35:24 +00:00
Raymond Hettinger f9f4c6945e SF patch #736962: Port tests to unittest
(Contributed by Walter Dörwald).

* Convert three test modules to unittest format.
* Expanded coverage in test_structseq.py.
* Raymond added a new test in test_sets.py
2003-08-30 22:54:55 +00:00
Raymond Hettinger c11dbcd4bf SF bug 797650: Infinite loop in textwrap.py
When the indents were set to longer than the width and long word breaking
was enabled, an infinite loop would result because the inner loop did not
assure that at least one character was stripped off on every pass.
2003-08-30 14:43:55 +00:00
Raymond Hettinger 6229713221 Eliminate unnecessary eval() in tests 2003-08-30 01:24:19 +00:00
Raymond Hettinger a56f6b6600 SF bug #793826: using itertools.izip to mutate tuples
Avoid Armin Rigo's dastardly exercise in re-entrancy.
2003-08-29 23:09:58 +00:00
Andrew M. Kuchling b738041c5d Rework previous fix slightly; the &0x20 test seems useless, and the isprint() check mustn't prevent the meta-bit check at the end 2003-08-29 18:50:59 +00:00
Andrew M. Kuchling e8792c1f65 Add tests for meta- bit set 2003-08-29 18:49:05 +00:00
Andrew M. Kuchling 72cdb70296 [Bug #790356] unctrl() doesn't work for full printable charset. Fix by Dave Cinege. 2003-08-29 18:40:03 +00:00
Andrew M. Kuchling e752e20605 Add simple unit test for ascii.unctrl() function 2003-08-29 18:37:37 +00:00
Andrew M. Kuchling ff638ea6db [Bug #776542] open_https() generates a bad Authorization header because it calls .putheader() wrongly. Reported by Steffen Ries. 2003-08-29 18:12:23 +00:00
Brett Cannon 953c6f508b Make sure parentheses are escaped when used in the format string.
Closes bug #796149 .  Will be backported.
2003-08-29 02:28:54 +00:00
Gregory P. Smith 6676f6edc1 Support DBEnv.set_shm_key() to allow multi-threaded multi-process
database environments to use shared memory on systems supporting it.
2003-08-28 21:50:30 +00:00
Jeremy Hylton ead21f596c Fix SF bug [ 788011 ] compiler.compileFile fails on csv.py
Bug fix candidate.
2003-08-28 02:09:26 +00:00
Thomas Heller 4651f53949 Fix typo in docstring: The switch is '-x', not '-s'.
Will backport to 2.3 myself.
2003-08-27 20:19:35 +00:00
Thomas Heller 611dbc338e Remove a typo. (Or is this some markup I don't understand? ;-) 2003-08-27 10:48:12 +00:00
Raymond Hettinger 9bfe533c69 SF bug #795506: Wrong handling of string format code for float values.
Adding missing support for '%F'.

Will backport to 2.3.1.
2003-08-27 04:55:52 +00:00
Jason Tishler 063606a0d5 test_largefile can leave its temp file open if one of many tests fail. On
platforms (e.g., Cygwin) that are "particular" about open files, this will
cause other regression tests that use the same temp file to fail:

    $ ./python.exe -E -tt Lib/test/regrtest.py -l
    test_largefile test_mmap test_mutants
    test_largefile
    test test_largefile failed -- got -1794967295L, but expected 2500000001L
    test_mmap
    test test_mmap crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test'
    test_mutants
    test test_mutants crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test'

This patch solves the problem by adding missing "try/finally" blocks. Note
that the "large" size of this patch is due to many white space changes --
otherwise, the patch is small.

I tested this patch under Red Hat Linux 8.0 too.
2003-08-26 11:59:27 +00:00
Barry Warsaw c86c24e44d Bump the version number for the standalone mimelib package. 2003-08-19 04:05:25 +00:00
Barry Warsaw 622d60b5a2 test_rfc2231_no_language_or_charset_in_filename(),
test_rfc2231_no_language_or_charset_in_boundary(),
test_rfc2231_no_language_or_charset_in_charset(): New tests for proper
decoding of some RFC 2231 headers.

Backport candidate (as was the Utils.py 1.25 change) to both Python
2.3.1 and 2.2.4 -- will do momentarily.
2003-08-19 03:54:24 +00:00
Barry Warsaw 6208369ff3 get_param(): Update the docstring to explain how CHARSET and LANGUAGE
can be None, and what to do in that situation.

get_filename(), get_boundary(), get_content_charset(): Make sure these
handle RFC 2231 headers without a CHARSET field.

Backport candidate (as was the Utils.py 1.25 change) to both Python
2.3.1 and 2.2.4 -- will do momentarily.
2003-08-19 03:53:02 +00:00
Barry Warsaw 0b6f0d8810 decode_rfc2231(): We need to urllib.unquote() the value even if the
charset and language fields are not present, e.g. as in:

    title*0="This%20is%20encoded"
2003-08-19 03:49:34 +00:00
Raymond Hettinger 6a1801271a Improvements to set.py:
* Relaxed the argument restrictions for non-operator methods.  They now
  allow any iterable instead of requiring a set.  This makes the module
  a little easier to use and paves the way for an efficient C
  implementation which can take better advantage of iterable arguments
  while screening out immutables.

* Deprecated Set.update() because it now duplicates Set.union_update()

* Adapted the tests and docs to include the above changes.

* Added more test coverage including testing identities and checking
  to make sure non-restartable generators work as arguments.

Will backport to Py2.3.1 so that the interface remains consistent
across versions.  The deprecation of update() will be changed to
a FutureWarning.
2003-08-17 08:34:09 +00:00
Raymond Hettinger 1954035a47 Keep doctests in sync with the docs. 2003-08-16 00:59:59 +00:00
Raymond Hettinger ee562fc084 Make sets.py compatible with Py2.2 2003-08-15 21:17:04 +00:00
Walter Dörwald c8cb5d9d69 Make a copy of L before appending, so the global L remains
unchanged (and sys.gettotalrefcount() remains constant).

Fix a few typos.
2003-08-15 17:52:39 +00:00
Michael W. Hudson b2c7de4667 Fix for
[ 784825 ] fix obscure crash in descriptor handling

Should be applied to release23-maint and in all likelyhood
release22-maint, too.

Certainly doesn't apply to release21-maint.
2003-08-15 13:07:47 +00:00
Kurt B. Kaiser b785518d05 IDLE didn't start correctly when Python was installed in "Program Files"
on W2K and XP.  Python Bugs 780451, 784183

Backported to 2.2-maint
2003-08-14 14:54:28 +00:00
Andrew M. Kuchling 69f31eb80c [Patch #739124] Add use_default_colors() to curses module 2003-08-13 23:11:04 +00:00
Walter Dörwald a54b92b2eb Add a unicode prefix to the characters in the UnicodeEncodeError and
UnicodeTranslateError message.
2003-08-12 17:34:49 +00:00
Walter Dörwald fd196bd263 Enhance message for UnicodeEncodeError and UnicodeTranslateError.
If there is only one bad character it will now be printed in a
form that is a valid Python string.
2003-08-12 17:32:43 +00:00
Brett Cannon c83124ab79 Fix bug in test_bad_timezone where test was assuming locale knew of PDT. 2003-08-11 19:06:13 +00:00
Andrew M. Kuchling b2f89ee71a Comment typo fixes 2003-08-11 16:20:39 +00:00
Jason Tishler 0fd54d8050 Unconditionally opening the temp file in text mode causes this test to fail
under Cygwin. The attached patch corrects this problem.

I tested this patch under Red Hat Linux 8.0 too.
2003-08-11 12:13:14 +00:00
Jack Jansen a290e3d7c6 Bug fix for #780461: 'sysu' gestalt selector is meaningless on MacOSX,
but attempting to get it resulted in a crash. Fixed. Backport candidate.
2003-08-11 11:08:49 +00:00
Brett Cannon 5187a3bcdb Fix handling of bad locale setup where time.tzname[0] == time.tzname[1] and
time.daylight is true.  Add an explicit test for this situation.

Fixed some wording in docstrings.
2003-08-11 07:24:05 +00:00
Raymond Hettinger 3081d59f92 SF bug #778964: bad seed in python 2.3 random
The default seed is time.time().
Multiplied by 256 before truncating so that fractional seconds are used.
This way, two successive calls to random.seed() are much more likely
to produce different sequences.
2003-08-09 18:30:57 +00:00
Martin v. Löwis 39a682f5f2 Add HIDDEN. Fixes #777664. 2003-08-09 09:53:51 +00:00
Raymond Hettinger cffb9dee67 SF patch #747364: BaseHTTPServer doesn't need StringIO intermediary
(Contributed by Andrew Dalke.)
2003-08-09 05:01:41 +00:00
Kurt B. Kaiser 3f42a6d267 IDLEfork Bug 782759
backported to 23-maint
2003-08-09 01:51:28 +00:00
Raymond Hettinger 5475f2394a SF bug #770485: cStringIO does not set closed attr 2003-08-08 12:20:03 +00:00
Raymond Hettinger b5a420883c Modified itertools.izip() to match the behavior of __builtin__.zip()
which can now take zero arguments.
2003-08-08 05:10:41 +00:00
Raymond Hettinger 77fe69bd08 Re-sync doc tests with the doc updates. 2003-08-08 04:33:19 +00:00
Brett Cannon f5c96fb74d Fix docstring in LocaleTime. 2003-08-08 01:53:05 +00:00
Michael W. Hudson e723e453a1 Repair refcounting on error return from type_set_bases.
Include a test case that failed for one of my efforts to repair this.
2003-08-07 14:58:10 +00:00
Mark Hammond 7edd0a9b21 Demonstrate and fix [ 783882 ] os.lstat crashes with Unicode filename.
Will also check in on the 2.3 branch.
2003-08-06 02:46:58 +00:00
Walter Dörwald 5301d9c10d Remove useless import. 2003-08-05 15:55:38 +00:00
Walter Dörwald b27cca6634 Check both __div__ and __truediv__ in division tests.
(From SF patch #543867)
2003-08-05 15:34:34 +00:00