Commit Graph

97979 Commits

Author SHA1 Message Date
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
Mariatta 86eb93fae6 bpo-30530: Update Descriptor How To Documentation (GH-1845) (GH-1953)
Update the code example in Functions and Methods section
Remove objtype argument in MethodType
(cherry picked from commit 1bced56567)
2017-06-04 20:06:48 -07:00
Zachary Ware 47779d720a [3.6] Only run AppVeyor on long-lived branches (GH-1941)
Also on the short-lived `buildbot-custom` branch.
(cherry picked from commit d3bedf356a)
2017-06-04 19:50:37 -05:00
Zachary Ware 7e6d999b6c [3.6] Fix skipping test_UNC_path on AppVeyor due to a different error being raised (GH-1920)
We get `ERROR_BAD_NETPATH` (53) on AppVeyor which is translated to
ENOENT (2).
(cherry picked from commit 7a99625e0d)
2017-06-04 17:14:03 -05:00
Brett Cannon ba6bfcdfb4 [3.6] Turn on macOS builds for Travis (GH-1846) (#1929)
Initially the macOS builds are allowed to fail until such time that they can be determined to be stable and not add an unacceptable amount of time to the overall Travis-passing process.
(cherry picked from commit 21c2dd7cf8)
2017-06-03 10:33:53 -07:00
Steve Dower c63ae1122f bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails (#1912) (#1925)
* bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails

* bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails
2017-06-02 14:39:05 -07:00
Mariatta 1c92c0edca bpo-30052: Link `bytes` & `bytearray` to stdtypes not functions (GH-1271) (GH-1915)
Builtin container types have two potential link targets in the docs:

- their entry in the list of builtin callables
- their type documentation

This change brings `bytes` and `bytearray` into line with other
container types by having cross-references default to linking to
their type documentation, rather than their builtin callable entry..
(cherry picked from commit c6db4811f9)
2017-06-01 21:56:24 -07:00
Matthias Bussonnier e417d12d72 bpo-29660: traceback: Document that etype is ignored in some places. (GH-344) (GH-1913)
(cherry picked from commit cdb89cd)
2017-06-01 20:26:15 -07:00
Xiang Zhang 95b4da2be4 bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses (#1676) (#1903) 2017-06-01 22:20:27 +08:00
Mariatta 9d752aa5e6 bpo-30499: Remove a deprecated note about sets. (GH-1848) (GH-1905)
(cherry picked from commit 0737ee2067)
2017-06-01 07:12:01 -07:00
Mariatta 9522159bc4 bpo-22702: Clarify documentation of str.join & bytes.join (GH-156) (GH-1897)
The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition.
(cherry picked from commit 08e2f355d0)
2017-05-31 19:49:01 -07:00
csabella 9abd0bf68f bpo-27618: Clarify that threading.Lock is a factory function (GH-1307) (GH-1894)
(cherry picked from commit 56ddfd2eea)
2017-05-31 18:53:24 -07:00
Brett Cannon 767b6d7d2d [3.6] Fix Travis config to reinstate test build (GH-1879) (GH-1889)
(cherry picked from commit a5aa72ac78)
2017-05-31 15:52:39 -07:00