Commit Graph

16016 Commits

Author SHA1 Message Date
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
Benjamin Peterson b9e7c01294 remove debugging rubish 2010-05-21 21:32:49 +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
Stefan Krah 8a6f3fe3b5 Fix typos in docstrings. 2010-05-19 15:46:39 +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
Florent Xicluna af87f9f09f Issue #1285086: Speed up urllib.quote and urllib.unquote for simple cases. 2010-05-17 13:35:09 +00:00
Tarek Ziadé 4fc2a008b8 upgraded distutils docs w.r.t. the manifest regeneration 2010-05-17 10:54:43 +00:00
Florent Xicluna e127e24359 Slight style cleanup. 2010-05-17 10:39:07 +00:00
Tarek Ziadé 422545f0e7 Fixed #8688: Distutils now recalculates MANIFEST everytime. 2010-05-17 10:06:20 +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
Victor Stinner 2b271f7e30 Fix regression introduced by r81154 (Issue #5099, subprocess destructor) 2010-05-14 21:52:26 +00:00
Brett Cannon 42a0ba7b2c subprocess.Popen.__del__ referenced global objects, which is a no-no thanks to
interpreter shutdown semantics. Same issue goes for the methods that __del__
called. Now all the methods capture the global objects it needs as default
values to private parameters (could have stuck them on the class object itself,
but since the objects have nothing directly to do with the class that seemed
wrong).

There is no test as making one that works is hard. This patch was
verified against a consistently failing test in Mercurial's test suite, though,
so it has been tested in some regard.

Closes issue #5099. Thanks to Mary Stern for the bug report and Gabriel
Genellina for writing another patch for the same issue and attempting to write
a test.
2010-05-14 00:21:48 +00:00
Brett Cannon da9af75d5f test_site was failing under darwin for non-framework builds because a test was
assuming framework-specific site-packages directories were being used.
2010-05-13 23:59:41 +00:00
Florent Xicluna b3d0554040 Revert changeset r81150 which helped diagnose issue #8423 on some OS X buildbot. 2010-05-13 23:46:48 +00:00
Florent Xicluna 9cf210f392 Improve test feedback to troubleshoot issue #8423 on OS X. 2010-05-13 21:41:05 +00:00
Florent Xicluna 9ac6114dc9 Better test skipping, with message in the log. 2010-05-13 21:40:01 +00:00
Florent Xicluna 8652f2e83e Revert the additional OS X information (r81140). Keep the endianness information. 2010-05-13 18:16:06 +00:00
Florent Xicluna b7d413f9bc Add sensible information about the OS X platform to diagnose issue #8423:
test_pep277 fails on "x86 Tiger" buildbot but not on "PPC Tiger".
2010-05-13 17:05:29 +00:00
Victor Stinner 37368163bd Fix verb tense in skip message.
Ooops, merge also r80334 (patch by r.david.murray)
2010-05-13 16:22:15 +00:00
Victor Stinner 20c3258bf2 Issue #8422, test_genericpath: skip the creation of a directory with an invalid
UTF name on Mac OS X because the OS deny it (the name have to be a valid UTF8
string).

Merge r80163 from py3k branch.
2010-05-13 16:18:14 +00:00
Senthil Kumaran 81a0450cb5 Fix Issue8657 - adding git and git+ssh as know schemes. 2010-05-13 03:25:21 +00:00
Mark Dickinson 62f7e8b0b8 Fix unused variable in test_factorial. 2010-05-12 19:53:36 +00:00
Giampaolo Rodolà fd25594aa4 Removed the assertion that dispatcher.connected attribute must be False after a single connect() call. Solaris and FreeBSD buildbots failures showed how connect() can succeed even in a single call. All bo failures should definitively be fixed now. 2010-05-12 00:29:27 +00:00
Antoine Pitrou fc3bfad2e0 Issue #8681: Make the zlib module's error messages more informative when
the zlib itself doesn't give any detailed explanation.
2010-05-11 23:42:28 +00:00
Antoine Pitrou 37ffc3e3ba Issue #8672: Add a zlib test ensuring that an incomplete stream can be
handled by a decompressor object without errors (it returns incomplete
uncompressed data).
2010-05-11 23:32:31 +00:00
Michael Foord 72b1977221 Improving help message for python -m unittest. Issue 8303. 2010-05-10 20:21:16 +00:00
Giampaolo Rodolà ff46d6e844 Issue #8490: adds a more solid test suite for asyncore 2010-05-10 15:33:22 +00:00
Michael Foord 53a92eb3c3 Adding a test for unittest.BaseTestSuite. 2010-05-09 09:58:25 +00:00
Mark Dickinson 7000e9e01b Issue #8644: Improve accuracy of timedelta.total_seconds method.
(Backport of r80979 to py3k.)  Thanks Alexander Belopolsky.
2010-05-09 09:30:06 +00:00
Gregory P. Smith 860852fdf4 Revert r81012. buildbot problems and its questionable of me to even
add this to trunk while we're on the way to 2.7rc1.

When fixed this can go into py3k first.  Sorry.
2010-05-09 01:20:20 +00:00
Gregory P. Smith 56fe6569fd Fixes [issue7245] Better Ctrl-C support in pdb. 2010-05-08 23:38:49 +00:00
Jean-Paul Calderone e54ddf1ed2 Skip signal handler re-installation if it is not necessary. Issue 8354. 2010-05-08 20:06:02 +00:00
Benjamin Peterson c251607d59 bump version to 2.7 beta 2 2010-05-08 17:08:17 +00:00
Michael Foord 9c164af6c3 unittest: issue 8301. Adding functions to test suites no longer crashes. 2010-05-08 17:06:25 +00:00
Benjamin Peterson 7daf0e4aa1 update pydoc-topics 2010-05-08 17:05:19 +00:00
Benjamin Peterson f063d15873 run and fix enumerate start test cases #8636 2010-05-08 16:44:52 +00:00
Michael Foord 959c16d7a4 Updating documentation and adding docstrings to unittest.TestCase.assertRegexpMatches and assertNotRegexpMatches. Issue 8038. 2010-05-08 16:40:52 +00:00
Benjamin Peterson 7baf8627bd add underscore 2010-05-08 15:42:29 +00:00
Benjamin Peterson ac896ed177 r80967 introduced a new scheme 2010-05-08 15:41:44 +00:00
Antoine Pitrou dac6aeb43c Revert r80963 - it broke compilation everywhere 2010-05-08 15:23:57 +00:00
Michael Foord 22097e4e66 Issue 7780. Adding a test for unittest test discovery from a dotted path. 2010-05-08 13:20:07 +00:00
Ronald Oussoren 2f88bfdf96 Issue #8084: ensure that the --user directory
conforms to platforms standars on OSX when
using a python framework.
2010-05-08 10:29:06 +00:00
Ronald Oussoren d875d3c36e Fix for issue #7724: make it possible to build using
the OSX 10.4u SDK on MacOSX 10.6 by honoring the specified
SDK when looking for files.
2010-05-08 08:44:37 +00:00
Senthil Kumaran 18e4dd74e0 Fixing the errors trigerred in test_urllib2net. Related to issue8656. 2010-05-08 05:00:11 +00:00
Senthil Kumaran 6057ba1f97 Fix Issue8656 - urllib2 mangles file://-scheme URLs 2010-05-08 03:11:50 +00:00
Michael Foord e6f5e22123 Issue 8547 - detecting and reporting that modules have been imported from the wrong location under test discovery. 2010-05-07 23:39:38 +00:00
Benjamin Peterson 1a0ce685ab revert r80932; it breaks windows 2010-05-07 20:45:07 +00:00
Benjamin Peterson 5dfad9dc9a Merged revisions 79911,79916-79917,80018,80418,80572-80573,80635-80639,80668,80922 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r79911 | benjamin.peterson | 2010-04-09 15:38:53 -0500 (Fri, 09 Apr 2010) | 1 line

  use absolute import
........
  r79916 | benjamin.peterson | 2010-04-09 16:05:21 -0500 (Fri, 09 Apr 2010) | 1 line

  generalize detection of __future__ imports and attach them to the tree
........
  r79917 | benjamin.peterson | 2010-04-09 16:11:44 -0500 (Fri, 09 Apr 2010) | 1 line

  don't try to 'fix' relative imports when absolute_import is enabled #8858
........
  r80018 | benjamin.peterson | 2010-04-12 16:12:12 -0500 (Mon, 12 Apr 2010) | 4 lines

  prevent diffs from being mangled is multiprocess mode #6409

  Patch by George Boutsioukis.
........
  r80418 | benjamin.peterson | 2010-04-23 16:00:03 -0500 (Fri, 23 Apr 2010) | 1 line

  remove unhelpful description
........
  r80572 | benjamin.peterson | 2010-04-27 20:33:54 -0500 (Tue, 27 Apr 2010) | 1 line

  use unicode literals
........
  r80573 | jeffrey.yasskin | 2010-04-27 23:08:27 -0500 (Tue, 27 Apr 2010) | 6 lines

  Don't transform imports that are already relative.  2to3 turned
    from . import refactor
  into
    from .. import refactor
  which broke the transformation of 2to3 itself.
........
  r80635 | benjamin.peterson | 2010-04-29 16:02:23 -0500 (Thu, 29 Apr 2010) | 1 line

  remove imports
........
  r80636 | benjamin.peterson | 2010-04-29 16:02:41 -0500 (Thu, 29 Apr 2010) | 1 line

  unicode literal
........
  r80637 | benjamin.peterson | 2010-04-29 16:03:42 -0500 (Thu, 29 Apr 2010) | 1 line

  must pass a string to Number
........
  r80638 | benjamin.peterson | 2010-04-29 16:05:34 -0500 (Thu, 29 Apr 2010) | 1 line

  unicode literals
........
  r80639 | benjamin.peterson | 2010-04-29 16:06:09 -0500 (Thu, 29 Apr 2010) | 1 line

  pass string to Number
........
  r80668 | jeffrey.yasskin | 2010-04-30 18:02:47 -0500 (Fri, 30 Apr 2010) | 4 lines

  Make 2to3 run under Python 2.5 so that the benchmark suite at
  http://hg.python.org/benchmarks/ can use it and still run on implementations
  that haven't gotten to 2.6 yet.  Fixes issue 8566.
........
  r80922 | benjamin.peterson | 2010-05-07 11:06:25 -0500 (Fri, 07 May 2010) | 1 line

  prevent xrange transformation from wrapping range calls it produces in list
........
2010-05-07 18:58:23 +00:00
Michael Foord ae4dde0858 Issue 8547 - detecting and reporting that modules have been imported from the wrong location under test discovery. 2010-05-07 18:16:19 +00:00
Antoine Pitrou 3843cd8e86 Issue #8571: Fix an internal error when compressing or decompressing a
chunk larger than 1GB with the zlib module's compressor and decompressor
objects.
2010-05-07 16:50:34 +00:00
Michael Foord 4fedbce55a Adding tests for unittest command line handling of buffer, catchbreak and failfast. 2010-05-07 15:52:05 +00:00
Michael Foord 215d394b82 Adding a test for unittest test discovery with dotted path name. 2010-05-07 15:34:08 +00:00
Senthil Kumaran e41bb0bc2c Testsuite for RFC3986 based parsing scenario. Related Issue1462525. 2010-05-07 04:07:29 +00:00
Giampaolo Rodolà e4499a88c2 adds handle_error(self):raise to test modules using asyncore to provide a clearer error message in case something goes wrong 2010-05-06 20:19:32 +00:00
Giampaolo Rodolà 215b6b392d provides a clearer warning message when cheap inheritance with the underlying socket object is used 2010-05-06 19:56:34 +00:00
Giampaolo Rodolà f7454fa98d Fix asyncore issues 8573 and 8483: _strerror might throw ValueError; asyncore.__getattr__ cheap inheritance caused confusing error messages when accessing undefined class attributes; added an alias for __str__ which now is used as a fallback for __repr__ 2010-05-06 17:57:06 +00:00
Antoine Pitrou 1bbb68d37c `self` doesn't exist here 2010-05-06 14:11:23 +00:00
Brian Curtin 11f8b9db79 Fix #7863. Properly identify Windows 7 and Server 2008 R2.
Removed various unused code and added a way to correctly determine
server vs. workstation via the registry.
2010-05-06 02:54:44 +00:00
Mark Dickinson 481ab89b75 Issue #1533: test_range in test_builtin: fix test comment and add test
for rejection of small floats.  Thanks Alexander Belopolsky.
2010-05-05 22:42:51 +00:00
Tarek Ziadé 31a673da52 removed non needed lines 2010-05-05 22:41:25 +00:00
Tarek Ziadé 38f81223ae Fixed #4265: shutil.copyfile() was leaking file descriptors when disk fills 2010-05-05 22:15:31 +00:00
Ronald Oussoren 9545a23c7f In a number of places code still revers
to "sys.platform == 'mac'" and that is
dead code because it refers to a platform
that is no longer supported (and hasn't been
supported for several releases).

Fixes issue #7908 for the trunk.
2010-05-05 19:09:31 +00:00
Antoine Pitrou a8157183b8 Issue #8600: fix test_gdb failures when gdb issues some spurious warnings. 2010-05-05 18:29:02 +00:00
R. David Murray 7d93221a5c Issue #7472: remove unused code from email.encoders.encode_7or8bit.
Yukihiro Nakadaira noticed a typo in encode_7or8bit that was trying
to special case iso-2022 codecs.  It turns out that the code in
question is never used, because whereas it was designed to trigger
if the payload encoding was eight bit but its output encoding was
7 bit, in practice the payload is always converted to the 7bit
encoding before encode_7or8bit is called.  Patch by Shawat Anand.
2010-05-05 17:31:03 +00:00
Barry Warsaw 43ad706ef4 Bug 7755: audiotest.au is arguably copyrighted material, but definitely makes
Debian unhappy.  The actual contents of the audio clip are unimportant, so
replace it with something that we know is okay.  Guido likes woodpeckers.
2010-05-05 16:15:09 +00:00
Ronald Oussoren 91165c0b42 Force exit using os._exit instead of sys.exit,
this makes sure that the child does not continue
testing.
2010-05-05 15:32:39 +00:00
Ronald Oussoren 3320696371 The C function used by uuid.uuid4 is broken on
OSX 10.6 in that after os.fork() the parent and
child generate the same sequence of UUIDs.

This patch falls back to the the Python implementation
on OSX 10.6 or later.

Fixes issue #8621.
2010-05-05 14:48:37 +00:00
Victor Stinner 926fd4ee32 Issue #8313: traceback.format_exception_only() encodes unicode message to
ASCII with backslashreplace error handler if str(value) failed
2010-05-05 12:40:49 +00:00
Mark Dickinson 3b0b4ff19e Fix test_gzip failure on OS X. The failure was a result of trying to fflush
a file that wasn't open for writing.  Patch by Antoine Pitrou.
2010-05-04 18:45:27 +00:00
Thomas Heller 06a7e2069a On Windows, ctypes does no longer check the stack before and after
calling a foreign function.  This allows to use the unmodified libffi
library.

Remove most files from _ctypes/libffi_msvc, only two include files
stay (updated from _ctypes/libffi/...).  Other files are used in the
cross-platform _ctypes/libffi directory.
2010-05-04 18:44:42 +00:00
Mark Dickinson a8d2668818 Issue #1533: fix inconsistency in range function argument processing:
any non-float non-integer argument is now converted to an integer (if
possible) using its __int__ method.  Previously, only small arguments
were treated this way; larger arguments (those whose __int__ was
outside the range of a C long) would produce a TypeError.

Patch by Alexander Belopolsky (with minor modifications).
2010-05-04 16:18:25 +00:00
Mark Dickinson 4f96f5ffc6 Issue #8567: Fix incorrect precedence of signals in Decimal module.
When a Decimal operation raises multiple signals and more than one of
those signals is trapped, the specification determines the order in
which the signals should be handled.  In many cases this order wasn't
being followed, leading to the wrong Python exception being raised.
This commit fixes those cases, and adds extra tests.  The tests are
only enabled when EXTENDEDERRORTESTS is True, since they involve
rerunning each Decimal testcase several times.
2010-05-04 14:25:50 +00:00
Victor Stinner 7120219918 _pyio: Fix TextIOWrapper constructor: os has no device_encoding() function
_io module doesn't call this function which was introduced in Python3.
2010-05-04 11:35:36 +00:00
Alexandre Vassalotti 268e4872d3 Issue #8404: Fix set operations on dictionary views. 2010-05-04 03:21:51 +00:00
Antoine Pitrou f7fd8e4c94 Issue #7865: The close() method of :mod:`io` objects should not swallow
exceptions raised by the implicit flush().  Also ensure that calling
close() several times is supported.  Patch by Pascal Chambon.
2010-05-03 16:25:33 +00:00
Vinay Sajip 27a1370ae0 Issue #8576: logging updated to remove usage of find_unused_port(). 2010-05-03 15:11:53 +00:00
Michael Foord f9ffccea56 Fix unittest tests to not abuse traceback.format_exception 2010-05-02 20:39:42 +00:00
Ronald Oussoren b0153cf7ac Small update to r80698 to ensure that webbrowser.open
uses the default browser.
2010-05-02 09:55:57 +00:00
Ronald Oussoren 4ef1c7e7ef For for issue #7192: with this patch webbrowser.get("firefox")
works on OSX
2010-05-02 09:48:21 +00:00
Antoine Pitrou 8651810df9 Remove duplicate test 2010-05-01 20:26:58 +00:00
Mark Dickinson 16cd2bea1d Fix incorrect use of a list as the target of an 'except' clause in test_decimal.py. 2010-05-01 11:46:20 +00:00
Senthil Kumaran 1b7f9e53b3 Fix issue8582: urllib.urlretrieve fails with ValueError: Invalid format string 2010-05-01 08:01:56 +00:00
Antoine Pitrou 54f9f83e5c Issue #8576: Remove use of find_unused_port() in test_smtplib and
test_multiprocessing.  Patch by Paul Moore.
2010-04-30 23:08:48 +00:00
Tarek Ziadé a5cd18275e Fixed #8577. distutils.sysconfig.get_python_inc() now differenciates buildir and srcdir 2010-04-30 12:15:12 +00:00
Andrew M. Kuchling ba88b7f23b Always add space after RFC; reword paragraph 2010-04-30 00:49:09 +00:00
Lars Gustäbel 5c4c4619b0 Issue #8464: tarfile.open(name, mode="w|") no longer creates
files with execute permissions set.
2010-04-29 15:23:38 +00:00
Antoine Pitrou 3945c867d6 Fix style issues in test_ssl 2010-04-28 21:11:01 +00:00
Senthil Kumaran ed9204346e Fixed Issue6312 - httplib fails with HEAD requests to pages with "transfer-encoding: chunked" 2010-04-28 17:20:43 +00:00
Nick Coghlan dfb45dfd04 Issue 7490: make IGNORE_EXCEPTION_DETAIL also ignore details of the module containing the exception under test (original patch by Lennart Regebro) 2010-04-28 14:29:06 +00:00
Victor Stinner 6a10281d33 Issue #7449, last part (11): fix many tests if thread support is disabled
* Use try/except ImportError or test_support.import_module() to import thread
   and threading modules
 * Add @unittest.skipUnless(threading, ...) to testcases using threads
2010-04-27 23:55:59 +00:00
Victor Stinner c73a05f775 Issue #7449, part 10: test_cmd imports trace module using test_support.import_module()
Use test_support.import_module() instead of import to raise a SkipTest
exception if the import fail. Import trace fails if the threading module is
missing.

See also part 3: test_doctest: import trace module in test_coverage().
2010-04-27 23:51:16 +00:00
Victor Stinner 47c884129d Partial revert of r80556 (Issue #7449, part 5, fix ctypes test)
Rewrite r80556: the thread test have to be executed just after the test on
libc_open() and so the test cannot be splitted in two functions (without
duplicating code, and I don't want to duplicate code).
2010-04-27 23:33:58 +00:00
Victor Stinner a44b5a3326 Issue #7449, part 9: fix test_xmlrpclib for missing threading module
* Skip testcases using threads if threading module is missing
 * Use "http://" instead of URL in ServerProxyTestCase if threading is missing
   because URL is not set in this case
2010-04-27 23:14:58 +00:00
Victor Stinner 09227b9111 Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing
TestFifo can be executed without the threading module
2010-04-27 23:03:16 +00:00
Victor Stinner be595d336c Issue #7449, part 7: simplify threading detection in test_capi
* Skip TestPendingCalls if threading module is missing
 * Test if threading module is present or not, instead of test the presence of
   _testcapi._test_thread_state
2010-04-27 23:01:29 +00:00
Victor Stinner fd8ea99275 Issue #7449, part 6: fix test_hashlib for missing threading module
Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing().
2010-04-27 22:59:35 +00:00
Antoine Pitrou 4c7bcf1194 Issue #8086: In :func:`ssl.DER_cert_to_PEM_cert()`, fix missing newline
before the certificate footer.  Patch by Kyle VanderBeek.
2010-04-27 22:03:37 +00:00
Victor Stinner 9751472001 Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py
* Split Test.test_open() in 2 functions: test_open() and test_thread_open()
 * Skip test_open() and test_thread_open() if we are unable to find the C
   library
 * Skip test_thread_open() if thread support is disabled
 * Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError()
2010-04-27 22:01:24 +00:00
Victor Stinner 613b4cf283 Issue #7449, part 4: skip test_multiprocessing if thread support is disabled
import threading after _multiprocessing to raise a more revelant error message:
"No module named _multiprocessing". _multiprocessing is not compiled without
thread support.
2010-04-27 21:56:26 +00:00
Victor Stinner edb9f873cf Issue #7449 part 3, test_doctest: import trace module in test_coverage()
Import trace module fail if the threading module is missing. test_coverage() is
only used if test_doctest.py is used with the -c option. This commit allows to
execute the test suite without thread support.

Move "import trace" in test_coverage() and use
test_support.import_module('trace').
2010-04-27 21:51:26 +00:00
Victor Stinner 1b4a69d79b Issue #7449, part 2: regrtest.py -j option requires thread support 2010-04-27 21:47:01 +00:00
Victor Stinner d9d147b806 Issue #7449, part 1: fix test_support.py for Python compiled without thread 2010-04-27 21:46:03 +00:00
Benjamin Peterson ae9f8bd2f9 correct signature 2010-04-27 21:19:06 +00:00
Benjamin Peterson 27737259b4 condense import 2010-04-27 21:18:30 +00:00
Benjamin Peterson fed4abcc84 fold __future__ imports 2010-04-27 21:17:22 +00:00
Benjamin Peterson 5e9cc5efed fix comment 2010-04-27 21:15:28 +00:00