Commit Graph

15930 Commits

Author SHA1 Message Date
Michael Foord 5fe21ff91a unittest.TestCase assertion methods inform you when they have omitted an over long diff on failure. Issue 8351. 2010-06-05 13:38:16 +00:00
Mark Dickinson ec27d91741 Fix test_py3kwarn not to test for __cmp__-related DeprecationWarning. 2010-06-05 13:18:33 +00:00
Michael Foord 674648e3f2 unittest.TestCase.assertDictEqual and assertMultilineEqual provide better default failure messages in the event of long diffs. 2010-06-05 12:58:39 +00:00
Michael Foord e37d75fce2 Removed the new max_diff argument to assertSequenceEqual. All unittest.TestCase assert methods that use difflib to produce failure messages now truncate overly long messages. New class attribute unittest.TestCase.maxDiff to configure this if necessary. Issue 8351. 2010-06-05 12:10:52 +00:00
Mark Dickinson 23f0d6b57b Issue #8627: remove out-of-date warning about overriding __cmp__ 2010-06-05 11:52:24 +00:00
Michael Foord a441287f79 Extract error message truncating into a method (unittest.TestCase._truncateMessage). 2010-06-05 11:46:59 +00:00
Michael Foord 0100702b9a Issue 8351. Suppress large diffs in unittest.TestCase.assertSequenceEqual. 2010-06-05 11:23:51 +00:00
Michael Foord 9ef5d33084 unittest TestLoader test discovery filename matching done in a method. This makes it easier to override the matching strategy in subclasses. No behaviour change in actual implementation. 2010-06-05 10:39:42 +00:00
Benjamin Peterson 2aa6c38237 properly lookup the __format__ special method 2010-06-05 00:32:50 +00:00
R. David Murray e7e505ba6e #4487: have Charset check with codecs for possible aliases.
Previously, unexpected results occurred when email was passed, for example,
'utf8' as a charset name, since email would accept it but would *not* use
the 'utf-8' codec for it, even though Python itself recognises that as
an alias for utf-8.  Now Charset checks with codecs for aliases as well
as its own internal table.  Issue 8898 has been opened to change this
further in py3k so that all aliasing is routed through the codecs module.
2010-06-04 19:51:06 +00:00
Martin v. Löwis eba67c0eac Issue #6470: Drop UNC prefix in FixTk.py
Patch by Christop Gohlke and Amaury Forgeot d'Arc.
2010-06-04 19:39:07 +00:00
Senthil Kumaran fb6950140a test verifying the resp object is closed for HEAD response. 2010-06-04 17:17:09 +00:00
Senthil Kumaran dfaced5d3d Fix issue6312 - close the resp object for HEAD response. 2010-06-04 16:32:14 +00:00
Benjamin Peterson 3b95934e05 use a set for membership testing 2010-06-03 21:21:03 +00:00
R. David Murray 4653fb556c #8889: rewrite transient_internet so we don't use EAI_NODATA on FreeBSD.
FreeBSD doesn't have socket.EAI_NODATA.  I rewrote the routine because
there's no easy way to conditionally include a context manager in a
with statement.  As a side benefit, instead of a stack of context
managers there's now only one.
2010-06-03 20:19:25 +00:00
R. David Murray 61746d580e #5610: use \Z not $ so we don't eat extra chars when body part ends with \r\n.
If a body part ended with \r\n, feedparser, using '$' to terminate its
search for the newline, would match on the \r\n, and think that it needed
to strip two characters in order to account for the line end before the
boundary.  That made it chop one too many characters off the end of
the body part.  Using \Z makes the match correct.

Patch and test by Tony Nelson.
2010-06-03 15:43:20 +00:00
Stefan Krah 449aa86bd6 Issue #7384: If the system readline library is linked against ncurses,
the curses module must be linked against ncurses as well. Otherwise it
is not safe to load both the readline and curses modules in an application.

Thanks Thomas Dickey for answering questions about ncurses/ncursesw
and readline!
2010-06-03 12:39:50 +00:00
Lars Gustäbel 4da7d410b3 Issue #8741: Fixed the TarFile.makelink() method that is responsible
for extracting symbolic and hard link entries as regular files as a
work-around on platforms that do not support filesystem links.

This stopped working reliably after a change in r74571. I also added
a few tests for this functionality.
2010-06-03 12:34:14 +00:00
Lars Gustäbel 2ee9c6fa50 Issue #8833: tarfile created hard link entries with a size
field != 0 by mistake. The associated testcase did not
expose this bug because it was broken too.
2010-06-03 09:56:22 +00:00
Ronald Oussoren 593e4ca7a5 Fix for issue #7724: ensure that distutils and python's own setup.py
honor the MacOSX SDK when one is specified.

This is needed to be able to build using the 10.4u SDK while running
on OSX 10.6.

This is a fixed version of the patch in r80963, I've tested this patch
on OSX and Linux.
2010-06-03 09:47:21 +00:00
R. David Murray 52dcd45906 #1368247: make set_charset/MIMEText automatically encode unicode _payload.
Fixes (mysterious, to the end user) UnicodeErrors when using utf-8 as
the charset and unicode as the _text argument.  Also makes the way in
which unicode gets encoded to quoted printable for other charsets more
sane (it only worked by accident previously).  The _payload now is encoded
to the charset.output_charset if it is unicode.
2010-06-02 22:03:15 +00:00
Vinay Sajip 3b4849a21d Logging: improved error reporting for BaseConfigurator.resolve(). 2010-06-02 10:05:31 +00:00
Brian Curtin 824912eb30 Fix #8618. Ask the Windows mixer API if there are any playback devices
configured before attempting to test PlaySound.
2010-06-01 13:29:13 +00:00
Senthil Kumaran 4f0108b0d9 Fix Issue8797 - urllib2 basic authentication fix for wrong passwords. It fails after 5 retries. 2010-06-01 12:40:07 +00:00
Mark Dickinson 4ca7c3c089 Issue #8748: Fix incorrect results from comparisons between an integer
and a complex instance.  Based on a patch by Meador Inge.
2010-05-30 13:18:10 +00:00
Mark Dickinson 813363743d Issue #5211: Complete removal of implicit coercions for the complex
type.  Coercion for arithmetic operations was already removed in
r78280, but that commit didn't remove coercion for rich comparisons.
2010-05-30 12:12:25 +00:00
Brian Curtin 83cba05c30 Fix #8405 for slow buildbots. Remove the sleep on startup and move the
pipe communication into a loop to retry in case a buildbot gets even slower.
2010-05-28 15:49:21 +00:00
Benjamin Peterson 29d438c96c remove non-ascii coding per PEP 8 2010-05-28 02:12:36 +00:00
Victor Stinner 03883624a4 Issue #8835: test_support.transient_internet() catchs gaierror(EAI_NONAME) and
gaierror(EAI_NODATA)
2010-05-27 22:29:48 +00:00
Alexander Belopolsky 9292ee0667 Issue #7150: Raise OverflowError if the result of adding or subtracting
timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
2010-05-27 20:55:27 +00:00
Alexander Belopolsky 58451d2dd7 Issue #7879: Skip negative timestamps test on any Windows platform
using unittest.skipIf decorator.
2010-05-26 20:45:37 +00:00
Alexander Belopolsky a26cf46dd4 Issue #7879: Do not test negative timestamps on any Windows platform
including Windows CE.
2010-05-26 19:43:16 +00:00
Mark Dickinson 784a47f2c0 Issue #8825: additional testcases for int(string, 0) and long(string, 0). 2010-05-26 19:06:33 +00:00
Victor Stinner 708c0727f9 Issue #7449: Skip test_socketserver if threading support is disabled 2010-05-26 17:25:28 +00:00
Victor Stinner c49dfcc8dc Issue #3798: Write sys.exit() message to sys.stderr to use stderr encoding and
error handler, instead of writing to the C stderr file in utf-8
2010-05-25 22:30:32 +00:00
Mark Dickinson ecb8316885 Fix a NameError in test_enumerate. 2010-05-25 19:44:49 +00:00
Mark Dickinson 2066559913 Issue #8816: Extra tests for some built-in functions. These tests are
ports of IronPython tests.  Thanks Gregory Nofi.
2010-05-25 19:01:08 +00:00
R. David Murray bfbdefe539 Issue 8143: sync unquote in urlparse with urllib; add comment about doing so.
unquote is duplicated in the two files to avoid a circular reference.
(This is fixed in Python3.)  Updates keep getting made to the public unquote
without fixing the urlparse one, however, so this fix syncs the two
and adds a comment to both to make sure changes are applied to both.
2010-05-25 15:20:46 +00:00
Brian Curtin b64c89bd7a Fix #2810 - handle the case where some registry calls return
ERROR_MORE_DATA, requiring another call to get the remaining data.

Patch by Daniel Stutzbach
2010-05-25 15:06:15 +00:00
Victor Stinner 554a3b82e4 Issue #6662: Fix parsing of malformatted charref (&#bad;) 2010-05-24 21:33:24 +00:00
Georg Brandl f0757a2937 #8016: add the CP858 codec (approved by Benjamin). (Also add CP720 to the tests, it was missing there.) 2010-05-24 21:29:07 +00:00
Steven Bethard dce6e1bd5a Fix default value for version help. Approved by Benjamin on python-dev: http://mail.python.org/pipermail/python-dev/2010-May/100231.html 2010-05-24 03:45:26 +00:00
Benjamin Peterson 36cd75ab8d Merged revisions 80937,81478 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r80937 | benjamin.peterson | 2010-05-07 14:10:58 -0500 (Fri, 07 May 2010) | 1 line

  remove redundant unicode call
........
  r81478 | benjamin.peterson | 2010-05-22 13:47:39 -0500 (Sat, 22 May 2010) | 1 line

  ensure doctests have some future_features
........
2010-05-22 18:52:21 +00:00
Victor Stinner 54b40ee929 Fix my last commit (r81471) about codecs
Rememder: don't touch the code just before a commit
2010-05-22 13:44:25 +00:00
Victor Stinner 7df55dad3b Issue #6268: More bugfixes about BOM, UTF-16 and UTF-32
* Fix seek() method of codecs.open(), don't write the BOM twice after seek(0)
 * Fix reset() method of codecs, UTF-16, UTF-32 and StreamWriter classes
 * test_codecs: use "w+" mode instead of "wt+". "t" mode is not supported by
   Solaris or Windows, but does it really exist? I found it the in the issue.
2010-05-22 13:37:56 +00:00
Georg Brandl a19baf58e6 Underscore the name of an internal utility function. 2010-05-22 11:31:16 +00:00
Georg Brandl 5d0ca2c832 Issue #3924: Ignore cookies with invalid "version" field in cookielib. 2010-05-22 11:29:19 +00:00
Victor Stinner 262be5e70b Issue #6268: Fix seek() method of codecs.open(), don't read the BOM twice
after seek(0)
2010-05-22 02:11:07 +00:00
Victor Stinner d6703b5e38 Issue #5640: Fix Shift-JIS incremental encoder for error handlers different
than strict
2010-05-21 22:50:28 +00:00
Benjamin Peterson 26da187193 simplify and modernize updatecache() 2010-05-21 21:35:44 +00:00