Commit Graph

6370 Commits

Author SHA1 Message Date
Mark Dickinson a123631a5c Fix a performance issue in Decimal.pow. Thanks Stefan Krah for finding this. 2010-07-08 19:03:34 +00:00
Antoine Pitrou f48ea7c2a9 Issue #8605: Skip test_gdb if Python is compiled with optimizations. 2010-07-08 18:51:30 +00:00
Mark Dickinson 247900ce47 In test_decimal, convert heuristic for skipping tests into an explicit skiplist. 2010-07-08 17:23:40 +00:00
Benjamin Peterson 6ef08a0ebe ValueError in this case is also acceptable 2010-07-07 22:45:06 +00:00
Benjamin Peterson de73c4587f don't ignore exceptions from PyObject_IsTrue 2010-07-07 18:54:59 +00:00
Benjamin Peterson c937dc2ccb this needn't be in the loop 2010-07-07 18:44:05 +00:00
Mark Dickinson be64d95169 Issue #9186: log1p(-1.0) should raise ValueError, not OverflowError. 2010-07-07 16:21:29 +00:00
Alexander Belopolsky a11d8c03a4 Issue #9000: datetime.timezone objects now have eval-friendly repr. 2010-07-06 23:19:45 +00:00
Brett Cannon c84dc9d018 Fix test_xmlrpc_net to no longer fail since there are no more buildbots for trunk. 2010-07-05 22:11:16 +00:00
Alexander Belopolsky d87e932f51 Added two more test cases for datetime 2010-07-05 17:57:31 +00:00
Benjamin Peterson 97c694b90b looking up on the type is correct, so this isn't an XXX 2010-07-05 17:11:05 +00:00
Alexander Belopolsky f34e82ef49 Added more tests for utctimetuple() 2010-07-05 15:05:33 +00:00
Benjamin Peterson 335d2c757d pydoc still has a silly encoding 2010-07-05 14:59:40 +00:00
Mark Dickinson feb3b75818 Issue #9130: Validate ellipsis tokens in relative imports. 2010-07-04 18:38:57 +00:00
Mark Dickinson 3445b482b3 Fix symbol numbers in test_parser test. 2010-07-04 18:15:26 +00:00
Mark Dickinson 2cc8a5e490 Issue #9130: Fix validation of relative imports in parser module. 2010-07-04 18:11:51 +00:00
Mark Dickinson 2bd61a988f Issue #9128: Fix validation of class decorators in parser module. 2010-07-04 16:37:31 +00:00
Brett Cannon 61b14251d3 Make importlib.abc.SourceLoader the primary mechanism for importlib.
This required moving the class from importlib/abc.py into
importlib/_bootstrap.py and jiggering some code to work better with the class.
This included changing how the file finder worked to better meet import
semantics. This also led to fixing importlib to handle the empty string from
sys.path as import currently does (and making me wish we didn't support that
instead just required people to insert '.' instead to represent cwd).

It also required making the new set_data abstractmethod create
any needed subdirectories implicitly thanks to __pycache__ (it was either this
or grow the SourceLoader ABC to gain an 'exists' method and either a mkdir
method or have set_data with no data arg mean to create a directory).

Lastly, as an optimization the file loaders cache the file path where the
finder found something to use for loading (this is thanks to having a
sourceless loader separate from the source loader to simplify the code and
cut out stat calls).
Unfortunately test_runpy assumed a loader would always work for a module, even
if you changed from underneath it what it was expected to work with. By simply
dropping the previous loader in test_runpy so the proper loader can be returned
by the finder fixed the failure.

At this point importlib deviates from import on two points:

1. The exception raised when trying to import a file is different (import does
an explicit file check to print a special message, importlib just says the path
cannot be imported as if it was just some module name).

2. the co_filename on a code object is not being set to where bytecode was
actually loaded from instead of where the marshalled code object originally
came from (a solution for this has already been agreed upon on python-dev but has
not been implemented yet; issue8611).
2010-07-03 21:48:25 +00:00
Senthil Kumaran df022da3d8 Fix Issue5468 - urlencode to handle bytes and other alternate encodings.
(Extensive tests provided). Patch by Dan Mahn.
2010-07-03 17:48:22 +00:00
Victor Stinner bc5c54bca2 Merged revisions 82492 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82492 | victor.stinner | 2010-07-03 15:36:19 +0200 (sam., 03 juil. 2010) | 3 lines

  Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
  ensure that the input string length is a multiple of the frame size
........
2010-07-03 13:44:22 +00:00
Nick Coghlan 5c8b54eb04 Issue 6507: accept source strings directly in dis.dis(). Original patch by Daniel Urban 2010-07-03 07:36:51 +00:00
Brett Cannon 2cab50b937 Make test_import a little bit more robust for cleaning up after itself in the
face of a failure.
2010-07-03 01:32:48 +00:00
Benjamin Peterson e401c6842a Merged revisions 82461 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82461 | benjamin.peterson | 2010-07-02 18:05:27 -0500 (Fri, 02 Jul 2010) | 1 line

  don't require the presence of __getformat__ or __setformat__; use requires_IEEE_754 globally
........
2010-07-02 23:25:44 +00:00
Benjamin Peterson f751bc9c01 fix lookup of __ceil__ 2010-07-02 13:46:42 +00:00
Benjamin Peterson 8bb9cde6c0 correctly lookup __trunc__ and __floor__ 2010-07-01 15:16:55 +00:00
Ezio Melotti 57221d02ba 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) Change the error messages "unexpected code byte" to "invalid start byte"
   and "invalid data" to "invalid continuation byte";
4) Add an extensive set of tests in test_unicode;
5) Fix test_codeccallbacks because it was failing after this change.
2010-07-01 07:32:02 +00:00
Benjamin Peterson 1cc6df97bc Merged revisions 82403 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82403 | benjamin.peterson | 2010-06-30 12:11:08 -0500 (Wed, 30 Jun 2010) | 1 line

  mark test depending on ref counting
........
2010-06-30 17:39:45 +00:00
Michael Foord b3a8984488 Issue 9110. Adding ContextDecorator to contextlib. This enables the creation of APIs that act as decorators as well as context managers. contextlib.contextmanager changed to use ContextDecorator. 2010-06-30 12:17:50 +00:00
Mark Dickinson 50b79a80bd Issue #9011: Tests for Python 3.2's treatment of negated imaginary literals. 2010-06-30 11:13:36 +00:00
Mark Dickinson 3c0b317e36 Merged revisions 82356 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82356 | mark.dickinson | 2010-06-29 08:37:25 +0100 (Tue, 29 Jun 2010) | 1 line

  Spelling.
........
2010-06-29 07:38:37 +00:00
Benjamin Peterson 902d2bd64d Merged revisions 82332 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82332 | benjamin.peterson | 2010-06-28 10:41:06 -0500 (Mon, 28 Jun 2010) | 1 line

  fix skipping condition
........
2010-06-28 15:43:25 +00:00
Benjamin Peterson 17e0bbc30c Merged revisions 82330 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82330 | benjamin.peterson | 2010-06-28 10:36:40 -0500 (Mon, 28 Jun 2010) | 1 line

  testcapi tests are definitely cpython only
........
2010-06-28 15:39:55 +00:00
Benjamin Peterson 02d7806a81 Merged revisions 82303 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82303 | benjamin.peterson | 2010-06-27 17:40:26 -0500 (Sun, 27 Jun 2010) | 1 line

  mark tracking tests as implementation details
........
2010-06-27 22:44:51 +00:00
Benjamin Peterson 5a6214afe2 Merged revisions 81499,81506 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81499 | georg.brandl | 2010-05-24 16:29:07 -0500 (Mon, 24 May 2010) | 1 line

  #8016: add the CP858 codec (approved by Benjamin).  (Also add CP720 to the tests, it was missing there.)
........
  r81506 | benjamin.peterson | 2010-05-24 17:04:53 -0500 (Mon, 24 May 2010) | 1 line

  set svn:eol-style
........
2010-06-27 22:41:29 +00:00
Benjamin Peterson 556d8001df Merged revisions 81380 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81380 | brett.cannon | 2010-05-20 13:37:55 -0500 (Thu, 20 May 2010) | 8 lines

  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-06-27 22:37:28 +00:00
Benjamin Peterson 3e5cd1d04e Merged revisions 81465-81466,81468,81679,81735,81760,81868,82183 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81465 | georg.brandl | 2010-05-22 06:29:19 -0500 (Sat, 22 May 2010) | 2 lines

  Issue #3924: Ignore cookies with invalid "version" field in cookielib.
........
  r81466 | georg.brandl | 2010-05-22 06:31:16 -0500 (Sat, 22 May 2010) | 1 line

  Underscore the name of an internal utility function.
........
  r81468 | georg.brandl | 2010-05-22 06:43:25 -0500 (Sat, 22 May 2010) | 1 line

  #8635: document enumerate() start parameter in docstring.
........
  r81679 | benjamin.peterson | 2010-06-03 16:21:03 -0500 (Thu, 03 Jun 2010) | 1 line

  use a set for membership testing
........
  r81735 | michael.foord | 2010-06-05 06:46:59 -0500 (Sat, 05 Jun 2010) | 1 line

  Extract error message truncating into a method (unittest.TestCase._truncateMessage).
........
  r81760 | michael.foord | 2010-06-05 14:38:42 -0500 (Sat, 05 Jun 2010) | 1 line

  Issue 8302. SkipTest exception is setUpClass or setUpModule is now reported as a skip rather than an error.
........
  r81868 | benjamin.peterson | 2010-06-09 14:45:04 -0500 (Wed, 09 Jun 2010) | 1 line

  fix code formatting
........
  r82183 | benjamin.peterson | 2010-06-23 15:29:26 -0500 (Wed, 23 Jun 2010) | 1 line

  cpython only gc tests
........
2010-06-27 21:45:24 +00:00
Benjamin Peterson a82addb5f3 Merged revisions 80712,81651 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80712 | vinay.sajip | 2010-05-03 10:11:53 -0500 (Mon, 03 May 2010) | 1 line

  Issue #8576: logging updated to remove usage of find_unused_port().
........
  r81651 | vinay.sajip | 2010-06-02 05:05:31 -0500 (Wed, 02 Jun 2010) | 1 line

  Logging: improved error reporting for BaseConfigurator.resolve().
........
2010-06-27 20:54:28 +00:00
R. David Murray 76af40296e Merged revisions 82242 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82242 | r.david.murray | 2010-06-25 23:27:32 -0400 (Fri, 25 Jun 2010) | 2 lines

  Fix indentation in recently added test.
........
2010-06-26 03:34:33 +00:00
R. David Murray 809726954c Merged revisions 82233 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82233 | r.david.murray | 2010-06-25 20:06:44 -0400 (Fri, 25 Jun 2010) | 2 lines

  #4640: add a test to optparse that proves issue is invalid.
........
2010-06-26 00:17:12 +00:00
Benjamin Peterson 4fd283a4fe fix typos 2010-06-25 23:24:35 +00:00
Benjamin Peterson c7a7d406c8 Merged revisions 82229 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82229 | benjamin.peterson | 2010-06-25 17:58:47 -0500 (Fri, 25 Jun 2010) | 1 line

  mark implementation detail as such
........
2010-06-25 23:02:11 +00:00
Benjamin Peterson 6e4c68ed7e Merged revisions 82225 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82225 | benjamin.peterson | 2010-06-25 15:34:01 -0500 (Fri, 25 Jun 2010) | 1 line

  mark implementation detail as such
........
2010-06-25 20:37:22 +00:00
Benjamin Peterson 88968ad380 only take into account positional arguments count in related error messages 2010-06-25 19:30:21 +00:00
Ezio Melotti 5a3ef5b22a #9018: os.path.normcase() now raises a TypeError if the argument is not str or bytes. 2010-06-25 10:56:11 +00:00
Victor Stinner 25e8ec4724 Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
"w*" format instead. Add tests for "w*" format.
2010-06-25 00:02:38 +00:00
Victor Stinner 3c9e6e9375 PyArg_Parse*() functions: factorize code for s/z and u/Z formats 2010-06-24 22:31:12 +00:00
Victor Stinner 4aae1ebab2 Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
objects, as described in the documentation.
2010-06-24 22:08:25 +00:00
Benjamin Peterson 1b1a1a4bce Merged revisions 82189 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82189 | benjamin.peterson | 2010-06-23 19:12:40 -0500 (Wed, 23 Jun 2010) | 1 line

  prevent assignment to set literals
........
2010-06-24 00:17:03 +00:00
Alexander Belopolsky 5e307de6e0 Added more test cases 2010-06-23 22:58:49 +00:00
Alexander Belopolsky 33b94c9fa9 Test future pickle protocols. Thanks Antoine Pitrou for suggestion. 2010-06-23 22:29:48 +00:00
Alexander Belopolsky 1b7046b99e Issue #9051: Instances of timezone class can now be pickled. 2010-06-23 21:40:15 +00:00
Benjamin Peterson 945c579829 Merged revisions 82167 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82167 | benjamin.peterson | 2010-06-22 15:32:02 -0500 (Tue, 22 Jun 2010) | 1 line

  mark ref counting as impl detail
........
2010-06-22 20:34:34 +00:00
Benjamin Peterson 1fa17e65a3 Merged revisions 82165 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82165 | benjamin.peterson | 2010-06-22 15:26:20 -0500 (Tue, 22 Jun 2010) | 1 line

  must force gc here
........
2010-06-22 20:29:32 +00:00
Alexander Belopolsky 1b40292592 Added more test cases 2010-06-22 14:07:33 +00:00
Alexander Belopolsky 75f94c210a Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000. 2010-06-21 15:21:14 +00:00
Mark Dickinson 6ded1d5687 Merged revisions 82117 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82117 | mark.dickinson | 2010-06-20 19:50:19 +0100 (Sun, 20 Jun 2010) | 1 line

  Merge test_strtod and test_float string-to-float conversion tests.
........
2010-06-20 20:01:04 +00:00
Jean-Paul Calderone 6ed7ac48ec Revert r82089. Commit was intended for a branch. 2010-06-19 19:58:37 +00:00
Jean-Paul Calderone 867c435460 merge forward from the python 2.x branch 2010-06-19 19:54:48 +00:00
Jean-Paul Calderone 1ddd4075bf Merged revisions 82075 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82075 | jean-paul.calderone | 2010-06-18 16:00:17 -0400 (Fri, 18 Jun 2010) | 12 lines

  Revert r60115

  This revision introduced quoting for strings containing | based
  on a misunderstanding of the commonly used quoting rules used
  on Windows.

  | is interpreted by cmd.exe, not by the MS C runtime argv initializer.
  It only needs to be quoted if it is part of an argument passed through
  cmd.exe.

  See issue1300, issue7839, and issue8972.
........
2010-06-18 20:03:54 +00:00
Alexander Belopolsky f568218e7e Issue #6641: Original commit for this issue, r82053, introduced a
regression making datetime subclass' strptime return datetime rather
than subclass instances.  Fixed this bug and a few typos.
2010-06-18 18:44:37 +00:00
Alexander Belopolsky ca94f55758 Issue #6641: The datetime.strptime method now supports the %z directive. 2010-06-17 18:30:34 +00:00
R. David Murray 4155f97699 Don't use os.normcase when the result we are expecting is None.
This worked fine on linux but fails on Windows.  That may or may
not be a but in normcase.
2010-06-17 13:23:18 +00:00
Mark Dickinson d35a32e12e Issue #9011: Remove buggy and unnecessary ST->AST compilation code
dealing with unary minus applied to a constant.  The removed code was
mutating the ST, causing a second compilation to fail.  (The peephole
optimizer already takes care of optimizing this case, so there's no
lost optimization opportunity here.)
2010-06-17 12:33:22 +00:00
R. David Murray a1b3740d04 Merged revisions 82039 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82039 | r.david.murray | 2010-06-16 21:36:52 -0400 (Wed, 16 Jun 2010) | 10 lines

  #8720: fix inspect regression by teaching getsourcefile about linecache.

  The fix for issue 4050 caused a regression:  before that fix, source
  lines in the linecache would eventually be found by inspect.  After the
  fix inspect reports an error earlier, and the source isn't found.
  The fix for the fix is to have getsourcefile look in the linecache for
  the file and return the psuedo-filename if the source is there, just as
  it already returns it if there is a PEP 302 loader.
........
2010-06-17 02:04:29 +00:00
Victor Stinner 554f3f0081 Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
mode raises unicode errors. The encoder only supports "strict" and "replace"
error handlers, the decoder only supports "strict" and "ignore" error handlers.
2010-06-16 23:33:54 +00:00
Alexander Belopolsky 05cc2030e5 Minor changes to the choice of assert methods 2010-06-15 18:40:23 +00:00
Brett Cannon 4507190a1e Switch the __import__ state check from using __builtins__ to builtins to be
nicer to other VMs.

Thanks to Philip Jenvey for the pointer.
2010-06-14 22:22:54 +00:00
Alexander Belopolsky 43ca710a44 Issue 6280: Tests and simpler implementation for calendar.timegm 2010-06-14 17:32:03 +00:00
Alexander Belopolsky 4e749a1113 Issue #5094: The ``datetime`` module now has a simple concrete class
implementing ``datetime.tzinfo`` interface.
2010-06-14 14:15:50 +00:00
Victor Stinner 06e49dd029 Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
formats if the string contains a null byte/character. Write unit tests for
string formats.
2010-06-13 18:21:50 +00:00
Mark Dickinson bcdf9da265 Merged revisions 81967 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81967 | mark.dickinson | 2010-06-13 11:50:29 +0100 (Sun, 13 Jun 2010) | 4 lines

  Issue #8986: erfc was raising OverflowError on Linux for arguments in
  the (approximate) range (-27.3, 30.0), as a result of an escaped errno
  value.
........
2010-06-13 10:52:38 +00:00
Nick Coghlan 5e76e94fd4 Merged revisions 80578 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80578 | nick.coghlan | 2010-04-29 00:29:06 +1000 (Thu, 29 Apr 2010) | 1 line

  Issue 7490: make IGNORE_EXCEPTION_DETAIL also ignore details of the module containing the exception under test (original patch by Lennart Regebro)
........
2010-06-12 13:42:46 +00:00
Brett Cannon 5976d975f8 When dealing with __import__ for detecting a global state change made by a
test, make sure to check if __builtins__ is a dict or not.

Discovered when running importlib.test.regrtest.
2010-06-12 00:38:29 +00:00
Victor Stinner 313a120ab6 Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
filenames and enable os.fsencode().
2010-06-11 23:56:51 +00:00
Victor Stinner 9a45a6b1c2 Issue #8965: Write more tests for sys.getfilesystemencoding() 2010-06-11 23:06:13 +00:00
Victor Stinner 2690461a9e Issue #8965: Add a regression test to test_sys with LANG=C 2010-06-11 22:17:52 +00:00
Antoine Pitrou cc0cfd3576 Merged revisions 81907 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81907 | antoine.pitrou | 2010-06-11 23:42:26 +0200 (ven., 11 juin 2010) | 5 lines

  Issue #8941: decoding big endian UTF-32 data in UCS-2 builds could crash
  the interpreter with characters outside the Basic Multilingual Plane
  (higher than 0x10000).
........
2010-06-11 21:46:32 +00:00
Mark Dickinson b72e6860d8 Fix more undefined-behaviour inducing overflow checks in struct module. 2010-06-11 19:50:30 +00:00
Mark Dickinson ab4096f2f9 Avoid possible undefined behaviour from signed overflow. 2010-06-11 16:56:34 +00:00
Alexander Belopolsky 177e8530cb Issue #3129: Trailing digits in format string are no longer ignored. 2010-06-11 16:04:59 +00:00
Mark Dickinson 08ade6faa0 Issue #8188: Comparisons between Decimal objects and other numeric
objects (Fraction, float, complex, int) now all function as expected.
2010-06-11 10:44:52 +00:00
Victor Stinner 1286d7f060 test_sys: add a test on the file system encoding for darwin 2010-06-11 00:41:41 +00:00
Mark Dickinson c73013127b Issue #8950: Make PyArg_Parse* with 'L' code raise for float inputs,
instead of warning.  This makes it consistent with the other integer
codes.
2010-06-10 16:05:10 +00:00
Stefan Krah 0ca4624e8a Issue #8932: Skip required when compiled --without-threads. 2010-06-09 08:56:28 +00:00
Kristján Valur Jónsson 17173cfe7b http://bugs.python.org/issue8832
Issue minidom.unlink with a context manager
2010-06-09 08:13:42 +00:00
Victor Stinner 3dcb5acdb0 Issue #8838, #8339: Remove codecs.charbuffer_encode() and "t#" parsing format
Remove last references to the "char buffer" of the buffer protocol from
Python3.
2010-06-08 22:54:19 +00:00
R. David Murray a59bfb3c7d Now that sunau has some tests, remove it from test_sundry. 2010-06-08 14:41:45 +00:00
Stefan Krah 095b273afc 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-08 13:41:44 +00:00
Benjamin Peterson 59a1b2f732 Merged revisions 81820 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81820 | benjamin.peterson | 2010-06-07 17:23:23 -0500 (Mon, 07 Jun 2010) | 1 line

  correctly overflow when indexes are too large
........
2010-06-07 22:31:26 +00:00
Victor Stinner 7f3652e371 Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
Thomas Jollans.
2010-06-07 20:14:04 +00:00
Benjamin Peterson da2cf04c28 Merged revisions 81706-81707 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81706 | benjamin.peterson | 2010-06-04 19:32:50 -0500 (Fri, 04 Jun 2010) | 1 line

  properly lookup the __format__ special method
........
  r81707 | benjamin.peterson | 2010-06-04 19:38:22 -0500 (Fri, 04 Jun 2010) | 1 line

  remove PyType_Ready call; float should be initialized in interpreter startup
........
2010-06-05 00:45:37 +00:00
Martin v. Löwis 2d5157eb91 Merged revisions 81701 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81701 | martin.v.loewis | 2010-06-04 21:39:07 +0200 (Fr, 04 Jun 2010) | 2 lines

  Issue #6470: Drop UNC prefix in FixTk.py
  Patch by Christop Gohlke and Amaury Forgeot d'Arc.
........
2010-06-04 19:50:26 +00:00
Senthil Kumaran 0b99883547 Merged revisions 81691 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81691 | senthil.kumaran | 2010-06-04 22:47:09 +0530 (Fri, 04 Jun 2010) | 3 lines

  test verifying the resp object is closed for HEAD response.
........
2010-06-04 17:27:11 +00:00
Lars Gustäbel 1b51272b1b Merged revisions 81667 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81667 | lars.gustaebel | 2010-06-03 14:34:14 +0200 (Thu, 03 Jun 2010) | 8 lines

  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:45:16 +00:00
Lars Gustäbel 2470ff19e6 Merged revisions 81663 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81663 | lars.gustaebel | 2010-06-03 11:56:22 +0200 (Thu, 03 Jun 2010) | 4 lines

  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 10:11:52 +00:00
Brian Curtin ae16af2f40 Merged revisions 81640 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81640 | brian.curtin | 2010-06-01 08:29:13 -0500 (Tue, 01 Jun 2010) | 3 lines

  Fix #8618. Ask the Windows mixer API if there are any playback devices
  configured before attempting to test PlaySound.
........
2010-06-01 13:49:19 +00:00
Senthil Kumaran f4998acb5a Merged revisions 81636 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81636 | senthil.kumaran | 2010-06-01 18:10:07 +0530 (Tue, 01 Jun 2010) | 3 lines

  Fix Issue8797 - urllib2 basic authentication fix for wrong passwords. It fails after 5 retries.
........
2010-06-01 12:53:48 +00:00
Alexander Belopolsky 1790bc43bf Issue #1289118: datetime.timedelta objects can now be multiplied by float
and divided by float and int objects.
2010-05-31 17:33:47 +00:00
Brian Curtin c3acbc36d0 Merged revisions 81584 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81584 | brian.curtin | 2010-05-28 10:49:21 -0500 (Fri, 28 May 2010) | 3 lines

  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 16:08:40 +00:00
Alexander Belopolsky f03a616432 Merged revisions 81566 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81566 | alexander.belopolsky | 2010-05-27 16:55:27 -0400 (Thu, 27 May 2010) | 3 lines

  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 21:42:58 +00:00
Alexander Belopolsky c4e4a8db25 Merged revisions 81559 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81559 | alexander.belopolsky | 2010-05-26 16:45:37 -0400 (Wed, 26 May 2010) | 3 lines

  Issue #7879: Skip negative timestamps test on any Windows platform
  using unittest.skipIf decorator.
........
2010-05-26 20:48:30 +00:00
Mark Dickinson f9a5a8e0af Issue #2844: Make int('42', n) consistently raise ValueError for
invalid integers n (including n = -909).
2010-05-26 20:07:58 +00:00
Alexander Belopolsky d5442cd37a Merged revisions 81555 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81555 | alexander.belopolsky | 2010-05-26 15:43:16 -0400 (Wed, 26 May 2010) | 3 lines

  Issue #7879: Do not test negative timestamps on any Windows platform
  including Windows CE.
........
2010-05-26 20:00:12 +00:00
Mark Dickinson 56544db46d Merged revisions 81551 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81551 | mark.dickinson | 2010-05-26 20:06:33 +0100 (Wed, 26 May 2010) | 1 line

  Issue #8825: additional testcases for int(string, 0) and long(string, 0).
........
2010-05-26 19:14:01 +00:00
Giampaolo Rodolà 6da11e5fce fix wrong assertIs context 2010-05-26 18:21:26 +00:00
Giampaolo Rodolà a67299e757 Fix issue #8806: add SSL contexts support to ftplib 2010-05-26 18:06:04 +00:00
Brian Curtin 60853211da 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-26 17:43:50 +00:00
Victor Stinner 5f22e72e6d Merged revisions 81543 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81543 | victor.stinner | 2010-05-26 19:25:28 +0200 (mer., 26 mai 2010) | 2 lines

  Issue #7449: Skip test_socketserver if threading support is disabled
........
2010-05-26 17:33:03 +00:00
Victor Stinner 0dee1b859b Fix the new TestMain.test_decode() of test_base64 for Windows 2010-05-25 22:17:22 +00:00
Victor Stinner 479736b31c Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer and
sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes API
2010-05-25 21:12:34 +00:00
Mark Dickinson f43c3d3363 Merged revisions 81527 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81527 | mark.dickinson | 2010-05-25 20:44:49 +0100 (Tue, 25 May 2010) | 1 line

  Fix a NameError in test_enumerate.
........
2010-05-25 19:46:20 +00:00
Mark Dickinson fb3dc94b8c Merged revisions 81525 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81525 | mark.dickinson | 2010-05-25 20:01:08 +0100 (Tue, 25 May 2010) | 3 lines

  Issue #8816: Extra tests for some built-in functions.  These tests are
  ports of IronPython tests.  Thanks Gregory Nofi.
........
2010-05-25 19:06:24 +00:00
Tarek Ziadé a751499363 Made sysconfig a script that displays useful information - #8770 2010-05-25 09:44:36 +00:00
Victor Stinner e021f4b206 Recorded merge of revisions 81500-81501 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81500 | victor.stinner | 2010-05-24 23:33:24 +0200 (lun., 24 mai 2010) | 2 lines

  Issue #6662: Fix parsing of malformatted charref (&#bad;)
........
  r81501 | victor.stinner | 2010-05-24 23:37:28 +0200 (lun., 24 mai 2010) | 2 lines

  Add the author of the last fix (Issue #6662)
........
2010-05-24 21:46:25 +00:00
Steven Bethard 50fe593ae9 Merged revisions 81492 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81492 | steven.bethard | 2010-05-23 20:45:26 -0700 (Sun, 23 May 2010) | 1 line

  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:47:38 +00:00
Mark Dickinson dc787d2055 Issue #8188: Introduce a new scheme for computing hashes of numbers
(instances of int, float, complex, decimal.Decimal and
fractions.Fraction) that makes it easy to maintain the invariant that
hash(x) == hash(y) whenever x and y have equal value.
2010-05-23 13:33:13 +00:00
Mark Dickinson b1d8e3229c #Issue 8540: Make Context._clamp attribute public in decimal module. 2010-05-22 18:35:36 +00:00
Victor Stinner a92ad7ee2c Merged revisions 81471-81472 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81471 | victor.stinner | 2010-05-22 15:37:56 +0200 (sam., 22 mai 2010) | 7 lines

  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.
........
  r81472 | victor.stinner | 2010-05-22 15:44:25 +0200 (sam., 22 mai 2010) | 4 lines

  Fix my last commit (r81471) about codecs

  Rememder: don't touch the code just before a commit
........
2010-05-22 16:59:09 +00:00
Victor Stinner 3fed0870a6 Merged revisions 81459 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81459 | victor.stinner | 2010-05-22 04:11:07 +0200 (sam., 22 mai 2010) | 3 lines

  Issue #6268: Fix seek() method of codecs.open(), don't read the BOM twice
  after seek(0)
........
2010-05-22 02:16:27 +00:00
Victor Stinner 7126dbc867 Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
of the C file stderr, to use stderr encoding and error handler
2010-05-21 23:45:42 +00:00
Benjamin Peterson aada7b8f78 Merged revisions 81428-81429,81432-81433,81437 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81428 | benjamin.peterson | 2010-05-21 16:16:12 -0500 (Fri, 21 May 2010) | 1 line

  use addCleanup
........
  r81429 | benjamin.peterson | 2010-05-21 16:17:22 -0500 (Fri, 21 May 2010) | 1 line

  fix name
........
  r81432 | benjamin.peterson | 2010-05-21 16:31:24 -0500 (Fri, 21 May 2010) | 1 line

  ensure the last line has a trailing newline #8782
........
  r81433 | benjamin.peterson | 2010-05-21 16:32:49 -0500 (Fri, 21 May 2010) | 1 line

  remove debugging rubish
........
  r81437 | benjamin.peterson | 2010-05-21 16:35:44 -0500 (Fri, 21 May 2010) | 1 line

  simplify and modernize updatecache()
........
2010-05-21 21:45:06 +00:00
Benjamin Peterson 4ad6bd5482 Merged revisions 81414 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81414 | benjamin.peterson | 2010-05-21 15:51:45 -0500 (Fri, 21 May 2010) | 1 line

  return NotImplemented from Mapping when comparing to a non-mapping #8729
........
2010-05-21 20:55:22 +00:00
Victor Stinner b369358ee4 Issue #8780: Fix a regression introduced by r78946 in subprocess on Windows
Ensure that stdout / stderr is inherited from the parent if stdout=PIPE /
stderr=PIPE is not used.
2010-05-21 20:13:12 +00:00
Mark Dickinson cc6a982de8 Issue #8748: Fix two issues with comparisons between complex and integer
objects.  (1) The comparison could incorrectly return True in some cases
(2**53+1 == complex(2**53) == 2**53), breaking transivity of equality.
(2) The comparison raised an OverflowError for large integers, leading
to unpredictable exceptions when combining integers and complex objects
in sets or dicts.

Patch by Meador Inge.
2010-05-21 14:55:26 +00:00
Antoine Pitrou b52187710e Issue #4870: Add an `options` attribute to SSL contexts, as well as
several ``OP_*`` constants to the `ssl` module.  This allows to selectively
disable protocol versions, when used in combination with `PROTOCOL_SSLv23`.
2010-05-21 09:56:06 +00:00
Victor Stinner 150016fd24 Issue #8559: improve unicode support of (gdb) libpython.py
* Escape non printable characters (use locale.getpreferredencoding())
 * Fix support of surrogate pairs
 * test_gdb.py: use ascii() instead of repr() in gdb program arguments to avoid
   encoding issues
 * Fix test_strings() of test_gdb.py for encoding different than UTF-8
   (eg. ACSII)
2010-05-19 23:04:56 +00:00
Tarek Ziadé 06710a8421 Merged revisions 81371 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81371 | tarek.ziade | 2010-05-20 00:20:14 +0200 (Thu, 20 May 2010) | 1 line

  #8759: Fixed user paths in sysconfig for posix and os2 schemes
........
2010-05-19 22:25:00 +00:00
Georg Brandl 8569e582f8 Merged revisions 80030,80067,80069,80080-80081,80084,80432-80433,80465-80470,81059,81065-81067 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r80030 | georg.brandl | 2010-04-13 08:43:54 +0200 (Di, 13 Apr 2010) | 1 line

  Get rid of multi-row cells.
........
  r80067 | georg.brandl | 2010-04-14 10:53:38 +0200 (Mi, 14 Apr 2010) | 1 line

  #5341: typo.
........
  r80069 | georg.brandl | 2010-04-14 15:50:31 +0200 (Mi, 14 Apr 2010) | 1 line

  Add an x-ref to where the O_ constants are documented and move the SEEK_ constants after lseek().
........
  r80080 | georg.brandl | 2010-04-14 21:16:38 +0200 (Mi, 14 Apr 2010) | 1 line

  #8399: add note about Windows and O_BINARY.
........
  r80081 | georg.brandl | 2010-04-14 23:34:44 +0200 (Mi, 14 Apr 2010) | 1 line

  #5250: document __instancecheck__ and __subclasscheck__.  I hope the part about the class/metaclass distinction is understandable.
........
  r80084 | georg.brandl | 2010-04-14 23:46:45 +0200 (Mi, 14 Apr 2010) | 1 line

  Fix missing.
........
  r80432 | georg.brandl | 2010-04-24 10:56:58 +0200 (Sa, 24 Apr 2010) | 1 line

  Markup fixes.
........
  r80433 | georg.brandl | 2010-04-24 11:08:10 +0200 (Sa, 24 Apr 2010) | 1 line

  #7507: quote "!" in pipes.quote(); it is a special character for some shells.
........
  r80465 | georg.brandl | 2010-04-25 12:29:17 +0200 (So, 25 Apr 2010) | 1 line

  Remove LaTeXy index entry syntax.
........
  r80466 | georg.brandl | 2010-04-25 12:54:42 +0200 (So, 25 Apr 2010) | 1 line

  Patch from Tim Hatch: Better cross-referencing in socket and winreg docs.
........
  r80467 | georg.brandl | 2010-04-25 12:55:16 +0200 (So, 25 Apr 2010) | 1 line

  Patch from Tim Hatch: Remove reference to winreg being the fabled high-level registry interface.
........
  r80468 | georg.brandl | 2010-04-25 12:55:58 +0200 (So, 25 Apr 2010) | 1 line

  Patch from Tim Hatch: Minor spelling changes to _winreg docs.
........
  r80469 | georg.brandl | 2010-04-25 12:56:41 +0200 (So, 25 Apr 2010) | 1 line

  Fix code example to have valid syntax so that it can be highlighted.
........
  r80470 | georg.brandl | 2010-04-25 12:57:15 +0200 (So, 25 Apr 2010) | 1 line

  Patch from Tim Hatch: Make socket setblocking <-> settimeout examples symmetric.
........
  r81059 | georg.brandl | 2010-05-10 23:02:51 +0200 (Mo, 10 Mai 2010) | 1 line

  #8642: fix wrong function name.
........
  r81065 | georg.brandl | 2010-05-10 23:46:50 +0200 (Mo, 10 Mai 2010) | 1 line

  Fix reference direction.
........
  r81066 | georg.brandl | 2010-05-10 23:50:57 +0200 (Mo, 10 Mai 2010) | 1 line

  Consolidate deprecation messages.
........
  r81067 | georg.brandl | 2010-05-10 23:51:33 +0200 (Mo, 10 Mai 2010) | 1 line

  Fix typo.
........
2010-05-19 20:57:08 +00:00
Victor Stinner 7d79b8b771 Issue #8766: Initialize _warnings module before importing the first module.
Fix a crash if an empty directory called "encodings" exists in sys.path.
2010-05-19 20:40:50 +00:00
Victor Stinner 1802d3f388 regrtest.py: call replace_stdout() before the first call to print()
print("==  ", os.getcwd()) fails if the current working directory is not ASCII
whereas sys.stdout encoding is ASCII.
2010-05-19 17:11:19 +00:00
Victor Stinner 93b5513cf1 Issue #6697: Fix a crash if a keyword contains a surrogate 2010-05-19 00:54:06 +00:00
Giampaolo Rodolà 82e02b5876 Merged revisions 81294 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81294 | giampaolo.rodola | 2010-05-18 22:04:31 +0200 (mar, 18 mag 2010) | 1 line

  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:11:58 +00:00
Victor Stinner b745a74c99 Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
subprocess.Popen() and os._execvpe() support bytes program name. Add
os.supports_bytes_environ flag: True if the native OS type of the environment
is bytes (eg. False on Windows).
2010-05-18 17:17:23 +00:00
Barry Warsaw 04b5684d00 Repair test failure. Bug 8727. 2010-05-18 14:15:20 +00:00
Victor Stinner c0983856c6 Fix test_main_invalid_unicode() of test_sys for ASCII locale encoding
It should fix sparc 3.x and 3.1 failures.
2010-05-17 19:57:40 +00:00
Lars Gustäbel 1465cc2887 Issue #8633: Support for POSIX.1-2008 binary pax headers.
tarfile is now able to read and write pax headers with a
"hdrcharset=BINARY" record. This record was introduced in
POSIX.1-2008 as a method to store unencoded binary strings that
cannot be translated to UTF-8. In practice, this is just a workaround
that allows a tar implementation to store filenames that do not
comply with the current filesystem encoding and thus cannot be
decoded correctly.
Additionally, tarfile works around a bug in current versions of GNU
tar: undecodable filenames are stored as-is in a pax header without a
"hdrcharset" record being added. Technically, these headers are
invalid, but tarfile manages to read them correctly anyway.
2010-05-17 18:02:50 +00:00
Victor Stinner 7cf7d72263 Improve test_exit() error message to analyze sparc failures 2010-05-17 14:36:43 +00:00
Antoine Pitrou d7e4c1caa6 Typo (thanks Arfrever) 2010-05-17 14:13:10 +00:00
Antoine Pitrou d0919507f9 Try to fix buildbot failures with old OpenSSLs. 2010-05-17 10:30:00 +00:00
Victor Stinner e9fb319e68 handle_system_exit() flushs files to warranty the output order
PyObject_Print() writes into the C object stderr, whereas PySys_WriteStderr()
writes into the Python object sys.stderr. Each object has its own buffer, so
call sys.stderr.flush() and fflush(stderr).
2010-05-17 08:58:51 +00:00
Victor Stinner 372ac5e732 PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
of strict) error handler to escape surrogates
2010-05-17 01:26:01 +00:00
Victor Stinner 6baded49d0 Issue #6697: Fix a crash if code of "python -c code" contains surrogates 2010-05-17 01:13:37 +00:00
Victor Stinner f155f1f4ce Oops, my patch on subprocess is not merged yet: fix my previous commit on test_os 2010-05-17 00:18:34 +00:00
Victor Stinner c2d095f494 test_os: cleanup test_internal_execvpe() and os._execvpe() mockup
* Replace os.defpath instead of os.get_exec_path() to test also
   os.get_exec_path()
 * Use contextlib.contextmanager, move the mockup outside the class, and
   the mockup returns directly the call list object
 * Use two different contexts for the two tests
 * Use more revelant values and names
2010-05-17 00:14:53 +00:00
Antoine Pitrou 304740635b "xyzzy" is not a silly enough name for some OpenSSL versions to report an error 2010-05-16 23:46:26 +00:00
Antoine Pitrou 27ba6388ed Do not fail if ssl fails to import 2010-05-16 20:35:03 +00:00
Antoine Pitrou 65ec8ae47f Fix (hopefully) the remaining test_ssl buildbot failures 2010-05-16 19:56:32 +00:00
Antoine Pitrou 467f28de03 Followup on r81233: fix test_ssl with OpenSSL < 1.0.0. 2010-05-16 19:22:44 +00:00
Antoine Pitrou 152efa2ae2 Issue #8550: Add first class `SSLContext` objects to the ssl module. 2010-05-16 18:19:27 +00:00
Victor Stinner 7ac5cb18df Merged revisions 81224 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81224 | victor.stinner | 2010-05-16 02:34:40 +0200 (dim., 16 mai 2010) | 4 lines

  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:36:38 +00:00