Commit Graph

37516 Commits

Author SHA1 Message Date
Jason R. Coombs 80c29ac1ea Issue #20387: Merge patch and test 2015-06-28 10:23:11 -04:00
Serhiy Storchaka eab7704044 Issue #24336: The contextmanager decorator now works with functions with
keyword arguments called "func" and "self".  Patch by Martin Panter.
2015-06-28 17:08:35 +03:00
Serhiy Storchaka 101ff3541c Issue #24336: The contextmanager decorator now works with functions with
keyword arguments called "func" and "self".  Patch by Martin Panter.
2015-06-28 17:06:07 +03:00
Benjamin Peterson 4801383c29 upgrade to Unicode 8.0.0 2015-06-27 15:45:56 -05:00
Berker Peksag a7c781724f Issue #23684: Clarify the return value of the scheme attribute of ParseResult and SplitResult objects.
Patch by Martin Panter.
2015-06-25 23:39:26 +03:00
Berker Peksag 89584c97e4 Issue #23684: Clarify the return value of the scheme attribute of ParseResult and SplitResult objects.
Patch by Martin Panter.
2015-06-25 23:38:48 +03:00
Yury Selivanov f847f1fba7 Issue #24400, #24325: More tests for types._GeneratorWrapper
Also, make 'wrapped' and 'isgen' private.
2015-06-24 12:49:28 -04:00
Yury Selivanov 00e3372358 Issue #24325, #24400: Add more unittests for types.coroutine; tweak wrapper implementation. 2015-06-24 11:44:51 -04:00
Yury Selivanov fcba97242b Issue #24495, #24400: Test asyncio.Task.repr in debug mode 2015-06-24 10:55:12 -04:00
Yury Selivanov 5ac716251f Fix asyncio unittests in debug mode 2015-06-24 10:47:44 -04:00
Yury Selivanov 339d5e7d85 Fix asyncio unittests in debug mode 2015-06-24 10:45:44 -04:00
Yury Selivanov 8f1c99321b Issue #24400: Fix CoroWrapper for 'async def' coroutines 2015-06-24 10:32:22 -04:00
Yury Selivanov 29a602a140 Issue #24400: Fix CoroWrapper for 'async def' coroutines 2015-06-24 10:30:14 -04:00
Yury Selivanov dfbd27f0be asyncio: Merge changes from issue #24400. 2015-06-24 09:41:35 -04:00
Steve Dower 7aec764d73 Closes #24244: Removes invalid test from test_time 2015-06-23 20:48:32 -07:00
Antoine Pitrou a72f0cdaea Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar(). 2015-06-23 14:38:13 +02:00
Antoine Pitrou 6bc217dd3d Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar(). 2015-06-23 14:31:11 +02:00
Yury Selivanov 5376ba9630 Issue #24400: Introduce a distinct type for 'async def' coroutines.
Summary of changes:

1. Coroutines now have a distinct, separate from generators
   type at the C level: PyGen_Type, and a new typedef PyCoroObject.
   PyCoroObject shares the initial segment of struct layout with
   PyGenObject, making it possible to reuse existing generators
   machinery.  The new type is exposed as 'types.CoroutineType'.

   As a consequence of having a new type, CO_GENERATOR flag is
   no longer applied to coroutines.

2. Having a separate type for coroutines made it possible to add
   an __await__ method to the type.  Although it is not used by the
   interpreter (see details on that below), it makes coroutines
   naturally (without using __instancecheck__) conform to
   collections.abc.Coroutine and collections.abc.Awaitable ABCs.

   [The __instancecheck__ is still used for generator-based
   coroutines, as we don't want to add __await__ for generators.]

3. Add new opcode: GET_YIELD_FROM_ITER.  The opcode is needed to
   allow passing native coroutines to the YIELD_FROM opcode.

   Before this change, 'yield from o' expression was compiled to:

      (o)
      GET_ITER
      LOAD_CONST
      YIELD_FROM

   Now, we use GET_YIELD_FROM_ITER instead of GET_ITER.

   The reason for adding a new opcode is that GET_ITER is used
   in some contexts (such as 'for .. in' loops) where passing
   a coroutine object is invalid.

4. Add two new introspection functions to the inspec module:
   getcoroutinestate(c) and getcoroutinelocals(c).

5. inspect.iscoroutine(o) is updated to test if 'o' is a native
   coroutine object.  Before this commit it used abc.Coroutine,
   and it was requested to update inspect.isgenerator(o) to use
   abc.Generator; it was decided, however, that inspect functions
   should really be tailored for checking for native types.

6. sys.set_coroutine_wrapper(w) API is updated to work with only
   native coroutines.  Since types.coroutine decorator supports
   any type of callables now, it would be confusing that it does
   not work for all types of coroutines.

7. Exceptions logic in generators C implementation was updated
   to raise clearer messages for coroutines:

   Before: TypeError("generator raised StopIteration")
   After: TypeError("coroutine raised StopIteration")
2015-06-22 12:19:30 -04:00
Dingyuan Wang e411b6629f Issue #20387: Restore retention of indentation during untokenize. 2015-06-22 10:01:12 +08:00
Jason R. Coombs b6d1cdda8e Issue #20387: Correct test to properly capture expectation. 2015-06-25 22:42:24 -04:00
Serhiy Storchaka ac803cd2f3 Issue #24408: Fixed test for tkinter.Font on OS X.
Based on patch by Martin Panter.
2015-06-21 14:42:57 +03:00
Serhiy Storchaka 753a1dfcc2 Issue #24408: Fixed test for tkinter.Font on OS X.
Based on patch by Martin Panter.
2015-06-21 14:41:44 +03:00
Jason R. Coombs 5713b3c5bf Issue #20387: Add test capturing failure to roundtrip indented code in tokenize module. 2015-06-20 19:52:22 -04:00
Jason R. Coombs 7cf36387e4 Remove unused import and remove doctest-only import into doctests. 2015-06-20 19:13:50 -04:00
Steve Dower f3291a8340 Issue #8232: Renamed WinFireFox to WinFirefox 2015-06-15 09:11:14 -07:00
Victor Stinner 138adb8d05 (Merge 3.4) Issue #15745: Rewrite os.utime() tests in test_os
* Don't use the timestamp of an existing file anymore, only use fixed
  timestamp
* Enhance the code checking the resolution of the filesystem timestamps.
* Check timestamps with a resolution of 1 microsecond instead of 1 millisecond
* When os.utime() uses the current system clock, tolerate a delta of 20 ms.
  Before some os.utime() tolerated a different of 10 seconds.
* Merge duplicated tests and simplify the code
2015-06-12 22:01:54 +02:00
Victor Stinner e12e7aa3fd Issue #15745: Rewrite os.utime() tests in test_os
* Don't use the timestamp of an existing file anymore, only use fixed
  timestamp
* Enhance the code checking the resolution of the filesystem timestamps.
* Check timestamps with a resolution of 1 microsecond instead of 1 millisecond
* When os.utime() uses the current system clock, tolerate a delta of 20 ms.
  Before some os.utime() tolerated a different of 10 seconds.
* Merge duplicated tests and simplify the code
2015-06-12 21:58:00 +02:00
Serhiy Storchaka fabdc827a5 Issue #24408: Added more tkinter.Font tests. 2015-06-09 07:21:00 +03:00
Serhiy Storchaka c0ed707b2f Issue #24408: Added more tkinter.Font tests. 2015-06-09 07:18:54 +03:00
Serhiy Storchaka 23e6109112 Issue #24299: Fixed test__locale on Solaris. 2015-06-08 18:50:18 +03:00
Serhiy Storchaka 07c002573a Issue #24299: Fixed test__locale on Solaris. 2015-06-08 18:48:33 +03:00
Serhiy Storchaka 4fafda731a Issue #24408: Fixed AttributeError in measure() and metrics() methods of
tkinter.Font.
2015-06-08 18:43:55 +03:00
Serhiy Storchaka 391af751f2 Issue #14373: Other attempt to fix threaded test for lru_cache(). 2015-06-08 12:44:18 +03:00
Serhiy Storchaka e7070f09bc Issue #14373: C implementation of functools.lru_cache() now can be used with
methods.
2015-06-08 11:19:24 +03:00
Serhiy Storchaka 77cb197aaa Issue #14373: Fixed threaded test for lru_cache(). Added new threaded test. 2015-06-08 11:14:31 +03:00
Steve Dower 93cfeb93ac Issue #8232: webbrowser support incomplete on Windows. Patch by Brandon Milam 2015-06-07 21:35:39 -07:00
Tal Einat 988df6a365 added matmul and imatmul to operator.__all__ 2015-06-07 19:21:01 +03:00
Yury Selivanov 94c2263005 Issue 24374: Plug refleak in set_coroutine_wrapper 2015-06-04 10:16:51 -04:00
Eric Snow 4fabf02633 Issue #24369: Defend against key-changes during iteration. 2015-06-04 00:09:56 -06:00
Eric Snow ac02ef373f Issue #24368: Support keyword arguments in OrderedDict methods. 2015-06-02 20:42:14 -06:00
Yury Selivanov aab3c4a211 Issue 24342: Let wrapper set by sys.set_coroutine_wrapper fail gracefully 2015-06-02 18:43:51 -04:00
Donald Stufft 231d90609b Merge update to pip/setuptools 2015-06-02 11:39:55 -04:00
Donald Stufft 96cf848a8b Upgrade pip to 7.0.3 and setuptools to 17.0 2015-06-02 11:39:31 -04:00
Donald Stufft 67872ba91a Merge the fix for #24267 2015-06-02 10:38:01 -04:00
Donald Stufft 71a8589ddc Closes #24267 - Does not check version on ensurepip uninstall
Ensure that the uninstall helper for Windows passes the proper
flags to pip to prevent it from checking PyPI if the pip that
we're currently attempting to uninstall is the latest verison.
2015-06-02 10:37:08 -04:00
Eric Snow b952ab43f2 Issue #24359: Check for changed OrderedDict size during iteration. 2015-06-01 23:35:13 -06:00
Eric Snow d171975609 Issue #24348: Drop superfluous increfs/decrefs. 2015-06-01 23:12:13 -06:00
Eric Snow a762af74b2 Issue #24347: Set KeyError if PyDict_GetItemWithError returns NULL. 2015-06-01 22:59:08 -06:00
Larry Hastings c72056a1ae Merge release engineering changes with 3.5 branch head. 2015-05-31 21:43:57 -07:00
Yury Selivanov e42cc38639 Issue 24017: Add a test for CoroWrapper and 'async def' coroutines 2015-05-31 21:44:05 -04:00
Yury Selivanov 6a0fab92f9 Issue 24017: Fix asyncio.CoroWrapper to support 'async def' coroutines 2015-05-31 21:37:23 -04:00
Yury Selivanov 70adad2a0e Issue 24017: Fix asyncio.CoroWrapper to support 'async def' coroutines 2015-05-31 21:37:09 -04:00
Tal Einat d5519ed7f4 Issue #19543: Implementation of isclose as per PEP 485
For details, see:
PEP 0485 -- A Function for testing approximate equality

Functions added: math.isclose() and cmath.isclose().

Original code by Chris Barker. Patch by Tal Einat.
2015-05-31 22:05:00 +03:00
Yury Selivanov 439c5fe3ae Issue 24004: Fix DeprecationWarning in a unittest 2015-05-31 11:28:35 -04:00
Serhiy Storchaka d4ea03c785 Issue #24284: The startswith and endswith methods of the str class no longer
return True when finding the empty string and the indexes are completely out
of range.
2015-05-31 09:15:51 +03:00
Yury Selivanov ad583a8e6d Issue 24004: Add a unittest for @asyncio.coroutine supporting Awaitables 2015-05-30 21:04:37 -04:00
Yury Selivanov 353f2299bf Issue 24004: Support Awaitables (pep 492) in @asyncio.coroutine decorator
(Merge 3.4)
2015-05-30 21:02:34 -04:00
Yury Selivanov a316085192 Issue 24004: Support Awaitables (pep 492) in @asyncio.coroutine decorator 2015-05-30 21:02:12 -04:00
Larry Hastings e8ff0caa72 Regenerated pydoc topic index in preparation for Python 3.5.0b2. 2015-05-30 16:58:27 -07:00
Yury Selivanov bf304fcb32 Issue #23934: Fix inspect.signature to fail correctly for builtin types.
Initial patch by James Powell.
2015-05-30 17:08:36 -04:00
Eric Snow 67fb92e8c6 Issue #16991: Do not return None from OrderedDict.__reversed__. 2015-05-30 11:43:36 -06:00
Serhiy Storchaka 1b560cbf85 Issue #5633: Fixed timeit when the statement is a string and the setup is not.
Refactored timeit.__init__ for unified handling of stmt and setup parameters.
2015-05-30 19:44:55 +03:00
Serhiy Storchaka f28fa66351 Issue #5633: Fixed timeit when the statement is a string and the setup is not. 2015-05-30 19:38:26 +03:00
Yury Selivanov 7aa5341164 Reverting my previous commit.
Something went horribly wrong when I was doing `hg rebase`.
2015-05-30 10:57:56 -04:00
Serhiy Storchaka f49c42324f Use test.support.start_threads() in threaded lru_cache tests. 2015-05-30 15:49:42 +03:00
Serhiy Storchaka bf2b3b72d3 Use test.support.start_threads() in threaded lru_cache tests. 2015-05-30 15:49:17 +03:00
Raymond Hettinger 4c97a62ae3 Issue #23509: Speed up Counter operators
(Based on patch by Serhiy Storchaka.)
2015-05-29 22:14:07 -07:00
Benjamin Peterson e16f427243 Merge 3.5 2015-05-30 00:02:25 -05:00
Benjamin Peterson 3d1151d2c0 use assert method in another place 2015-05-30 00:02:17 -05:00
Eric Snow 96c6af9b20 Issue #16991: Add a C implementation of collections.OrderedDict. 2015-05-29 22:21:39 -06:00
Eric Snow 47db71756d Issue #16991: Add a C implementation of collections.OrderedDict. 2015-05-29 22:21:39 -06:00
Benjamin Peterson 3979323ca3 merge 3.5 2015-05-29 18:44:50 -05:00
Benjamin Peterson 0a3297d7d4 use assert method (#24328) 2015-05-29 18:44:45 -05:00
Benjamin Peterson 0c70ca9aac merge 3.5 (#24328) 2015-05-29 17:11:36 -05:00
Benjamin Peterson e20056c8f7 fix importing one char extension modules (closes #24328) 2015-05-29 17:10:30 -05:00
Serhiy Storchaka 07739f3555 Issue #24326: Fixed audioop.ratecv() with non-default weightB argument.
Original patch by David Moore.
2015-05-30 00:58:09 +03:00
Serhiy Storchaka a663121e10 Issue #24326: Fixed audioop.ratecv() with non-default weightB argument.
Original patch by David Moore.
2015-05-30 00:57:21 +03:00
Serhiy Storchaka 50451eb912 Issue #24326: Fixed audioop.ratecv() with non-default weightB argument.
Original patch by David Moore.
2015-05-30 00:53:26 +03:00
Yury Selivanov 38bc0a7f97 Issue 24316: Wrap gen objects returned from callables in types.coroutine
(Merge 3.5)
2015-05-29 16:19:34 -04:00
Yury Selivanov 13f7723d81 Issue 24316: Wrap gen objects returned from callables in types.coroutine 2015-05-29 16:19:18 -04:00
Yury Selivanov 7ad0419c4d Issue 24316: Fix types.coroutine() to accept objects from Cython
(Merge 3.5)
2015-05-29 09:06:24 -04:00
Yury Selivanov c565cd5d1b Issue 24316: Fix types.coroutine() to accept objects from Cython 2015-05-29 09:06:05 -04:00
Yury Selivanov a24fcfdf23 Issue 24315: Make collections.abc.Coroutine derived from Awaitable
(Merge 3.5)
2015-05-29 09:01:47 -04:00
Yury Selivanov 56fc614025 Issue 24315: Make collections.abc.Coroutine derived from Awaitable 2015-05-29 09:01:29 -04:00
Benjamin Peterson 0938d98bcc merge 3.5 2015-05-28 14:40:15 -05:00
Benjamin Peterson 264be6f48f remove STORE_MAP, since it's unused 2015-05-28 14:40:08 -05:00
Benjamin Peterson 2ec8f9bffc merge 3.5 (#11205) 2015-05-28 14:31:14 -05:00
Benjamin Peterson ee85339cc6 in dict displays, evaluate the key before the value (closes #11205)
Patch partially by Steve Dougherty.
2015-05-28 14:30:26 -05:00
Yury Selivanov 26f7057b36 Issue 24297: Add a unittest that Lib/symbol.py is in sync with Grammar 2015-05-28 14:06:12 -04:00
Serhiy Storchaka 6e6883f11a Issue #24309: Removed Python 2 idioms. 2015-05-28 20:45:29 +03:00
Yury Selivanov ee941b0278 asyncio: Drop some useless code from tasks.py.
See also issue 24017.
2015-05-28 10:53:04 -04:00
Yury Selivanov 6076a385e3 asyncio: Drop some useless code from tasks.py.
See also issue 24017.
2015-05-28 10:52:46 -04:00
Yury Selivanov 1ad08a5555 asyncio: Drop some useless code from tasks.py.
See also issue 24017.
2015-05-28 10:52:19 -04:00
Yury Selivanov 72f389fed0 Issue 24298: Fix signature() to properly unwrap wrappers around bound methods 2015-05-27 21:59:27 -04:00
Yury Selivanov 507cd3cf91 Issue 24298: Fix signature() to properly unwrap wrappers around bound methods 2015-05-27 21:59:03 -04:00
Yury Selivanov 46c759d76d Issue 24298: Fix signature() to properly unwrap wrappers around bound methods 2015-05-27 21:56:53 -04:00
Yury Selivanov 8544e2584d Issue 24297: Update symbol.py. See also issue 24017. 2015-05-27 11:08:46 -04:00
Yury Selivanov 0109812040 Issue 24297: Update symbol.py. See also issue 24017. 2015-05-27 11:08:19 -04:00
Lars Gustäbel 572183eaab Merge with 3.5: tarfile.open() with mode 'x' created files without an end of archive marker. 2015-05-27 13:05:30 +02:00
Lars Gustäbel 20703c6969 tarfile.open() with mode 'x' created files without an end of archive marker. 2015-05-27 12:53:44 +02:00
Raymond Hettinger 944db38cb7 Issue #23509: Speed up Counter operators
(Based on patch by Serhiy Storchaka.)
2015-05-26 10:35:15 -07:00
Nick Coghlan 06f155f488 Merge fix for issue #24285 from 3.5 2015-05-26 21:57:16 +10:00
Nick Coghlan 55871f04bf Issue #24285: fix importing extensions from packages 2015-05-26 21:48:17 +10:00
Raymond Hettinger c074e9d765 Issue #24286: Forward port dict view abstract base class tests. 2015-05-26 01:47:58 -07:00
Benjamin Peterson 09479d0b94 merge 3.4 2015-05-25 21:25:09 -05:00
Benjamin Peterson 82d8f06fcd merge 3.3 2015-05-25 21:24:48 -05:00
Benjamin Peterson 86c3a3b0b7 merge 3.2 2015-05-25 21:24:26 -05:00
Benjamin Peterson b03856ab66 keep distutils version in sync with python version automatically 2015-05-25 21:24:00 -05:00
Victor Stinner 24d262af0b (Merge 3.5) Issue #23840: tokenize.open() now closes the temporary binary file
on error to fix a resource warning.
2015-05-26 00:46:44 +02:00
Victor Stinner 387729e183 Issue #23840: tokenize.open() now closes the temporary binary file on error to
fix a resource warning.
2015-05-26 00:43:58 +02:00
Larry Hastings aca575cb25 Merge. 2015-05-24 16:41:42 -07:00
Serhiy Storchaka 46c5611948 Backed out changeset: b0a0b9b59012 2015-05-24 21:53:49 +03:00
Larry Hastings 205acde55e Version bump for 3.5.0b1. 2015-05-23 17:43:05 -07:00
Larry Hastings 0482af4269 Updated topics (and susp-ignored) for Python 3.5.0b1. 2015-05-23 17:39:42 -07:00
Larry Hastings d68ec172d1 Merge backout of 57776eee74f2. 2015-05-23 14:57:12 -07:00
Larry Hastings 8252cc9832 Backed out changeset 57776eee74f2 2015-05-23 14:56:23 -07:00
Terry Jan Reedy b888d61320 Update idlelib/NEWS.txt 2015-05-23 17:24:22 -04:00
Terry Jan Reedy c4dc43eaf4 Update idlelib/NEWS.txt. 2015-05-23 17:23:30 -04:00
Serhiy Storchaka 1c858c352b Issue #14373: Added C implementation of functools.lru_cache(). Based on
patches by Matt Joiner and Alexey Kachayev.
2015-05-23 22:42:49 +03:00
Steve Dower c70908558d Issue #23970: Fixes bdist_wininst not working on non-Windows platform. 2015-05-23 12:15:57 -07:00
Steve Dower fd3664be00 Issue #23970: Adds distutils._msvccompiler for new Visual Studio versions. 2015-05-23 09:02:50 -07:00
Benjamin Peterson 5a69420062 merge 3.4 (#22931) 2015-05-23 10:41:30 -05:00
Benjamin Peterson c4ae86e477 merge 3.3 (#22931) 2015-05-23 10:40:47 -05:00
Benjamin Peterson d504f20e1c merge 3.2 (#22931) 2015-05-23 10:38:48 -05:00
Benjamin Peterson 9bd476ea57 allow square brackets in cookie values (closes #22931) 2015-05-23 10:36:48 -05:00
Nick Coghlan d5cacbb1d9 PEP 489: Multi-phase extension module initialization
Known limitations of the current implementation:

- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet

The leak is most visible by running:

  ./python -m test -R3:3 test_importlib

However, you can also see it by running:

  ./python -X showrefcount

Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
2015-05-23 22:24:10 +10:00
Raymond Hettinger ec219ba1c0 Issue #23086: Add start and stop arguments to the Sequence.index() mixin method. 2015-05-22 19:29:22 -07:00
Donald Stufft 256613c605 Merge 3.4 into default, upgrading pip to 7.0.1 2015-05-22 20:30:57 -04:00
Donald Stufft 7bf0d5a759 Upgrade pip to 7.0.1 2015-05-22 20:30:16 -04:00
Raymond Hettinger f070f1cbbc Issue #21448: Improve performance of the email feedparser 2015-05-22 17:23:28 -07:00
Raymond Hettinger 573b44c18f Issue 22189: Add missing methods to UserString 2015-05-22 16:56:32 -07:00
Gregory P. Smith ad577b938b Issue 24230: The tempfile module now accepts bytes for prefix, suffix and dir
parameters and returns bytes in such situations (matching the os module APIs).
2015-05-22 16:18:14 -07:00
Yury Selivanov c8386f78fd Issue 20438: Adjust stacklevel of inspect.getargspec() warning. 2015-05-22 16:09:44 -04:00
Guido van Rossum 46dbb7d103 Preliminary typing.py, anticipating provisional acceptance of PEP 484.
There area bunch of TODOs here, but the biggest (not mentioned in the
file) is that I'm going to take out __instancecheck__ and
__subclasscheck__.  However my personal schedule is such that I
probably won't have time for these before Larry tags beta 1.  But I
will try -- this commit is mostly to make sure that typing.py doesn't
completely miss the train.

PS. I'm tracking issues at https://github.com/ambv/typehinting/issues.
2015-05-22 10:14:11 -07:00
Zachary Ware 7dc9dea778 Issue #20035: Reimplement tkinter._fix module as a C function.
The new private C function makes no permanent changes to the environment
and is #ifdef'd out on non-Windows platforms.
2015-05-22 11:36:53 -05:00
Yury Selivanov 3cfec2e2fc Issue 20438: Deprecate inspect.getargspec() and friends. 2015-05-22 11:38:38 -04:00
Yury Selivanov 683333955a Issue 24237: Raise PendingDeprecationWarning per PEP 479
Raise PendingDeprecationWarning when generator raises StopIteration
and no __future__ import is used.  Fix offenders in the stdlib
and tests.

See also issue 22906.
Thanks to Nick Coghlan and Berker Peksag for reviews.
2015-05-22 11:16:47 -04:00
Serhiy Storchaka e79ec70801 Issue #24257: Fixed incorrect uses of PyObject_IsInstance().
Fixed segmentation fault in sqlite3.Row constructor with faked cursor type.
Fixed system error in the comparison of faked types.SimpleNamespace.
2015-05-22 11:13:20 +03:00
Serhiy Storchaka 08d230a540 Issue #24257: Fixed incorrect uses of PyObject_IsInstance().
Fixed segmentation fault in sqlite3.Row constructor with faked cursor type.
Fixed system error in the comparison of faked types.SimpleNamespace.
2015-05-22 11:02:49 +03:00
Donald Stufft 35e24a50c5 merge: Upgrade pip to 7.0 and setuptools to 16.0 2015-05-22 00:39:57 -04:00
Donald Stufft df9ba3623a Upgrade pip to 7.0 and setuptools to 16.0 2015-05-22 00:39:22 -04:00
Berker Peksag b560158622 Set stacklevel to 2 to get more accurate warning messages from deprecated functions. 2015-05-21 23:40:54 +03:00
Yury Selivanov 095fb84fc2 Issue 23898: Fix inspect.classify_class_attrs() to work with __eq__
Patch by Mike Bayer.
2015-05-21 15:45:08 -04:00
Yury Selivanov bf341fb5f6 Issue 23898: Fix inspect.classify_class_attrs() to work with __eq__ 2015-05-21 15:41:57 -04:00
Serhiy Storchaka b2f3c2357c Issue #23985: Fixed integer overflow in iterator object. Patch by
Clement Rouault.
2015-05-21 20:51:53 +03:00
Serhiy Storchaka 4faf5c5655 Issue #23985: Fixed integer overflow in iterator object. Patch by
Clement Rouault.
2015-05-21 20:50:25 +03:00
Serhiy Storchaka 041dd8eef1 Issue #15836: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() assertments now check the type of the first argument
to prevent possible user error.  Based on patch by Daniel Wagner-Hall.
2015-05-21 20:15:40 +03:00
Yury Selivanov ff54223606 Issue 24017: Use abc.Coroutine in inspect.iscoroutine() function 2015-05-21 12:03:21 -04:00
Yury Selivanov 57c74fca02 Issue 24248: Deprecate inspect.Signature.from_function and .from_builtin 2015-05-20 23:07:02 -04:00
Antoine Pitrou 45d6156154 Issue #9858: Add missing method stubs to _io.RawIOBase. Patch by Laura Rupprecht. 2015-05-20 21:50:59 +02:00
Serhiy Storchaka 60335855f0 Issue #22955: Fixed test_operator. It left Python implementation in
sys.modules and broke test_ipaddress.
2015-05-20 22:02:43 +03:00
Yury Selivanov cf45f022b7 inspect.Signature: Factor out Signature.from_function to a private helper 2015-05-20 14:38:50 -04:00
Yury Selivanov bcd4fc161a Issue 20691: Add follow_wrapped arg to inspect.signature/from_callable. 2015-05-20 14:30:08 -04:00
Serhiy Storchaka 1f507a8140 Issue 24215: Added tests for more builtin types in test_pprint.
Made test_pprint and test_trace discoverable.
2015-05-20 19:38:05 +03:00
Serhiy Storchaka cbfe07e06c Issue 24215: Added tests for more builtin types in test_pprint.
Made test_pprint and test_trace discoverable.
2015-05-20 19:37:10 +03:00
Serhiy Storchaka 3ddcfb119d Issue #24134: Use assertRaises() in context manager form in test_slice to
avoid passing the test accidently because slice.__hash__ is None.
2015-05-20 18:38:39 +03:00
Serhiy Storchaka c0e0022f07 Issue #24134: Use assertRaises() in context manager form in test_slice to
avoid passing the test accidently because slice.__hash__ is None.
2015-05-20 18:37:37 +03:00
Serhiy Storchaka 35ac5f8280 Issue #22955: attrgetter, itemgetter and methodcaller objects in the operator
module now support pickling.  Added readable and evaluable repr for these
objects.  Based on patch by Josh Rosenberg.
2015-05-20 18:29:18 +03:00
Serhiy Storchaka 5418d0bfc4 Issue #24245: Eliminated senseless expect clauses that have no any effect in
IDLE.  Patch by Martin Panter.
2015-05-20 16:15:20 +03:00
Serhiy Storchaka ef94869f4f Issue #24245: Eliminated senseless expect clauses that have no any effect in
IDLE.  Patch by Martin Panter.
2015-05-20 16:15:02 +03:00
Serhiy Storchaka e98209c2b4 Issue #24245: Eliminated senseless expect clauses that have no any effect.
Patch by Martin Panter.
2015-05-20 16:10:04 +03:00
Serhiy Storchaka ba9ac5b5c4 Issue #16261: Converted some bare except statements to except statements
with specified exception type.  Original patch by Ramchandra Apte.
2015-05-20 10:33:40 +03:00
Serhiy Storchaka 492f027793 Issue #22107: tempfile.gettempdir() and tempfile.mkdtemp() now try again
when a directory with the chosen name already exists on Windows as well as
on Unix.  tempfile.mkstemp() now fails early if parent directory is not
valid (not exists or is a file) on Windows.
2015-05-20 00:14:00 +03:00
Serhiy Storchaka 5d6b7b1cb7 Issue #22107: tempfile.gettempdir() and tempfile.mkdtemp() now try again
when a directory with the chosen name already exists on Windows as well as
on Unix.  tempfile.mkstemp() now fails early if parent directory is not
valid (not exists or is a file) on Windows.
2015-05-20 00:11:48 +03:00
Antoine Pitrou ef64847f71 Issue #23985: Fix a possible buffer overrun when deleting a slice from the front of a bytearray and then appending some other bytes data.
Patch by Martin Panter.
2015-05-19 20:55:42 +02:00
Antoine Pitrou 2545411e28 Issue #23985: Fix a possible buffer overrun when deleting a slice from the front of a bytearray and then appending some other bytes data.
Patch by Martin Panter.
2015-05-19 20:52:27 +02:00
R David Murray 6371446036 #24215: also back out changeset that broke test_trace in 3.4.
I missed that this change was applied to both branches.
2015-05-19 08:24:59 -04:00
R David Murray 7bc452d604 Back out changeset 955dffec3d94 since it broke the buildbots.
and the situation has not been addressed in several days.
2015-05-19 08:16:04 -04:00
Serhiy Storchaka 5bfc03f430 Issue #23780: Improved error message in os.path.join() with single argument.
Idea by R. David Murray.
2015-05-19 11:00:07 +03:00
Serhiy Storchaka 6baa0a53b0 Issue #6598: Increased time precision and random number range in
email.utils.make_msgid() to strengthen the uniqueness of the message ID.
2015-05-19 10:10:15 +03:00
Serhiy Storchaka ae760c0a2c Issue #6598: Increased time precision and random number range in
email.utils.make_msgid() to strengthen the uniqueness of the message ID.
2015-05-19 10:09:42 +03:00
Yury Selivanov 8687275358 Issue 24205: Improve inspect.Signature.bind() error messages. 2015-05-19 00:27:49 -04:00
Yury Selivanov 8085b80c18 Issue 24226: Fix parsing of many sequential one-line 'def' statements. 2015-05-18 12:50:52 -04:00
Serhiy Storchaka a2c145c2f3 Issue #24091: Fixed various crashes in corner cases in C implementation of
ElementTree.
2015-05-18 18:33:31 +03:00
Serhiy Storchaka 5bf3120e24 Issue #24091: Fixed various crashes in corner cases in C implementation of
ElementTree.
2015-05-18 18:29:33 +03:00
Serhiy Storchaka c0937f79ec Issue #24102: Fixed exception type checking in standard error handlers. 2015-05-18 16:10:40 +03:00
Serhiy Storchaka ca7fecb038 Issue #24102: Fixed exception type checking in standard error handlers. 2015-05-18 16:08:52 +03:00
Zachary Ware 4baebfe867 Issue #21337: Add bare-bones Tix test
All this does is confirm that Tix is available on Windows, which should
always be the case (if _tkinter itself is available).
2015-05-17 20:55:42 -05:00
R David Murray c17686f071 Issue #13866: add *quote_via* argument to urlencode.
Patch by samwyse, completed by Arnon Yaari, and reviewed by
Martin Panter.
2015-05-17 20:44:50 -04:00
R David Murray 8308444eef #24218: Add SMTPUTF8 support to send_message.
Reviewed by Maciej Szulik.
2015-05-17 19:27:22 -04:00
Raymond Hettinger 740d6134f1 merge 2015-05-17 14:47:00 -07:00
Raymond Hettinger 610a51f364 Issue #23757: Only call the concrete list API for exact lists. 2015-05-17 14:45:58 -07:00
R David Murray fdb23c2fe5 #20098: add mangle_from_ policy option.
This defaults to True in the compat32 policy for backward compatibility,
but to False for all new policies.

Patch by Milan Oberkirch, with a few tweaks.
2015-05-17 14:24:33 -04:00
R David Murray 224ef3ec3b #24211: Add RFC6532 support to the email library.
This could use more edge case tests, but the basic functionality is tested.
(Note that this changeset does not add tailored support for the RFC 6532
message/global MIME type, but the email package generic facilities will handle
it.)

Reviewed by Maciej Szulik.
2015-05-17 11:29:21 -04:00
Terry Jan Reedy bbbff3fcc0 Merge with 3.4 2015-05-16 19:33:32 -04:00
Terry Jan Reedy 296c66e21c Issue #24199: Make idlever module self updating. Syop using it in aboutDialog. 2015-05-16 19:28:32 -04:00
Serhiy Storchaka f7e39387b3 Fixed issue #16314 test for the case when lzma is not available. 2015-05-17 02:23:02 +03:00
Terry Jan Reedy c7e0522d42 Merge with 3.4 2015-05-16 18:31:32 -04:00
Terry Jan Reedy a0b8a508c9 Issue #24212: Put reference in idle.__main__ to issue with explanation. 2015-05-16 18:31:15 -04:00
Berker Peksag 9e7990ae21 Issue #24210: Silence more PendingDeprecationWarning warnings in tests. 2015-05-16 23:21:26 +03:00
R David Murray b744f3a45e #21083: add get_content_disposition method to email.message.
Patch by Abhilash Raj.
2015-05-16 15:41:07 -04:00
Serhiy Storchaka b9cec6a30f Issue #16314: Added support for the LZMA compression in distutils. 2015-05-16 22:13:27 +03:00
R David Murray b8cd3e4e30 #21804: Add RFC 6856 (UTF8) support to poplib.
Patch by Milan Oberkirch.
2015-05-16 15:05:53 -04:00
Serhiy Storchaka 8eb1f077c2 Issue #18682: Optimized pprint functions for builtin scalar types. 2015-05-16 21:38:05 +03:00
Serhiy Storchaka 6d90fd5fd9 Added tests for more builtin types.
Made test_pprint discoverable.
2015-05-16 21:35:56 +03:00
Serhiy Storchaka 5dbb40ff17 Added tests for more builtin types.
Made test_pprint discoverable.
2015-05-16 21:35:24 +03:00
Terry Jan Reedy b9731f26c3 Merge with 3.4 2015-05-16 14:24:06 -04:00
Terry Jan Reedy 031d0640cd Issue #23964: Update idlelib/idle_test/README.txt. first patch by Al Sweigart. 2015-05-16 14:23:39 -04:00
R David Murray cee7cf6026 #22027: Add RFC6531 support to smtplib.
Initial patch by Milan Oberkirch.
2015-05-16 13:58:14 -04:00
Yury Selivanov b907a513c8 Issue 24190: Add inspect.BoundArguments.apply_defaults() method. 2015-05-16 13:45:09 -04:00
Berker Peksag 1392f71c39 Issue #24210: Silence a PendingDeprecationWarning warning in platform.platform(). 2015-05-16 20:24:28 +03:00
Yury Selivanov 6738b1157a Issue 24208: Fix tests -- don't create a tempdir in __init__. 2015-05-16 10:10:21 -04:00
Benjamin Peterson de12b79cd6 allow test node after ** in calls (closes #24176) 2015-05-16 09:44:45 -04:00
Serhiy Storchaka df573d6ad8 Issue #24134: assertRaises(), assertRaisesRegex(), assertWarns() and
assertWarnsRegex() checks now emits a deprecation warning when callable is
None or keyword arguments except msg is passed in the context manager mode.
2015-05-16 16:29:50 +03:00
Serhiy Storchaka a7d00c207f Reverted issue #24134 changes (except new tests). 2015-05-16 16:25:43 +03:00
Terry Jan Reedy 75fb816c78 Issue #23184: idle tests, remove unused names and imports. 2015-05-15 23:55:21 -04:00
Eric Snow 183a941bc1 Issue #24192: Fix namespace package imports. 2015-05-15 21:54:59 -06:00
Terry Jan Reedy 188c18d48f Merge 3.4 #23184: idle tests, remove unused names and imports. 2015-05-15 23:55:49 -04:00
Terry Jan Reedy 7fae66ccd7 Merge with 3.4 Issue #23184: idlelib, remove more unused names and imports. 2015-05-15 23:03:53 -04:00
Terry Jan Reedy 038c16b9a0 Issue #23184: idlelib, remove more unused names and imports. 2015-05-15 23:03:17 -04:00
Yury Selivanov 0cd2bf46ba Issue 24200: Fix broken unittest. 2015-05-15 12:55:20 -04:00
Yury Selivanov f229bc5c53 inspect: Remove "0x..." IDs from Signature objects' __repr__
Issue 24200.
2015-05-15 12:53:56 -04:00
Yury Selivanov 3f6538fed0 Issue 22547: Implement informative __repr__ for inspect.BoundArguments 2015-05-14 18:47:17 -04:00
Yury Selivanov 6b4046f062 Merge 2015-05-14 18:33:14 -04:00
Yury Selivanov 4cfd4eac7d inspect: Test that BoundArguments.__eq__ repects the order of params 2015-05-14 18:30:27 -04:00
Yury Selivanov 692b340092 inspect: Micro-optimize __eq__ for Signature, Parameter and BoundArguments
Provide __ne__ method for consistency.
2015-05-14 18:20:01 -04:00
Terry Jan Reedy 8aad7f27a4 Merge with 3.4 2015-05-14 18:11:14 -04:00
Terry Jan Reedy 2733618fd9 idlelib: remove unused names and imports (one is a duplicate import). 2015-05-14 18:10:50 -04:00
Yury Selivanov e0104ae103 Issue 24184: Add AsyncIterator and AsyncIterable to collections.abc. 2015-05-14 12:19:16 -04:00
Yury Selivanov 08e5300afc collections.abc.tests: Remove some unnecessary code. 2015-05-13 23:57:59 -04:00
Yury Selivanov aded55c6e3 collections.abc: Test that if an object is a Coroutine it is also an Awaitable 2015-05-13 23:41:55 -04:00
Yury Selivanov 6abe03288b inspect: Add __slots__ to BoundArguments. 2015-05-13 17:18:41 -04:00
Yury Selivanov 9113dc7c97 Issue 24017: More tests for 'async for' and 'async with'. 2015-05-13 16:49:35 -04:00
Yury Selivanov c41632a856 asyncio/tests: Drop unused import. 2015-05-13 15:37:48 -04:00
Yury Selivanov 6c792bd65a asyncio: Add a test for asyncio.iscoroutine().
Test that asyncio.iscoroutine() supports 'async def' coroutines and
collections.abc.Coroutine types.
2015-05-13 15:34:12 -04:00
Yury Selivanov af928b65fc asyncio: Use 'collections.abc.Coroutine' in asyncio.iscoroutine. 2015-05-13 15:22:03 -04:00
Yury Selivanov c58cca5951 asyncio: Use 'collections.abc.Coroutine' in asyncio.iscoroutine (in 3.5) 2015-05-13 15:21:41 -04:00
Yury Selivanov d08c363c26 Sync asyncio code from default branch. 2015-05-13 15:15:56 -04:00
Yury Selivanov 33c6b569b7 Issue 24179: Support 'async for' for asyncio.StreamReader. 2015-05-13 14:23:29 -04:00
Yury Selivanov 29f88c22e6 Issue 24178: support 'async with' for asyncio locks. 2015-05-13 14:10:38 -04:00
Berker Peksag 50c72d2778 Issue #22064: Improve the misleading message from 2to3 when skipping optional fixers.
Patch by Vinod Kurup.
2015-05-13 13:40:12 +03:00
Berker Peksag 3a81f9ba46 Issue #22064: Improve the misleading message from 2to3 when skipping optional fixers.
Patch by Vinod Kurup.
2015-05-13 13:39:51 +03:00
Berker Peksag 2f3742b0d8 Issue #1322: platform.dist() and platform.linux_distribution() functions are now deprecated.
Initial patch by Vajrasky Kok.
2015-05-13 12:32:20 +03:00
Raymond Hettinger eac503aeac Issue #24064: Property() docstrings are now writeable.
(Patch by Berker Peksag.)
2015-05-13 01:09:59 -07:00
Zachary Ware 37ac590f7c Clean up test_coroutines a bit.
No more test_main(), s/assertEquals/assertEqual/, and remove unused import.
2015-05-13 01:03:06 -05:00
Nick Coghlan baaadbf70d Issue 24017: fix for "async with" refcounting
* adds missing INCREF in WITH_CLEANUP_START
* adds missing DECREF in WITH_CLEANUP_FINISH
* adds several new tests Yury created while investigating this
2015-05-13 15:54:02 +10:00
Zachary Ware 84d3e764d7 Issue #23911: Fix ctypes test on Windows.
Comparing equality of list and tuple is always False.
2015-05-13 00:34:39 -05:00
Zachary Ware d9b25bb511 Issue #23731: Fix tracemalloc test on Windows.
'a.pyo' can no longer match 'a.py', so 'a.PYO' can't either.
2015-05-13 00:27:01 -05:00
Zachary Ware ad3e27ae4c Issue #23193: Skip numeric_owner tests on platforms where they don't make sense
In particular, the tests bomb out on Windows.  The feature is a no-op on platforms
without the pwd module or os.geteuid anyway.
2015-05-12 23:57:21 -05:00
Raymond Hettinger 849564f874 Extend test coverage to include heapifying large heaps 2015-05-12 21:42:40 -07:00
Raymond Hettinger ffcd8490d0 Reduce the overhead in functools.total_ordering by localizing NotImplemented.
(Sugguested by Serhiy Storchaka)
2015-05-12 21:26:37 -07:00
Serhiy Storchaka cd4a5cc339 Added forgotten new files for issues #22681 and #22682. 2015-05-13 00:34:53 +03:00
Serhiy Storchaka 48e47aaa28 Issue #22486: Added the math.gcd() function. The fractions.gcd() function now is
deprecated.  Based on patch by Mark Dickinson.
2015-05-13 00:19:51 +03:00
Serhiy Storchaka f0eeedf0d8 Issue #22681: Added support for the koi8_t encoding. 2015-05-12 23:24:19 +03:00
Serhiy Storchaka ad8a1c3fb2 Issue #22682: Added support for the kz1048 encoding. 2015-05-12 23:16:55 +03:00
Yury Selivanov fdba8381ff Issue #24017: Unset asyncio event loop after test. 2015-05-12 14:28:08 -04:00
Yury Selivanov 08a7a4e592 asyncio: Make sure sys.set_coroutine_wrapper is called *only* when loop is running.
Previous approach of installing coroutine wrapper in loop.set_debug() and
uninstalling it in loop.close() was very fragile.  Most of asyncio tests
do not call loop.close() at all.  Since coroutine wrapper is a global
setting, we have to make sure that it's only set when the loop is
running, and is automatically unset when it stops running.

Issue #24017.
2015-05-12 11:43:35 -04:00
Yury Selivanov e8944cb217 asyncio: Make sure sys.set_coroutine_wrapper is called *only* when loop is running.
Previous approach of installing coroutine wrapper in loop.set_debug() and
uninstalling it in loop.close() was very fragile.  Most of asyncio tests
do not call loop.close() at all.  Since coroutine wrapper is a global
setting, we have to make sure that it's only set when the loop is
running, and is automatically unset when it stops running.

Issue #24017.
2015-05-12 11:43:04 -04:00
Berker Peksag ea6d5592f2 Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
if they called on a closed object.

Patch by John Hergenroeder.
2015-05-12 17:13:56 +03:00
Berker Peksag d10d6ae2fa Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
if they called on a closed object.

Patch by John Hergenroeder.
2015-05-12 17:01:05 +03:00