From 803502c56b1ead3a59ae0d203ebfa6869dc13fb0 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Sat, 15 Aug 2015 18:33:45 -0400 Subject: [PATCH 01/14] #21167: Fix definition of NAN when ICC used without -fp-model strict. Patch from Chris Hogan of Intel, reviewed by Mark Dickinson. --- Include/pymath.h | 24 +++++++++++++++++++++++- Misc/ACKS | 1 + Misc/NEWS | 3 +++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Include/pymath.h b/Include/pymath.h index 62a6c42bbf0..1ea9ac1437a 100644 --- a/Include/pymath.h +++ b/Include/pymath.h @@ -150,7 +150,29 @@ PyAPI_FUNC(void) _Py_set_387controlword(unsigned short); * doesn't support NaNs. */ #if !defined(Py_NAN) && !defined(Py_NO_NAN) -#define Py_NAN (Py_HUGE_VAL * 0.) +#if !defined(__INTEL_COMPILER) + #define Py_NAN (Py_HUGE_VAL * 0.) +#else /* __INTEL_COMPILER */ + #if defined(ICC_NAN_STRICT) + #pragma float_control(push) + #pragma float_control(precise, on) + #pragma float_control(except, on) + #if defined(_MSC_VER) + __declspec(noinline) + #else /* Linux */ + __attribute__((noinline)) + #endif /* _MSC_VER */ + static double __icc_nan() + { + return sqrt(-1.0); + } + #pragma float_control (pop) + #define Py_NAN __icc_nan() + #else /* ICC_NAN_RELAXED as default for Intel Compiler */ + static union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f}; + #define Py_NAN (__nan_store.__icc_nan) + #endif /* ICC_NAN_STRICT */ +#endif /* __INTEL_COMPILER */ #endif /* Py_OVERFLOWED(X) diff --git a/Misc/ACKS b/Misc/ACKS index e2e8387d958..c2386e8107b 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -594,6 +594,7 @@ Gregor Hoffleit Chris Hoffman Stefan Hoffmeister Albert Hofkamp +Chris Hogan Tomas Hoger Jonathan Hogg Kamilla Holanda diff --git a/Misc/NEWS b/Misc/NEWS index 27a05648cc6..459bacc443b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Release date: 2015-08-23 Core and Builtins ----------------- +- Issue #21167: NAN operations are now handled correctly when python is + compiled with ICC even if -fp-model strict is not specified. + Library ------- From 7ca6c55a4e2655dc0e5d780c3cc2ed7234edd72f Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Mon, 17 Aug 2015 14:46:51 -0400 Subject: [PATCH 02/14] Issue #24867: Fix asyncio.Task.get_stack() for 'async def' coroutines --- Lib/asyncio/tasks.py | 6 +++++- Lib/test/test_asyncio/test_pep492.py | 17 +++++++++++++++ Lib/test/test_asyncio/test_tasks.py | 32 ++++++++++++++++++++++++++++ Misc/NEWS | 2 ++ 4 files changed, 56 insertions(+), 1 deletion(-) diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 9bfc1cf8147..a235e742e23 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -128,7 +128,11 @@ class Task(futures.Future): returned for a suspended coroutine. """ frames = [] - f = self._coro.gi_frame + try: + # 'async def' coroutines + f = self._coro.cr_frame + except AttributeError: + f = self._coro.gi_frame if f is not None: while f is not None: if limit is not None: diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py index b702efcdfda..41e1b8a9e0c 100644 --- a/Lib/test/test_asyncio/test_pep492.py +++ b/Lib/test/test_asyncio/test_pep492.py @@ -186,6 +186,23 @@ class CoroutineTests(BaseTest): data = self.loop.run_until_complete(coro()) self.assertEqual(data, 'spam') + def test_task_print_stack(self): + T = None + + async def foo(): + f = T.get_stack(limit=1) + try: + self.assertEqual(f[0].f_code.co_name, 'foo') + finally: + f = None + + async def runner(): + nonlocal T + T = asyncio.ensure_future(foo(), loop=self.loop) + await T + + self.loop.run_until_complete(runner()) + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 251192acee4..04267873103 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -2,6 +2,7 @@ import contextlib import functools +import io import os import re import sys @@ -162,6 +163,37 @@ class TaskTests(test_utils.TestCase): 'function is deprecated, use ensure_'): self.assertIs(f, asyncio.async(f)) + def test_get_stack(self): + T = None + + @asyncio.coroutine + def foo(): + yield from bar() + + @asyncio.coroutine + def bar(): + # test get_stack() + f = T.get_stack(limit=1) + try: + self.assertEqual(f[0].f_code.co_name, 'foo') + finally: + f = None + + # test print_stack() + file = io.StringIO() + T.print_stack(limit=1, file=file) + file.seek(0) + tb = file.read() + self.assertRegex(tb, r'foo\(\) running') + + @asyncio.coroutine + def runner(): + nonlocal T + T = asyncio.ensure_future(foo(), loop=self.loop) + yield from T + + self.loop.run_until_complete(runner()) + def test_task_repr(self): self.loop.set_debug(False) diff --git a/Misc/NEWS b/Misc/NEWS index 27a05648cc6..a6f39498dc4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -74,6 +74,8 @@ Library - Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'. +- Issue #24867: Fix Task.get_stack() for 'async def' coroutines + Documentation ------------- From ab2a34abb7ffe959fc2a221d77943b51f82f8d65 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 19 Aug 2015 08:39:12 -0700 Subject: [PATCH 03/14] Issue #24847: Removes vcruntime140.dll dependency from Tcl/Tk. --- Misc/NEWS | 2 ++ PCbuild/get_externals.bat | 6 +++--- PCbuild/readme.txt | 2 +- PCbuild/tcl.vcxproj | 3 ++- PCbuild/tcltk.props | 4 ++-- PCbuild/tix.vcxproj | 6 ++---- PCbuild/tk.vcxproj | 4 ++-- Tools/msi/tcltk/tcltk.wixproj | 7 ------- 8 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 27a05648cc6..b844fd9305a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -13,6 +13,8 @@ Core and Builtins Library ------- +- Issue #24847: Removes vcruntime140.dll dependency from Tcl/Tk. + - Issue #24839: platform._syscmd_ver raises DeprecationWarning What's New in Python 3.5.0 release candidate 1? diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index 3037326129f..f9b740fa6aa 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -55,9 +55,9 @@ for %%e in ( bzip2-1.0.6 nasm-2.11.06 openssl-1.0.2d - tcl-core-8.6.4.1 - tk-8.6.4.1 - tix-8.4.3.4 + tcl-core-8.6.4.2 + tk-8.6.4.2 + tix-8.4.3.6 sqlite-3.8.11.0 xz-5.0.5 ) do ( diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 9d5f342e9e7..68cdb0ffbc6 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -236,7 +236,7 @@ _sqlite3 Homepage: http://www.sqlite.org/ _tkinter - Wraps version 8.6.1 of the Tk windowing system. + Wraps version 8.6.4 of the Tk windowing system. Homepage: http://www.tcl.tk/ diff --git a/PCbuild/tcl.vcxproj b/PCbuild/tcl.vcxproj index 8f2544a74e6..e9287c7b37d 100644 --- a/PCbuild/tcl.vcxproj +++ b/PCbuild/tcl.vcxproj @@ -61,7 +61,8 @@ - symbols + ucrt + symbols,ucrt INSTALLDIR="$(OutDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))" DEBUGFLAGS="-wd4456 -wd4457 -wd4458 -wd4459 -wd4996" setlocal diff --git a/PCbuild/tcltk.props b/PCbuild/tcltk.props index 96bd5777b8e..5e794e55375 100644 --- a/PCbuild/tcltk.props +++ b/PCbuild/tcltk.props @@ -5,7 +5,7 @@ 8 6 4 - 1 + 2 $(TclMajorVersion) $(TclMinorVersion) $(TclPatchLevel) @@ -13,7 +13,7 @@ 8 4 3 - 4 + 6 $(ExternalsDir)tcl-core-$(TclMajorVersion).$(TclMinorVersion).$(TclPatchLevel).$(TclRevision)\ $(ExternalsDir)tk-$(TkMajorVersion).$(TkMinorVersion).$(TkPatchLevel).$(TkRevision)\ $(ExternalsDir)tix-$(TixMajorVersion).$(TixMinorVersion).$(TixPatchLevel).$(TixRevision)\ diff --git a/PCbuild/tix.vcxproj b/PCbuild/tix.vcxproj index 74a6b84f573..1786324c2c6 100644 --- a/PCbuild/tix.vcxproj +++ b/PCbuild/tix.vcxproj @@ -56,11 +56,9 @@ - msvcrt - symbols,msvcrt BUILDDIRTOP="$(BuildDirTop)" TCL_DIR="$(tclDir.TrimEnd(`\`))" TK_DIR="$(tkDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))" - DEBUG=1 NODEBUG=0 TCL_DBGX=g DEBUGFLAGS="-wd4456 -wd4457 -wd4458 -wd4459 -wd4996" - DEBUG=0 NODEBUG=1 + DEBUG=1 NODEBUG=0 UCRT=1 TCL_DBGX=tg TK_DBGX=tg + DEBUG=0 NODEBUG=1 UCRT=1 TCL_DBGX=t TK_DBGX=t setlocal @(ExpectedOutputs->'if not exist "%(FullPath)" goto build',' ') diff --git a/PCbuild/tk.vcxproj b/PCbuild/tk.vcxproj index 20749f719f5..589338cf5cf 100644 --- a/PCbuild/tk.vcxproj +++ b/PCbuild/tk.vcxproj @@ -60,8 +60,8 @@ - msvcrt - symbols,msvcrt + ucrt + symbols,ucrt TCLDIR="$(tclDir.TrimEnd(`\`))" INSTALLDIR="$(OutDir.TrimEnd(`\`))" DEBUGFLAGS="-wd4456 -wd4457 -wd4458 -wd4459 -wd4996" setlocal diff --git a/Tools/msi/tcltk/tcltk.wixproj b/Tools/msi/tcltk/tcltk.wixproj index e1addd9ed54..f66fc149884 100644 --- a/Tools/msi/tcltk/tcltk.wixproj +++ b/Tools/msi/tcltk/tcltk.wixproj @@ -27,13 +27,6 @@ DLLs\ tcltk_dlls - - $(VCInstallDir)redist\$(Platform)\ - $(VCInstallDir)redist\$(Platform)\ - $(VCInstallDir)redist\$(Platform)\ - DLLs\ - tcltk_dlls - $(tcltkDir) From b98046b206020d4cefb0296ab893e946ba69b23f Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 19 Aug 2015 08:44:05 -0700 Subject: [PATCH 04/14] Fixes file that did not graft correctly. --- PCbuild/tix.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PCbuild/tix.vcxproj b/PCbuild/tix.vcxproj index 1786324c2c6..a1dad1e301e 100644 --- a/PCbuild/tix.vcxproj +++ b/PCbuild/tix.vcxproj @@ -57,8 +57,8 @@ BUILDDIRTOP="$(BuildDirTop)" TCL_DIR="$(tclDir.TrimEnd(`\`))" TK_DIR="$(tkDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))" - DEBUG=1 NODEBUG=0 UCRT=1 TCL_DBGX=tg TK_DBGX=tg - DEBUG=0 NODEBUG=1 UCRT=1 TCL_DBGX=t TK_DBGX=t + DEBUG=1 NODEBUG=0 UCRT=1 TCL_DBGX=g TK_DBGX=g + DEBUG=0 NODEBUG=1 UCRT=1 setlocal @(ExpectedOutputs->'if not exist "%(FullPath)" goto build',' ') From 1df0b35e3dfece45ef4d72fce2e3bdd256b5f6b3 Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Mon, 24 Aug 2015 19:53:56 -0700 Subject: [PATCH 05/14] Issue #24769: Interpreter now starts properly when dynamic loading is disabled. Patch by Petr Viktorin. --- Lib/importlib/_bootstrap.py | 2 +- Misc/NEWS | 4 +++ Python/clinic/import.c.h | 29 +++++++++++++++- Python/import.c | 69 ++++++++++++++++++++++++------------- Python/importlib.h | 2 +- 5 files changed, 80 insertions(+), 26 deletions(-) diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 931754e1544..6f62bb35fef 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -745,7 +745,7 @@ class BuiltinImporter: @classmethod def exec_module(self, module): """Exec a built-in module""" - _call_with_frames_removed(_imp.exec_dynamic, module) + _call_with_frames_removed(_imp.exec_builtin, module) @classmethod @_requires_builtin diff --git a/Misc/NEWS b/Misc/NEWS index 804f43bff58..422eaa67608 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Release date: 2015-08-23 Core and Builtins ----------------- +- Issue #24769: Interpreter now starts properly when dynamic loading + is disabled. Patch by Petr Viktorin. + - Issue #21167: NAN operations are now handled correctly when python is compiled with ICC even if -fp-model strict is not specified. @@ -20,6 +23,7 @@ Library - Issue #24839: platform._syscmd_ver raises DeprecationWarning + What's New in Python 3.5.0 release candidate 1? =============================================== diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 53b5b171eef..9ed62f4f721 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -318,6 +318,33 @@ exit: #endif /* defined(HAVE_DYNAMIC_LOADING) */ +PyDoc_STRVAR(_imp_exec_builtin__doc__, +"exec_builtin($module, mod, /)\n" +"--\n" +"\n" +"Initialize an extension module."); + +#define _IMP_EXEC_BUILTIN_METHODDEF \ + {"exec_builtin", (PyCFunction)_imp_exec_builtin, METH_O, _imp_exec_builtin__doc__}, + +static int +_imp_exec_builtin_impl(PyModuleDef *module, PyObject *mod); + +static PyObject * +_imp_exec_builtin(PyModuleDef *module, PyObject *mod) +{ + PyObject *return_value = NULL; + int _return_value; + + _return_value = _imp_exec_builtin_impl(module, mod); + if ((_return_value == -1) && PyErr_Occurred()) + goto exit; + return_value = PyLong_FromLong((long)_return_value); + +exit: + return return_value; +} + #ifndef _IMP_CREATE_DYNAMIC_METHODDEF #define _IMP_CREATE_DYNAMIC_METHODDEF #endif /* !defined(_IMP_CREATE_DYNAMIC_METHODDEF) */ @@ -325,4 +352,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=0f1059766dd58f88 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c38749cebcadbc3b input=a9049054013a1b77]*/ diff --git a/Python/import.c b/Python/import.c index 44aae809907..7fd49305cbd 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1943,6 +1943,34 @@ _imp_is_frozen_impl(PyModuleDef *module, PyObject *name) return PyBool_FromLong((long) (p == NULL ? 0 : p->size)); } +/* Common implementation for _imp.exec_dynamic and _imp.exec_builtin */ +static int +exec_builtin_or_dynamic(PyObject *mod) { + PyModuleDef *def; + void *state; + + if (!PyModule_Check(mod)) { + return 0; + } + + def = PyModule_GetDef(mod); + if (def == NULL) { + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + state = PyModule_GetState(mod); + if (PyErr_Occurred()) { + return -1; + } + if (state) { + /* Already initialized; skip reload */ + return 0; + } + return PyModule_ExecDef(mod, def); +} + #ifdef HAVE_DYNAMIC_LOADING /*[clinic input] @@ -2014,34 +2042,28 @@ static int _imp_exec_dynamic_impl(PyModuleDef *module, PyObject *mod) /*[clinic end generated code: output=4b84f1301b22d4bd input=9fdbfcb250280d3a]*/ { - PyModuleDef *def; - void *state; - - if (!PyModule_Check(mod)) { - return 0; - } - - def = PyModule_GetDef(mod); - if (def == NULL) { - if (PyErr_Occurred()) { - return -1; - } - return 0; - } - state = PyModule_GetState(mod); - if (PyErr_Occurred()) { - return -1; - } - if (state) { - /* Already initialized; skip reload */ - return 0; - } - return PyModule_ExecDef(mod, def); + return exec_builtin_or_dynamic(mod); } #endif /* HAVE_DYNAMIC_LOADING */ +/*[clinic input] +_imp.exec_builtin -> int + + mod: object + / + +Initialize a built-in module. +[clinic start generated code]*/ + +static int +_imp_exec_builtin_impl(PyModuleDef *module, PyObject *mod) +/*[clinic end generated code: output=215e99876a27e284 input=77ebec0c2a10ecca]*/ +{ + return exec_builtin_or_dynamic(mod); +} + /*[clinic input] dump buffer [clinic start generated code]*/ @@ -2064,6 +2086,7 @@ static PyMethodDef imp_methods[] = { _IMP_IS_FROZEN_METHODDEF _IMP_CREATE_DYNAMIC_METHODDEF _IMP_EXEC_DYNAMIC_METHODDEF + _IMP_EXEC_BUILTIN_METHODDEF _IMP__FIX_CO_FILENAME_METHODDEF {NULL, NULL} /* sentinel */ }; diff --git a/Python/importlib.h b/Python/importlib.h index d5d34066927..a4daf621e24 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -1304,7 +1304,7 @@ const unsigned char _Py_M__importlib[] = { 0,1,100,1,0,83,41,2,122,22,69,120,101,99,32,97, 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, 78,41,3,114,65,0,0,0,114,57,0,0,0,90,12,101, - 120,101,99,95,100,121,110,97,109,105,99,41,2,114,19,0, + 120,101,99,95,98,117,105,108,116,105,110,41,2,114,19,0, 0,0,114,89,0,0,0,114,10,0,0,0,114,10,0,0, 0,114,11,0,0,0,114,139,0,0,0,233,2,0,0,115, 2,0,0,0,0,3,122,27,66,117,105,108,116,105,110,73, From 01b1ff69701f2092ac92a086f2c794d9ca494f0e Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Mon, 24 Aug 2015 20:23:27 -0700 Subject: [PATCH 06/14] Rebuilt Clinic generated code. --- Python/clinic/import.c.h | 4 ++-- Python/import.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 9ed62f4f721..247766519e1 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -322,7 +322,7 @@ PyDoc_STRVAR(_imp_exec_builtin__doc__, "exec_builtin($module, mod, /)\n" "--\n" "\n" -"Initialize an extension module."); +"Initialize a built-in module."); #define _IMP_EXEC_BUILTIN_METHODDEF \ {"exec_builtin", (PyCFunction)_imp_exec_builtin, METH_O, _imp_exec_builtin__doc__}, @@ -352,4 +352,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=c38749cebcadbc3b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=32324a5e46cdfc4b input=a9049054013a1b77]*/ diff --git a/Python/import.c b/Python/import.c index 7fd49305cbd..edf030d87ae 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2059,7 +2059,7 @@ Initialize a built-in module. static int _imp_exec_builtin_impl(PyModuleDef *module, PyObject *mod) -/*[clinic end generated code: output=215e99876a27e284 input=77ebec0c2a10ecca]*/ +/*[clinic end generated code: output=215e99876a27e284 input=7beed5a2f12a60ca]*/ { return exec_builtin_or_dynamic(mod); } From db1ccc69f478c01cf961a7a6bf1f27418b6881bc Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Mon, 24 Aug 2015 20:30:34 -0700 Subject: [PATCH 07/14] Regenerated pydoc topics for Python 3.5.0rc2. --- Lib/pydoc_data/topics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py index 8b70dcfdad0..5083977a4e4 100644 --- a/Lib/pydoc_data/topics.py +++ b/Lib/pydoc_data/topics.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Autogenerated by Sphinx on Sun Aug 9 03:32:48 2015 +# Autogenerated by Sphinx on Mon Aug 24 20:29:23 2015 topics = {'assert': u'\nThe "assert" statement\n**********************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, "assert expression", is equivalent to\n\n if __debug__:\n if not expression: raise AssertionError\n\nThe extended form, "assert expression1, expression2", is equivalent to\n\n if __debug__:\n if not expression1: raise AssertionError(expression2)\n\nThese equivalences assume that "__debug__" and "AssertionError" refer\nto the built-in variables with those names. In the current\nimplementation, the built-in variable "__debug__" is "True" under\nnormal circumstances, "False" when optimization is requested (command\nline option -O). The current code generator emits no code for an\nassert statement when optimization is requested at compile time. Note\nthat it is unnecessary to include the source code for the expression\nthat failed in the error message; it will be displayed as part of the\nstack trace.\n\nAssignments to "__debug__" are illegal. The value for the built-in\nvariable is determined when the interpreter starts.\n', 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n | "*" target\n\n(See section *Primaries* for the syntax definitions for\n*attributeref*, *subscription*, and *slicing*.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list, optionally enclosed in\nparentheses or square brackets, is recursively defined as follows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The\n object must be an iterable with the same number of items as there\n are targets in the target list, and the items are assigned, from\n left to right, to the corresponding targets.\n\n * If the target list contains one target prefixed with an\n asterisk, called a "starred" target: The object must be a sequence\n with at least as many items as there are targets in the target\n list, minus one. The first items of the sequence are assigned,\n from left to right, to the targets before the starred target. The\n final items of the sequence are assigned to the targets after the\n starred target. A list of the remaining items in the sequence is\n then assigned to the starred target (the list can be empty).\n\n * Else: The object must be a sequence with the same number of\n items as there are targets in the target list, and the items are\n assigned, from left to right, to the corresponding targets.\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a "global" or "nonlocal" statement\n in the current code block: the name is bound to the object in the\n current local namespace.\n\n * Otherwise: the name is bound to the object in the global\n namespace or the outer namespace determined by "nonlocal",\n respectively.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in\n square brackets: The object must be an iterable with the same number\n of items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, "TypeError" is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily "AttributeError").\n\n Note: If the object is a class instance and the attribute reference\n occurs on both sides of the assignment operator, the RHS expression,\n "a.x" can access either an instance attribute or (if no instance\n attribute exists) a class attribute. The LHS target "a.x" is always\n set as an instance attribute, creating it if necessary. Thus, the\n two occurrences of "a.x" do not necessarily refer to the same\n attribute: if the RHS expression refers to a class attribute, the\n LHS creates a new instance attribute as the target of the\n assignment:\n\n class Cls:\n x = 3 # class variable\n inst = Cls()\n inst.x = inst.x + 1 # writes inst.x as 4 leaving Cls.x as 3\n\n This description does not necessarily apply to descriptor\n attributes, such as properties created with "property()".\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield an integer. If it is negative, the sequence\'s\n length is added to it. The resulting value must be a nonnegative\n integer less than the sequence\'s length, and the sequence is asked\n to assign the assigned object to its item with that index. If the\n index is out of range, "IndexError" is raised (assignment to a\n subscripted sequence cannot add new items to a list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n For user-defined objects, the "__setitem__()" method is called with\n appropriate arguments.\n\n* If the target is a slicing: The primary expression in the\n reference is evaluated. It should yield a mutable sequence object\n (such as a list). The assigned object should be a sequence object\n of the same type. Next, the lower and upper bound expressions are\n evaluated, insofar they are present; defaults are zero and the\n sequence\'s length. The bounds should evaluate to integers. If\n either bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the target\n sequence allows it.\n\n**CPython implementation detail:** In the current implementation, the\nsyntax for targets is taken to be the same as for expressions, and\ninvalid syntax is rejected during the code generation phase, causing\nless detailed error messages.\n\nAlthough the definition of assignment implies that overlaps between\nthe left-hand side and the right-hand side are \'simultanenous\' (for\nexample "a, b = b, a" swaps two variables), overlaps *within* the\ncollection of assigned-to variables occur left-to-right, sometimes\nresulting in confusion. For instance, the following program prints\n"[0, 2]":\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2 # i is updated, then x[i] is updated\n print(x)\n\nSee also: **PEP 3132** - Extended Iterable Unpacking\n\n The specification for the "*target" feature.\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n augtarget ::= identifier | attributeref | subscription | slicing\n augop ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions of the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like "x += 1" can be rewritten as\n"x = x + 1" to achieve a similar, but not exactly equal effect. In the\naugmented version, "x" is only evaluated once. Also, when possible,\nthe actual operation is performed *in-place*, meaning that rather than\ncreating a new object and assigning that to the target, the old object\nis modified instead.\n\nUnlike normal assignments, augmented assignments evaluate the left-\nhand side *before* evaluating the right-hand side. For example, "a[i]\n+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs\nthe addition, and lastly, it writes the result back to "a[i]".\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the same *caveat about\nclass and instance attributes* applies as for regular assignments.\n', 'atom-identifiers': u'\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name. See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a "NameError" exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them. The transformation inserts the\nclass name, with leading underscores removed and a single underscore\ninserted, in front of the name. For example, the identifier "__spam"\noccurring in a class named "Ham" will be transformed to "_Ham__spam".\nThis transformation is independent of the syntactical context in which\nthe identifier is used. If the transformed name is extremely long\n(longer than 255 characters), implementation defined truncation may\nhappen. If the class name consists only of underscores, no\ntransformation is done.\n', From e6c6f69ac935d045034712e53ee64fe46434e460 Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Mon, 24 Aug 2015 20:31:53 -0700 Subject: [PATCH 08/14] Version bump for Python 3.5.0rc2. --- Include/patchlevel.h | 4 ++-- Misc/NEWS | 2 +- README | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Include/patchlevel.h b/Include/patchlevel.h index b454c9b6747..85f3307a920 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -20,10 +20,10 @@ #define PY_MINOR_VERSION 5 #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA -#define PY_RELEASE_SERIAL 1 +#define PY_RELEASE_SERIAL 2 /* Version as a string */ -#define PY_VERSION "3.5.0rc1+" +#define PY_VERSION "3.5.0rc2" /*--end constants--*/ /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. diff --git a/Misc/NEWS b/Misc/NEWS index 422eaa67608..50db78b1e31 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -5,7 +5,7 @@ Python News What's New in Python 3.5.0 release candidate 2? =============================================== -Release date: 2015-08-23 +Release date: 2015-08-25 Core and Builtins ----------------- diff --git a/README b/README index f81f62a7340..16c109c07af 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -This is Python version 3.5.0 release candidate 1 +This is Python version 3.5.0 release candidate 2 ================================================ Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, From 5c21e6bbc8c06fc1bc6c4183f40e869f5e03019d Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Mon, 24 Aug 2015 20:32:19 -0700 Subject: [PATCH 09/14] Added tag v3.5.0rc2 for changeset cc15d736d860 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index ab6ce659e25..b1aa75d67e3 100644 --- a/.hgtags +++ b/.hgtags @@ -153,3 +153,4 @@ b4cbecbc0781e89a309d03b60a1f75f8499250e6 v3.4.3 0035fcd9b9243ae52c2e830204fd9c1f7d528534 v3.5.0b3 c0d64105463581f85d0e368e8d6e59b7fd8f12b1 v3.5.0b4 1a58b1227501e046eee13d90f113417b60843301 v3.5.0rc1 +cc15d736d860303b9da90d43cd32db39bab048df v3.5.0rc2 From a51812ae98157de257f074690c203ca7759fa0c0 Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Tue, 25 Aug 2015 13:30:58 -0700 Subject: [PATCH 10/14] Post-release updates for Python 3.5.0rc2. --- Include/patchlevel.h | 2 +- Misc/NEWS | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Include/patchlevel.h b/Include/patchlevel.h index 85f3307a920..9e81990dce6 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -23,7 +23,7 @@ #define PY_RELEASE_SERIAL 2 /* Version as a string */ -#define PY_VERSION "3.5.0rc2" +#define PY_VERSION "3.5.0rc2+" /*--end constants--*/ /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. diff --git a/Misc/NEWS b/Misc/NEWS index 50db78b1e31..9e50a456ddb 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -2,6 +2,18 @@ Python News +++++++++++ +What's New in Python 3.5.0 release candidate 3? +=============================================== + +Release date: 2015-09-06 + +Core and Builtins +----------------- + +Library +------- + + What's New in Python 3.5.0 release candidate 2? =============================================== From cd9b2123f6d3d9724fdf55dd22b4097a63a11836 Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Tue, 25 Aug 2015 13:37:23 -0700 Subject: [PATCH 11/14] Add missing Misc/NEWS item for merged pull request for issue #24867. --- Misc/NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Misc/NEWS b/Misc/NEWS index 9e50a456ddb..217a4cc9a05 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -35,6 +35,8 @@ Library - Issue #24839: platform._syscmd_ver raises DeprecationWarning +- Issue #24867: Fix Task.get_stack() for 'async def' coroutines + What's New in Python 3.5.0 release candidate 1? =============================================== From b96646684e66fef88f1e9cf47266abeea4116e7c Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Tue, 25 Aug 2015 13:41:35 -0700 Subject: [PATCH 12/14] Move misplaced Misc/NEWS item from 3.5.0rc1 to 3.5.0rc2. --- Misc/NEWS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 217a4cc9a05..d0312def54e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -28,6 +28,10 @@ Core and Builtins - Issue #21167: NAN operations are now handled correctly when python is compiled with ICC even if -fp-model strict is not specified. +- Issue #24492: A "package" lacking a __name__ attribute when trying to perform + a ``from .. import ...`` statement will trigger an ImportError instead of an + AttributeError. + Library ------- @@ -46,10 +50,6 @@ Release date: 2015-08-09 Core and Builtins ----------------- -- Issue #24492: A "package" lacking a __name__ attribute when trying to perform - a ``from .. import ...`` statement will trigger an ImportError instead of an - AttributeError. - - Issue #24667: Resize odict in all cases that the underlying dict resizes. Library From abcf3a128e0302931ce0e2f78294dd6e52f4d608 Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Tue, 25 Aug 2015 13:51:14 -0700 Subject: [PATCH 13/14] Added missing IDLE updates to Misc/NEWS that shipped with Python 3.5.0rc1. --- Misc/NEWS | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS b/Misc/NEWS index d0312def54e..60aeccf51f4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -97,7 +97,21 @@ Library - Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'. -- Issue #24867: Fix Task.get_stack() for 'async def' coroutines +IDLE +---- + +- Issue #23672: Allow Idle to edit and run files with astral chars in name. + Patch by Mohd Sanad Zaki Rizvi. + +- Issue 24745: Idle editor default font. Switch from Courier to + platform-sensitive TkFixedFont. This should not affect current customized + font selections. If there is a problem, edit $HOME/.idlerc/config-main.cfg + and remove 'fontxxx' entries from [Editor Window]. Patch by Mark Roseman. + +- Issue #21192: Idle editor. When a file is run, put its name in the restart bar. + Do not print false prompts. Original patch by Adnan Umer. + +- Issue #13884: Idle menus. Remove tearoff lines. Patch by Roger Serwy. Documentation ------------- From 9126d5499e7a634c9c9f2619ea6e961ff3b84662 Mon Sep 17 00:00:00 2001 From: Larry Hastings Date: Tue, 25 Aug 2015 14:08:21 -0700 Subject: [PATCH 14/14] Added missing #-marks to Misc/NEWS lines. --- Misc/NEWS | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 60aeccf51f4..1bf23343ab0 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -103,7 +103,7 @@ IDLE - Issue #23672: Allow Idle to edit and run files with astral chars in name. Patch by Mohd Sanad Zaki Rizvi. -- Issue 24745: Idle editor default font. Switch from Courier to +- Issue #24745: Idle editor default font. Switch from Courier to platform-sensitive TkFixedFont. This should not affect current customized font selections. If there is a problem, edit $HOME/.idlerc/config-main.cfg and remove 'fontxxx' entries from [Editor Window]. Patch by Mark Roseman. @@ -434,14 +434,14 @@ Library - Issue #14373: Added C implementation of functools.lru_cache(). Based on patches by Matt Joiner and Alexey Kachayev. -- Issue 24230: The tempfile module now accepts bytes for prefix, suffix and dir +- 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). - Issue #22189: collections.UserString now supports __getnewargs__(), __rmod__(), casefold(), format_map(), isprintable(), and maketrans(). Patch by Joe Jevnik. -- Issue 24244: Prevents termination when an invalid format string is +- Issue #24244: Prevents termination when an invalid format string is encountered on Windows in strftime. - Issue #23973: PEP 484: Add the typing module. @@ -579,26 +579,26 @@ Library - asyncio: async() function is deprecated in favour of ensure_future(). -- Issue 24178: asyncio.Lock, Condition, Semaphore, and BoundedSemaphore +- Issue #24178: asyncio.Lock, Condition, Semaphore, and BoundedSemaphore support new 'async with' syntax. Contributed by Yury Selivanov. -- Issue 24179: Support 'async for' for asyncio.StreamReader. +- Issue #24179: Support 'async for' for asyncio.StreamReader. Contributed by Yury Selivanov. -- Issue 24184: Add AsyncIterator and AsyncIterable ABCs to +- Issue #24184: Add AsyncIterator and AsyncIterable ABCs to collections.abc. Contributed by Yury Selivanov. -- Issue 22547: Implement informative __repr__ for inspect.BoundArguments. +- Issue #22547: Implement informative __repr__ for inspect.BoundArguments. Contributed by Yury Selivanov. -- Issue 24190: Implement inspect.BoundArgument.apply_defaults() method. +- Issue #24190: Implement inspect.BoundArgument.apply_defaults() method. Contributed by Yury Selivanov. -- Issue 20691: Add 'follow_wrapped' argument to +- Issue #20691: Add 'follow_wrapped' argument to inspect.Signature.from_callable() and inspect.signature(). Contributed by Yury Selivanov. -- Issue 24248: Deprecate inspect.Signature.from_function() and +- Issue #24248: Deprecate inspect.Signature.from_function() and inspect.Signature.from_builtin(). - Issue #23898: Fix inspect.classify_class_attrs() to support attributes @@ -700,7 +700,7 @@ Library - Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari -- Issue 19933: Provide default argument for ndigits in round. Patch by +- Issue #19933: Provide default argument for ndigits in round. Patch by Vajrasky Kok. - Issue #23193: Add a numeric_owner parameter to @@ -2516,7 +2516,7 @@ Library - Issue #13936: Remove the ability of datetime.time instances to be considered false in boolean contexts. -- Issue 18931: selectors module now supports /dev/poll on Solaris. +- Issue #18931: selectors module now supports /dev/poll on Solaris. Patch by Giampaolo Rodola'. - Issue #19977: When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale),