Commit Graph

6895 Commits

Author SHA1 Message Date
Mark Dickinson 40228912c8 Fix possible undefined behaviour from signed overflow in struct module.
Backport of revisions 81897, 81898 and 81902 from py3k.
2010-06-11 20:27:05 +00:00
Benjamin Peterson eabdeba25e use unicode literals 2010-06-07 22:33:09 +00:00
Benjamin Peterson 13e934acc0 correctly overflow when indexes are too large 2010-06-07 22:23:23 +00:00
Ezio Melotti 0b41707dde Silence deprecation warning in test___all__ caused by an import bsddb. 2010-06-07 22:00:18 +00:00
Ezio Melotti 62c3c79426 Replace deprecated fail* methods with the equivalent assert* ones. 2010-06-05 22:28:10 +00:00
Ezio Melotti ab2eb0ee84 Add a NEWS entry for r81758 and clarify a comment. 2010-06-05 19:21:32 +00:00
Ezio Melotti e57e50c8e7 Update PyUnicode_DecodeUTF8 from RFC 2279 to RFC 3629.
1) #8271: when a byte sequence is invalid, only the start byte and all the
   valid continuation bytes are now replaced by U+FFFD, instead of replacing
   the number of bytes specified by the start byte.
   See http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf (pages 94-95);
2) 5- and 6-bytes-long UTF-8 sequences are now considered invalid (no changes
   in behavior);
3) Add code and tests to reject surrogates (U+D800-U+DFFF) as defined in
   RFC 3629, but leave it commented out since it's not backward compatible;
4) Change the error messages "unexpected code byte" to "invalid start byte"
   and "invalid data" to "invalid continuation byte";
5) Add an extensive set of tests in test_unicode;
6) Fix test_codeccallbacks because it was failing after this change.
2010-06-05 17:51:07 +00:00
Mark Dickinson ec27d91741 Fix test_py3kwarn not to test for __cmp__-related DeprecationWarning. 2010-06-05 13:18:33 +00:00
Mark Dickinson 23f0d6b57b Issue #8627: remove out-of-date warning about overriding __cmp__ 2010-06-05 11:52:24 +00:00
Benjamin Peterson 2aa6c38237 properly lookup the __format__ special method 2010-06-05 00:32:50 +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
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
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
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
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
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
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 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 266e454866 ensure the last line has a trailing newline #8782 2010-05-21 21:31:24 +00:00
Benjamin Peterson bd289dae35 fix name 2010-05-21 21:17:22 +00:00
Benjamin Peterson 6722ac2f00 use addCleanup 2010-05-21 21:16:12 +00:00
Benjamin Peterson eb318d3b16 return NotImplemented from Mapping when comparing to a non-mapping #8729 2010-05-21 20:51:45 +00:00
Brett Cannon eb3cd301ae Turned out that if you used explicit relative import syntax
(e.g. from .os import sep) and it failed, import would still try the implicit
relative import semantics of an absolute import (from os import sep). That's
not right, so when level is negative, only do explicit relative import
semantics.

Fixes issue #7902. Thanks to Meador Inge for the patch.
2010-05-20 18:37:55 +00:00
Victor Stinner b1556c537d libpython.py: fix support of non-BMP unicode characters
Forward port some code from Python3:

 * join surrogate pairs if sizeof(Py_UNICODE)==2
 * Enable non-BMP test on narrow builds using u"\U0001D121" instead of
   unichr(0x1D121)
2010-05-20 11:29:45 +00:00
Tarek Ziadé 8f692275e9 #8759: Fixed user paths in sysconfig for posix and os2 schemes 2010-05-19 22:20:14 +00:00
Giampaolo Rodolà e3a84e857f Fix issue #8573 (asyncore._strerror bug): fixed os.strerror typo; included NameError in the tuple of expected exception; added test case for asyncore._strerror. 2010-05-18 20:04:31 +00:00
Antoine Pitrou 83137c2e16 Issue #7079: Fix a possible crash when closing a file object while using
it from another thread.  Patch by Daniel Stutzbach.
2010-05-17 19:56:59 +00:00
Victor Stinner 8a470d6039 Use with open() as fo: ... instead of try: fo = open(...) finally: fo.close()
fo is not set if the open() fails.
2010-05-16 00:34:40 +00:00
Benjamin Peterson 5b5134b8d1 use TestCase skip method 2010-05-15 17:48:55 +00:00
Stefan Krah 7622eba757 If the timeout is exceeded, count the tests as skipped instead of just
issuing a warning.
2010-05-15 09:31:08 +00:00