Commit Graph

98191 Commits

Author SHA1 Message Date
Yury Selivanov 176f2ebdad bpo-30508: Don't log exceptions if Task/Future "cancel()" method was called. (#2109) 2017-06-11 14:00:14 +00:00
terryjreedy 59422a29ee [3.6]bpo-30022: idlelib.run IOError -> OSError [GH-1051] (#2107)
Part of patch by Serhiy Storchaka.
(cherry-pick from 55fe1ae970)
2017-06-11 06:26:25 -04:00
terryjreedy a13225e209 [3.6]bpo-30144: change idlelib abc import [GH-1263] (#2106)
Part of patch by Serhiy Storchaka.
(cherry-pick from 2e576f5)
2017-06-11 06:12:31 -04:00
terryjreedy c6696feb09 [3.6] bpo-29919 Remove unused imports from idlelib [GH-137] (#2105)
Part of patch by Victor Stinner.
(cherry-pick from d6debb24e0)
2017-06-11 05:53:46 -04:00
terryjreedy d755d19ac4 [3.6] Remove unused imports (#2104)
Part of patch by Serhiy Strochaka, 2016-12-16 (no bpo issue)
(cherry-pick of 70d28a184c)
2017-06-11 04:45:35 -04:00
terryjreedy ccccf3156f bpo-30495: IDLE: Modernize textview.py with docstrings and PEP8 names (#1839) (#2102)
Patch by Cheryl Sabella.
(cherry picked from commit 0aa0a06e8b)
2017-06-11 04:16:55 -04:00
terryjreedy c0ef607c52 [3.6] bpo-30166: backport pyshell changes (GH 1293) (#2098)
(cherry-pick IDLE pyshell change from 7e4db2f)
2017-06-11 00:34:20 -04:00
terryjreedy 556cddba77 [3.6] Update idlelib NEWS for 3.6 (GH-2089) (#2097)
(cherry-picked from 503bc63)
2017-06-10 23:48:00 -04:00
terryjreedy 82e606785e [3.6] Add IDLE news items (GH-2090) (#2096)
(cherry-pick from c94c41c)
2017-06-10 23:15:08 -04:00
Mariatta 8d15b19be6 bpo-28556: Updates to typing module (GH-2076) (GH-2087)
This PR contains two updates to typing module:

- Support ContextManager on all versions (original PR by Jelle Zijlstra).
- Add generic AsyncContextManager..
(cherry picked from commit 29fda8db16)
2017-06-10 14:41:00 -07:00
Zachary Ware 964c261dc9 [3.6] bpo-27425: Be more explicit in .gitattributes (GH-840) (GH-2083)
Also updates checked-in line endings on some files
2017-06-10 15:39:29 -05:00
KatherineMichel 865ed9ea67 bpo-30312: Small correction in datastructures set code sample (GH-2081) (GH-2085)
(cherry picked from commit ca81615344)
2017-06-10 13:33:57 -07:00
Mariatta 76eabd3a21 bpo-25409: Clarify fnmatch and fnmatchcase documentation (GH-1535) (GH-2065)
Mention that fnmatchcase does not call normcase, and fnmatch does.
(cherry picked from commit e5f6e86c48)
2017-06-10 07:25:33 -07:00
Yury Selivanov 6e14fd2a14 [3.6] bpo-29406: asyncio SSL contexts leak sockets after calling close with certain servers (GH-409) (#2062)
* bpo-29406: asyncio SSL contexts leak sockets after calling close with certain servers (#409)

(cherry picked from commit a608d2d5a7)

* [3.6] bpo-29406: asyncio SSL contexts leak sockets after calling close with certain servers (GH-409)

* asyncio SSL contexts leak sockets after calling close with certain servers

* cleanup _shutdown_timeout_handle on _fatal_error.
(cherry picked from commit a608d2d5a7)
2017-06-10 10:00:45 -04:00
Serhiy Storchaka 911068e250 [3.6] Regenerate Argument Clinic code for bpo-19180. (GH-2073). (#2077)
(cherry picked from commit 5f31d5cf6e)
2017-06-10 13:48:53 +03:00
Victor Stinner 0b7629cd84 bpo-30038: fix race condition in signal delivery + wakeup fd (#1082) (#2075)
Before, it was possible to get the following sequence of
events (especially on Windows, where the C-level signal handler for
SIGINT is run in a separate thread):

- SIGINT arrives
- trip_signal is called
- trip_signal writes to the wakeup fd
- the main thread wakes up from select()-or-equivalent
- the main thread checks for pending signals, but doesn't see any
- the main thread drains the wakeup fd
- the main thread goes back to sleep
- trip_signal sets is_tripped=1 and calls Py_AddPendingCall to notify
  the main thread the it should run the Python-level signal handler
- the main thread doesn't notice because it's asleep

This has been causing repeated failures in the Trio test suite:
  https://github.com/python-trio/trio/issues/119
(cherry picked from commit 4ae0149697)
2017-06-10 11:20:03 +02:00
terryjreedy 12cbd87ac0 [3.6] bpo-30290: IDLE - pep8 names and tests for help-about (#2070)
(cherry picked from commit 054e09147a)

* bpo-30290: IDLE: Refactor help_about to PEP8 names (#1714)

Patch by Cheryl Sabella.
(cherry picked from commit 5a346d5dbc)

* IDLE test_help_about: edit and add test. (#1838)

Coverage is now 100%
(cherry picked from commit eca7da0f13)
2017-06-10 02:53:19 -04:00
Yury Selivanov 361362f3a0 [3.6] Fix TypeError is asyncio/proactor_events (GH-993) (#2061)
(cherry picked from commit 34792d25ab)
2017-06-10 00:15:28 -04:00
Mariatta 753422f6e3 bpo-30266: support "= None" pattern in AbstractContextManager (GH-1448) (GH-2054)
contextlib.AbstractContextManager now supports anti-registration
by setting __enter__ = None or __exit__ = None, following the pattern
introduced in bpo-25958..
(cherry picked from commit 57161aac5e)
2017-06-09 20:36:28 -07:00
Zachary Ware e380c19b7e [3.6] bpo-30417: Disable `cpu` resource on AppVeyor (GH-1951)
(cherry picked from commit 42e3acda86)
2017-06-09 22:26:31 -05:00
Mariatta 10c9a09ef4 [3.6] bpo-30335: Add deprecation alias entry for assertNotRegexpMatches (GH-1536) (GH-2055)
Document that assertNotRegexpMatches is a deprecated alias for assertNotRegex.
(cherry picked from commit 74921ed894)
2017-06-09 18:33:31 -07:00
Brett Cannon fe796efa66 [3.6] Make codecov config on master the only config used (GH-2041) (GH-2052)
This will allow for centralized management of the Codecov config to prevent skew as well as easier management going forward.

Closes python/core-workflowGH-81.
(cherry picked from commit 11ffb4543b)
2017-06-09 17:02:04 -07:00
Yury Selivanov fe9c7a0fd3 Break circular references when closing SSLTransport objects (#981) (#2049) 2017-06-09 19:14:35 -04:00
Yury Selivanov 7a16a4535d Closing transport during handshake process leaks socket (#480) (#2044) 2017-06-09 18:33:31 -04:00
Brett Cannon d24429a20d [3.6] Clarify what --enable-optimizations does (GH-1847) (GH-2039)
(cherry picked from commit b4e5fee6f5)
2017-06-09 14:34:32 -07:00
Yury Selivanov fa7f519113 Fix waiter cancellation in asyncio.Lock (#1031) (#2037)
Avoid a deadlock when the waiter who is about to take the lock is
cancelled

Issue #27585
2017-06-09 17:07:48 -04:00
Yury Selivanov e89f95bfd0 [3.6] bpo-30039: Don't run signal handlers while resuming a yield from stack (GH-1081) (#1640)
If we have a chain of generators/coroutines that are 'yield from'ing
each other, then resuming the stack works like:

- call send() on the outermost generator
- this enters _PyEval_EvalFrameDefault, which re-executes the
  YIELD_FROM opcode
- which calls send() on the next generator
- which enters _PyEval_EvalFrameDefault, which re-executes the
  YIELD_FROM opcode
- ...etc.

However, every time we enter _PyEval_EvalFrameDefault, the first thing
we do is to check for pending signals, and if there are any then we
run the signal handler. And if it raises an exception, then we
immediately propagate that exception *instead* of starting to execute
bytecode. This means that e.g. a SIGINT at the wrong moment can "break
the chain" – it can be raised in the middle of our yield from chain,
with the bottom part of the stack abandoned for the garbage collector.

The fix is pretty simple: there's already a special case in
_PyEval_EvalFrameEx where it skips running signal handlers if the next
opcode is SETUP_FINALLY. (I don't see how this accomplishes anything
useful, but that's another story.) If we extend this check to also
skip running signal handlers when the next opcode is YIELD_FROM, then
that closes the hole – now the exception can only be raised at the
innermost stack frame.

This shouldn't have any performance implications, because the opcode
check happens inside the "slow path" after we've already determined
that there's a pending signal or something similar for us to process;
the vast majority of the time this isn't true and the new check
doesn't run at all..
(cherry picked from commit ab4413a7e9)
2017-06-09 17:06:39 -04:00
Victor Stinner b7577456c4 bpo-30524: Write unit tests for FASTCALL (#2022) (#2030)
Test C functions:

* _PyObject_FastCall()
* _PyObject_FastCallDict()
* _PyObject_FastCallKeywords()
(cherry picked from commit 3b5cf85edc)
2017-06-09 22:28:32 +02:00
terryjreedy bbeaccc76b [3.6] IDLE test_textview: add comments and test, increase coverage to 100% (GH-1641) (#2018)
(cherry picked from commit 295304d412)
2017-06-09 15:59:31 -04:00
Mariatta af609a00a6 bpo-24755: Document asyncio.wrap_future (GH-603) (GH-2019)
(cherry picked from commit 824f687912)
2017-06-09 07:32:46 -07:00
Nick Coghlan c422959dac [3.6] bpo-19180: Updated references for RFC 1750, RFC 3280 & RFC 4366
* RFC 1750 has been been obsoleted by RFC 4086.
* RFC 3280 has been obsoleted by RFC 5280.
* RFC 4366 has been obsoleted by RFC 6066.
(cherry picked from commit 63c2c8ac17)
2017-06-09 22:37:53 +10:00
Victor Stinner f0ff849adc bpo-30524: Fix _PyStack_UnpackDict() (#1886)
* bpo-29259: Remove unused func parameter of _PyStack_UnpackDict()
* bpo-29286: Change _PyStack_UnpackDict() prototype to be able to
  notify of failure when args is NULL. _PyStack_UnpackDict() now
  returns -1 on error.
2017-06-09 13:24:53 +02:00
Serhiy Storchaka 570b1c971c [3.6] bpo-30529: Fix errors for invalid whitespaces in f-string subexpressions. (GH-1888) (#2013)
'invalid character in identifier' now is raised instead of
'f-string: empty expression not allowed' if a subexpression contains
only whitespaces and they are not accepted by Python parser.
(cherry picked from commit 2e9cd58)
2017-06-09 00:38:06 +03:00
Victor Stinner b319d09ee4 bpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2004)
On Windows, subprocess.Popen.communicate() now also ignore EINVAL
on stdin.write() if the child process is still running but closed the
pipe.
(cherry picked from commit d52aa31378)
2017-06-08 23:14:07 +02:00
Victor Stinner 31b950ab86 bpo-30601: Fix a refleak in WindowsConsoleIO (#2003) (#2008)
Fix a reference leak in _io._WindowsConsoleIO: PyUnicode_FSDecoder()
always initialize decodedname when it succeed and it doesn't clear
input decodedname object.
(cherry picked from commit 29adc13bd7)
2017-06-08 23:13:12 +02:00
Denis Osipov ca1b66fd05 [3.6] bpo-30584: Fix test_os fails on non-English Windows (GH-1980) (#1999)
* Fix bpo-30584

* Adding a comment mentionning the bpo and explaining what is the identifier

* Add Denis Osipov to Misc/ACKS
(cherry picked from commit 897bba7563)
2017-06-08 14:02:05 +02:00
Nathaniel J. Smith 854f7ba1d5 [3.6] bpo-30594: Fixed refcounting in newPySSLSocket (GH-1992) (#1994)
If pass a server_hostname= that fails IDNA decoding to SSLContext.wrap_socket or SSLContext.wrap_bio, then the SSLContext object had a spurious Py_DECREF called on it, eventually leading to segfaults.
(cherry picked from commit 65ece7ca23)
2017-06-08 14:14:40 +03:00
Matthias Klose 2c7f927369 [3.6] trivial: update config.{guess,sub} from gnu.org. (GH-1987) (#1990)
* Update config.{guess,sub} from gnu.org.
(cherry picked from commit 6f46683a62)
2017-06-07 18:07:41 -07:00
Antoine Pietri ceabf9acf0 bpo-30177: pathlib: include the full path in resolve(strict=False) (#1893) (#1985) 2017-06-07 10:18:56 -07:00
Nate 09b6c0c71e [3.6] bpo-29822: make inspect.isabstract() work during __init_subclass__ (#1979)
At the time when an abstract base class' __init_subclass__ runs,
ABCMeta.__new__ has not yet finished running, so in the presence of
__init_subclass__, inspect.isabstract() can no longer depend only on
TPFLAGS_IS_ABSTRACT.
(cherry picked from commit fcfe80ec25)
2017-06-07 07:21:34 +03:00
Nate 6fb12b5c43 bpo-29581: bpo-29581: Make ABCMeta.__new__ pass **kwargs to type.__new__ (GH-527) (GH-1282)
Many metaclasses in the standard library don't play nice with
__init_subclass__. This bug makes ABCMeta in particular with
__init_subclass__, which is an 80/20 solution for me personally.
AFAICT, a general solution to this problem requires updating all
metaclasses in the standard library to make sure they pass **kwargs to
type.__new__, whereas this PR only fixes ABCMeta. For context, see
https://bugs.python.org/issue29581.

* added a test combining ABCMeta and __init_subclass__
* Added NEWS item

(cherry picked from commit bd583ef985)

* [3.6] bpo-29581: Make ABCMeta.__new__ pass **kwargs to type.__new__ (GH-527)

Many metaclasses in the standard library don't play nice with
__init_subclass__. This bug makes ABCMeta in particular with
__init_subclass__, which is an 80/20 solution for me personally.
AFAICT, a general solution to this problem requires updating all
metaclasses in the standard library to make sure they pass **kwargs to
type.__new__, whereas this PR only fixes ABCMeta. For context, see
https://bugs.python.org/issue29581.

* added a test combining ABCMeta and __init_subclass__
* Added NEWS item.
(cherry picked from commit bd583ef985)

* **kwargs -> ``kwargs`` in attempts to fix the Travis build.

* Quote the **kwargs
2017-06-06 17:31:03 -07:00
gfyoung 063f0b3583 bpo-29596: Improve clinic howto documentation (GH-1710) (GH-1976)
Clarify that `two-pass` buffer can only be dumped once, and it prints out all text sent to it during all processing, even from Clinic blocks *after* the dumping point.
2017-06-06 14:17:18 -07:00
Steve Dower 2bafc0dcca [3.6] bpo-30557: faulthandler now correctly filters and displays exception … (#1960)
* bpo-30557: faulthandler now correctly filters and displays exception codes on Windows (#1924)

* bpo-30557: faulthandler now correctly filters and displays exception codes on Windows

* Adds test for non-fatal exceptions.

* Adds bpo number to comment.

* bpo-30557: Fix test_faulthandler (#1969)

On Windows 8, 8.1 and 10 at least, the exit code is the exception
code (no bit is cleared).
2017-06-06 13:47:14 -07:00
wim glenn b25b7254d9 bpo-30583: Fix typo in datetime dateutil documentation (GH-1972) (GH-1974)
Replace `datetuil` into `dateutil`
(cherry picked from commit 53f2af1655)
2017-06-06 12:32:14 -07:00
Serhiy Storchaka 68e5af89d4 [3.6] bpo-30567: Fix refleak in sys.getwindowsversion (GH-1940) (#1970)
(cherry picked from commit 48fb766)
2017-06-06 19:23:02 +03:00
Mariatta e1a60d9032 [3.6] bpo-30303: IDLE: Add _utest argument to textview (GH-1499) (#1916)
(cherry picked from commit ba365da9ce)
2017-06-06 11:56:59 -04:00
Zachary Ware 01ea561f29 [3.6] Install dependencies in Travis OSX build (GH-1952)
(cherry picked from commit 167e0fc211)
2017-06-05 22:41:17 -05:00
Nick Coghlan 798cfb2123 bpo-30052: Always regenerate cross-references (GH-1339) (GH-1921)
The patch for bpo-30052 changed the preferred link target
for :func:`bytes` and :func`bytearray` references to be the
respective type definitions rather than the corresponding
builtin function entries.

This patch changes the daily documentation builds to disable
the output caching in Sphinx, in order to ensure that
cross-reference changes like this one are reliably picked
up and applied automatically after merging.
(cherry picked from commit 7a82f9c2b9)
2017-06-05 19:19:37 -07:00
Zachary Ware d125738e93 [3.6] bpo-30417: Disable 'cpu' and 'tzdata' resources on Travis (GH-1928)
Also weakens the 'should this be run?' regex to allow all builds when .travis.yml changes.
(cherry picked from commit c53b13b270)
2017-06-05 19:10:21 -05:00
csabella ce40550acd bpo-30538: Update count() in Functional Programming HOWTO (GH-1919) (GH-1943)
* bpo-30538: Update count() in Functional HOWTO
* bpo-30538: Update enumerate() arguments in Functional HOWTO
(cherry picked from commit 9be4ff359d)
2017-06-04 20:12:23 -07:00