From python-checkins at python.org Sun May 1 02:07:01 2016 From: python-checkins at python.org (berker.peksag) Date: Sun, 01 May 2016 06:07:01 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2323960=3A_Cleanup_args_and_kwargs_on_error_in_Py?= =?utf-8?q?Err=5FSetImportError?= Message-ID: <20160501060701.14942.13385.C25A3AB7@psf.io> https://hg.python.org/cpython/rev/94471357db08 changeset: 101196:94471357db08 parent: 101194:5b5fbce1db9c parent: 101195:5871b48f4c2e user: Berker Peksag date: Sun May 01 09:06:57 2016 +0300 summary: Issue #23960: Cleanup args and kwargs on error in PyErr_SetImportError Patch by Ofer Schwarz. files: Python/errors.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Python/errors.c b/Python/errors.c --- a/Python/errors.c +++ b/Python/errors.c @@ -727,9 +727,9 @@ PyTuple_SET_ITEM(args, 0, msg); if (PyDict_SetItemString(kwargs, "name", name) < 0) - return NULL; + goto done; if (PyDict_SetItemString(kwargs, "path", path) < 0) - return NULL; + goto done; error = PyObject_Call(PyExc_ImportError, args, kwargs); if (error != NULL) { @@ -737,9 +737,9 @@ Py_DECREF(error); } +done: Py_DECREF(args); Py_DECREF(kwargs); - return NULL; } -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 02:07:04 2016 From: python-checkins at python.org (berker.peksag) Date: Sun, 01 May 2016 06:07:04 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzIzOTYw?= =?utf-8?q?=3A_Cleanup_args_and_kwargs_on_error_in_PyErr=5FSetImportError?= Message-ID: <20160501060701.21691.83082.F47DB1AB@psf.io> https://hg.python.org/cpython/rev/5871b48f4c2e changeset: 101195:5871b48f4c2e branch: 3.5 parent: 101193:db5baad7ad69 user: Berker Peksag date: Sun May 01 09:06:36 2016 +0300 summary: Issue #23960: Cleanup args and kwargs on error in PyErr_SetImportError Patch by Ofer Schwarz. files: Python/errors.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Python/errors.c b/Python/errors.c --- a/Python/errors.c +++ b/Python/errors.c @@ -727,9 +727,9 @@ PyTuple_SET_ITEM(args, 0, msg); if (PyDict_SetItemString(kwargs, "name", name) < 0) - return NULL; + goto done; if (PyDict_SetItemString(kwargs, "path", path) < 0) - return NULL; + goto done; error = PyObject_Call(PyExc_ImportError, args, kwargs); if (error != NULL) { @@ -737,9 +737,9 @@ Py_DECREF(error); } +done: Py_DECREF(args); Py_DECREF(kwargs); - return NULL; } -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 04:28:40 2016 From: python-checkins at python.org (berker.peksag) Date: Sun, 01 May 2016 08:28:40 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326898=3A_Fix_typo_in_math=2Eisclose=28=29_docst?= =?utf-8?q?ring?= Message-ID: <20160501082840.1506.37715.86254514@psf.io> https://hg.python.org/cpython/rev/634764b4675c changeset: 101198:634764b4675c parent: 101196:94471357db08 parent: 101197:469bc90e8922 user: Berker Peksag date: Sun May 01 11:27:59 2016 +0300 summary: Issue #26898: Fix typo in math.isclose() docstring Patch by Marco Buttu. files: Modules/mathmodule.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -2046,7 +2046,7 @@ } PyDoc_STRVAR(math_isclose_doc, -"is_close(a, b, *, rel_tol=1e-09, abs_tol=0.0) -> bool\n" +"isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0) -> bool\n" "\n" "Determine whether two floating point numbers are close in value.\n" "\n" -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 04:28:41 2016 From: python-checkins at python.org (berker.peksag) Date: Sun, 01 May 2016 08:28:41 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2ODk4?= =?utf-8?q?=3A_Fix_typo_in_math=2Eisclose=28=29_docstring?= Message-ID: <20160501082840.39170.58519.9779D29D@psf.io> https://hg.python.org/cpython/rev/469bc90e8922 changeset: 101197:469bc90e8922 branch: 3.5 parent: 101195:5871b48f4c2e user: Berker Peksag date: Sun May 01 11:27:37 2016 +0300 summary: Issue #26898: Fix typo in math.isclose() docstring Patch by Marco Buttu. files: Modules/mathmodule.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -2046,7 +2046,7 @@ } PyDoc_STRVAR(math_isclose_doc, -"is_close(a, b, *, rel_tol=1e-09, abs_tol=0.0) -> bool\n" +"isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0) -> bool\n" "\n" "Determine whether two floating point numbers are close in value.\n" "\n" -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Sun May 1 04:52:34 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 01 May 2016 08:52:34 +0000 Subject: [Python-checkins] Daily reference leaks (5b5fbce1db9c): sum=11 Message-ID: <20160501085233.39162.80946.D2513FC8@psf.io> results for 5b5fbce1db9c on branch "default" -------------------------------------------- test_asyncio leaked [0, 3, 0] memory blocks, sum=3 test_collections leaked [4, -4, 0] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [3, 0, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog5AqhRW', '--timeout', '7200'] From python-checkins at python.org Sun May 1 06:07:33 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 01 May 2016 10:07:33 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Fixed_declarations_of_=5FPy=5FDumpTraceback=28=29_and_?= =?utf-8?b?X1B5X0R1bXBUcmFjZWJhY2tUaHJlYWRzKCku?= Message-ID: <20160501100733.1536.7618.AC5068A4@psf.io> https://hg.python.org/cpython/rev/5b2edc905db4 changeset: 101200:5b2edc905db4 parent: 101198:634764b4675c parent: 101199:4f5e4155c259 user: Serhiy Storchaka date: Sun May 01 13:07:14 2016 +0300 summary: Fixed declarations of _Py_DumpTraceback() and _Py_DumpTracebackThreads(). files: Include/traceback.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Include/traceback.h b/Include/traceback.h --- a/Include/traceback.h +++ b/Include/traceback.h @@ -48,7 +48,7 @@ This function is signal safe. */ -PyAPI_DATA(void) _Py_DumpTraceback( +PyAPI_FUNC(void) _Py_DumpTraceback( int fd, PyThreadState *tstate); @@ -75,7 +75,7 @@ This function is signal safe. */ -PyAPI_DATA(const char*) _Py_DumpTracebackThreads( +PyAPI_FUNC(const char*) _Py_DumpTracebackThreads( int fd, PyInterpreterState *interp, PyThreadState *current_tstate); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 06:07:34 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 01 May 2016 10:07:34 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Fixed_declarat?= =?utf-8?q?ions_of_=5FPy=5FDumpTraceback=28=29_and_=5FPy=5FDumpTracebackTh?= =?utf-8?b?cmVhZHMoKS4=?= Message-ID: <20160501100733.84492.49195.05A1DC16@psf.io> https://hg.python.org/cpython/rev/4f5e4155c259 changeset: 101199:4f5e4155c259 branch: 3.5 parent: 101197:469bc90e8922 user: Serhiy Storchaka date: Sun May 01 13:06:43 2016 +0300 summary: Fixed declarations of _Py_DumpTraceback() and _Py_DumpTracebackThreads(). files: Include/traceback.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Include/traceback.h b/Include/traceback.h --- a/Include/traceback.h +++ b/Include/traceback.h @@ -48,7 +48,7 @@ This function is signal safe. */ -PyAPI_DATA(void) _Py_DumpTraceback( +PyAPI_FUNC(void) _Py_DumpTraceback( int fd, PyThreadState *tstate); @@ -62,7 +62,7 @@ This function is signal safe. */ -PyAPI_DATA(const char*) _Py_DumpTracebackThreads( +PyAPI_FUNC(const char*) _Py_DumpTracebackThreads( int fd, PyInterpreterState *interp, PyThreadState *current_thread); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 06:37:07 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 01 May 2016 10:37:07 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326711=3A_Fixed_the_comparison_of_plistlib=2EDat?= =?utf-8?q?a_with_other_types=2E?= Message-ID: <20160501103706.21671.69089.BBF20239@psf.io> https://hg.python.org/cpython/rev/dbdd5bc4df99 changeset: 101202:dbdd5bc4df99 parent: 101200:5b2edc905db4 parent: 101201:41afb83cffac user: Serhiy Storchaka date: Sun May 01 13:36:42 2016 +0300 summary: Issue #26711: Fixed the comparison of plistlib.Data with other types. files: Lib/plistlib.py | 4 ++-- Lib/test/test_plistlib.py | 6 +++--- Misc/NEWS | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Lib/plistlib.py b/Lib/plistlib.py --- a/Lib/plistlib.py +++ b/Lib/plistlib.py @@ -225,10 +225,10 @@ def __eq__(self, other): if isinstance(other, self.__class__): return self.data == other.data - elif isinstance(other, str): + elif isinstance(other, bytes): return self.data == other else: - return id(self) == id(other) + return NotImplemented def __repr__(self): return "%s(%s)" % (self.__class__.__name__, repr(self.data)) diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py --- a/Lib/test/test_plistlib.py +++ b/Lib/test/test_plistlib.py @@ -514,15 +514,15 @@ cur = plistlib.loads(buf) self.assertEqual(cur, out_data) - self.assertNotEqual(cur, in_data) + self.assertEqual(cur, in_data) cur = plistlib.loads(buf, use_builtin_types=False) - self.assertNotEqual(cur, out_data) + self.assertEqual(cur, out_data) self.assertEqual(cur, in_data) with self.assertWarns(DeprecationWarning): cur = plistlib.readPlistFromBytes(buf) - self.assertNotEqual(cur, out_data) + self.assertEqual(cur, out_data) self.assertEqual(cur, in_data) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -256,6 +256,8 @@ Library ------- +- Issue #26711: Fixed the comparison of plistlib.Data with other types. + - Issue #24114: Fix an uninitialized variable in `ctypes.util`. The bug only occurs on SunOS when the ctypes implementation searches -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 06:37:07 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 01 May 2016 10:37:07 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2NzEx?= =?utf-8?q?=3A_Fixed_the_comparison_of_plistlib=2EData_with_other_types=2E?= Message-ID: <20160501103706.84508.83350.4D3EECCF@psf.io> https://hg.python.org/cpython/rev/41afb83cffac changeset: 101201:41afb83cffac branch: 3.5 parent: 101199:4f5e4155c259 user: Serhiy Storchaka date: Sun May 01 13:36:16 2016 +0300 summary: Issue #26711: Fixed the comparison of plistlib.Data with other types. files: Lib/plistlib.py | 4 ++-- Lib/test/test_plistlib.py | 6 +++--- Misc/NEWS | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Lib/plistlib.py b/Lib/plistlib.py --- a/Lib/plistlib.py +++ b/Lib/plistlib.py @@ -225,10 +225,10 @@ def __eq__(self, other): if isinstance(other, self.__class__): return self.data == other.data - elif isinstance(other, str): + elif isinstance(other, bytes): return self.data == other else: - return id(self) == id(other) + return NotImplemented def __repr__(self): return "%s(%s)" % (self.__class__.__name__, repr(self.data)) diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py --- a/Lib/test/test_plistlib.py +++ b/Lib/test/test_plistlib.py @@ -515,15 +515,15 @@ cur = plistlib.loads(buf) self.assertEqual(cur, out_data) - self.assertNotEqual(cur, in_data) + self.assertEqual(cur, in_data) cur = plistlib.loads(buf, use_builtin_types=False) - self.assertNotEqual(cur, out_data) + self.assertEqual(cur, out_data) self.assertEqual(cur, in_data) with self.assertWarns(DeprecationWarning): cur = plistlib.readPlistFromBytes(buf) - self.assertNotEqual(cur, out_data) + self.assertEqual(cur, out_data) self.assertEqual(cur, in_data) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -107,6 +107,8 @@ Library ------- +- Issue #26711: Fixed the comparison of plistlib.Data with other types. + - Issue #24114: Fix an uninitialized variable in `ctypes.util`. The bug only occurs on SunOS when the ctypes implementation searches -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 13:04:55 2016 From: python-checkins at python.org (ethan.furman) Date: Sun, 01 May 2016 17:04:55 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogaXNzdWUyNjg5Mzog?= =?utf-8?q?use_mro=28=29_to_examine_class_heirarchy?= Message-ID: <20160501170455.12168.30034.EAE16D02@psf.io> https://hg.python.org/cpython/rev/1b6581bae5a1 changeset: 101203:1b6581bae5a1 branch: 3.5 parent: 101201:41afb83cffac user: Ethan Furman date: Sun May 01 10:03:53 2016 -0700 summary: issue26893: use mro() to examine class heirarchy files: Lib/enum.py | 2 +- Lib/test/test_enum.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/Lib/enum.py b/Lib/enum.py --- a/Lib/enum.py +++ b/Lib/enum.py @@ -118,7 +118,7 @@ # save attributes from super classes so we know if we can take # the shortcut of storing members in the class dict - base_attributes = {a for b in bases for a in b.__dict__} + base_attributes = {a for b in enum_class.mro() for a in b.__dict__} # Reverse value->name map for hashable values. enum_class._value2member_map_ = {} diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -1568,6 +1568,19 @@ triple = 3 turkey = 3 + def test_unique_with_name(self): + @unique + class Silly(Enum): + one = 1 + two = 'dos' + name = 3 + @unique + class Sillier(IntEnum): + single = 1 + name = 2 + triple = 3 + value = 4 + expected_help_output_with_docs = """\ Help on class Color in module %s: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 13:05:00 2016 From: python-checkins at python.org (ethan.furman) Date: Sun, 01 May 2016 17:05:00 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_issue26893=3A_use_mro=28=29_to_examine_class_heirarchy?= Message-ID: <20160501170500.7003.43857.B7273176@psf.io> https://hg.python.org/cpython/rev/7188de6b50ab changeset: 101204:7188de6b50ab parent: 101202:dbdd5bc4df99 parent: 101203:1b6581bae5a1 user: Ethan Furman date: Sun May 01 10:04:21 2016 -0700 summary: issue26893: use mro() to examine class heirarchy files: Lib/enum.py | 2 +- Lib/test/test_enum.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/Lib/enum.py b/Lib/enum.py --- a/Lib/enum.py +++ b/Lib/enum.py @@ -124,7 +124,7 @@ # save attributes from super classes so we know if we can take # the shortcut of storing members in the class dict - base_attributes = {a for b in bases for a in b.__dict__} + base_attributes = {a for b in enum_class.mro() for a in b.__dict__} # Reverse value->name map for hashable values. enum_class._value2member_map_ = {} diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -1591,6 +1591,19 @@ triple = 3 turkey = 3 + def test_unique_with_name(self): + @unique + class Silly(Enum): + one = 1 + two = 'dos' + name = 3 + @unique + class Sillier(IntEnum): + single = 1 + name = 2 + triple = 3 + value = 4 + expected_help_output_with_docs = """\ Help on class Color in module %s: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 13:34:26 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 01 May 2016 17:34:26 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Regenerate_Argument_Clinic_code_for_issue_=2326874=2E?= Message-ID: <20160501173423.21663.14552.0F6905BD@psf.io> https://hg.python.org/cpython/rev/98678738b7e9 changeset: 101206:98678738b7e9 parent: 101204:7188de6b50ab parent: 101205:84ff79cce41e user: Serhiy Storchaka date: Sun May 01 20:34:00 2016 +0300 summary: Regenerate Argument Clinic code for issue #26874. files: Python/bltinmodule.c | 2 +- Python/clinic/bltinmodule.c.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -801,7 +801,7 @@ static PyObject * builtin_divmod_impl(PyModuleDef *module, PyObject *x, PyObject *y) -/*[clinic end generated code: output=9ad0076120ebf9ac input=7fdb15f8a97a5fe7]*/ +/*[clinic end generated code: output=9ad0076120ebf9ac input=175ad9c84ff41a85]*/ { return PyNumber_Divmod(x, y); } diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -179,7 +179,7 @@ "divmod($module, x, y, /)\n" "--\n" "\n" -"Return the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x."); +"Return the tuple (x//y, x%y). Invariant: div*y + mod == x."); #define BUILTIN_DIVMOD_METHODDEF \ {"divmod", (PyCFunction)builtin_divmod, METH_VARARGS, builtin_divmod__doc__}, @@ -660,4 +660,4 @@ exit: return return_value; } -/*[clinic end generated code: output=bec3399c0aee98d7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4bef16b6aa432879 input=a9049054013a1b77]*/ -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 1 13:34:27 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 01 May 2016 17:34:27 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Regenerate_Arg?= =?utf-8?q?ument_Clinic_code_for_issue_=2326874=2E?= Message-ID: <20160501173423.84500.68049.5ADC9D12@psf.io> https://hg.python.org/cpython/rev/84ff79cce41e changeset: 101205:84ff79cce41e branch: 3.5 parent: 101203:1b6581bae5a1 user: Serhiy Storchaka date: Sun May 01 20:33:24 2016 +0300 summary: Regenerate Argument Clinic code for issue #26874. files: Python/bltinmodule.c | 2 +- Python/clinic/bltinmodule.c.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -801,7 +801,7 @@ static PyObject * builtin_divmod_impl(PyModuleDef *module, PyObject *x, PyObject *y) -/*[clinic end generated code: output=9ad0076120ebf9ac input=7fdb15f8a97a5fe7]*/ +/*[clinic end generated code: output=9ad0076120ebf9ac input=175ad9c84ff41a85]*/ { return PyNumber_Divmod(x, y); } diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -179,7 +179,7 @@ "divmod($module, x, y, /)\n" "--\n" "\n" -"Return the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x."); +"Return the tuple (x//y, x%y). Invariant: div*y + mod == x."); #define BUILTIN_DIVMOD_METHODDEF \ {"divmod", (PyCFunction)builtin_divmod, METH_VARARGS, builtin_divmod__doc__}, @@ -660,4 +660,4 @@ exit: return return_value; } -/*[clinic end generated code: output=bec3399c0aee98d7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4bef16b6aa432879 input=a9049054013a1b77]*/ -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Mon May 2 04:53:05 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 02 May 2016 08:53:05 +0000 Subject: [Python-checkins] Daily reference leaks (98678738b7e9): sum=12 Message-ID: <20160502085305.12119.54889.E588D31B@psf.io> results for 98678738b7e9 on branch "default" -------------------------------------------- test_asyncio leaked [3, 0, 0] memory blocks, sum=3 test_collections leaked [4, -4, 4] memory blocks, sum=4 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [1, -2, 2] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogV64n_H', '--timeout', '7200'] From python-checkins at python.org Mon May 2 05:25:59 2016 From: python-checkins at python.org (berker.peksag) Date: Mon, 02 May 2016 09:25:59 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2318916=3A_Update_thread_module_docstrings?= Message-ID: <20160502092558.34499.89889.45690B7B@psf.io> https://hg.python.org/cpython/rev/57a475e0e378 changeset: 101208:57a475e0e378 parent: 101206:98678738b7e9 parent: 101207:203c9c4ccb2a user: Berker Peksag date: Mon May 02 12:26:00 2016 +0300 summary: Issue #18916: Update thread module docstrings * Fix acquire() signature * Remove outdated help(LockType) reference * Replace PyThread_allocate_lock() with threading.Lock() Patch by Christopher Welborn. files: Modules/_threadmodule.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -159,7 +159,7 @@ } PyDoc_STRVAR(acquire_doc, -"acquire([wait]) -> bool\n\ +"acquire(blocking=True, timeout=-1) -> bool\n\ (acquire_lock() is an obsolete synonym)\n\ \n\ Lock the lock. Without argument, this blocks if the lock is already\n\ @@ -1134,7 +1134,8 @@ "allocate_lock() -> lock object\n\ (allocate() is an obsolete synonym)\n\ \n\ -Create a new lock object. See help(LockType) for information about locks."); +Create a new lock object. See help(type(threading.Lock())) for\n\ +information about locks."); static PyObject * thread_get_ident(PyObject *self) @@ -1326,7 +1327,7 @@ PyDoc_STRVAR(lock_doc, "A lock object is a synchronization primitive. To create a lock,\n\ -call the PyThread_allocate_lock() function. Methods are:\n\ +call threading.Lock(). Methods are:\n\ \n\ acquire() -- lock the lock, possibly blocking until it can be obtained\n\ release() -- unlock of the lock\n\ -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 2 05:25:59 2016 From: python-checkins at python.org (berker.peksag) Date: Mon, 02 May 2016 09:25:59 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzE4OTE2?= =?utf-8?q?=3A_Update_thread_module_docstrings?= Message-ID: <20160502092557.13121.24151.EC69F2F7@psf.io> https://hg.python.org/cpython/rev/203c9c4ccb2a changeset: 101207:203c9c4ccb2a branch: 3.5 parent: 101205:84ff79cce41e user: Berker Peksag date: Mon May 02 12:25:35 2016 +0300 summary: Issue #18916: Update thread module docstrings * Fix acquire() signature * Remove outdated help(LockType) reference * Replace PyThread_allocate_lock() with threading.Lock() Patch by Christopher Welborn. files: Modules/_threadmodule.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -159,7 +159,7 @@ } PyDoc_STRVAR(acquire_doc, -"acquire([wait]) -> bool\n\ +"acquire(blocking=True, timeout=-1) -> bool\n\ (acquire_lock() is an obsolete synonym)\n\ \n\ Lock the lock. Without argument, this blocks if the lock is already\n\ @@ -1134,7 +1134,8 @@ "allocate_lock() -> lock object\n\ (allocate() is an obsolete synonym)\n\ \n\ -Create a new lock object. See help(LockType) for information about locks."); +Create a new lock object. See help(type(threading.Lock())) for\n\ +information about locks."); static PyObject * thread_get_ident(PyObject *self) @@ -1326,7 +1327,7 @@ PyDoc_STRVAR(lock_doc, "A lock object is a synchronization primitive. To create a lock,\n\ -call the PyThread_allocate_lock() function. Methods are:\n\ +call threading.Lock(). Methods are:\n\ \n\ acquire() -- lock the lock, possibly blocking until it can be obtained\n\ release() -- unlock of the lock\n\ -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 2 06:46:07 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Mon, 02 May 2016 10:46:07 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Got_rid_of_redundand_=22se?= =?utf-8?q?lf=22_parameter_declarations=2E?= Message-ID: <20160502104537.100800.51794.1522B293@psf.io> https://hg.python.org/cpython/rev/c5729c10ce65 changeset: 101209:c5729c10ce65 user: Serhiy Storchaka date: Mon May 02 13:45:20 2016 +0300 summary: Got rid of redundand "self" parameter declarations. Argument Clinic is now able to infer all needed information. files: Modules/_bz2module.c | 3 +- Modules/_lzmamodule.c | 14 +---- Modules/_tkinter.c | 17 ++----- Objects/bytearrayobject.c | 47 ++++++--------------- Objects/bytesobject.c | 46 +++++++++------------ Objects/clinic/bytesobject.c.h | 22 +++++----- Python/bltinmodule.c | 5 +- 7 files changed, 57 insertions(+), 97 deletions(-) diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c --- a/Modules/_bz2module.c +++ b/Modules/_bz2module.c @@ -592,7 +592,6 @@ /*[clinic input] _bz2.BZ2Decompressor.decompress - self: self(type="BZ2Decompressor *") data: Py_buffer max_length: Py_ssize_t=-1 @@ -615,7 +614,7 @@ static PyObject * _bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data, Py_ssize_t max_length) -/*[clinic end generated code: output=23e41045deb240a3 input=9558b424c8b00516]*/ +/*[clinic end generated code: output=23e41045deb240a3 input=52e1ffc66a8ea624]*/ { PyObject *result = NULL; diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c --- a/Modules/_lzmamodule.c +++ b/Modules/_lzmamodule.c @@ -553,7 +553,6 @@ /*[clinic input] _lzma.LZMACompressor.compress - self: self(type="Compressor *") data: Py_buffer / @@ -567,7 +566,7 @@ static PyObject * _lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data) -/*[clinic end generated code: output=31f615136963e00f input=8b60cb13e0ce6420]*/ +/*[clinic end generated code: output=31f615136963e00f input=64019eac7f2cc8d0]*/ { PyObject *result = NULL; @@ -583,8 +582,6 @@ /*[clinic input] _lzma.LZMACompressor.flush - self: self(type="Compressor *") - Finish the compression process. Returns the compressed data left in internal buffers. @@ -594,7 +591,7 @@ static PyObject * _lzma_LZMACompressor_flush_impl(Compressor *self) -/*[clinic end generated code: output=fec21f3e22504f50 input=3060fb26f9b4042c]*/ +/*[clinic end generated code: output=fec21f3e22504f50 input=6b369303f67ad0a8]*/ { PyObject *result = NULL; @@ -698,7 +695,6 @@ /*[-clinic input] _lzma.LZMACompressor.__init__ - self: self(type="Compressor *") format: int(c_default="FORMAT_XZ") = FORMAT_XZ The container format to use for the output. This can be FORMAT_XZ (default), FORMAT_ALONE, or FORMAT_RAW. @@ -1063,7 +1059,6 @@ /*[clinic input] _lzma.LZMADecompressor.decompress - self: self(type="Decompressor *") data: Py_buffer max_length: Py_ssize_t=-1 @@ -1086,7 +1081,7 @@ static PyObject * _lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data, Py_ssize_t max_length) -/*[clinic end generated code: output=ef4e20ec7122241d input=f2bb902cc1caf203]*/ +/*[clinic end generated code: output=ef4e20ec7122241d input=60c1f135820e309d]*/ { PyObject *result = NULL; @@ -1126,7 +1121,6 @@ /*[clinic input] _lzma.LZMADecompressor.__init__ - self: self(type="Decompressor *") format: int(c_default="FORMAT_AUTO") = FORMAT_AUTO Specifies the container format of the input stream. If this is FORMAT_AUTO (the default), the decompressor will automatically detect @@ -1152,7 +1146,7 @@ static int _lzma_LZMADecompressor___init___impl(Decompressor *self, int format, PyObject *memlimit, PyObject *filters) -/*[clinic end generated code: output=3e1821f8aa36564c input=458ca6132ef29801]*/ +/*[clinic end generated code: output=3e1821f8aa36564c input=81fe684a6c2f8a27]*/ { const uint32_t decoder_flags = LZMA_TELL_ANY_CHECK | LZMA_TELL_NO_CHECK; uint64_t memlimit_ = UINT64_MAX; diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -2485,7 +2485,6 @@ /*[clinic input] _tkinter.tkapp.createcommand - self: self(type="TkappObject *") name: str func: object / @@ -2495,7 +2494,7 @@ static PyObject * _tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name, PyObject *func) -/*[clinic end generated code: output=2a1c79a4ee2af410 input=2bc2c046a0914234]*/ +/*[clinic end generated code: output=2a1c79a4ee2af410 input=255785cb70edc6a0]*/ { PythonCmd_ClientData *data; int err; @@ -2561,7 +2560,6 @@ /*[clinic input] _tkinter.tkapp.deletecommand - self: self(type="TkappObject *") name: str / @@ -2569,7 +2567,7 @@ static PyObject * _tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name) -/*[clinic end generated code: output=a67e8cb5845e0d2d input=b6306468f10b219c]*/ +/*[clinic end generated code: output=a67e8cb5845e0d2d input=53e9952eae1f85f5]*/ { int err; @@ -2762,13 +2760,11 @@ /*[clinic input] _tkinter.tktimertoken.deletetimerhandler - self: self(type="TkttObject *") - [clinic start generated code]*/ static PyObject * _tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self) -/*[clinic end generated code: output=bd7fe17f328cfa55 input=25ba5dd594e52084]*/ +/*[clinic end generated code: output=bd7fe17f328cfa55 input=40bd070ff85f5cf3]*/ { TkttObject *v = self; PyObject *func = v->func; @@ -2894,7 +2890,6 @@ /*[clinic input] _tkinter.tkapp.mainloop - self: self(type="TkappObject *") threshold: int = 0 / @@ -2902,7 +2897,7 @@ static PyObject * _tkinter_tkapp_mainloop_impl(TkappObject *self, int threshold) -/*[clinic end generated code: output=0ba8eabbe57841b0 input=ad57c9c1dd2b9470]*/ +/*[clinic end generated code: output=0ba8eabbe57841b0 input=036bcdcf03d5eca0]*/ { #ifdef WITH_THREAD PyThreadState *tstate = PyThreadState_Get(); @@ -3072,13 +3067,11 @@ /*[clinic input] _tkinter.tkapp.willdispatch - self: self(type="TkappObject *") - [clinic start generated code]*/ static PyObject * _tkinter_tkapp_willdispatch_impl(TkappObject *self) -/*[clinic end generated code: output=0e3f46d244642155 input=2630699767808970]*/ +/*[clinic end generated code: output=0e3f46d244642155 input=d88f5970843d6dab]*/ { self->dispatching = 1; diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -1243,14 +1243,12 @@ /*[clinic input] bytearray.clear - self: self(type="PyByteArrayObject *") - Remove all items from the bytearray. [clinic start generated code]*/ static PyObject * bytearray_clear_impl(PyByteArrayObject *self) -/*[clinic end generated code: output=85c2fe6aede0956c input=e524fd330abcdc18]*/ +/*[clinic end generated code: output=85c2fe6aede0956c input=ed6edae9de447ac4]*/ { if (PyByteArray_Resize((PyObject *)self, 0) < 0) return NULL; @@ -1260,14 +1258,12 @@ /*[clinic input] bytearray.copy - self: self(type="PyByteArrayObject *") - Return a copy of B. [clinic start generated code]*/ static PyObject * bytearray_copy_impl(PyByteArrayObject *self) -/*[clinic end generated code: output=68cfbcfed484c132 input=6d5d2975aa0f33f3]*/ +/*[clinic end generated code: output=68cfbcfed484c132 input=6597b0c01bccaa9e]*/ { return PyByteArray_FromStringAndSize(PyByteArray_AS_STRING((PyObject *)self), PyByteArray_GET_SIZE(self)); @@ -1489,7 +1485,6 @@ /*[clinic input] bytearray.translate - self: self(type="PyByteArrayObject *") table: object Translation table, which must be a bytes object of length 256. [ @@ -1506,7 +1501,7 @@ static PyObject * bytearray_translate_impl(PyByteArrayObject *self, PyObject *table, int group_right_1, PyObject *deletechars) -/*[clinic end generated code: output=2bebc86a9a1ff083 input=b749ad85f4860824]*/ +/*[clinic end generated code: output=2bebc86a9a1ff083 input=846a01671bccc1c5]*/ { char *input, *output; const char *table_chars; @@ -2187,7 +2182,6 @@ /*[clinic input] bytearray.partition - self: self(type="PyByteArrayObject *") sep: object / @@ -2203,7 +2197,7 @@ static PyObject * bytearray_partition(PyByteArrayObject *self, PyObject *sep) -/*[clinic end generated code: output=45d2525ddd35f957 input=7d7fe37b1696d506]*/ +/*[clinic end generated code: output=45d2525ddd35f957 input=86f89223892b70b5]*/ { PyObject *bytesep, *result; @@ -2225,7 +2219,6 @@ /*[clinic input] bytearray.rpartition - self: self(type="PyByteArrayObject *") sep: object / @@ -2241,7 +2234,7 @@ static PyObject * bytearray_rpartition(PyByteArrayObject *self, PyObject *sep) -/*[clinic end generated code: output=440de3c9426115e8 input=9b8cd540c1b75853]*/ +/*[clinic end generated code: output=440de3c9426115e8 input=5f4094f2de87c8f3]*/ { PyObject *bytesep, *result; @@ -2299,14 +2292,12 @@ /*[clinic input] bytearray.reverse - self: self(type="PyByteArrayObject *") - Reverse the order of the values in B in place. [clinic start generated code]*/ static PyObject * bytearray_reverse_impl(PyByteArrayObject *self) -/*[clinic end generated code: output=9f7616f29ab309d3 input=7933a499b8597bd1]*/ +/*[clinic end generated code: output=9f7616f29ab309d3 input=543356319fc78557]*/ { char swap, *head, *tail; Py_ssize_t i, j, n = Py_SIZE(self); @@ -2335,7 +2326,6 @@ /*[clinic input] bytearray.insert - self: self(type="PyByteArrayObject *") index: Py_ssize_t The index where the value is to be inserted. item: bytesvalue @@ -2347,7 +2337,7 @@ static PyObject * bytearray_insert_impl(PyByteArrayObject *self, Py_ssize_t index, int item) -/*[clinic end generated code: output=76c775a70e7b07b7 input=833766836ba30e1e]*/ +/*[clinic end generated code: output=76c775a70e7b07b7 input=b2b5d07e9de6c070]*/ { Py_ssize_t n = Py_SIZE(self); char *buf; @@ -2377,7 +2367,6 @@ /*[clinic input] bytearray.append - self: self(type="PyByteArrayObject *") item: bytesvalue The item to be appended. / @@ -2387,7 +2376,7 @@ static PyObject * bytearray_append_impl(PyByteArrayObject *self, int item) -/*[clinic end generated code: output=a154e19ed1886cb6 input=ae56ea87380407cc]*/ +/*[clinic end generated code: output=a154e19ed1886cb6 input=20d6bec3d1340593]*/ { Py_ssize_t n = Py_SIZE(self); @@ -2407,7 +2396,6 @@ /*[clinic input] bytearray.extend - self: self(type="PyByteArrayObject *") iterable_of_ints: object The iterable of items to append. / @@ -2417,7 +2405,7 @@ static PyObject * bytearray_extend(PyByteArrayObject *self, PyObject *iterable_of_ints) -/*[clinic end generated code: output=98155dbe249170b1 input=ce83a5d75b70d850]*/ +/*[clinic end generated code: output=98155dbe249170b1 input=c617b3a93249ba28]*/ { PyObject *it, *item, *bytearray_obj; Py_ssize_t buf_size = 0, len = 0; @@ -2492,7 +2480,6 @@ /*[clinic input] bytearray.pop - self: self(type="PyByteArrayObject *") index: Py_ssize_t = -1 The index from where to remove the item. -1 (the default value) means remove the last item. @@ -2505,7 +2492,7 @@ static PyObject * bytearray_pop_impl(PyByteArrayObject *self, Py_ssize_t index) -/*[clinic end generated code: output=e0ccd401f8021da8 input=0797e6c0ca9d5a85]*/ +/*[clinic end generated code: output=e0ccd401f8021da8 input=3591df2d06c0d237]*/ { int value; Py_ssize_t n = Py_SIZE(self); @@ -2537,7 +2524,6 @@ /*[clinic input] bytearray.remove - self: self(type="PyByteArrayObject *") value: bytesvalue The value to remove. / @@ -2547,7 +2533,7 @@ static PyObject * bytearray_remove_impl(PyByteArrayObject *self, int value) -/*[clinic end generated code: output=d659e37866709c13 input=47560b11fd856c24]*/ +/*[clinic end generated code: output=d659e37866709c13 input=121831240cd51ddf]*/ { Py_ssize_t where, n = Py_SIZE(self); char *buf = PyByteArray_AS_STRING(self); @@ -2858,14 +2844,12 @@ /*[clinic input] bytearray.__reduce__ as bytearray_reduce - self: self(type="PyByteArrayObject *") - Return state information for pickling. [clinic start generated code]*/ static PyObject * bytearray_reduce_impl(PyByteArrayObject *self) -/*[clinic end generated code: output=52bf304086464cab input=fbb07de4d102a03a]*/ +/*[clinic end generated code: output=52bf304086464cab input=44b5737ada62dd3f]*/ { return _common_reduce(self, 2); } @@ -2873,7 +2857,6 @@ /*[clinic input] bytearray.__reduce_ex__ as bytearray_reduce_ex - self: self(type="PyByteArrayObject *") proto: int = 0 / @@ -2882,7 +2865,7 @@ static PyObject * bytearray_reduce_ex_impl(PyByteArrayObject *self, int proto) -/*[clinic end generated code: output=52eac33377197520 input=0e091a42ca6dbd91]*/ +/*[clinic end generated code: output=52eac33377197520 input=f129bc1a1aa151ee]*/ { return _common_reduce(self, proto); } @@ -2890,14 +2873,12 @@ /*[clinic input] bytearray.__sizeof__ as bytearray_sizeof - self: self(type="PyByteArrayObject *") - Returns the size of the bytearray object in memory, in bytes. [clinic start generated code]*/ static PyObject * bytearray_sizeof_impl(PyByteArrayObject *self) -/*[clinic end generated code: output=738abdd17951c427 input=6b23d305362b462b]*/ +/*[clinic end generated code: output=738abdd17951c427 input=e27320fd98a4bc5a]*/ { Py_ssize_t res; diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -9,9 +9,9 @@ #include /*[clinic input] -class bytes "PyBytesObject*" "&PyBytes_Type" +class bytes "PyBytesObject *" "&PyBytes_Type" [clinic start generated code]*/ -/*[clinic end generated code: output=da39a3ee5e6b4b0d input=1a1d9102afc1b00c]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=7a238f965d64892b]*/ #include "clinic/bytesobject.c.h" @@ -1752,8 +1752,8 @@ [clinic start generated code]*/ static PyObject * -bytes_split_impl(PyBytesObject*self, PyObject *sep, Py_ssize_t maxsplit) -/*[clinic end generated code: output=8bde44dacb36ef2e input=8b809b39074abbfa]*/ +bytes_split_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit) +/*[clinic end generated code: output=52126b5844c1d8ef input=8b809b39074abbfa]*/ { Py_ssize_t len = PyBytes_GET_SIZE(self), n; const char *s = PyBytes_AS_STRING(self), *sub; @@ -1777,7 +1777,6 @@ /*[clinic input] bytes.partition - self: self(type="PyBytesObject *") sep: Py_buffer / @@ -1793,7 +1792,7 @@ static PyObject * bytes_partition_impl(PyBytesObject *self, Py_buffer *sep) -/*[clinic end generated code: output=f532b392a17ff695 input=bc855dc63ca949de]*/ +/*[clinic end generated code: output=f532b392a17ff695 input=61cca95519406099]*/ { return stringlib_partition( (PyObject*) self, @@ -1805,7 +1804,6 @@ /*[clinic input] bytes.rpartition - self: self(type="PyBytesObject *") sep: Py_buffer / @@ -1821,7 +1819,7 @@ static PyObject * bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep) -/*[clinic end generated code: output=191b114cbb028e50 input=6588fff262a9170e]*/ +/*[clinic end generated code: output=191b114cbb028e50 input=67f689e63a62d478]*/ { return stringlib_rpartition( (PyObject*) self, @@ -1839,8 +1837,8 @@ [clinic start generated code]*/ static PyObject * -bytes_rsplit_impl(PyBytesObject*self, PyObject *sep, Py_ssize_t maxsplit) -/*[clinic end generated code: output=0b6570b977911d88 input=0f86c9f28f7d7b7b]*/ +bytes_rsplit_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit) +/*[clinic end generated code: output=ba698d9ea01e1c8f input=0f86c9f28f7d7b7b]*/ { Py_ssize_t len = PyBytes_GET_SIZE(self), n; const char *s = PyBytes_AS_STRING(self), *sub; @@ -1878,8 +1876,8 @@ [clinic start generated code]*/ static PyObject * -bytes_join(PyBytesObject*self, PyObject *iterable_of_bytes) -/*[clinic end generated code: output=634aff14764ff997 input=7fe377b95bd549d2]*/ +bytes_join(PyBytesObject *self, PyObject *iterable_of_bytes) +/*[clinic end generated code: output=a046f379f626f6f8 input=7fe377b95bd549d2]*/ { return stringlib_bytes_join((PyObject*)self, iterable_of_bytes); } @@ -2129,7 +2127,6 @@ /*[clinic input] bytes.strip - self: self(type="PyBytesObject *") bytes: object = None / @@ -2140,7 +2137,7 @@ static PyObject * bytes_strip_impl(PyBytesObject *self, PyObject *bytes) -/*[clinic end generated code: output=c7c228d3bd104a1b input=37daa5fad1395d95]*/ +/*[clinic end generated code: output=c7c228d3bd104a1b input=8a354640e4e0b3ef]*/ { return do_argstrip(self, BOTHSTRIP, bytes); } @@ -2148,7 +2145,6 @@ /*[clinic input] bytes.lstrip - self: self(type="PyBytesObject *") bytes: object = None / @@ -2159,7 +2155,7 @@ static PyObject * bytes_lstrip_impl(PyBytesObject *self, PyObject *bytes) -/*[clinic end generated code: output=28602e586f524e82 input=88811b09dfbc2988]*/ +/*[clinic end generated code: output=28602e586f524e82 input=9baff4398c3f6857]*/ { return do_argstrip(self, LEFTSTRIP, bytes); } @@ -2167,7 +2163,6 @@ /*[clinic input] bytes.rstrip - self: self(type="PyBytesObject *") bytes: object = None / @@ -2178,7 +2173,7 @@ static PyObject * bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes) -/*[clinic end generated code: output=547e3815c95447da input=8f93c9cd361f0140]*/ +/*[clinic end generated code: output=547e3815c95447da input=b78af445c727e32b]*/ { return do_argstrip(self, RIGHTSTRIP, bytes); } @@ -2235,7 +2230,6 @@ /*[clinic input] bytes.translate - self: self(type="PyBytesObject *") table: object Translation table, which must be a bytes object of length 256. [ @@ -2252,7 +2246,7 @@ static PyObject * bytes_translate_impl(PyBytesObject *self, PyObject *table, int group_right_1, PyObject *deletechars) -/*[clinic end generated code: output=233df850eb50bf8d input=d8fa5519d7cc4be7]*/ +/*[clinic end generated code: output=233df850eb50bf8d input=ca20edf39d780d49]*/ { char *input, *output; Py_buffer table_view = {NULL, NULL}; @@ -2909,9 +2903,9 @@ [clinic start generated code]*/ static PyObject * -bytes_replace_impl(PyBytesObject*self, Py_buffer *old, Py_buffer *new, +bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new, Py_ssize_t count) -/*[clinic end generated code: output=403dc9d7a83c5a1d input=b2fbbf0bf04de8e5]*/ +/*[clinic end generated code: output=994fa588b6b9c104 input=b2fbbf0bf04de8e5]*/ { return (PyObject *)replace((PyBytesObject *) self, (const char *)old->buf, old->len, @@ -3078,9 +3072,9 @@ [clinic start generated code]*/ static PyObject * -bytes_decode_impl(PyBytesObject*self, const char *encoding, +bytes_decode_impl(PyBytesObject *self, const char *encoding, const char *errors) -/*[clinic end generated code: output=2d2016ff8e0bb176 input=958174769d2a40ca]*/ +/*[clinic end generated code: output=5649a53dde27b314 input=958174769d2a40ca]*/ { return PyUnicode_FromEncodedObject((PyObject*)self, encoding, errors); } @@ -3098,8 +3092,8 @@ [clinic start generated code]*/ static PyObject * -bytes_splitlines_impl(PyBytesObject*self, int keepends) -/*[clinic end generated code: output=995c3598f7833cad input=7f4aac67144f9944]*/ +bytes_splitlines_impl(PyBytesObject *self, int keepends) +/*[clinic end generated code: output=3484149a5d880ffb input=7f4aac67144f9944]*/ { return stringlib_splitlines( (PyObject*) self, PyBytes_AS_STRING(self), diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -20,10 +20,10 @@ {"split", (PyCFunction)bytes_split, METH_VARARGS|METH_KEYWORDS, bytes_split__doc__}, static PyObject * -bytes_split_impl(PyBytesObject*self, PyObject *sep, Py_ssize_t maxsplit); +bytes_split_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit); static PyObject * -bytes_split(PyBytesObject*self, PyObject *args, PyObject *kwargs) +bytes_split(PyBytesObject *self, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; static char *_keywords[] = {"sep", "maxsplit", NULL}; @@ -133,10 +133,10 @@ {"rsplit", (PyCFunction)bytes_rsplit, METH_VARARGS|METH_KEYWORDS, bytes_rsplit__doc__}, static PyObject * -bytes_rsplit_impl(PyBytesObject*self, PyObject *sep, Py_ssize_t maxsplit); +bytes_rsplit_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit); static PyObject * -bytes_rsplit(PyBytesObject*self, PyObject *args, PyObject *kwargs) +bytes_rsplit(PyBytesObject *self, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; static char *_keywords[] = {"sep", "maxsplit", NULL}; @@ -359,11 +359,11 @@ {"replace", (PyCFunction)bytes_replace, METH_VARARGS, bytes_replace__doc__}, static PyObject * -bytes_replace_impl(PyBytesObject*self, Py_buffer *old, Py_buffer *new, +bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new, Py_ssize_t count); static PyObject * -bytes_replace(PyBytesObject*self, PyObject *args) +bytes_replace(PyBytesObject *self, PyObject *args) { PyObject *return_value = NULL; Py_buffer old = {NULL, NULL}; @@ -405,11 +405,11 @@ {"decode", (PyCFunction)bytes_decode, METH_VARARGS|METH_KEYWORDS, bytes_decode__doc__}, static PyObject * -bytes_decode_impl(PyBytesObject*self, const char *encoding, +bytes_decode_impl(PyBytesObject *self, const char *encoding, const char *errors); static PyObject * -bytes_decode(PyBytesObject*self, PyObject *args, PyObject *kwargs) +bytes_decode(PyBytesObject *self, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; static char *_keywords[] = {"encoding", "errors", NULL}; @@ -438,10 +438,10 @@ {"splitlines", (PyCFunction)bytes_splitlines, METH_VARARGS|METH_KEYWORDS, bytes_splitlines__doc__}, static PyObject * -bytes_splitlines_impl(PyBytesObject*self, int keepends); +bytes_splitlines_impl(PyBytesObject *self, int keepends); static PyObject * -bytes_splitlines(PyBytesObject*self, PyObject *args, PyObject *kwargs) +bytes_splitlines(PyBytesObject *self, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; static char *_keywords[] = {"keepends", NULL}; @@ -484,4 +484,4 @@ exit: return return_value; } -/*[clinic end generated code: output=bd0ce8f25d7e18f4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d0e9f5a1c0682910 input=a9049054013a1b77]*/ diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1078,7 +1078,6 @@ /*[clinic input] id as builtin_id - self: self(type="PyModuleDef *") obj as v: object / @@ -1089,8 +1088,8 @@ [clinic start generated code]*/ static PyObject * -builtin_id(PyModuleDef *self, PyObject *v) -/*[clinic end generated code: output=0aa640785f697f65 input=5a534136419631f4]*/ +builtin_id(PyModuleDef *module, PyObject *v) +/*[clinic end generated code: output=63635e497e09c2f7 input=57fb4a9aaff96384]*/ { return PyLong_FromVoidPtr(v); } -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 2 07:02:50 2016 From: python-checkins at python.org (donald.stufft) Date: Mon, 02 May 2016 11:02:50 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Upgrade_ensure?= =?utf-8?q?pip_bundled_setuptools_to_20=2E10=2E1?= Message-ID: <20160502110235.30349.54782.1C48CC12@psf.io> https://hg.python.org/cpython/rev/e407db1cac8b changeset: 101210:e407db1cac8b branch: 2.7 parent: 101192:57bf7a40925f user: Donald Stufft date: Mon May 02 07:02:30 2016 -0400 summary: Upgrade ensurepip bundled setuptools to 20.10.1 files: Lib/ensurepip/__init__.py | 2 +- Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl | Bin Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl | Bin 3 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -12,7 +12,7 @@ __all__ = ["version", "bootstrap"] -_SETUPTOOLS_VERSION = "20.3" +_SETUPTOOLS_VERSION = "20.10.1" _PIP_VERSION = "8.1.1" diff --git a/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9d1319a24aba103fe956ef6298e3649efacc0b93 GIT binary patch [stripped] diff --git a/Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl deleted file mode 100644 index 39e67c0b6e3bb3fcb8ed5f42a494f3b1ac3fa9cc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch [stripped] -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 2 07:03:51 2016 From: python-checkins at python.org (donald.stufft) Date: Mon, 02 May 2016 11:03:51 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E4=29=3A_Upgrade_ensure?= =?utf-8?q?pip_bundled_setuptools_to_20=2E10=2E1?= Message-ID: <20160502110350.12426.47320.E166BA0A@psf.io> https://hg.python.org/cpython/rev/5cf064bf81fd changeset: 101211:5cf064bf81fd branch: 3.4 parent: 100962:772805538caf user: Donald Stufft date: Mon May 02 07:03:46 2016 -0400 summary: Upgrade ensurepip bundled setuptools to 20.10.1 files: Lib/ensurepip/__init__.py | 2 +- Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl | Bin Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl | Bin 3 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -8,7 +8,7 @@ __all__ = ["version", "bootstrap"] -_SETUPTOOLS_VERSION = "20.3" +_SETUPTOOLS_VERSION = "20.10.1" _PIP_VERSION = "8.1.1" diff --git a/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9d1319a24aba103fe956ef6298e3649efacc0b93 GIT binary patch [stripped] diff --git a/Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl deleted file mode 100644 index 39e67c0b6e3bb3fcb8ed5f42a494f3b1ac3fa9cc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch [stripped] -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 2 07:05:04 2016 From: python-checkins at python.org (donald.stufft) Date: Mon, 02 May 2016 11:05:04 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAobWVyZ2UgMy40IC0+IDMuNSk6?= =?utf-8?q?_Upgrade_ensurepip_bundled_setuptools_to_20=2E10=2E1?= Message-ID: <20160502110503.13894.69459.95CCB7C1@psf.io> https://hg.python.org/cpython/rev/538eeb8c3019 changeset: 101212:538eeb8c3019 branch: 3.5 parent: 101207:203c9c4ccb2a parent: 101211:5cf064bf81fd user: Donald Stufft date: Mon May 02 07:04:59 2016 -0400 summary: Upgrade ensurepip bundled setuptools to 20.10.1 files: Lib/ensurepip/__init__.py | 2 +- Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl | Bin Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl | Bin 3 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -8,7 +8,7 @@ __all__ = ["version", "bootstrap"] -_SETUPTOOLS_VERSION = "20.3" +_SETUPTOOLS_VERSION = "20.10.1" _PIP_VERSION = "8.1.1" diff --git a/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9d1319a24aba103fe956ef6298e3649efacc0b93 GIT binary patch [stripped] diff --git a/Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl deleted file mode 100644 index 39e67c0b6e3bb3fcb8ed5f42a494f3b1ac3fa9cc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch [stripped] -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 2 07:05:33 2016 From: python-checkins at python.org (donald.stufft) Date: Mon, 02 May 2016 11:05:33 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Upgrade_ensurepip_bundled_setuptools_to_20=2E10=2E1?= Message-ID: <20160502110532.13918.93958.7A949E12@psf.io> https://hg.python.org/cpython/rev/e324588c2959 changeset: 101213:e324588c2959 parent: 101209:c5729c10ce65 parent: 101212:538eeb8c3019 user: Donald Stufft date: Mon May 02 07:05:29 2016 -0400 summary: Upgrade ensurepip bundled setuptools to 20.10.1 files: Lib/ensurepip/__init__.py | 2 +- Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl | Bin Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl | Bin 3 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -8,7 +8,7 @@ __all__ = ["version", "bootstrap"] -_SETUPTOOLS_VERSION = "20.3" +_SETUPTOOLS_VERSION = "20.10.1" _PIP_VERSION = "8.1.1" diff --git a/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-20.10.1-py2.py3-none-any.whl new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9d1319a24aba103fe956ef6298e3649efacc0b93 GIT binary patch [stripped] diff --git a/Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-20.3-py2.py3-none-any.whl deleted file mode 100644 index 39e67c0b6e3bb3fcb8ed5f42a494f3b1ac3fa9cc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch [stripped] -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 2 13:56:42 2016 From: python-checkins at python.org (brett.cannon) Date: Mon, 02 May 2016 17:56:42 +0000 Subject: [Python-checkins] =?utf-8?q?devguide=3A_Ignore_venv?= Message-ID: <20160502175641.13904.46980.B72FE5C8@psf.io> https://hg.python.org/devguide/rev/1df6fcc0578e changeset: 800:1df6fcc0578e user: Brett Cannon date: Mon May 02 10:49:10 2016 -0700 summary: Ignore venv files: .hgignore | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -3,3 +3,4 @@ *.swp *~ _build +venv -- Repository URL: https://hg.python.org/devguide From python-checkins at python.org Mon May 2 13:57:10 2016 From: python-checkins at python.org (brett.cannon) Date: Mon, 02 May 2016 17:57:10 +0000 Subject: [Python-checkins] =?utf-8?q?devguide=3A_Document_that_we_now_want?= =?utf-8?q?_your_GitHub_username_as_well?= Message-ID: <20160502175641.39162.87732.AB8E1814@psf.io> https://hg.python.org/devguide/rev/ff3ff9670efb changeset: 801:ff3ff9670efb user: Brett Cannon date: Mon May 02 10:56:37 2016 -0700 summary: Document that we now want your GitHub username as well files: coredev.rst | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/coredev.rst b/coredev.rst --- a/coredev.rst +++ b/coredev.rst @@ -63,8 +63,9 @@ You need to provide an SSH-2 key to be able to commit code. You may have multiple keys if you wish (e.g., for work and home). Using Ed25519 keys is encouraged. Send your key as an attachment in an email to -hgaccounts at python.org. Help in generating an SSH key can be found in the -:ref:`faq`. +hgaccounts at python.org along with your GitHub username so you can be added to +the "Python core" team at https://github.com/python. Help in generating an SSH +key can be found in the :ref:`faq`. Your SSH key will be set to a username in the form of "first_name.last_name". This should match your username on the issue tracker. -- Repository URL: https://hg.python.org/devguide From python-checkins at python.org Mon May 2 18:17:44 2016 From: python-checkins at python.org (terry.reedy) Date: Mon, 02 May 2016 22:17:44 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Clarify_IDLE-c?= =?utf-8?q?onsole_differences_with_respect_to_the_sys_module=2E?= Message-ID: <20160502221732.100796.25750.5800B6EE@psf.io> https://hg.python.org/cpython/rev/21d18f09822b changeset: 101214:21d18f09822b branch: 2.7 parent: 101210:e407db1cac8b user: Terry Jan Reedy date: Mon May 02 18:17:19 2016 -0400 summary: Clarify IDLE-console differences with respect to the sys module. The reload(sys) effect was the crux of a Stackoverflow question. files: Doc/library/idle.rst | 16 +++++++++------- Lib/idlelib/help.html | 20 +++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -550,14 +550,16 @@ As much as possible, the result of executing Python code with IDLE is the same as executing the same code in a console window. However, the different -interface and operation occasionally affects results. +interface and operation occasionally affects visible results. For instance, +``sys.modules`` starts with more entries. -For instance, IDLE normally executes user code in a separate process from -the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the -execution process get input from and send output to the GUI process, -which keeps control of the keyboard and screen. This is normally transparent, -but code that access these object will see different attribute values. -Also, functions that directly access the keyboard and screen will not work. +IDLE also replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` with +objects that get input from and send output to the Shell window. +When this window has the focus, it controls the keyboard and screen. +This is normally transparent, but functions that directly access the keyboard +and screen will not work. If ``sys`` is reset with ``reload(sys)``, +IDLE's changes are lost and things like ``input``, ``raw_input``, and +``print`` will not work correctly. With IDLE's Shell, one enters, edits, and recalls complete statements. Some consoles only work with a single physical line at a time. diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -163,7 +163,7 @@
Find Selection
Search for the currently selected string, if there is one.
Find in Files...
-
Open a file search dialog. Put results in an new output window.
+
Open a file search dialog. Put results in a new output window.
Replace...
Open a search-and-replace dialog.
Go to Line
@@ -517,13 +517,15 @@

24.6.3.2. IDLE-console differences?

As much as possible, the result of executing Python code with IDLE is the same as executing the same code in a console window. However, the different -interface and operation occasionally affects results.

-

For instance, IDLE normally executes user code in a separate process from -the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the -execution process get input from and send output to the GUI process, -which keeps control of the keyboard and screen. This is normally transparent, -but code that access these object will see different attribute values. -Also, functions that directly access the keyboard and screen will not work.

+interface and operation occasionally affects visible results. For instance, +sys.modules starts with more entries.

+

IDLE also replaces sys.stdin, sys.stdout, and sys.stderr with +objects that get input from and send output to the Shell window. +When this window has the focus, it controls the keyboard and screen. +This is normally transparent, but functions that directly access the keyboard +and screen will not work. If sys is reset with reload(sys), +IDLE’s changes are lost and things like input, raw_input, and +print will not work correctly.

With IDLE’s Shell, one enters, edits, and recalls complete statements. Some consoles only work with a single physical line at a time.

@@ -699,7 +701,7 @@ The Python Software Foundation is a non-profit corporation. Please donate.
- Last updated on Mar 20, 2016. + Last updated on May 02, 2016. Found a bug?
Created using Sphinx 1.3.3. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 2 18:30:35 2016 From: python-checkins at python.org (terry.reedy) Date: Mon, 02 May 2016 22:30:35 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Clarify_IDLE-c?= =?utf-8?q?onsole_differences_with_respect_to_the_sys_module=2E?= Message-ID: <20160502223035.27378.574.261EC1E6@psf.io> https://hg.python.org/cpython/rev/5ef3eda91051 changeset: 101215:5ef3eda91051 branch: 3.5 parent: 101212:538eeb8c3019 user: Terry Jan Reedy date: Mon May 02 18:30:02 2016 -0400 summary: Clarify IDLE-console differences with respect to the sys module. The reload(sys) effect was the crux of a Stackoverflow question. files: Doc/library/idle.rst | 16 +++++++++------- Lib/idlelib/help.html | 22 ++++++++++++---------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -550,14 +550,16 @@ As much as possible, the result of executing Python code with IDLE is the same as executing the same code in a console window. However, the different -interface and operation occasionally affects results. +interface and operation occasionally affects visible results. For instance, +``sys.modules`` starts with more entries. -For instance, IDLE normally executes user code in a separate process from -the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the -execution process get input from and send output to the GUI process, -which keeps control of the keyboard and screen. This is normally transparent, -but code that access these object will see different attribute values. -Also, functions that directly access the keyboard and screen will not work. +IDLE also replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` with +objects that get input from and send output to the Shell window. +When this window has the focus, it controls the keyboard and screen. +This is normally transparent, but functions that directly access the keyboard +and screen will not work. If ``sys`` is reset with ``importlib.reload(sys)``, +IDLE's changes are lost and things li ke ``input``, ``raw_input``, and +``print`` will not work correctly. With IDLE's Shell, one enters, edits, and recalls complete statements. Some consoles only work with a single physical line at a time. diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -163,7 +163,7 @@
Find Selection
Search for the currently selected string, if there is one.
Find in Files...
-
Open a file search dialog. Put results in an new output window.
+
Open a file search dialog. Put results in a new output window.
Replace...
Open a search-and-replace dialog.
Go to Line
@@ -517,13 +517,15 @@

25.5.3.2. IDLE-console differences?

As much as possible, the result of executing Python code with IDLE is the same as executing the same code in a console window. However, the different -interface and operation occasionally affects results.

-

For instance, IDLE normally executes user code in a separate process from -the IDLE GUI itself. The IDLE versions of sys.stdin, .stdout, and .stderr in the -execution process get input from and send output to the GUI process, -which keeps control of the keyboard and screen. This is normally transparent, -but code that access these object will see different attribute values. -Also, functions that directly access the keyboard and screen will not work.

+interface and operation occasionally affects visible results. For instance, +sys.modules starts with more entries.

+

IDLE also replaces sys.stdin, sys.stdout, and sys.stderr with +objects that get input from and send output to the Shell window. +When this window has the focus, it controls the keyboard and screen. +This is normally transparent, but functions that directly access the keyboard +and screen will not work. If sys is reset with importlib.reload(sys), +IDLE’s changes are lost and things li ke input, raw_input, and +print will not work correctly.

With IDLE’s Shell, one enters, edits, and recalls complete statements. Some consoles only work with a single physical line at a time.

@@ -694,12 +696,12 @@ @@ -694,12 +696,12 @@ ', file=outfile) print('
', file=outfile) -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 3 03:52:27 2016 From: python-checkins at python.org (georg.brandl) Date: Tue, 03 May 2016 07:52:27 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Fix_lists-in-blockquotes_in_3?= =?utf-8?q?xxx_PEPs=2E_Ref=3A_=2326914?= Message-ID: <20160503075226.14942.3246.E4F5E0DE@psf.io> https://hg.python.org/peps/rev/d420d6fe349f changeset: 6301:d420d6fe349f user: Georg Brandl date: Tue May 03 09:51:54 2016 +0200 summary: Fix lists-in-blockquotes in 3xxx PEPs. Ref: #26914 files: pep-3103.txt | 10 +- pep-3104.txt | 40 ++-- pep-3108.txt | 304 +++++++++++++++++++------------------- pep-3121.txt | 8 +- pep-3127.txt | 76 ++++---- pep-3131.txt | 6 +- pep-3137.txt | 66 ++++---- pep-3147.txt | 4 +- pep-3149.txt | 20 +- pep-3150.txt | 38 ++-- 10 files changed, 284 insertions(+), 288 deletions(-) diff --git a/pep-3103.txt b/pep-3103.txt --- a/pep-3103.txt +++ b/pep-3103.txt @@ -567,11 +567,11 @@ inside a function. There are a few pragmatic choices for how to treat a switch outside a function: - (a) Disallow it. - (b) Translate it into an if/elif chain. - (c) Allow only compile-time constant expressions. - (d) Compute the dispatch dict each time the switch is reached. - (e) Like (b) but tests that all expressions evaluated are hashable. +(a) Disallow it. +(b) Translate it into an if/elif chain. +(c) Allow only compile-time constant expressions. +(d) Compute the dispatch dict each time the switch is reached. +(e) Like (b) but tests that all expressions evaluated are hashable. Of these, (a) seems too restrictive: it's uniformly worse than (c); and (d) has poor performance for little or no benefits compared to diff --git a/pep-3104.txt b/pep-3104.txt --- a/pep-3104.txt +++ b/pep-3104.txt @@ -295,26 +295,26 @@ Many spellings have been suggested for such a declaration: - - ``scoped x`` [1]_ - - ``global x in f`` [3]_ (explicitly specify which scope) - - ``free x`` [5]_ - - ``outer x`` [6]_ - - ``use x`` [9]_ - - ``global x`` [10]_ (change the meaning of ``global``) - - ``nonlocal x`` [11]_ - - ``global x outer`` [18]_ - - ``global in x`` [18]_ - - ``not global x`` [18]_ - - ``extern x`` [20]_ - - ``ref x`` [22]_ - - ``refer x`` [22]_ - - ``share x`` [22]_ - - ``sharing x`` [22]_ - - ``common x`` [22]_ - - ``using x`` [22]_ - - ``borrow x`` [22]_ - - ``reuse x`` [23]_ - - ``scope f x`` [25]_ (explicitly specify which scope) +- ``scoped x`` [1]_ +- ``global x in f`` [3]_ (explicitly specify which scope) +- ``free x`` [5]_ +- ``outer x`` [6]_ +- ``use x`` [9]_ +- ``global x`` [10]_ (change the meaning of ``global``) +- ``nonlocal x`` [11]_ +- ``global x outer`` [18]_ +- ``global in x`` [18]_ +- ``not global x`` [18]_ +- ``extern x`` [20]_ +- ``ref x`` [22]_ +- ``refer x`` [22]_ +- ``share x`` [22]_ +- ``sharing x`` [22]_ +- ``common x`` [22]_ +- ``using x`` [22]_ +- ``borrow x`` [22]_ +- ``reuse x`` [23]_ +- ``scope f x`` [25]_ (explicitly specify which scope) The most commonly discussed choices appear to be ``outer``, ``global``, and ``nonlocal``. ``outer`` is already used as both a diff --git a/pep-3108.txt b/pep-3108.txt --- a/pep-3108.txt +++ b/pep-3108.txt @@ -70,56 +70,56 @@ * cfmfile - + Documented as deprecated since Python 2.4 without an explicit - reason. + + Documented as deprecated since Python 2.4 without an explicit + reason. * cl - + Documented as obsolete since Python 2.0 or earlier. - + Interface to SGI hardware. + + Documented as obsolete since Python 2.0 or earlier. + + Interface to SGI hardware. * md5 - + Supplanted by the ``hashlib`` module. + + Supplanted by the ``hashlib`` module. * mimetools - + Documented as obsolete in a previous version. - + Supplanted by the ``email`` package. + + Documented as obsolete in a previous version. + + Supplanted by the ``email`` package. * MimeWriter - + Supplanted by the ``email`` package. + + Supplanted by the ``email`` package. * mimify - + Supplanted by the ``email`` package. + + Supplanted by the ``email`` package. * multifile - + Supplanted by the ``email`` package. + + Supplanted by the ``email`` package. * posixfile - + Locking is better done by ``fcntl.lockf()``. + + Locking is better done by ``fcntl.lockf()``. * rfc822 - + Supplanted by the ``email`` package. + + Supplanted by the ``email`` package. * sha - + Supplanted by the ``hashlib`` package. + + Supplanted by the ``hashlib`` package. * sv - + Documented as obsolete since Python 2.0 or earlier. - + Interface to obsolete SGI Indigo hardware. + + Documented as obsolete since Python 2.0 or earlier. + + Interface to obsolete SGI Indigo hardware. * timing - + Documented as obsolete since Python 2.0 or earlier. - + ``time.clock()`` gives better time resolution. + + Documented as obsolete since Python 2.0 or earlier. + + ``time.clock()`` gives better time resolution. Platform-specific with minimal use [done] @@ -136,120 +136,121 @@ for the specified platforms will also be removed. IRIX -/////////// +//// + The IRIX operating system is no longer produced [#irix-retirement]_. Removing all modules from the plat-irix[56] directory has been deemed reasonable because of this fact. - + AL/al ++ AL/al - - Provides sound support on Indy and Indigo workstations. - - Both workstations are no longer available. - - Code has not been uniquely edited in three years. + - Provides sound support on Indy and Indigo workstations. + - Both workstations are no longer available. + - Code has not been uniquely edited in three years. - + cd/CD ++ cd/CD - - CD drive control for SGI systems. - - SGI no longer sells machines with IRIX on them. - - Code has not been uniquely edited in 14 years. + - CD drive control for SGI systems. + - SGI no longer sells machines with IRIX on them. + - Code has not been uniquely edited in 14 years. - + cddb ++ cddb - - Undocumented. + - Undocumented. - + cdplayer ++ cdplayer - - Undocumented. + - Undocumented. - + cl/CL/CL_old ++ cl/CL/CL_old - - Compression library for SGI systems. - - SGI no longer sells machines with IRIX on them. - - Code has not been uniquely edited in 14 years. + - Compression library for SGI systems. + - SGI no longer sells machines with IRIX on them. + - Code has not been uniquely edited in 14 years. - + DEVICE/GL/gl/cgen/cgensuport ++ DEVICE/GL/gl/cgen/cgensuport - - GL access, which is the predecessor to OpenGL. - - Has not been edited in at least eight years. - - Third-party libraries provide better support (PyOpenGL [#pyopengl]_). + - GL access, which is the predecessor to OpenGL. + - Has not been edited in at least eight years. + - Third-party libraries provide better support (PyOpenGL [#pyopengl]_). - + ERRNO ++ ERRNO - - Undocumented. + - Undocumented. - + FILE ++ FILE - - Undocumented. + - Undocumented. - + FL/fl/flp ++ FL/fl/flp - - Wrapper for the FORMS library [#irix-forms]_ - - FORMS has not been edited in 12 years. - - Library is not widely used. - - First eight hits on Google are for Python docs for fl. + - Wrapper for the FORMS library [#irix-forms]_ + - FORMS has not been edited in 12 years. + - Library is not widely used. + - First eight hits on Google are for Python docs for fl. - + fm ++ fm - - Wrapper to the IRIS Font Manager library. - - Only available on SGI machines which no longer come with IRIX. + - Wrapper to the IRIS Font Manager library. + - Only available on SGI machines which no longer come with IRIX. - + GET ++ GET - - Undocumented. + - Undocumented. - + GLWS ++ GLWS - - Undocumented. + - Undocumented. - + imgfile ++ imgfile - - Wrapper for SGI libimage library for imglib image files - (``.rgb`` files). - - Python Imaging Library provdes read-only support [#pil]_. - - Not uniquely edited in 13 years. + - Wrapper for SGI libimage library for imglib image files + (``.rgb`` files). + - Python Imaging Library provdes read-only support [#pil]_. + - Not uniquely edited in 13 years. - + IN ++ IN - - Undocumented. + - Undocumented. - + IOCTL ++ IOCTL - - Undocumented. + - Undocumented. - + jpeg ++ jpeg - - Wrapper for JPEG (de)compressor. - - Code not uniquely edited in nine years. - - Third-party libraries provide better support - (Python Imaging Library [#pil]_). + - Wrapper for JPEG (de)compressor. + - Code not uniquely edited in nine years. + - Third-party libraries provide better support + (Python Imaging Library [#pil]_). - + panel ++ panel - - Undocumented. + - Undocumented. - + panelparser ++ panelparser - - Undocumented. + - Undocumented. - + readcd ++ readcd - - Undocumented. + - Undocumented. - + SV ++ SV - - Undocumented. + - Undocumented. - + torgb ++ torgb - - Undocumented. + - Undocumented. - + WAIT ++ WAIT - - Undocumented. + - Undocumented. Mac-specific modules -//////////////////////////// +//////////////////// The Mac-specific modules are not well-maintained (e.g., the bgen tool used to auto-generate many of the modules has never been @@ -261,108 +262,107 @@ * _builtinSuites - - Undocumented. - - Package under lib-scriptpackages. + - Undocumented. + - Package under lib-scriptpackages. * Audio_mac - - Undocumented. + - Undocumented. * aepack - - OSA support is better through third-party modules. + - OSA support is better through third-party modules. - * Appscript [#appscript]_. + * Appscript [#appscript]_. - - Hard-coded endianness which breaks on Intel Macs. - - Might need to rename if Carbon package dependent. + - Hard-coded endianness which breaks on Intel Macs. + - Might need to rename if Carbon package dependent. * aetools - - See aepack. + - See aepack. * aetypes - - See aepack. + - See aepack. * applesingle - - Undocumented. - - AppleSingle is a binary file format for A/UX. - - A/UX no longer distributed. + - Undocumented. + - AppleSingle is a binary file format for A/UX. + - A/UX no longer distributed. * appletrawmain - - Undocumented. + - Undocumented. * appletrunner - - Undocumented. + - Undocumented. * argvemulator - - Undocumented. + - Undocumented. * autoGIL - - Very bad model for using Python with the CFRunLoop. + - Very bad model for using Python with the CFRunLoop. * bgenlocations - - Undocumented. + - Undocumented. * buildtools - - Documented as deprecated since Python 2.3 without an explicit - reason. + - Documented as deprecated since Python 2.3 without an explicit + reason. * bundlebuilder - - Undocumented. + - Undocumented. * Carbon - - Carbon development has stopped. - - Does not support 64-bit systems completely. - - Dependent on bgen which has never been updated to support UCS-4 - Unicode builds of Python. + - Carbon development has stopped. + - Does not support 64-bit systems completely. + - Dependent on bgen which has never been updated to support UCS-4 + Unicode builds of Python. * CodeWarrior - - Undocumented. - - Package under lib-scriptpackages. + - Undocumented. + - Package under lib-scriptpackages. * ColorPicker - - Better to use Cocoa for GUIs. + - Better to use Cocoa for GUIs. * EasyDialogs - - Better to use Cocoa for GUIs. + - Better to use Cocoa for GUIs. * Explorer - - Undocumented. - - Package under lib-scriptpackages. + - Undocumented. + - Package under lib-scriptpackages. * Finder - - Undocumented. - - Package under lib-scriptpackages. - + - Undocumented. + - Package under lib-scriptpackages. * findertools - - No longer useful. + - No longer useful. * FrameWork - - Poorly documented. - - Not updated to support Carbon Events. + - Poorly documented. + - Not updated to support Carbon Events. * gensuitemodule - - See aepack. + - See aepack. * ic @@ -370,85 +370,84 @@ * icopen - - Not needed on OS X. - - Meant to replace 'open' which is usually a bad thing to do. + - Not needed on OS X. + - Meant to replace 'open' which is usually a bad thing to do. * macerrors - - Undocumented. + - Undocumented. * MacOS - - Would also mean the removal of binhex. + - Would also mean the removal of binhex. * macostools * macresource - - Undocumented. + - Undocumented. * MiniAEFrame - - See aepack. + - See aepack. * Nav - - Undocumented. + - Undocumented. * Netscape - - Undocumented. - - Package under lib-scriptpackages. + - Undocumented. + - Package under lib-scriptpackages. * OSATerminology * pimp - - Undocumented. + - Undocumented. * PixMapWrapper - - Undocumented. + - Undocumented. * StdSuites - - Undocumented. - - Package under lib-scriptpackages. + - Undocumented. + - Package under lib-scriptpackages. * SystemEvents - - Undocumented. - - Package under lib-scriptpackages. + - Undocumented. + - Package under lib-scriptpackages. * Terminal - - Undocumented. - - Package under lib-scriptpackages. - + - Undocumented. + - Package under lib-scriptpackages. * terminalcommand - - Undocumented. + - Undocumented. * videoreader - - No longer used. + - No longer used. * W - - No longer distributed with Python. + - No longer distributed with Python. .. _PyObjC: http://pyobjc.sourceforge.net/ Solaris -/////////////// +/////// - + SUNAUDIODEV/sunaudiodev ++ SUNAUDIODEV/sunaudiodev - - Access to the sound card on Sun machines. - - Code not uniquely edited in over eight years. + - Access to the sound card on Sun machines. + - Code not uniquely edited in over eight years. Hardly used [done] @@ -476,7 +475,6 @@ + Only useful with the 'sched' module. + Not thread-safe. - * stringold + Function versions of the methods on string objects. @@ -769,7 +767,7 @@ dbm package -////////////////// +/////////// ================= =============================== Current Name Replacement Name @@ -790,7 +788,7 @@ html package -/////////////////// +//////////// ================== =============================== Current Name Replacement Name @@ -801,7 +799,7 @@ http package -/////////////////// +//////////// ================= =============================== Current Name Replacement Name @@ -819,7 +817,7 @@ tkinter package -////////////////////// +/////////////// ================== =============================== Current Name Replacement Name @@ -850,7 +848,7 @@ urllib package -////////////////////////////////////////////////// +////////////// Originally this new package was to be named ``url``, but because of the common use of the name as a variable, it has been deemed better @@ -873,7 +871,7 @@ xmlrpc package -///////////////////// +////////////// ================== =============================== Current Name Replacement Name @@ -895,10 +893,8 @@ Issues related to this PEP: -* `Issue 2775`_ - Master tracking issue -* `Issue 2828`_ - clean up undoc.rst +* `Issue 2775`_: Master tracking issue +* `Issue 2828`_: clean up undoc.rst .. _Issue 2775: http://bugs.python.org/issue2775 .. _Issue 2828: http://bugs.python.org/issue2828 diff --git a/pep-3121.txt b/pep-3121.txt --- a/pep-3121.txt +++ b/pep-3121.txt @@ -190,13 +190,13 @@ at one point, and lists the following additional hooks which aren't currently supported in this PEP: - * when the module object is deleted from sys.modules +* when the module object is deleted from sys.modules - * when Py_Finalize is called +* when Py_Finalize is called - * when Python exits +* when Python exits - * when the Python DLL is unloaded (Windows only) +* when the Python DLL is unloaded (Windows only) References diff --git a/pep-3127.txt b/pep-3127.txt --- a/pep-3127.txt +++ b/pep-3127.txt @@ -24,14 +24,14 @@ The proposal is that: - a) octal literals must now be specified - with a leading "0o" or "0O" instead of "0"; +a) octal literals must now be specified + with a leading "0o" or "0O" instead of "0"; - b) binary literals are now supported via a - leading "0b" or "0B"; and +b) binary literals are now supported via a + leading "0b" or "0B"; and - c) provision will be made for binary numbers in - string formatting. +c) provision will be made for binary numbers in + string formatting. Motivation @@ -39,15 +39,15 @@ This PEP was motivated by two different issues: - - The default octal representation of integers is silently confusing - to people unfamiliar with C-like languages. It is extremely easy - to inadvertently create an integer object with the wrong value, - because '013' means 'decimal 11', not 'decimal 13', to the Python - language itself, which is not the meaning that most humans would - assign to this literal. +- The default octal representation of integers is silently confusing + to people unfamiliar with C-like languages. It is extremely easy + to inadvertently create an integer object with the wrong value, + because '013' means 'decimal 11', not 'decimal 13', to the Python + language itself, which is not the meaning that most humans would + assign to this literal. - - Some Python users have a strong desire for binary support in - the language. +- Some Python users have a strong desire for binary support in + the language. Specification @@ -175,22 +175,22 @@ Throughout this document, unless otherwise noted, discussions about the string representation of integers relate to these features: - - Literal integer tokens, as used by normal module compilation, - by eval(), and by int(token, 0). (int(token) and int(token, 2-36) - are not modified by this proposal.) +- Literal integer tokens, as used by normal module compilation, + by eval(), and by int(token, 0). (int(token) and int(token, 2-36) + are not modified by this proposal.) - * Under 2.6, long() is treated the same as int() + * Under 2.6, long() is treated the same as int() - - Formatting of integers into strings, either via the % string - operator or the new PEP 3101 advanced string formatting method. +- Formatting of integers into strings, either via the % string + operator or the new PEP 3101 advanced string formatting method. It is presumed that: - - All of these features should have an identical set - of supported radices, for consistency. +- All of these features should have an identical set + of supported radices, for consistency. - - Python source code syntax and int(mystring, 0) should - continue to share identical behavior. +- Python source code syntax and int(mystring, 0) should + continue to share identical behavior. Removal of old octal syntax @@ -239,14 +239,14 @@ occasionally or as a matter of habit, use leading zeros for decimal numbers. Python could either: - a) silently do the wrong thing with his numbers, as it does now; +a) silently do the wrong thing with his numbers, as it does now; - b) immediately disabuse him of the notion that this is viable syntax - (and yes, the SyntaxWarning should be more gentle than it - currently is, but that is a subject for a different PEP); or +b) immediately disabuse him of the notion that this is viable syntax + (and yes, the SyntaxWarning should be more gentle than it + currently is, but that is a subject for a different PEP); or - c) let him continue to think that computers are happy with - multi-digit decimal integers which start with "0". +c) let him continue to think that computers are happy with + multi-digit decimal integers which start with "0". Some people passionately believe that (c) is the correct answer, and they would be absolutely right if we could be sure that new @@ -416,16 +416,16 @@ (sometimes conflicting) requirements and "nice-to-haves" for this syntax: - - It should be as compatible with other languages and - previous versions of Python as is reasonable, both - for the input syntax and for the output (e.g. string - % operator) syntax. +- It should be as compatible with other languages and + previous versions of Python as is reasonable, both + for the input syntax and for the output (e.g. string + % operator) syntax. - - It should be as obvious to the casual observer as - possible. +- It should be as obvious to the casual observer as + possible. - - It should be easy to visually distinguish integers - formatted in the different bases. +- It should be easy to visually distinguish integers + formatted in the different bases. Proposed syntaxes included things like arbitrary radix prefixes, diff --git a/pep-3131.txt b/pep-3131.txt --- a/pep-3131.txt +++ b/pep-3131.txt @@ -144,9 +144,9 @@ It's not clear how that can precisely apply to this PEP; possible consequences are - * warn about characters listed as "restricted" in xidmodifications.txt - * warn about identifiers using mixed scripts - * somehow perform Confusable Detection +* warn about characters listed as "restricted" in xidmodifications.txt +* warn about identifiers using mixed scripts +* somehow perform Confusable Detection In the latter two approaches, it's not clear how precisely the algorithm should work. For mixed scripts, certain kinds of mixing diff --git a/pep-3137.txt b/pep-3137.txt --- a/pep-3137.txt +++ b/pep-3137.txt @@ -58,11 +58,11 @@ I propose the following type names at the Python level: - - ``bytes`` is an immutable array of bytes (PyString) +- ``bytes`` is an immutable array of bytes (PyString) - - ``bytearray`` is a mutable array of bytes (PyBytes) +- ``bytearray`` is a mutable array of bytes (PyBytes) - - ``memoryview`` is a bytes view on another object (PyMemory) +- ``memoryview`` is a bytes view on another object (PyMemory) The old type named ``buffer`` is so similar to the new type ``memoryview``, introduce by PEP 3118, that it is redundant. The rest @@ -116,27 +116,27 @@ There are four forms of constructors, applicable to both bytes and bytearray: - - ``bytes()``, ``bytes()``, ``bytearray()``, - ``bytearray()``: simple copying constructors, with the - note that ``bytes()`` might return its (immutable) - argument, but ``bytearray()`` always makes a copy. +- ``bytes()``, ``bytes()``, ``bytearray()``, + ``bytearray()``: simple copying constructors, with the + note that ``bytes()`` might return its (immutable) + argument, but ``bytearray()`` always makes a copy. - - ``bytes(, [, ])``, ``bytearray(, - [, ])``: encode a text string. Note that the - ``str.encode()`` method returns an *immutable* bytes object. The - argument is mandatory; is optional. - and , if given, must be ``str`` instances. +- ``bytes(, [, ])``, ``bytearray(, + [, ])``: encode a text string. Note that the + ``str.encode()`` method returns an *immutable* bytes object. The + argument is mandatory; is optional. + and , if given, must be ``str`` instances. - - ``bytes()``, ``bytearray()``: construct - a bytes or bytearray object from anything that implements the PEP - 3118 buffer API. +- ``bytes()``, ``bytearray()``: construct + a bytes or bytearray object from anything that implements the PEP + 3118 buffer API. - - ``bytes()``, ``bytearray()``: - construct a bytes or bytearray object from a stream of integers in - range(256). +- ``bytes()``, ``bytearray()``: + construct a bytes or bytearray object from a stream of integers in + range(256). - - ``bytes()``, ``bytearray()``: construct a - zero-initialized bytes or bytearray object of a given length. +- ``bytes()``, ``bytearray()``: construct a + zero-initialized bytes or bytearray object of a given length. Comparisons ----------- @@ -190,26 +190,26 @@ The following operators are implemented by the bytes and bytearray types, except where mentioned: - - ``b1 + b2``: concatenation. With mixed bytes/bytearray operands, - the return type is that of the first argument (this seems arbitrary - until you consider how ``+=`` works). +- ``b1 + b2``: concatenation. With mixed bytes/bytearray operands, + the return type is that of the first argument (this seems arbitrary + until you consider how ``+=`` works). - - ``b1 += b2``: mutates b1 if it is a bytearray object. +- ``b1 += b2``: mutates b1 if it is a bytearray object. - - ``b * n``, ``n * b``: repetition; n must be an integer. +- ``b * n``, ``n * b``: repetition; n must be an integer. - - ``b *= n``: mutates b if it is a bytearray object. +- ``b *= n``: mutates b if it is a bytearray object. - - ``b1 in b2``, ``b1 not in b2``: substring test; b1 can be any - object implementing the PEP 3118 buffer API. +- ``b1 in b2``, ``b1 not in b2``: substring test; b1 can be any + object implementing the PEP 3118 buffer API. - - ``i in b``, ``i not in b``: single-byte membership test; i must - be an integer (if it is a length-1 bytes array, it is considered - to be a substring test, with the same outcome). +- ``i in b``, ``i not in b``: single-byte membership test; i must + be an integer (if it is a length-1 bytes array, it is considered + to be a substring test, with the same outcome). - - ``len(b)``: the number of bytes. +- ``len(b)``: the number of bytes. - - ``hash(b)``: the hash value; only implemented by the bytes type. +- ``hash(b)``: the hash value; only implemented by the bytes type. Note that the % operator is *not* implemented. It does not appear worth the complexity. diff --git a/pep-3147.txt b/pep-3147.txt --- a/pep-3147.txt +++ b/pep-3147.txt @@ -426,8 +426,8 @@ To support this use case, we'll add two new methods to the `imp` package [17]_: - * `imp.cache_from_source(py_path)` -> `pyc_path` - * `imp.source_from_cache(pyc_path)` -> `py_path` +* `imp.cache_from_source(py_path)` -> `pyc_path` +* `imp.source_from_cache(pyc_path)` -> `py_path` Alternative implementations are free to override these functions to return reasonable values based on their own support for this PEP. diff --git a/pep-3149.txt b/pep-3149.txt --- a/pep-3149.txt +++ b/pep-3149.txt @@ -117,9 +117,9 @@ tag as appropriate. For example, on POSIX systems these flags will also contribute to the file name: - * ``--with-pydebug`` (flag: ``d``) - * ``--with-pymalloc`` (flag: ``m``) - * ``--with-wide-unicode`` (flag: ``u``) +* ``--with-pydebug`` (flag: ``d``) +* ``--with-pymalloc`` (flag: ``m``) +* ``--with-wide-unicode`` (flag: ``u``) By default in Python 3.2, ``configure`` enables ``--with-pymalloc`` so shared library file names would appear as ``foo.cpython-32m.so``. @@ -224,13 +224,13 @@ Martin v. L?wis describes his thoughts [7]_ about the applicability of this PEP to PEP 384. In summary: - * ``--with-pydebug`` would not be supported by the stable ABI because - this changes the layout of ``PyObject``, which is an exposed - structure. - * ``--with-pymalloc`` has no bearing on the issue. - * ``--with-wide-unicode`` is trickier, though Martin's inclination is - to force the stable ABI to use a ``Py_UNICODE`` that matches the - platform's ``wchar_t``. +* ``--with-pydebug`` would not be supported by the stable ABI because + this changes the layout of ``PyObject``, which is an exposed + structure. +* ``--with-pymalloc`` has no bearing on the issue. +* ``--with-wide-unicode`` is trickier, though Martin's inclination is + to force the stable ABI to use a ``Py_UNICODE`` that matches the + platform's ``wchar_t``. Alternatives diff --git a/pep-3150.txt b/pep-3150.txt --- a/pep-3150.txt +++ b/pep-3150.txt @@ -60,15 +60,15 @@ current list of simple statements that would be affected by this addition is as follows: - * expression statement - * assignment statement - * augmented assignment statement - * del statement - * return statement - * yield statement - * raise statement - * assert statement - * pass statement +* expression statement +* assignment statement +* augmented assignment statement +* del statement +* return statement +* yield statement +* raise statement +* assert statement +* pass statement The ``given`` clause would allow subexpressions to be referenced by name in the header line, with the actual definitions following in @@ -238,17 +238,17 @@ PEP proposes the following additions for ``given`` statements to the "Programming Conventions" section of PEP 8: - - for code that could reasonably be factored out into a separate function, - but is not currently reused anywhere, consider using a ``given`` clause. - This clearly indicates which variables are being used only to define - subcomponents of another statement rather than to hold algorithm or - application state. This is an especially useful technique when - passing multi-line functions to operations which take callable - arguments. +- for code that could reasonably be factored out into a separate function, + but is not currently reused anywhere, consider using a ``given`` clause. + This clearly indicates which variables are being used only to define + subcomponents of another statement rather than to hold algorithm or + application state. This is an especially useful technique when + passing multi-line functions to operations which take callable + arguments. - - keep ``given`` clauses concise. If they become unwieldy, either break - them up into multiple steps or else move the details into a separate - function. +- keep ``given`` clauses concise. If they become unwieldy, either break + them up into multiple steps or else move the details into a separate + function. Rationale -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 3 04:35:16 2016 From: python-checkins at python.org (georg.brandl) Date: Tue, 03 May 2016 08:35:16 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Fixup_some_more_lists-in-bloc?= =?utf-8?q?kquotes=2E_Fixes_=2326914=2E?= Message-ID: <20160503083515.1272.6979.799FDEB5@psf.io> https://hg.python.org/peps/rev/e7200e32b220 changeset: 6303:e7200e32b220 user: Georg Brandl date: Tue May 03 10:35:10 2016 +0200 summary: Fixup some more lists-in-blockquotes. Fixes #26914. files: pep-0318.txt | 2 +- pep-0410.txt | 32 ++++++++++++++++---------------- pep-0422.txt | 2 +- pep-0436.txt | 8 ++++---- pep-0446.txt | 24 ++++++++++++------------ pep-0495.txt | 40 ++++++++++++++++++++-------------------- pep-0498.txt | 8 ++++---- pep-3104.txt | 6 +++--- pep-3108.txt | 8 ++++---- pep-3127.txt | 2 +- pep-3141.txt | 26 +++++++++++++------------- pep-3149.txt | 4 ++-- pep-3156.txt | 14 +++++++------- 13 files changed, 88 insertions(+), 88 deletions(-) diff --git a/pep-0318.txt b/pep-0318.txt --- a/pep-0318.txt +++ b/pep-0318.txt @@ -396,7 +396,7 @@ http://mail.python.org/pipermail/python-dev/2004-August/047112.html The next form is that the decorator syntax goes inside the method body at -the start, in the same place that docstrings currently live: +the start, in the same place that docstrings currently live:: def foo(arg1,arg2): @classmethod diff --git a/pep-0410.txt b/pep-0410.txt --- a/pep-0410.txt +++ b/pep-0410.txt @@ -425,7 +425,7 @@ used: type(numerator) / type(denominator). A variant is to use a "converter" callback to create a timestamp. Example -creating a float timestamp: +creating a float timestamp:: def timestamp_to_float(numerator, denominator): return float(numerator) / float(denominator) @@ -520,24 +520,24 @@ Python: - * `Issue #7652: Merge C version of decimal into py3k `_ (cdecimal) - * `Issue #11457: os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution `_ - * `Issue #13882: PEP 410: Use decimal.Decimal type for timestamps `_ - * `[Python-Dev] Store timestamps as decimal.Decimal objects `_ +* `Issue #7652: Merge C version of decimal into py3k `_ (cdecimal) +* `Issue #11457: os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution `_ +* `Issue #13882: PEP 410: Use decimal.Decimal type for timestamps `_ +* `[Python-Dev] Store timestamps as decimal.Decimal objects `_ Other languages: - * Ruby (1.9.3), the `Time class `_ - supports picosecond (10\ :sup:`-12`) - * .NET framework, `DateTime type `_: - number of 100-nanosecond intervals that have elapsed since 12:00:00 - midnight, January 1, 0001. DateTime.Ticks uses a signed 64-bit integer. - * Java (1.5), `System.nanoTime() `_: - wallclock with an unspecified starting point as a number of nanoseconds, use - a signed 64 bits integer (long). - * Perl, `Time::Hiref module `_: - use float so has the same loss of precision issue with nanosecond resolution - than Python float timestamps +* Ruby (1.9.3), the `Time class `_ + supports picosecond (10\ :sup:`-12`) +* .NET framework, `DateTime type `_: + number of 100-nanosecond intervals that have elapsed since 12:00:00 + midnight, January 1, 0001. DateTime.Ticks uses a signed 64-bit integer. +* Java (1.5), `System.nanoTime() `_: + wallclock with an unspecified starting point as a number of nanoseconds, use + a signed 64 bits integer (long). +* Perl, `Time::Hiref module `_: + use float so has the same loss of precision issue with nanosecond resolution + than Python float timestamps Copyright diff --git a/pep-0422.txt b/pep-0422.txt --- a/pep-0422.txt +++ b/pep-0422.txt @@ -130,7 +130,7 @@ return cls To simplify the cooperative multiple inheritance case, ``object`` will gain -a default implementation of the hook that returns the class unmodified: +a default implementation of the hook that returns the class unmodified:: class object: def __autodecorate__(cls): diff --git a/pep-0436.txt b/pep-0436.txt --- a/pep-0436.txt +++ b/pep-0436.txt @@ -517,10 +517,10 @@ A list of strings representing acceptable Python types for this object. There are also four strings which represent Python protocols: - * "buffer" - * "mapping" - * "number" - * "sequence" + * "buffer" + * "mapping" + * "number" + * "sequence" ``zeroes`` For converters that accept string types. The converted value should diff --git a/pep-0446.txt b/pep-0446.txt --- a/pep-0446.txt +++ b/pep-0446.txt @@ -308,18 +308,18 @@ On UNIX, new flags were added for files and sockets: - * ``O_CLOEXEC``: available on Linux (2.6.23), FreeBSD (8.3), - Mac OS 10.8, OpenBSD 5.0, Solaris 11, QNX, BeOS, next NetBSD release - (6.1?). This flag is part of POSIX.1-2008. - * ``SOCK_CLOEXEC`` flag for ``socket()`` and ``socketpair()``, - available on Linux 2.6.27, OpenBSD 5.2, NetBSD 6.0. - * ``fcntl()``: ``F_DUPFD_CLOEXEC`` flag, available on Linux 2.6.24, - OpenBSD 5.0, FreeBSD 9.1, NetBSD 6.0, Solaris 11. This flag is part - of POSIX.1-2008. - * ``fcntl()``: ``F_DUP2FD_CLOEXEC`` flag, available on FreeBSD 9.1 - and Solaris 11. - * ``recvmsg()``: ``MSG_CMSG_CLOEXEC``, available on Linux 2.6.23, - NetBSD 6.0. +* ``O_CLOEXEC``: available on Linux (2.6.23), FreeBSD (8.3), + Mac OS 10.8, OpenBSD 5.0, Solaris 11, QNX, BeOS, next NetBSD release + (6.1?). This flag is part of POSIX.1-2008. +* ``SOCK_CLOEXEC`` flag for ``socket()`` and ``socketpair()``, + available on Linux 2.6.27, OpenBSD 5.2, NetBSD 6.0. +* ``fcntl()``: ``F_DUPFD_CLOEXEC`` flag, available on Linux 2.6.24, + OpenBSD 5.0, FreeBSD 9.1, NetBSD 6.0, Solaris 11. This flag is part + of POSIX.1-2008. +* ``fcntl()``: ``F_DUP2FD_CLOEXEC`` flag, available on FreeBSD 9.1 + and Solaris 11. +* ``recvmsg()``: ``MSG_CMSG_CLOEXEC``, available on Linux 2.6.23, + NetBSD 6.0. On Linux older than 2.6.23, ``O_CLOEXEC`` flag is simply ignored. So ``fcntl()`` must be called to check if the file descriptor is diff --git a/pep-0495.txt b/pep-0495.txt --- a/pep-0495.txt +++ b/pep-0495.txt @@ -676,29 +676,29 @@ The following alternative names have also been considered: - **later** - A close contender to "fold". One author dislikes it because - it is confusable with equally fitting "latter," but in the age - of auto-completion everywhere this is a small consideration. A - stronger objection may be that in the case of missing time, we - will have ``later=True`` instance converted to an earlier time by - ``.astimezone(timezone.utc)`` that that with ``later=False``. - Yet again, this can be interpreted as a desirable indication that - the original time is invalid. +**later** + A close contender to "fold". One author dislikes it because + it is confusable with equally fitting "latter," but in the age + of auto-completion everywhere this is a small consideration. A + stronger objection may be that in the case of missing time, we + will have ``later=True`` instance converted to an earlier time by + ``.astimezone(timezone.utc)`` that that with ``later=False``. + Yet again, this can be interpreted as a desirable indication that + the original time is invalid. - **which** - The `original`_ placeholder name for the `localtime` function - branch index was `independently proposed`_ for the name of the - disambiguation attribute and received `some support`_. +**which** + The `original`_ placeholder name for the `localtime` function + branch index was `independently proposed`_ for the name of the + disambiguation attribute and received `some support`_. - **repeated** - Did not receive any support on the mailing list. +**repeated** + Did not receive any support on the mailing list. - **ltdf** - (Local Time Disambiguation Flag) - short and no-one will attempt - to guess what it means without reading the docs. (This abbreviation - was used in PEP discussions with the meaning ``ltdf=False`` is the - earlier by those who didn't want to endorse any of the alternatives.) +**ltdf** + (Local Time Disambiguation Flag) - short and no-one will attempt + to guess what it means without reading the docs. (This abbreviation + was used in PEP discussions with the meaning ``ltdf=False`` is the + earlier by those who didn't want to endorse any of the alternatives.) .. _original: https://mail.python.org/pipermail/python-dev/2015-April/139099.html .. _independently proposed: https://mail.python.org/pipermail/datetime-sig/2015-August/000479.html diff --git a/pep-0498.txt b/pep-0498.txt --- a/pep-0498.txt +++ b/pep-0498.txt @@ -616,11 +616,11 @@ recently in PEP 461 [#]_. The discussions of such a feature usually suggest either - - adding a method such as ``__bformat__()`` so an object can control - how it is converted to bytes, or +- adding a method such as ``__bformat__()`` so an object can control + how it is converted to bytes, or - - having ``bytes.format()`` not be as general purpose or extensible - as ``str.format()``. +- having ``bytes.format()`` not be as general purpose or extensible + as ``str.format()``. Both of these remain as options in the future, if such functionality is desired. diff --git a/pep-3104.txt b/pep-3104.txt --- a/pep-3104.txt +++ b/pep-3104.txt @@ -190,9 +190,9 @@ statement similar to JavaScript's ``var``. A few possible keywords have been proposed for this purpose: - - ``scope x`` [4]_ - - ``var x`` [4]_ [9]_ - - ``my x`` [13]_ +- ``scope x`` [4]_ +- ``var x`` [4]_ [9]_ +- ``my x`` [13]_ In all these proposals, a declaration such as ``var x`` in a particular scope S would cause all references to ``x`` in scopes diff --git a/pep-3108.txt b/pep-3108.txt --- a/pep-3108.txt +++ b/pep-3108.txt @@ -431,11 +431,11 @@ * videoreader - - No longer used. + - No longer used. * W - - No longer distributed with Python. + - No longer distributed with Python. .. _PyObjC: http://pyobjc.sourceforge.net/ @@ -1051,7 +1051,7 @@ * audioop/sunau/aifc - + Audio modules where the formats are still used. + + Audio modules where the formats are still used. * base64/quopri/uu @@ -1065,7 +1065,7 @@ * linecache - + Used internally in several places. + + Used internally in several places. * nis diff --git a/pep-3127.txt b/pep-3127.txt --- a/pep-3127.txt +++ b/pep-3127.txt @@ -179,7 +179,7 @@ by eval(), and by int(token, 0). (int(token) and int(token, 2-36) are not modified by this proposal.) - * Under 2.6, long() is treated the same as int() + * Under 2.6, long() is treated the same as int() - Formatting of integers into strings, either via the % string operator or the new PEP 3101 advanced string formatting method. diff --git a/pep-3141.txt b/pep-3141.txt --- a/pep-3141.txt +++ b/pep-3141.txt @@ -467,19 +467,19 @@ instance of ``A``, which is a subtype of ``Complex`` (``a : A <: Complex``), and ``b : B <: Complex``. I'll consider ``a + b``: - 1. If A defines an __add__ which accepts b, all is well. - 2. If A falls back to the boilerplate code, and it were to return - a value from __add__, we'd miss the possibility that B defines - a more intelligent __radd__, so the boilerplate should return - NotImplemented from __add__. (Or A may not implement __add__ at - all.) - 3. Then B's __radd__ gets a chance. If it accepts a, all is well. - 4. If it falls back to the boilerplate, there are no more possible - methods to try, so this is where the default implementation - should live. - 5. If B <: A, Python tries B.__radd__ before A.__add__. This is - ok, because it was implemented with knowledge of A, so it can - handle those instances before delegating to Complex. +1. If A defines an __add__ which accepts b, all is well. +2. If A falls back to the boilerplate code, and it were to return + a value from __add__, we'd miss the possibility that B defines + a more intelligent __radd__, so the boilerplate should return + NotImplemented from __add__. (Or A may not implement __add__ at + all.) +3. Then B's __radd__ gets a chance. If it accepts a, all is well. +4. If it falls back to the boilerplate, there are no more possible + methods to try, so this is where the default implementation + should live. +5. If B <: A, Python tries B.__radd__ before A.__add__. This is + ok, because it was implemented with knowledge of A, so it can + handle those instances before delegating to Complex. If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge, then the appropriate shared operation is the one involving the built diff --git a/pep-3149.txt b/pep-3149.txt --- a/pep-3149.txt +++ b/pep-3149.txt @@ -107,8 +107,8 @@ The following information *MUST* be included in the shared library file name: - * The Python implementation (e.g. cpython, pypy, jython, etc.) - * The interpreter's major and minor version numbers +* The Python implementation (e.g. cpython, pypy, jython, etc.) +* The interpreter's major and minor version numbers These two fields are separated by a hyphen and no dots are to appear between the major and minor version numbers. E.g. ``cpython-32``. diff --git a/pep-3156.txt b/pep-3156.txt --- a/pep-3156.txt +++ b/pep-3156.txt @@ -1386,10 +1386,10 @@ Here is a table indicating the order and multiplicity of the basic calls: - 1. ``connection_made()`` -- exactly once - 2. ``data_received()`` -- zero or more times - 3. ``eof_received()`` -- at most once - 4. ``connection_lost()`` -- exactly once +1. ``connection_made()`` -- exactly once +2. ``data_received()`` -- zero or more times +3. ``eof_received()`` -- at most once +4. ``connection_lost()`` -- exactly once Calls to ``pause_writing()`` and ``resume_writing()`` occur in pairs and only between #1 and #4. These pairs will not be nested. The @@ -1418,9 +1418,9 @@ Here is a chart indicating the order and multiplicity of calls: - 1. ``connection_made()`` -- exactly once - 2. ``datagram_received()``, ``error_received()`` -- zero or more times - 3. ``connection_lost()`` -- exactly once +1. ``connection_made()`` -- exactly once +2. ``datagram_received()``, ``error_received()`` -- zero or more times +3. ``connection_lost()`` -- exactly once Subprocess Protocol -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 3 04:35:18 2016 From: python-checkins at python.org (georg.brandl) Date: Tue, 03 May 2016 08:35:18 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Fix_lists-in-blockquotes_in_0?= =?utf-8?q?xxx_PEPs=2E_Ref=3A_=2326914?= Message-ID: <20160503083515.84492.72361.3AAB535B@psf.io> https://hg.python.org/peps/rev/d34c698f63a3 changeset: 6302:d34c698f63a3 user: Georg Brandl date: Tue May 03 10:18:02 2016 +0200 summary: Fix lists-in-blockquotes in 0xxx PEPs. Ref: #26914 files: pep-0302.txt | 144 ++++++------ pep-0327.txt | 12 +- pep-0339.txt | 102 ++++---- pep-0362.txt | 100 ++++---- pep-0364.txt | 26 +- pep-0372.txt | 2 +- pep-0380.txt | 57 ++-- pep-0382.txt | 20 +- pep-0393.txt | 16 +- pep-0400.txt | 170 ++++++++-------- pep-0403.txt | 10 +- pep-0404.txt | 2 +- pep-0410.txt | 114 +++++----- pep-0416.txt | 226 ++++++++++---------- pep-0418.txt | 16 +- pep-0426.txt | 32 +- pep-0432.txt | 70 ++++- pep-0433.txt | 407 ++++++++++++++++++++------------------ pep-0437.txt | 74 +++--- pep-0446.txt | 40 +- pep-0457.txt | 72 +++--- pep-0461.txt | 36 +- pep-0472.txt | 12 +- pep-0488.txt | 12 +- pep-0498.txt | 6 +- pep-0628.txt | 12 +- 26 files changed, 920 insertions(+), 870 deletions(-) diff --git a/pep-0302.txt b/pep-0302.txt --- a/pep-0302.txt +++ b/pep-0302.txt @@ -34,15 +34,15 @@ built-in ``__import__`` function. However, overriding ``__import__`` has many problems. To begin with: - * An ``__import__`` replacement needs to *fully* reimplement the entire - import mechanism, or call the original ``__import__`` before or after the - custom code. +* An ``__import__`` replacement needs to *fully* reimplement the entire + import mechanism, or call the original ``__import__`` before or after the + custom code. - * It has very complex semantics and responsibilities. +* It has very complex semantics and responsibilities. - * ``__import__`` gets called even for modules that are already in - ``sys.modules``, which is almost never what you want, unless you're writing - some sort of monitoring tool. +* ``__import__`` gets called even for modules that are already in + ``sys.modules``, which is almost never what you want, unless you're writing + some sort of monitoring tool. The situation gets worse when you need to extend the import mechanism from C: it's currently impossible, apart from hacking Python's ``import.c`` or @@ -233,61 +233,61 @@ The ``load_module()`` method has a few responsibilities that it must fulfill *before* it runs any code: - * If there is an existing module object named 'fullname' in ``sys.modules``, - the loader must use that existing module. (Otherwise, the ``reload()`` - builtin will not work correctly.) If a module named 'fullname' does not - exist in ``sys.modules``, the loader must create a new module object and - add it to ``sys.modules``. +* If there is an existing module object named 'fullname' in ``sys.modules``, + the loader must use that existing module. (Otherwise, the ``reload()`` + builtin will not work correctly.) If a module named 'fullname' does not + exist in ``sys.modules``, the loader must create a new module object and + add it to ``sys.modules``. - Note that the module object *must* be in ``sys.modules`` before the loader - executes the module code. This is crucial because the module code may - (directly or indirectly) import itself; adding it to ``sys.modules`` - beforehand prevents unbounded recursion in the worst case and multiple - loading in the best. + Note that the module object *must* be in ``sys.modules`` before the loader + executes the module code. This is crucial because the module code may + (directly or indirectly) import itself; adding it to ``sys.modules`` + beforehand prevents unbounded recursion in the worst case and multiple + loading in the best. - If the load fails, the loader needs to remove any module it may have - inserted into ``sys.modules``. If the module was already in ``sys.modules`` - then the loader should leave it alone. + If the load fails, the loader needs to remove any module it may have + inserted into ``sys.modules``. If the module was already in ``sys.modules`` + then the loader should leave it alone. - * The ``__file__`` attribute must be set. This must be a string, but it may - be a dummy value, for example "". The privilege of not having a - ``__file__`` attribute at all is reserved for built-in modules. +* The ``__file__`` attribute must be set. This must be a string, but it may + be a dummy value, for example "". The privilege of not having a + ``__file__`` attribute at all is reserved for built-in modules. - * The ``__name__`` attribute must be set. If one uses ``imp.new_module()`` - then the attribute is set automatically. +* The ``__name__`` attribute must be set. If one uses ``imp.new_module()`` + then the attribute is set automatically. - * If it's a package, the ``__path__`` variable must be set. This must be a - list, but may be empty if ``__path__`` has no further significance to the - importer (more on this later). +* If it's a package, the ``__path__`` variable must be set. This must be a + list, but may be empty if ``__path__`` has no further significance to the + importer (more on this later). - * The ``__loader__`` attribute must be set to the loader object. This is - mostly for introspection and reloading, but can be used for - importer-specific extras, for example getting data associated with an - importer. +* The ``__loader__`` attribute must be set to the loader object. This is + mostly for introspection and reloading, but can be used for + importer-specific extras, for example getting data associated with an + importer. - * The ``__package__`` attribute [8]_ must be set. +* The ``__package__`` attribute [8]_ must be set. - If the module is a Python module (as opposed to a built-in module or a - dynamically loaded extension), it should execute the module's code in the - module's global name space (``module.__dict__``). + If the module is a Python module (as opposed to a built-in module or a + dynamically loaded extension), it should execute the module's code in the + module's global name space (``module.__dict__``). - Here is a minimal pattern for a ``load_module()`` method:: + Here is a minimal pattern for a ``load_module()`` method:: - # Consider using importlib.util.module_for_loader() to handle - # most of these details for you. - def load_module(self, fullname): - code = self.get_code(fullname) - ispkg = self.is_package(fullname) - mod = sys.modules.setdefault(fullname, imp.new_module(fullname)) - mod.__file__ = "<%s>" % self.__class__.__name__ - mod.__loader__ = self - if ispkg: - mod.__path__ = [] - mod.__package__ = fullname - else: - mod.__package__ = fullname.rpartition('.')[0] - exec(code, mod.__dict__) - return mod + # Consider using importlib.util.module_for_loader() to handle + # most of these details for you. + def load_module(self, fullname): + code = self.get_code(fullname) + ispkg = self.is_package(fullname) + mod = sys.modules.setdefault(fullname, imp.new_module(fullname)) + mod.__file__ = "<%s>" % self.__class__.__name__ + mod.__loader__ = self + if ispkg: + mod.__path__ = [] + mod.__package__ = fullname + else: + mod.__package__ = fullname.rpartition('.')[0] + exec(code, mod.__dict__) + return mod Specification part 2: Registering Hooks @@ -326,8 +326,8 @@ Just like ``sys.path`` itself, the new ``sys`` variables must have specific types: - * ``sys.meta_path`` and ``sys.path_hooks`` must be Python lists. - * ``sys.path_importer_cache`` must be a Python dict. +* ``sys.meta_path`` and ``sys.path_hooks`` must be Python lists. +* ``sys.path_importer_cache`` must be a Python dict. Modifying these variables in place is allowed, as is replacing them with new objects. @@ -457,26 +457,26 @@ There are a number of possible ways to address this problem: - * "Don't do that". If a package needs to locate data files via its - ``__path__``, it is not suitable for loading via an import hook. The - package can still be located on a directory in ``sys.path``, as at present, - so this should not be seen as a major issue. +* "Don't do that". If a package needs to locate data files via its + ``__path__``, it is not suitable for loading via an import hook. The + package can still be located on a directory in ``sys.path``, as at present, + so this should not be seen as a major issue. - * Locate data files from a standard location, rather than relative to the - module file. A relatively simple approach (which is supported by - distutils) would be to locate data files based on ``sys.prefix`` (or - ``sys.exec_prefix``). For example, looking in - ``os.path.join(sys.prefix, "data", package_name)``. +* Locate data files from a standard location, rather than relative to the + module file. A relatively simple approach (which is supported by + distutils) would be to locate data files based on ``sys.prefix`` (or + ``sys.exec_prefix``). For example, looking in + ``os.path.join(sys.prefix, "data", package_name)``. - * Import hooks could offer a standard way of getting at data files relative - to the module file. The standard ``zipimport`` object provides a method - ``get_data(name)`` which returns the content of the "file" called ``name``, - as a string. To allow modules to get at the importer object, ``zipimport`` - also adds an attribute ``__loader__`` to the module, containing the - ``zipimport`` object used to load the module. If such an approach is used, - it is important that client code takes care not to break if the - ``get_data()`` method is not available, so it is not clear that this - approach offers a general answer to the problem. +* Import hooks could offer a standard way of getting at data files relative + to the module file. The standard ``zipimport`` object provides a method + ``get_data(name)`` which returns the content of the "file" called ``name``, + as a string. To allow modules to get at the importer object, ``zipimport`` + also adds an attribute ``__loader__`` to the module, containing the + ``zipimport`` object used to load the module. If such an approach is used, + it is important that client code takes care not to break if the + ``get_data()`` method is not available, so it is not clear that this + approach offers a general answer to the problem. It was suggested on python-dev that it would be useful to be able to receive a list of available modules from an importer and/or a list of available data diff --git a/pep-0327.txt b/pep-0327.txt --- a/pep-0327.txt +++ b/pep-0327.txt @@ -499,12 +499,12 @@ The initial discussion on this item was what should happen when passing floating point to the constructor: - 1. ``Decimal(1.1) == Decimal('1.1')`` +1. ``Decimal(1.1) == Decimal('1.1')`` - 2. ``Decimal(1.1) == - Decimal('110000000000000008881784197001252...e-51')`` +2. ``Decimal(1.1) == + Decimal('110000000000000008881784197001252...e-51')`` - 3. an exception is raised +3. an exception is raised Several people alleged that (1) is the better option here, because it's what you expect when writing ``Decimal(1.1)``. And quoting John @@ -1180,14 +1180,14 @@ These are methods that return useful information from the Context: -- ``Etiny()``: Minimum exponent considering precision. +- ``Etiny()``: Minimum exponent considering precision. :: >>> c.Emin -999999999 >>> c.Etiny() -1000000007 -- ``Etop()``: Maximum exponent considering precision. +- ``Etop()``: Maximum exponent considering precision. :: >>> c.Emax 999999999 diff --git a/pep-0339.txt b/pep-0339.txt --- a/pep-0339.txt +++ b/pep-0339.txt @@ -428,12 +428,12 @@ + Parser/ - - Python.asdl - ASDL syntax file + - Python.asdl + ASDL syntax file - - asdl.py - "An implementation of the Zephyr Abstract Syntax Definition - Language." Uses SPARK_ to parse the ASDL files. + - asdl.py + "An implementation of the Zephyr Abstract Syntax Definition + Language." Uses SPARK_ to parse the ASDL files. - asdl_c.py "Generate C code from an ASDL description." Generates @@ -444,86 +444,86 @@ + Python/ - - Python-ast.c - Creates C structs corresponding to the ASDL types. Also + - Python-ast.c + Creates C structs corresponding to the ASDL types. Also contains code for marshaling AST nodes (core ASDL types have marshaling code in asdl.c). "File automatically generated by Parser/asdl_c.py". This file must be committed separately - after every grammar change is committed since the __version__ - value is set to the latest grammar change revision number. + after every grammar change is committed since the __version__ + value is set to the latest grammar change revision number. - - asdl.c - Contains code to handle the ASDL sequence type. Also has code - to handle marshalling the core ASDL types, such as number and - identifier. used by Python-ast.c for marshaling AST nodes. + - asdl.c + Contains code to handle the ASDL sequence type. Also has code + to handle marshalling the core ASDL types, such as number and + identifier. used by Python-ast.c for marshaling AST nodes. - - ast.c - Converts Python's parse tree into the abstract syntax tree. + - ast.c + Converts Python's parse tree into the abstract syntax tree. - - ceval.c - Executes byte code (aka, eval loop). + - ceval.c + Executes byte code (aka, eval loop). - - compile.c - Emits bytecode based on the AST. + - compile.c + Emits bytecode based on the AST. - - symtable.c + - symtable.c Generates a symbol table from AST. - - pyarena.c - Implementation of the arena memory manager. + - pyarena.c + Implementation of the arena memory manager. - - import.c - Home of the magic number (named ``MAGIC``) for bytecode versioning + - import.c + Home of the magic number (named ``MAGIC``) for bytecode versioning + Include/ - - Python-ast.h - Contains the actual definitions of the C structs as generated by - Python/Python-ast.c . - "Automatically generated by Parser/asdl_c.py". + - Python-ast.h + Contains the actual definitions of the C structs as generated by + Python/Python-ast.c . + "Automatically generated by Parser/asdl_c.py". - - asdl.h - Header for the corresponding Python/ast.c . + - asdl.h + Header for the corresponding Python/ast.c . - - ast.h - Declares PyAST_FromNode() external (from Python/ast.c). + - ast.h + Declares PyAST_FromNode() external (from Python/ast.c). - - code.h + - code.h Header file for Objects/codeobject.c; contains definition of PyCodeObject. - - symtable.h + - symtable.h Header for Python/symtable.c . struct symtable and PySTEntryObject are defined here. - - pyarena.h - Header file for the corresponding Python/pyarena.c . + - pyarena.h + Header file for the corresponding Python/pyarena.c . - - opcode.h - Master list of bytecode; if this file is modified you must modify - several other files accordingly (see "`Introducing New Bytecode`_") + - opcode.h + Master list of bytecode; if this file is modified you must modify + several other files accordingly (see "`Introducing New Bytecode`_") + Objects/ - - codeobject.c - Contains PyCodeObject-related code (originally in - Python/compile.c). + - codeobject.c + Contains PyCodeObject-related code (originally in + Python/compile.c). + Lib/ - - opcode.py - One of the files that must be modified if Include/opcode.h is. + - opcode.py + One of the files that must be modified if Include/opcode.h is. - - compiler/ + - compiler/ - * pyassem.py - One of the files that must be modified if Include/opcode.h is - changed. + * pyassem.py + One of the files that must be modified if Include/opcode.h is + changed. - * pycodegen.py - One of the files that must be modified if Include/opcode.h is - changed. + * pycodegen.py + One of the files that must be modified if Include/opcode.h is + changed. Known Compiler-related Experiments diff --git a/pep-0362.txt b/pep-0362.txt --- a/pep-0362.txt +++ b/pep-0362.txt @@ -151,32 +151,32 @@ Describes how argument values are bound to the parameter. Possible values: - * ``Parameter.POSITIONAL_ONLY`` - value must be supplied - as a positional argument. + * ``Parameter.POSITIONAL_ONLY`` - value must be supplied + as a positional argument. - Python has no explicit syntax for defining positional-only - parameters, but many built-in and extension module functions - (especially those that accept only one or two parameters) - accept them. + Python has no explicit syntax for defining positional-only + parameters, but many built-in and extension module functions + (especially those that accept only one or two parameters) + accept them. - * ``Parameter.POSITIONAL_OR_KEYWORD`` - value may be - supplied as either a keyword or positional argument - (this is the standard binding behaviour for functions - implemented in Python.) + * ``Parameter.POSITIONAL_OR_KEYWORD`` - value may be + supplied as either a keyword or positional argument + (this is the standard binding behaviour for functions + implemented in Python.) - * ``Parameter.KEYWORD_ONLY`` - value must be supplied - as a keyword argument. Keyword only parameters are those - which appear after a "*" or "\*args" entry in a Python - function definition. + * ``Parameter.KEYWORD_ONLY`` - value must be supplied + as a keyword argument. Keyword only parameters are those + which appear after a "*" or "\*args" entry in a Python + function definition. - * ``Parameter.VAR_POSITIONAL`` - a tuple of positional - arguments that aren't bound to any other parameter. - This corresponds to a "\*args" parameter in a Python - function definition. + * ``Parameter.VAR_POSITIONAL`` - a tuple of positional + arguments that aren't bound to any other parameter. + This corresponds to a "\*args" parameter in a Python + function definition. - * ``Parameter.VAR_KEYWORD`` - a dict of keyword arguments - that aren't bound to any other parameter. This corresponds - to a "\*\*kwargs" parameter in a Python function definition. + * ``Parameter.VAR_KEYWORD`` - a dict of keyword arguments + that aren't bound to any other parameter. This corresponds + to a "\*\*kwargs" parameter in a Python function definition. Always use ``Parameter.*`` constants for setting and checking value of the ``kind`` attribute. @@ -271,39 +271,39 @@ The function implements the following algorithm: - - If the object is not callable - raise a TypeError +- If the object is not callable - raise a TypeError - - If the object has a ``__signature__`` attribute and if it - is not ``None`` - return it +- If the object has a ``__signature__`` attribute and if it + is not ``None`` - return it - - If it has a ``__wrapped__`` attribute, return - ``signature(object.__wrapped__)`` +- If it has a ``__wrapped__`` attribute, return + ``signature(object.__wrapped__)`` - - If the object is an instance of ``FunctionType``, construct - and return a new ``Signature`` for it +- If the object is an instance of ``FunctionType``, construct + and return a new ``Signature`` for it - - If the object is a bound method, construct and return a new ``Signature`` - object, with its first parameter (usually ``self`` or ``cls``) - removed. (``classmethod`` and ``staticmethod`` are supported - too. Since both are descriptors, the former returns a bound method, - and the latter returns its wrapped function.) +- If the object is a bound method, construct and return a new ``Signature`` + object, with its first parameter (usually ``self`` or ``cls``) + removed. (``classmethod`` and ``staticmethod`` are supported + too. Since both are descriptors, the former returns a bound method, + and the latter returns its wrapped function.) - - If the object is an instance of ``functools.partial``, construct - a new ``Signature`` from its ``partial.func`` attribute, and - account for already bound ``partial.args`` and ``partial.kwargs`` +- If the object is an instance of ``functools.partial``, construct + a new ``Signature`` from its ``partial.func`` attribute, and + account for already bound ``partial.args`` and ``partial.kwargs`` - - If the object is a class or metaclass: +- If the object is a class or metaclass: - - If the object's type has a ``__call__`` method defined in - its MRO, return a Signature for it + - If the object's type has a ``__call__`` method defined in + its MRO, return a Signature for it - - If the object has a ``__new__`` method defined in its MRO, - return a Signature object for it + - If the object has a ``__new__`` method defined in its MRO, + return a Signature object for it - - If the object has a ``__init__`` method defined in its MRO, - return a Signature object for it + - If the object has a ``__init__`` method defined in its MRO, + return a Signature object for it - - Return ``signature(object.__call__)`` +- Return ``signature(object.__call__)`` Note that the ``Signature`` object is created in a lazy manner, and is not automatically cached. However, the user can manually cache a @@ -323,13 +323,13 @@ objects in the ``inspect.signature()`` function. However, this has the following downsides: - * If the ``Signature`` object is cached then any changes to the function - it describes will not be reflected in it. However, If the caching is - needed, it can be always done manually and explicitly +* If the ``Signature`` object is cached then any changes to the function + it describes will not be reflected in it. However, If the caching is + needed, it can be always done manually and explicitly - * It is better to reserve the ``__signature__`` attribute for the cases - when there is a need to explicitly set to a ``Signature`` object that - is different from the actual one +* It is better to reserve the ``__signature__`` attribute for the cases + when there is a need to explicitly set to a ``Signature`` object that + is different from the actual one Some functions may not be introspectable diff --git a/pep-0364.txt b/pep-0364.txt --- a/pep-0364.txt +++ b/pep-0364.txt @@ -206,23 +206,23 @@ Open Issues =========== - - Should there be a command line switch and/or environment variable to - disable all remappings? +- Should there be a command line switch and/or environment variable to + disable all remappings? - - Should remappings occur recursively? +- Should remappings occur recursively? - - Should we automatically parse package directories for .mv files when - the package's __init__.py is loaded? This would allow packages to - easily include .mv files for their own remappings. Compare what the - email package currently has to do if we place its ``.mv`` file in - the email package instead of in the oldlib package:: +- Should we automatically parse package directories for .mv files when + the package's __init__.py is loaded? This would allow packages to + easily include .mv files for their own remappings. Compare what the + email package currently has to do if we place its ``.mv`` file in + the email package instead of in the oldlib package:: - # Expose old names - import os, sys - sys.stdlib_remapper.read_directory_mv_files(os.path.dirname(__file__)) + # Expose old names + import os, sys + sys.stdlib_remapper.read_directory_mv_files(os.path.dirname(__file__)) - I think we should automatically read a package's directory for any - ``.mv`` files it might contain. + I think we should automatically read a package's directory for any + ``.mv`` files it might contain. Reference Implementation diff --git a/pep-0372.txt b/pep-0372.txt --- a/pep-0372.txt +++ b/pep-0372.txt @@ -317,6 +317,7 @@ This document has been placed in the public domain. + .. Local Variables: mode: indented-text @@ -325,4 +326,3 @@ fill-column: 70 coding: utf-8 End: - diff --git a/pep-0380.txt b/pep-0380.txt --- a/pep-0380.txt +++ b/pep-0380.txt @@ -85,35 +85,35 @@ The full semantics of the ``yield from`` expression can be described in terms of the generator protocol as follows: - * Any values that the iterator yields are passed directly to the - caller. +* Any values that the iterator yields are passed directly to the + caller. - * Any values sent to the delegating generator using ``send()`` are - passed directly to the iterator. If the sent value is None, the - iterator's ``__next__()`` method is called. If the sent value - is not None, the iterator's ``send()`` method is called. If the - call raises StopIteration, the delegating generator is resumed. - Any other exception is propagated to the delegating generator. +* Any values sent to the delegating generator using ``send()`` are + passed directly to the iterator. If the sent value is None, the + iterator's ``__next__()`` method is called. If the sent value + is not None, the iterator's ``send()`` method is called. If the + call raises StopIteration, the delegating generator is resumed. + Any other exception is propagated to the delegating generator. - * Exceptions other than GeneratorExit thrown into the delegating - generator are passed to the ``throw()`` method of the iterator. - If the call raises StopIteration, the delegating generator is - resumed. Any other exception is propagated to the delegating - generator. +* Exceptions other than GeneratorExit thrown into the delegating + generator are passed to the ``throw()`` method of the iterator. + If the call raises StopIteration, the delegating generator is + resumed. Any other exception is propagated to the delegating + generator. - * If a GeneratorExit exception is thrown into the delegating - generator, or the ``close()`` method of the delegating generator - is called, then the ``close()`` method of the iterator is called - if it has one. If this call results in an exception, it is - propagated to the delegating generator. Otherwise, - GeneratorExit is raised in the delegating generator. +* If a GeneratorExit exception is thrown into the delegating + generator, or the ``close()`` method of the delegating generator + is called, then the ``close()`` method of the iterator is called + if it has one. If this call results in an exception, it is + propagated to the delegating generator. Otherwise, + GeneratorExit is raised in the delegating generator. - * The value of the ``yield from`` expression is the first argument - to the ``StopIteration`` exception raised by the iterator when - it terminates. +* The value of the ``yield from`` expression is the first argument + to the ``StopIteration`` exception raised by the iterator when + it terminates. - * ``return expr`` in a generator causes ``StopIteration(expr)`` to - be raised upon exit from the generator. +* ``return expr`` in a generator causes ``StopIteration(expr)`` to + be raised upon exit from the generator. Enhancements to StopIteration @@ -133,7 +133,7 @@ RESULT = yield from EXPR -is semantically equivalent to :: + is semantically equivalent to :: _i = iter(EXPR) try: @@ -180,12 +180,12 @@ return value -is semantically equivalent to :: + is semantically equivalent to :: raise StopIteration(value) -except that, as currently, the exception cannot be caught by -``except`` clauses within the returning generator. + except that, as currently, the exception cannot be caught by + ``except`` clauses within the returning generator. 3. The StopIteration exception behaves as though defined thusly:: @@ -469,6 +469,7 @@ This document has been placed in the public domain. + .. Local Variables: mode: indented-text diff --git a/pep-0382.txt b/pep-0382.txt --- a/pep-0382.txt +++ b/pep-0382.txt @@ -117,16 +117,16 @@ encountered. In summary, the process import a package foo works like this: - 1. sys.path is searched for directories foo or foo.pyp, or a file foo.. - If a file is found and no directory, it is treated as a module, and imported. - 2. If a directory foo is found, a check is made whether it contains __init__.py. - If so, the location of the __init__.py is remembered. Otherwise, the directory - is skipped. Once an __init__.py is found, further directories called foo are - skipped. - 3. For both directories foo and foo.pyp, the directories are added to the package's - __path__. - 4. If an __init__ module was found, it is imported, with __path__ - being initialized to the path computed all ``.pyp`` directories. +1. sys.path is searched for directories foo or foo.pyp, or a file foo.. + If a file is found and no directory, it is treated as a module, and imported. +2. If a directory foo is found, a check is made whether it contains __init__.py. + If so, the location of the __init__.py is remembered. Otherwise, the directory + is skipped. Once an __init__.py is found, further directories called foo are + skipped. +3. For both directories foo and foo.pyp, the directories are added to the package's + __path__. +4. If an __init__ module was found, it is imported, with __path__ + being initialized to the path computed all ``.pyp`` directories. Impact on Import Hooks ---------------------- diff --git a/pep-0393.txt b/pep-0393.txt --- a/pep-0393.txt +++ b/pep-0393.txt @@ -110,10 +110,12 @@ - length: number of code points in the string (result of sq_length) - interned: interned-state (SSTATE_*) as in 3.2 - kind: form of string - + 00 => str is not initialized (data are in wstr) - + 01 => 1 byte (Latin-1) - + 10 => 2 byte (UCS-2) - + 11 => 4 byte (UCS-4); + + + 00 => str is not initialized (data are in wstr) + + 01 => 1 byte (Latin-1) + + 10 => 2 byte (UCS-2) + + 11 => 4 byte (UCS-4); + - compact: the object uses one of the compact representations (implies ready) - ascii: the object uses the PyASCIIObject representation @@ -189,9 +191,9 @@ gives the void pointer to the data. Access to individual characters should use PyUnicode_{READ|WRITE}[_CHAR]: - - PyUnicode_READ(kind, data, index) - - PyUnicode_WRITE(kind, data, index, value) - - PyUnicode_READ_CHAR(unicode, index) +- PyUnicode_READ(kind, data, index) +- PyUnicode_WRITE(kind, data, index, value) +- PyUnicode_READ_CHAR(unicode, index) All these macros assume that the string is in canonical form; callers need to ensure this by calling PyUnicode_READY. diff --git a/pep-0400.txt b/pep-0400.txt --- a/pep-0400.txt +++ b/pep-0400.txt @@ -77,72 +77,72 @@ StreamReader and StreamWriter issues '''''''''''''''''''''''''''''''''''' - * StreamReader is unable to translate newlines. - * StreamWriter doesn't support "line buffering" (flush if the input - text contains a newline). - * StreamReader classes of the CJK encodings (e.g. GB18030) only - supports UNIX newlines ('\\n'). - * StreamReader and StreamWriter are stateful codecs but don't expose - functions to control their state (getstate() or setstate()). Each - codec has to handle corner cases, see `Appendix A`_. - * StreamReader and StreamWriter are very similar to IncrementalReader - and IncrementalEncoder, some code is duplicated for stateful codecs - (e.g. UTF-16). - * Each codec has to reimplement its own StreamReader and StreamWriter - class, even if it's trivial (just call the encoder/decoder). - * codecs.open(filename, "r") creates a io.TextIOWrapper object. - * No codec implements an optimized method in StreamReader or - StreamWriter based on the specificities of the codec. +* StreamReader is unable to translate newlines. +* StreamWriter doesn't support "line buffering" (flush if the input + text contains a newline). +* StreamReader classes of the CJK encodings (e.g. GB18030) only + supports UNIX newlines ('\\n'). +* StreamReader and StreamWriter are stateful codecs but don't expose + functions to control their state (getstate() or setstate()). Each + codec has to handle corner cases, see `Appendix A`_. +* StreamReader and StreamWriter are very similar to IncrementalReader + and IncrementalEncoder, some code is duplicated for stateful codecs + (e.g. UTF-16). +* Each codec has to reimplement its own StreamReader and StreamWriter + class, even if it's trivial (just call the encoder/decoder). +* codecs.open(filename, "r") creates a io.TextIOWrapper object. +* No codec implements an optimized method in StreamReader or + StreamWriter based on the specificities of the codec. Issues in the bug tracker: - * `Issue #5445 `_ (2009-03-08): - codecs.StreamWriter.writelines problem when passed generator - * `Issue #7262: `_ (2009-11-04): - codecs.open() + eol (windows) - * `Issue #8260 `_ (2010-03-29): - When I use codecs.open(...) and f.readline() follow up by f.read() - return bad result - * `Issue #8630 `_ (2010-05-05): - Keepends param in codec readline(s) - * `Issue #10344 `_ (2010-11-06): - codecs.readline doesn't care buffering - * `Issue #11461 `_ (2011-03-10): - Reading UTF-16 with codecs.readline() breaks on surrogate pairs - * `Issue #12446 `_ (2011-06-30): - StreamReader Readlines behavior odd - * `Issue #12508 `_ (2011-07-06): - Codecs Anomaly - * `Issue #12512 `_ (2011-07-07): - codecs: StreamWriter issues with stateful codecs after a seek or - with append mode - * `Issue #12513 `_ (2011-07-07): - codec.StreamReaderWriter: issues with interlaced read-write +* `Issue #5445 `_ (2009-03-08): + codecs.StreamWriter.writelines problem when passed generator +* `Issue #7262: `_ (2009-11-04): + codecs.open() + eol (windows) +* `Issue #8260 `_ (2010-03-29): + When I use codecs.open(...) and f.readline() follow up by f.read() + return bad result +* `Issue #8630 `_ (2010-05-05): + Keepends param in codec readline(s) +* `Issue #10344 `_ (2010-11-06): + codecs.readline doesn't care buffering +* `Issue #11461 `_ (2011-03-10): + Reading UTF-16 with codecs.readline() breaks on surrogate pairs +* `Issue #12446 `_ (2011-06-30): + StreamReader Readlines behavior odd +* `Issue #12508 `_ (2011-07-06): + Codecs Anomaly +* `Issue #12512 `_ (2011-07-07): + codecs: StreamWriter issues with stateful codecs after a seek or + with append mode +* `Issue #12513 `_ (2011-07-07): + codec.StreamReaderWriter: issues with interlaced read-write TextIOWrapper features '''''''''''''''''''''' - * TextIOWrapper supports any kind of newline, including translating - newlines (to UNIX newlines), to read and write. - * TextIOWrapper reuses codecs incremental encoders and decoders (no - duplication of code). - * The io module (TextIOWrapper) is faster than the codecs module - (StreamReader). It is implemented in C, whereas codecs is - implemented in Python. - * TextIOWrapper has a readahead algorithm which speeds up small - reads: read character by character or line by line (io is 10x - through 25x faster than codecs on these operations). - * TextIOWrapper has a write buffer. - * TextIOWrapper.tell() is optimized. - * TextIOWrapper supports random access (read+write) using a single - class which permit to optimize interlaced read-write (but no such - optimization is implemented). +* TextIOWrapper supports any kind of newline, including translating + newlines (to UNIX newlines), to read and write. +* TextIOWrapper reuses codecs incremental encoders and decoders (no + duplication of code). +* The io module (TextIOWrapper) is faster than the codecs module + (StreamReader). It is implemented in C, whereas codecs is + implemented in Python. +* TextIOWrapper has a readahead algorithm which speeds up small + reads: read character by character or line by line (io is 10x + through 25x faster than codecs on these operations). +* TextIOWrapper has a write buffer. +* TextIOWrapper.tell() is optimized. +* TextIOWrapper supports random access (read+write) using a single + class which permit to optimize interlaced read-write (but no such + optimization is implemented). TextIOWrapper issues '''''''''''''''''''' - * `Issue #12215 `_ (2011-05-30): - TextIOWrapper: issues with interlaced read-write +* `Issue #12215 `_ (2011-05-30): + TextIOWrapper: issues with interlaced read-write Possible improvements of StreamReader and StreamWriter '''''''''''''''''''''''''''''''''''''''''''''''''''''' @@ -233,29 +233,29 @@ Python supports the following stateful codecs: - * cp932 - * cp949 - * cp950 - * euc_jis_2004 - * euc_jisx2003 - * euc_jp - * euc_kr - * gb18030 - * gbk - * hz - * iso2022_jp - * iso2022_jp_1 - * iso2022_jp_2 - * iso2022_jp_2004 - * iso2022_jp_3 - * iso2022_jp_ext - * iso2022_kr - * shift_jis - * shift_jis_2004 - * shift_jisx0213 - * utf_8_sig - * utf_16 - * utf_32 +* cp932 +* cp949 +* cp950 +* euc_jis_2004 +* euc_jisx2003 +* euc_jp +* euc_kr +* gb18030 +* gbk +* hz +* iso2022_jp +* iso2022_jp_1 +* iso2022_jp_2 +* iso2022_jp_2004 +* iso2022_jp_3 +* iso2022_jp_ext +* iso2022_kr +* shift_jis +* shift_jis_2004 +* shift_jisx0213 +* utf_8_sig +* utf_16 +* utf_32 Read and seek(0) '''''''''''''''' @@ -312,13 +312,13 @@ Links ===== - * `PEP 100: Python Unicode Integration - `_ - * `PEP 3116: New I/O `_ - * `Issue #8796: Deprecate codecs.open() - `_ - * `[python-dev] Deprecate codecs.open() and StreamWriter/StreamReader - `_ +* `PEP 100: Python Unicode Integration + `_ +* `PEP 3116: New I/O `_ +* `Issue #8796: Deprecate codecs.open() + `_ +* `[python-dev] Deprecate codecs.open() and StreamWriter/StreamReader + `_ Copyright diff --git a/pep-0403.txt b/pep-0403.txt --- a/pep-0403.txt +++ b/pep-0403.txt @@ -176,11 +176,11 @@ many constructs Python has where one expression is responsible for the bulk of the heavy lifting: - * comprehensions, generator expressions, map(), filter() - * key arguments to sorted(), min(), max() - * partial function application - * provision of callbacks (e.g. for weak references or aysnchronous IO) - * array broadcast operations in NumPy +* comprehensions, generator expressions, map(), filter() +* key arguments to sorted(), min(), max() +* partial function application +* provision of callbacks (e.g. for weak references or aysnchronous IO) +* array broadcast operations in NumPy However, adopting Ruby's block syntax directly won't work for Python, since the effectiveness of Ruby's blocks relies heavily on various conventions in diff --git a/pep-0404.txt b/pep-0404.txt --- a/pep-0404.txt +++ b/pep-0404.txt @@ -32,7 +32,7 @@ The current un-schedule is: - - 2.8 final Never +- 2.8 final Never Official pronouncement diff --git a/pep-0410.txt b/pep-0410.txt --- a/pep-0410.txt +++ b/pep-0410.txt @@ -32,8 +32,8 @@ os.stat() uses float timestamps by default since Python 2.5. Python 3.3 introduced functions supporting nanosecond resolutions: - * os module: futimens(), utimensat() - * time module: clock_gettime(), clock_getres(), monotonic(), wallclock() +* os module: futimens(), utimensat() +* time module: clock_gettime(), clock_getres(), monotonic(), wallclock() os.stat() reads nanosecond timestamps but returns timestamps as float. @@ -74,24 +74,24 @@ Add an optional *timestamp* argument to: - * os module: fstat(), fstatat(), lstat(), stat() (st_atime, - st_ctime and st_mtime fields of the stat structure), - sched_rr_get_interval(), times(), wait3() and wait4() - * resource module: ru_utime and ru_stime fields of getrusage() - * signal module: getitimer(), setitimer() - * time module: clock(), clock_gettime(), clock_getres(), - monotonic(), time() and wallclock() +* os module: fstat(), fstatat(), lstat(), stat() (st_atime, + st_ctime and st_mtime fields of the stat structure), + sched_rr_get_interval(), times(), wait3() and wait4() +* resource module: ru_utime and ru_stime fields of getrusage() +* signal module: getitimer(), setitimer() +* time module: clock(), clock_gettime(), clock_getres(), + monotonic(), time() and wallclock() The *timestamp* argument value can be float or Decimal, float is still the default for backward compatibility. The following functions support Decimal as input: - * datetime module: date.fromtimestamp(), datetime.fromtimestamp() and - datetime.utcfromtimestamp() - * os module: futimes(), futimesat(), lutimes(), utime() - * select module: epoll.poll(), kqueue.control(), select() - * signal module: setitimer(), sigtimedwait() - * time module: ctime(), gmtime(), localtime(), sleep() +* datetime module: date.fromtimestamp(), datetime.fromtimestamp() and + datetime.utcfromtimestamp() +* os module: futimes(), futimesat(), lutimes(), utime() +* select module: epoll.poll(), kqueue.control(), select() +* signal module: setitimer(), sigtimedwait() +* time module: ctime(), gmtime(), localtime(), sleep() The os.stat_float_times() function is deprecated: use an explicit cast using int() instead. @@ -132,22 +132,22 @@ To support timestamps with an arbitrary or nanosecond resolution, the following types have been considered: - * decimal.Decimal - * number of nanoseconds - * 128-bits float - * datetime.datetime - * datetime.timedelta - * tuple of integers - * timespec structure +* decimal.Decimal +* number of nanoseconds +* 128-bits float +* datetime.datetime +* datetime.timedelta +* tuple of integers +* timespec structure Criteria: - * Doing arithmetic on timestamps must be possible - * Timestamps must be comparable - * An arbitrary resolution, or at least a resolution of one nanosecond without - losing precision - * It should be possible to coerce the new timestamp to float for backward - compatibility +* Doing arithmetic on timestamps must be possible +* Timestamps must be comparable +* An arbitrary resolution, or at least a resolution of one nanosecond without + losing precision +* It should be possible to coerce the new timestamp to float for backward + compatibility A resolution of one nanosecond is enough to support all current C functions. @@ -264,39 +264,39 @@ Different formats have been proposed: - * A: (numerator, denominator) +* A: (numerator, denominator) - * value = numerator / denominator - * resolution = 1 / denominator - * denominator > 0 + * value = numerator / denominator + * resolution = 1 / denominator + * denominator > 0 - * B: (seconds, numerator, denominator) +* B: (seconds, numerator, denominator) - * value = seconds + numerator / denominator - * resolution = 1 / denominator - * 0 <= numerator < denominator - * denominator > 0 + * value = seconds + numerator / denominator + * resolution = 1 / denominator + * 0 <= numerator < denominator + * denominator > 0 - * C: (intpart, floatpart, base, exponent) +* C: (intpart, floatpart, base, exponent) - * value = intpart + floatpart / base\ :sup:`exponent` - * resolution = 1 / base \ :sup:`exponent` - * 0 <= floatpart < base \ :sup:`exponent` - * base > 0 - * exponent >= 0 + * value = intpart + floatpart / base\ :sup:`exponent` + * resolution = 1 / base \ :sup:`exponent` + * 0 <= floatpart < base \ :sup:`exponent` + * base > 0 + * exponent >= 0 - * D: (intpart, floatpart, exponent) +* D: (intpart, floatpart, exponent) - * value = intpart + floatpart / 10\ :sup:`exponent` - * resolution = 1 / 10 \ :sup:`exponent` - * 0 <= floatpart < 10 \ :sup:`exponent` - * exponent >= 0 + * value = intpart + floatpart / 10\ :sup:`exponent` + * resolution = 1 / 10 \ :sup:`exponent` + * 0 <= floatpart < 10 \ :sup:`exponent` + * exponent >= 0 - * E: (sec, nsec) +* E: (sec, nsec) - * value = sec + nsec ? 10\ :sup:`-9` - * resolution = 10 \ :sup:`-9` (nanosecond) - * 0 <= nsec < 10 \ :sup:`9` + * value = sec + nsec ? 10\ :sup:`-9` + * resolution = 10 \ :sup:`-9` (nanosecond) + * 0 <= nsec < 10 \ :sup:`9` All formats support an arbitrary resolution, except of the format (E). @@ -490,11 +490,11 @@ Add new functions for each type, examples: - * time.clock_decimal() - * time.time_decimal() - * os.stat_decimal() - * os.stat_timespec() - * etc. +* time.clock_decimal() +* time.time_decimal() +* os.stat_decimal() +* os.stat_timespec() +* etc. Adding a new function for each function creating timestamps duplicate a lot of code and would be a pain to maintain. diff --git a/pep-0416.txt b/pep-0416.txt --- a/pep-0416.txt +++ b/pep-0416.txt @@ -15,22 +15,22 @@ I'm rejecting this PEP. A number of reasons (not exhaustive): - * According to Raymond Hettinger, use of frozendict is low. Those - that do use it tend to use it as a hint only, such as declaring - global or class-level "constants": they aren't really immutable, - since anyone can still assign to the name. - * There are existing idioms for avoiding mutable default values. - * The potential of optimizing code using frozendict in PyPy is - unsure; a lot of other things would have to change first. The same - holds for compile-time lookups in general. - * Multiple threads can agree by convention not to mutate a shared - dict, there's no great need for enforcement. Multiple processes - can't share dicts. - * Adding a security sandbox written in Python, even with a limited - scope, is frowned upon by many, due to the inherent difficulty with - ever proving that the sandbox is actually secure. Because of this - we won't be adding one to the stdlib any time soon, so this use - case falls outside the scope of a PEP. +* According to Raymond Hettinger, use of frozendict is low. Those + that do use it tend to use it as a hint only, such as declaring + global or class-level "constants": they aren't really immutable, + since anyone can still assign to the name. +* There are existing idioms for avoiding mutable default values. +* The potential of optimizing code using frozendict in PyPy is + unsure; a lot of other things would have to change first. The same + holds for compile-time lookups in general. +* Multiple threads can agree by convention not to mutate a shared + dict, there's no great need for enforcement. Multiple processes + can't share dicts. +* Adding a security sandbox written in Python, even with a limited + scope, is frowned upon by many, due to the inherent difficulty with + ever proving that the sandbox is actually secure. Because of this + we won't be adding one to the stdlib any time soon, so this use + case falls outside the scope of a PEP. On the other hand, exposing the existing read-only dict proxy as a built-in type sounds good to me. (It would need to be changed to @@ -55,46 +55,46 @@ Use cases: - * Immutable global variable like a default configuration. - * Default value of a function parameter. Avoid the issue of mutable default - arguments. - * Implement a cache: frozendict can be used to store function keywords. - frozendict can be used as a key of a mapping or as a member of set. - * frozendict avoids the need of a lock when the frozendict is shared - by multiple threads or processes, especially hashable frozendict. It would - also help to prohibe coroutines (generators + greenlets) to modify the - global state. - * frozendict lookup can be done at compile time instead of runtime because the - mapping is read-only. frozendict can be used instead of a preprocessor to - remove conditional code at compilation, like code specific to a debug build. - * frozendict helps to implement read-only object proxies for security modules. - For example, it would be possible to use frozendict type for __builtins__ - mapping or type.__dict__. This is possible because frozendict is compatible - with the PyDict C API. - * frozendict avoids the need of a read-only proxy in some cases. frozendict is - faster than a proxy because getting an item in a frozendict is a fast lookup - whereas a proxy requires a function call. +* Immutable global variable like a default configuration. +* Default value of a function parameter. Avoid the issue of mutable default + arguments. +* Implement a cache: frozendict can be used to store function keywords. + frozendict can be used as a key of a mapping or as a member of set. +* frozendict avoids the need of a lock when the frozendict is shared + by multiple threads or processes, especially hashable frozendict. It would + also help to prohibe coroutines (generators + greenlets) to modify the + global state. +* frozendict lookup can be done at compile time instead of runtime because the + mapping is read-only. frozendict can be used instead of a preprocessor to + remove conditional code at compilation, like code specific to a debug build. +* frozendict helps to implement read-only object proxies for security modules. + For example, it would be possible to use frozendict type for __builtins__ + mapping or type.__dict__. This is possible because frozendict is compatible + with the PyDict C API. +* frozendict avoids the need of a read-only proxy in some cases. frozendict is + faster than a proxy because getting an item in a frozendict is a fast lookup + whereas a proxy requires a function call. Constraints =========== - * frozendict has to implement the Mapping abstract base class - * frozendict keys and values can be unorderable - * a frozendict is hashable if all keys and values are hashable - * frozendict hash does not depend on the items creation order +* frozendict has to implement the Mapping abstract base class +* frozendict keys and values can be unorderable +* a frozendict is hashable if all keys and values are hashable +* frozendict hash does not depend on the items creation order Implementation ============== - * Add a PyFrozenDictObject structure based on PyDictObject with an extra - "Py_hash_t hash;" field - * frozendict.__hash__() is implemented using hash(frozenset(self.items())) and - caches the result in its private hash attribute - * Register frozendict as a collections.abc.Mapping - * frozendict can be used with PyDict_GetItem(), but PyDict_SetItem() and - PyDict_DelItem() raise a TypeError +* Add a PyFrozenDictObject structure based on PyDictObject with an extra + "Py_hash_t hash;" field +* frozendict.__hash__() is implemented using hash(frozenset(self.items())) and + caches the result in its private hash attribute +* Register frozendict as a collections.abc.Mapping +* frozendict can be used with PyDict_GetItem(), but PyDict_SetItem() and + PyDict_DelItem() raise a TypeError Recipe: hashable dict @@ -161,90 +161,90 @@ Whitelist approach. - * `Implementing an Immutable Dictionary (Python recipe 498072) - `_ by Aristotelis Mikropoulos. - Similar to frozendict except that it is not truly read-only: it is possible - to access to this private internal dict. It does not implement __hash__ and - has an implementation issue: it is possible to call again __init__() to - modify the mapping. - * PyWebmail contains an ImmutableDict type: `webmail.utils.ImmutableDict - `_. - It is hashable if keys and values are hashable. It is not truly read-only: - its internal dict is a public attribute. - * remember project: `remember.dicts.FrozenDict - `_. - It is used to implement a cache: FrozenDict is used to store function callbacks. - FrozenDict may be hashable. It has an extra supply_dict() class method to - create a FrozenDict from a dict without copying the dict: store the dict as - the internal dict. Implementation issue: __init__() can be called to modify - the mapping and the hash may differ depending on item creation order. The - mapping is not truly read-only: the internal dict is accessible in Python. +* `Implementing an Immutable Dictionary (Python recipe 498072) + `_ by Aristotelis Mikropoulos. + Similar to frozendict except that it is not truly read-only: it is possible + to access to this private internal dict. It does not implement __hash__ and + has an implementation issue: it is possible to call again __init__() to + modify the mapping. +* PyWebmail contains an ImmutableDict type: `webmail.utils.ImmutableDict + `_. + It is hashable if keys and values are hashable. It is not truly read-only: + its internal dict is a public attribute. +* remember project: `remember.dicts.FrozenDict + `_. + It is used to implement a cache: FrozenDict is used to store function callbacks. + FrozenDict may be hashable. It has an extra supply_dict() class method to + create a FrozenDict from a dict without copying the dict: store the dict as + the internal dict. Implementation issue: __init__() can be called to modify + the mapping and the hash may differ depending on item creation order. The + mapping is not truly read-only: the internal dict is accessible in Python. Blacklist approach: inherit from dict and override write methods to raise an exception. It is not truly read-only: it is still possible to call dict methods on such "frozen dictionary" to modify it. - * brownie: `brownie.datastructures.ImmuatableDict - `_. - It is hashable if keys and values are hashable. werkzeug project has the - same code: `werkzeug.datastructures.ImmutableDict - `_. - ImmutableDict is used for global constant (configuration options). The Flask - project uses ImmutableDict of werkzeug for its default configuration. - * SQLAchemy project: `sqlachemy.util.immutabledict - `_. - It is not hashable and has an extra method: union(). immutabledict is used - for the default value of parameter of some functions expecting a mapping. - Example: mapper_args=immutabledict() in SqlSoup.map(). - * `Frozen dictionaries (Python recipe 414283) `_ - by Oren Tirosh. It is hashable if keys and values are hashable. Included in - the following projects: +* brownie: `brownie.datastructures.ImmuatableDict + `_. + It is hashable if keys and values are hashable. werkzeug project has the + same code: `werkzeug.datastructures.ImmutableDict + `_. + ImmutableDict is used for global constant (configuration options). The Flask + project uses ImmutableDict of werkzeug for its default configuration. +* SQLAchemy project: `sqlachemy.util.immutabledict + `_. + It is not hashable and has an extra method: union(). immutabledict is used + for the default value of parameter of some functions expecting a mapping. + Example: mapper_args=immutabledict() in SqlSoup.map(). +* `Frozen dictionaries (Python recipe 414283) `_ + by Oren Tirosh. It is hashable if keys and values are hashable. Included in + the following projects: - * lingospot: `frozendict/frozendict.py - `_ - * factor-graphics: frozendict type in `python/fglib/util_ext_frozendict.py - `_ + * lingospot: `frozendict/frozendict.py + `_ + * factor-graphics: frozendict type in `python/fglib/util_ext_frozendict.py + `_ - * The gsakkis-utils project written by George Sakkis includes a frozendict - type: `datastructs.frozendict - `_ - * characters: `scripts/python/frozendict.py - `_. - It is hashable. __init__() sets __init__ to None. - * Old NLTK (1.x): `nltk.util.frozendict - `_. Keys and - values must be hashable. __init__() can be called twice to modify the - mapping. frozendict is used to "freeze" an object. +* The gsakkis-utils project written by George Sakkis includes a frozendict + type: `datastructs.frozendict + `_ +* characters: `scripts/python/frozendict.py + `_. + It is hashable. __init__() sets __init__ to None. +* Old NLTK (1.x): `nltk.util.frozendict + `_. Keys and + values must be hashable. __init__() can be called twice to modify the + mapping. frozendict is used to "freeze" an object. Hashable dict: inherit from dict and just add an __hash__ method. - * `pypy.rpython.lltypesystem.lltype.frozendict - `_. - It is hashable but don't deny modification of the mapping. - * factor-graphics: hashabledict type in `python/fglib/util_ext_frozendict.py - `_ +* `pypy.rpython.lltypesystem.lltype.frozendict + `_. + It is hashable but don't deny modification of the mapping. +* factor-graphics: hashabledict type in `python/fglib/util_ext_frozendict.py + `_ Links ===== - * `Issue #14162: PEP 416: Add a builtin frozendict type - `_ - * PEP 412: Key-Sharing Dictionary - (`issue #13903 `_) - * PEP 351: The freeze protocol - * `The case for immutable dictionaries; and the central misunderstanding of - PEP 351 `_ - * `make dictproxy object via ctypes.pythonapi and type() (Python recipe - 576540) `_ by Ikkei Shimomura. - * Python security modules implementing read-only object proxies using a C - extension: +* `Issue #14162: PEP 416: Add a builtin frozendict type + `_ +* PEP 412: Key-Sharing Dictionary + (`issue #13903 `_) +* PEP 351: The freeze protocol +* `The case for immutable dictionaries; and the central misunderstanding of + PEP 351 `_ +* `make dictproxy object via ctypes.pythonapi and type() (Python recipe + 576540) `_ by Ikkei Shimomura. +* Python security modules implementing read-only object proxies using a C + extension: - * `pysandbox `_ - * `mxProxy `_ - * `zope.proxy `_ - * `zope.security `_ + * `pysandbox `_ + * `mxProxy `_ + * `zope.proxy `_ + * `zope.security `_ Copyright diff --git a/pep-0418.txt b/pep-0418.txt --- a/pep-0418.txt +++ b/pep-0418.txt @@ -116,14 +116,14 @@ Return a ``time.clock_info`` object which has the following attributes: - * ``implementation`` (str): name of the underlying operating system - function. Examples: ``"QueryPerformanceCounter()"``, - ``"clock_gettime(CLOCK_REALTIME)"``. - * ``monotonic`` (bool): True if the clock cannot go backward. - * ``adjustable`` (bool): ``True`` if the clock can be changed automatically - (e.g. by a NTP daemon) or manually by the system administrator, ``False`` - otherwise - * ``resolution`` (float): resolution in seconds of the clock. +* ``implementation`` (str): name of the underlying operating system + function. Examples: ``"QueryPerformanceCounter()"``, + ``"clock_gettime(CLOCK_REALTIME)"``. +* ``monotonic`` (bool): True if the clock cannot go backward. +* ``adjustable`` (bool): ``True`` if the clock can be changed automatically + (e.g. by a NTP daemon) or manually by the system administrator, ``False`` + otherwise +* ``resolution`` (float): resolution in seconds of the clock. time.monotonic() diff --git a/pep-0426.txt b/pep-0426.txt --- a/pep-0426.txt +++ b/pep-0426.txt @@ -868,27 +868,27 @@ * Implied runtime dependencies: + * ``run_requires`` + * ``meta_requires`` + +* Implied build dependencies: + + * ``build_requires`` + * If running the distribution's test suite as part of the build process, + request the ``:run:``, ``:meta:``, and ``:test:`` extras to also + install: + * ``run_requires`` * ``meta_requires`` - -* Implied build dependencies: - - * ``build_requires`` - * If running the distribution's test suite as part of the build process, - request the ``:run:``, ``:meta:``, and ``:test:`` extras to also - install: - - * ``run_requires`` - * ``meta_requires`` - * ``test_requires`` + * ``test_requires`` * Implied development and publication dependencies: - * ``run_requires`` - * ``meta_requires`` - * ``build_requires`` - * ``test_requires`` - * ``dev_requires`` + * ``run_requires`` + * ``meta_requires`` + * ``build_requires`` + * ``test_requires`` + * ``dev_requires`` The notation described in `Extras (optional dependencies)`_ SHOULD be used to determine exactly what gets installed for various operations. diff --git a/pep-0432.txt b/pep-0432.txt --- a/pep-0432.txt +++ b/pep-0432.txt @@ -175,32 +175,50 @@ * Whether or not to enable the import system (required by CPython's build process when freezing the importlib._bootstrap bytecode) * The "Where is Python located?" elements in the ``sys`` module: + * ``sys.executable`` * ``sys.base_exec_prefix`` * ``sys.base_prefix`` * ``sys.exec_prefix`` * ``sys.prefix`` + * The path searched for imports from the filesystem (and other path hooks): + * ``sys.path`` + * The command line arguments seen by the interpeter: + * ``sys.argv`` + * The filesystem encoding used by: + * ``sys.getfsencoding`` * ``os.fsencode`` * ``os.fsdecode`` + * The IO encoding (if any) and the buffering used by: + * ``sys.stdin`` * ``sys.stdout`` * ``sys.stderr`` + * The initial warning system state: + * ``sys.warnoptions`` + * Arbitrary extended options (e.g. to automatically enable ``faulthandler``): + * ``sys._xoptions`` + * Whether or not to implicitly cache bytecode files: + * ``sys.dont_write_bytecode`` + * Whether or not to enforce correct case in filenames on case-insensitive platforms + * ``os.environ["PYTHONCASEOK"]`` + * The other settings exposed to Python code in ``sys.flags``: * ``debug`` (Enable debugging output in the pgen parser) @@ -738,9 +756,9 @@ (typically a zipfile or directory) * otherwise, it will be accurate: - * the script name if running an ordinary script - * ``-c`` if executing a supplied string - * ``-`` or the empty string if running from stdin + * the script name if running an ordinary script + * ``-c`` if executing a supplied string + * ``-`` or the empty string if running from stdin * the metadata in the ``__main__`` module will still indicate it is a builtin module @@ -791,24 +809,26 @@ ``main_code``. * For ``main_path``: - * if the supplied path is recognised as a valid ``sys.path`` entry, it - is inserted as ``sys.path[0]``, ``main_module`` is set - to ``__main__`` and processing continues as for ``main_module`` below. - * otherwise, path is read as a CPython bytecode file - * if that fails, it is read as a Python source file and compiled - * in the latter two cases, the code object is saved to ``main_code`` - and ``__main__.__file__`` is set appropriately + + * if the supplied path is recognised as a valid ``sys.path`` entry, it + is inserted as ``sys.path[0]``, ``main_module`` is set + to ``__main__`` and processing continues as for ``main_module`` below. + * otherwise, path is read as a CPython bytecode file + * if that fails, it is read as a Python source file and compiled + * in the latter two cases, the code object is saved to ``main_code`` + and ``__main__.__file__`` is set appropriately * For ``main_module``: - * any parent package is imported - * the loader for the module is determined - * if the loader indicates the module is a package, add ``.__main__`` to - the end of ``main_module`` and try again (if the final name segment - is already ``.__main__`` then fail immediately) - * once the module source code is located, save the compiled module code - as ``main_code`` and populate the following attributes in ``__main__`` - appropriately: ``__name__``, ``__loader__``, ``__file__``, - ``__cached__``, ``__package__``. + + * any parent package is imported + * the loader for the module is determined + * if the loader indicates the module is a package, add ``.__main__`` to + the end of ``main_module`` and try again (if the final name segment + is already ``.__main__`` then fail immediately) + * once the module source code is located, save the compiled module code + as ``main_code`` and populate the following attributes in ``__main__`` + appropriately: ``__name__``, ``__loader__``, ``__file__``, + ``__cached__``, ``__package__``. (Note: the behaviour described in this section isn't new, it's a write-up @@ -1222,26 +1242,38 @@ * Completely disabling the import system * The initial warning system state: + * ``sys.warnoptions`` * (-W option, PYTHONWARNINGS) + * Arbitrary extended options (e.g. to automatically enable ``faulthandler``): + * ``sys._xoptions`` * (-X option) + * The filesystem encoding used by: + * ``sys.getfsencoding`` * ``os.fsencode`` * ``os.fsdecode`` + * The IO encoding and buffering used by: + * ``sys.stdin`` * ``sys.stdout`` * ``sys.stderr`` * (-u option, PYTHONIOENCODING, PYTHONUNBUFFEREDIO) + * Whether or not to implicitly cache bytecode files: + * ``sys.dont_write_bytecode`` * (-B option, PYTHONDONTWRITEBYTECODE) + * Whether or not to enforce correct case in filenames on case-insensitive platforms + * ``os.environ["PYTHONCASEOK"]`` + * The other settings exposed to Python code in ``sys.flags``: * ``debug`` (Enable debugging output in the pgen parser) diff --git a/pep-0433.txt b/pep-0433.txt --- a/pep-0433.txt +++ b/pep-0433.txt @@ -18,10 +18,10 @@ descriptors, add different ways to change default values of this parameter, and add four new functions: - * ``os.get_cloexec(fd)`` - * ``os.set_cloexec(fd, cloexec=True)`` - * ``sys.getdefaultcloexec()`` - * ``sys.setdefaultcloexec(cloexec)`` +* ``os.get_cloexec(fd)`` +* ``os.set_cloexec(fd, cloexec=True)`` +* ``sys.getdefaultcloexec()`` +* ``sys.setdefaultcloexec(cloexec)`` Rationale @@ -86,14 +86,14 @@ See also the following issues: - * `Issue #2320: Race condition in subprocess using stdin - `_ (2008) - * `Issue #3006: subprocess.Popen causes socket to remain open after - close `_ (2008) - * `Issue #7213: subprocess leaks open file descriptors between Popen - instances causing hangs `_ (2009) - * `Issue #12786: subprocess wait() hangs when stdin is closed - `_ (2011) +* `Issue #2320: Race condition in subprocess using stdin + `_ (2008) +* `Issue #3006: subprocess.Popen causes socket to remain open after + close `_ (2008) +* `Issue #7213: subprocess leaks open file descriptors between Popen + instances causing hangs `_ (2009) +* `Issue #12786: subprocess wait() hangs when stdin is closed + `_ (2011) Security @@ -112,20 +112,20 @@ Example of vulnerabilities: - * `OpenSSH Security Advisory: portable-keysign-rand-helper.adv - `_ - (April 2011) - * `CWE-403: Exposure of File Descriptor to Unintended Control Sphere - `_ (2008) - * `Hijacking Apache https by mod_php - `_ (Dec 2003) +* `OpenSSH Security Advisory: portable-keysign-rand-helper.adv + `_ + (April 2011) +* `CWE-403: Exposure of File Descriptor to Unintended Control Sphere + `_ (2008) +* `Hijacking Apache https by mod_php + `_ (Dec 2003) - * Apache: `Apr should set FD_CLOEXEC if APR_FOPEN_NOCLEANUP is not set - `_ - (fixed in 2009) - * PHP: `system() (and similar) don't cleanup opened handles of Apache - `_ (not fixed in january - 2013) + * Apache: `Apr should set FD_CLOEXEC if APR_FOPEN_NOCLEANUP is not set + `_ + (fixed in 2009) + * PHP: `system() (and similar) don't cleanup opened handles of Apache + `_ (not fixed in january + 2013) Atomicity @@ -189,37 +189,37 @@ Add new functions: - * ``os.get_cloexec(fd:int) -> bool``: get the - close-on-exec flag of a file descriptor. Not available on all - platforms. - * ``os.set_cloexec(fd:int, cloexec:bool=True)``: set or clear the - close-on-exec flag on a file descriptor. Not available on all - platforms. - * ``sys.getdefaultcloexec() -> bool``: get the current default value - of the *cloexec* parameter - * ``sys.setdefaultcloexec(cloexec: bool)``: set the default value - of the *cloexec* parameter +* ``os.get_cloexec(fd:int) -> bool``: get the + close-on-exec flag of a file descriptor. Not available on all + platforms. +* ``os.set_cloexec(fd:int, cloexec:bool=True)``: set or clear the + close-on-exec flag on a file descriptor. Not available on all + platforms. +* ``sys.getdefaultcloexec() -> bool``: get the current default value + of the *cloexec* parameter +* ``sys.setdefaultcloexec(cloexec: bool)``: set the default value + of the *cloexec* parameter Add a new optional *cloexec* parameter to: - * ``asyncore.dispatcher.create_socket()`` - * ``io.FileIO`` - * ``io.open()`` - * ``open()`` - * ``os.dup()`` - * ``os.dup2()`` - * ``os.fdopen()`` - * ``os.open()`` - * ``os.openpty()`` - * ``os.pipe()`` - * ``select.devpoll()`` - * ``select.epoll()`` - * ``select.kqueue()`` - * ``socket.socket()`` - * ``socket.socket.accept()`` - * ``socket.socket.dup()`` - * ``socket.socket.fromfd`` - * ``socket.socketpair()`` +* ``asyncore.dispatcher.create_socket()`` +* ``io.FileIO`` +* ``io.open()`` +* ``open()`` +* ``os.dup()`` +* ``os.dup2()`` +* ``os.fdopen()`` +* ``os.open()`` +* ``os.openpty()`` +* ``os.pipe()`` +* ``select.devpoll()`` +* ``select.epoll()`` +* ``select.kqueue()`` +* ``socket.socket()`` +* ``socket.socket.accept()`` +* ``socket.socket.dup()`` +* ``socket.socket.fromfd`` +* ``socket.socketpair()`` The default value of the *cloexec* parameter is ``sys.getdefaultcloexec()``. @@ -241,13 +241,13 @@ Drawbacks of the proposal: - * It is not more possible to know if the close-on-exec flag will be - set or not on a newly created file descriptor just by reading the - source code. - * If the inheritance of a file descriptor matters, the *cloexec* - parameter must now be specified explicitly, or the library or the - application will not work depending on the default value of the - *cloexec* parameter. +* It is not more possible to know if the close-on-exec flag will be + set or not on a newly created file descriptor just by reading the + source code. +* If the inheritance of a file descriptor matters, the *cloexec* + parameter must now be specified explicitly, or the library or the + application will not work depending on the default value of the + *cloexec* parameter. Alternatives @@ -288,23 +288,23 @@ Advantages of setting close-on-exec flag by default: - * There are far more programs that are bitten by FD inheritance upon - exec (see `Inherited file descriptors issues`_ and `Security`_) - than programs relying on it (see `Applications using inheritance of - file descriptors`_). +* There are far more programs that are bitten by FD inheritance upon + exec (see `Inherited file descriptors issues`_ and `Security`_) + than programs relying on it (see `Applications using inheritance of + file descriptors`_). Drawbacks of setting close-on-exec flag by default: - * It violates the principle of least surprise. Developers using the - os module may expect that Python respects the POSIX standard and so - that close-on-exec flag is not set by default. - * The os module is written as a thin wrapper to system calls (to - functions of the C standard library). If atomic flags to set - close-on-exec flag are not supported (see `Appendix: Operating - system support`_), a single Python function call may call 2 or 3 - system calls (see `Performances`_ section). - * Extra system calls, if any, may slow down Python: see - `Performances`_. +* It violates the principle of least surprise. Developers using the + os module may expect that Python respects the POSIX standard and so + that close-on-exec flag is not set by default. +* The os module is written as a thin wrapper to system calls (to + functions of the C standard library). If atomic flags to set + close-on-exec flag are not supported (see `Appendix: Operating + system support`_), a single Python function call may call 2 or 3 + system calls (see `Performances`_ section). +* Extra system calls, if any, may slow down Python: see + `Performances`_. Backward compatibility: only a few programs rely on inheritance of file descriptors, and they only pass a few file descriptors, usually just @@ -329,20 +329,20 @@ Drawbacks: - * It does not solve the problem on Windows: ``fork()`` does not exist - on Windows - * This alternative does not solve the problem for programs using - ``exec()`` without ``fork()``. - * A third party module may call directly the C function ``fork()`` - which will not call "atfork" callbacks. - * All functions creating file descriptors must be changed to register - a callback and then unregister their callback when the file is - closed. Or a list of *all* open file descriptors must be - maintained. - * The operating system is a better place than Python to close - automatically file descriptors. For example, it is not easy to - avoid a race condition between closing the file and unregistering - the callback closing the file. +* It does not solve the problem on Windows: ``fork()`` does not exist + on Windows +* This alternative does not solve the problem for programs using + ``exec()`` without ``fork()``. +* A third party module may call directly the C function ``fork()`` + which will not call "atfork" callbacks. +* All functions creating file descriptors must be changed to register + a callback and then unregister their callback when the file is + closed. Or a list of *all* open file descriptors must be + maintained. +* The operating system is a better place than Python to close + automatically file descriptors. For example, it is not easy to + avoid a race condition between closing the file and unregistering + the callback closing the file. open(): add "e" flag to mode @@ -363,9 +363,9 @@ Bikeshedding on the name of the new parameter --------------------------------------------- - * ``inherit``, ``inherited``: closer to Windows definition - * ``sensitive`` - * ``sterile``: "Does not produce offspring." +* ``inherit``, ``inherited``: closer to Windows definition +* ``sensitive`` +* ``sterile``: "Does not produce offspring." @@ -400,11 +400,11 @@ Example of programs taking file descriptors from the parent process using a command line option: - * gpg: ``--status-fd ``, ``--logger-fd ``, etc. - * openssl: ``-pass fd:`` - * qemu: ``-add-fd `` - * valgrind: ``--log-fd=``, ``--input-fd=``, etc. - * xterm: ``-S `` +* gpg: ``--status-fd ``, ``--logger-fd ``, etc. +* openssl: ``-pass fd:`` +* qemu: ``-add-fd `` +* valgrind: ``--log-fd=``, ``--input-fd=``, etc. +* xterm: ``-S `` On Linux, it is possible to use ``"/dev/fd/"`` filename to pass a file descriptor to a program expecting a filename. @@ -417,24 +417,24 @@ each creation of new file descriptors. The number of additional system calls depends on the method used to set the flag: - * ``O_NOINHERIT``: no additional system call - * ``O_CLOEXEC``: one additional system call, but only at the creation - of the first file descriptor, to check if the flag is supported. If - the flag is not supported, Python has to fallback to the next method. - * ``ioctl(fd, FIOCLEX)``: one additional system call per file - descriptor - * ``fcntl(fd, F_SETFD, flags)``: two additional system calls per file - descriptor, one to get old flags and one to set new flags +* ``O_NOINHERIT``: no additional system call +* ``O_CLOEXEC``: one additional system call, but only at the creation + of the first file descriptor, to check if the flag is supported. If + the flag is not supported, Python has to fallback to the next method. +* ``ioctl(fd, FIOCLEX)``: one additional system call per file + descriptor +* ``fcntl(fd, F_SETFD, flags)``: two additional system calls per file + descriptor, one to get old flags and one to set new flags On Linux, setting the close-on-flag has a low overhead on performances. Results of `bench_cloexec.py `_ on Linux 3.6: - * close-on-flag not set: 7.8 us - * ``O_CLOEXEC``: 1% slower (7.9 us) - * ``ioctl()``: 3% slower (8.0 us) - * ``fcntl()``: 3% slower (8.0 us) +* close-on-flag not set: 7.8 us +* ``O_CLOEXEC``: 1% slower (7.9 us) +* ``ioctl()``: 3% slower (8.0 us) +* ``fcntl()``: 3% slower (8.0 us) Implementation @@ -522,52 +522,52 @@ open() ------ - * Windows: ``open()`` with ``O_NOINHERIT`` flag [atomic] - * ``open()`` with ``O_CLOEXEC flag`` [atomic] - * ``open()`` + ``os.set_cloexec(fd, True)`` [best-effort] +* Windows: ``open()`` with ``O_NOINHERIT`` flag [atomic] +* ``open()`` with ``O_CLOEXEC flag`` [atomic] +* ``open()`` + ``os.set_cloexec(fd, True)`` [best-effort] os.dup() -------- - * Windows: ``DuplicateHandle()`` [atomic] - * ``fcntl(fd, F_DUPFD_CLOEXEC)`` [atomic] - * ``dup()`` + ``os.set_cloexec(fd, True)`` [best-effort] +* Windows: ``DuplicateHandle()`` [atomic] +* ``fcntl(fd, F_DUPFD_CLOEXEC)`` [atomic] +* ``dup()`` + ``os.set_cloexec(fd, True)`` [best-effort] os.dup2() --------- - * ``fcntl(fd, F_DUP2FD_CLOEXEC, fd2)`` [atomic] - * ``dup3()`` with ``O_CLOEXEC`` flag [atomic] - * ``dup2()`` + ``os.set_cloexec(fd, True)`` [best-effort] +* ``fcntl(fd, F_DUP2FD_CLOEXEC, fd2)`` [atomic] +* ``dup3()`` with ``O_CLOEXEC`` flag [atomic] +* ``dup2()`` + ``os.set_cloexec(fd, True)`` [best-effort] os.pipe() --------- - * Windows: ``CreatePipe()`` with - ``SECURITY_ATTRIBUTES.bInheritHandle=TRUE``, or ``_pipe()`` with - ``O_NOINHERIT`` flag [atomic] - * ``pipe2()`` with ``O_CLOEXEC`` flag [atomic] - * ``pipe()`` + ``os.set_cloexec(fd, True)`` [best-effort] +* Windows: ``CreatePipe()`` with + ``SECURITY_ATTRIBUTES.bInheritHandle=TRUE``, or ``_pipe()`` with + ``O_NOINHERIT`` flag [atomic] +* ``pipe2()`` with ``O_CLOEXEC`` flag [atomic] +* ``pipe()`` + ``os.set_cloexec(fd, True)`` [best-effort] socket.socket() --------------- - * Windows: ``WSASocket()`` with ``WSA_FLAG_NO_HANDLE_INHERIT`` flag - [atomic] - * ``socket()`` with ``SOCK_CLOEXEC`` flag [atomic] - * ``socket()`` + ``os.set_cloexec(fd, True)`` [best-effort] +* Windows: ``WSASocket()`` with ``WSA_FLAG_NO_HANDLE_INHERIT`` flag + [atomic] +* ``socket()`` with ``SOCK_CLOEXEC`` flag [atomic] +* ``socket()`` + ``os.set_cloexec(fd, True)`` [best-effort] socket.socketpair() ------------------- - * ``socketpair()`` with ``SOCK_CLOEXEC`` flag [atomic] - * ``socketpair()`` + ``os.set_cloexec(fd, True)`` [best-effort] +* ``socketpair()`` with ``SOCK_CLOEXEC`` flag [atomic] +* ``socketpair()`` + ``os.set_cloexec(fd, True)`` [best-effort] socket.socket.accept() ---------------------- - * ``accept4()`` with ``SOCK_CLOEXEC`` flag [atomic] - * ``accept()`` + ``os.set_cloexec(fd, True)`` [best-effort] +* ``accept4()`` with ``SOCK_CLOEXEC`` flag [atomic] +* ``accept()`` + ``os.set_cloexec(fd, True)`` [best-effort] Backward compatibility @@ -603,8 +603,8 @@ Functions: - * ``ioctl(fd, FIOCLEX, 0)``: set the close-on-exec flag - * ``ioctl(fd, FIONCLEX, 0)``: clear the close-on-exec flag +* ``ioctl(fd, FIOCLEX, 0)``: set the close-on-exec flag +* ``ioctl(fd, FIONCLEX, 0)``: clear the close-on-exec flag Availability: Linux, Mac OS X, QNX, NetBSD, OpenBSD, FreeBSD. @@ -614,10 +614,10 @@ Functions: - * ``flags = fcntl(fd, F_GETFD); fcntl(fd, F_SETFD, flags | FD_CLOEXEC)``: - set the close-on-exec flag - * ``flags = fcntl(fd, F_GETFD); fcntl(fd, F_SETFD, flags & ~FD_CLOEXEC)``: - clear the close-on-exec flag +* ``flags = fcntl(fd, F_GETFD); fcntl(fd, F_SETFD, flags | FD_CLOEXEC)``: + set the close-on-exec flag +* ``flags = fcntl(fd, F_GETFD); fcntl(fd, F_SETFD, flags & ~FD_CLOEXEC)``: + clear the close-on-exec flag Availability: AIX, Digital UNIX, FreeBSD, HP-UX, IRIX, Linux, Mac OS X, OpenBSD, Solaris, SunOS, Unicos. @@ -628,20 +628,20 @@ New flags: - * ``O_CLOEXEC``: available on Linux (2.6.23), FreeBSD (8.3), - OpenBSD 5.0, Solaris 11, QNX, BeOS, next NetBSD release (6.1?). - This flag is part of POSIX.1-2008. - * ``SOCK_CLOEXEC`` flag for ``socket()`` and ``socketpair()``, - available on Linux 2.6.27, OpenBSD 5.2, NetBSD 6.0. - * ``WSA_FLAG_NO_HANDLE_INHERIT`` flag for ``WSASocket()``: supported - on Windows 7 with SP1, Windows Server 2008 R2 with SP1, and later - * ``fcntl()``: ``F_DUPFD_CLOEXEC`` flag, available on Linux 2.6.24, - OpenBSD 5.0, FreeBSD 9.1, NetBSD 6.0, Solaris 11. This flag is part - of POSIX.1-2008. - * ``fcntl()``: ``F_DUP2FD_CLOEXEC`` flag, available on FreeBSD 9.1 - and Solaris 11. - * ``recvmsg()``: ``MSG_CMSG_CLOEXEC``, available on Linux 2.6.23, - NetBSD 6.0. +* ``O_CLOEXEC``: available on Linux (2.6.23), FreeBSD (8.3), + OpenBSD 5.0, Solaris 11, QNX, BeOS, next NetBSD release (6.1?). + This flag is part of POSIX.1-2008. +* ``SOCK_CLOEXEC`` flag for ``socket()`` and ``socketpair()``, + available on Linux 2.6.27, OpenBSD 5.2, NetBSD 6.0. +* ``WSA_FLAG_NO_HANDLE_INHERIT`` flag for ``WSASocket()``: supported + on Windows 7 with SP1, Windows Server 2008 R2 with SP1, and later +* ``fcntl()``: ``F_DUPFD_CLOEXEC`` flag, available on Linux 2.6.24, + OpenBSD 5.0, FreeBSD 9.1, NetBSD 6.0, Solaris 11. This flag is part + of POSIX.1-2008. +* ``fcntl()``: ``F_DUP2FD_CLOEXEC`` flag, available on FreeBSD 9.1 + and Solaris 11. +* ``recvmsg()``: ``MSG_CMSG_CLOEXEC``, available on Linux 2.6.23, + NetBSD 6.0. On Linux older than 2.6.23, ``O_CLOEXEC`` flag is simply ignored. So we have to check that the flag is supported by calling ``fcntl()``. If @@ -657,9 +657,9 @@ New functions: - * ``dup3()``: available on Linux 2.6.27 (and glibc 2.9) - * ``pipe2()``: available on Linux 2.6.27 (and glibc 2.9) - * ``accept4()``: available on Linux 2.6.28 (and glibc 2.10) +* ``dup3()``: available on Linux 2.6.27 (and glibc 2.9) +* ``pipe2()``: available on Linux 2.6.27 (and glibc 2.9) +* ``accept4()``: available on Linux 2.6.28 (and glibc 2.10) If ``accept4()`` is called on Linux older than 2.6.28, ``accept4()`` returns ``-1`` (fail) and ``errno`` is set to ``ENOSYS``. @@ -670,55 +670,55 @@ Links: - * `Secure File Descriptor Handling - `_ (Ulrich Drepper, - 2008) - * `win32_support.py of the Tornado project - `_: - emulate fcntl(fd, F_SETFD, FD_CLOEXEC) using - ``SetHandleInformation(fd, HANDLE_FLAG_INHERIT, 1)`` - * `LKML: [PATCH] nextfd(2) - `_ +* `Secure File Descriptor Handling + `_ (Ulrich Drepper, + 2008) +* `win32_support.py of the Tornado project + `_: + emulate fcntl(fd, F_SETFD, FD_CLOEXEC) using + ``SetHandleInformation(fd, HANDLE_FLAG_INHERIT, 1)`` +* `LKML: [PATCH] nextfd(2) + `_ Python issues: - * `#10115: Support accept4() for atomic setting of flags at socket - creation `_ - * `#12105: open() does not able to set flags, such as O_CLOEXEC - `_ - * `#12107: TCP listening sockets created without FD_CLOEXEC flag - `_ - * `#16500: Add an atfork module - `_ - * `#16850: Add "e" mode to open(): close-and-exec - (O_CLOEXEC) / O_NOINHERIT `_ - * `#16860: Use O_CLOEXEC in the tempfile module - `_ - * `#17036: Implementation of the PEP 433 - `_ - * `#16946: subprocess: _close_open_fd_range_safe() does not set - close-on-exec flag on Linux < 2.6.23 if O_CLOEXEC is defined - `_ - * `#17070: PEP 433: Use the new cloexec to improve security and avoid - bugs `_ +* `#10115: Support accept4() for atomic setting of flags at socket + creation `_ +* `#12105: open() does not able to set flags, such as O_CLOEXEC + `_ +* `#12107: TCP listening sockets created without FD_CLOEXEC flag + `_ +* `#16500: Add an atfork module + `_ +* `#16850: Add "e" mode to open(): close-and-exec + (O_CLOEXEC) / O_NOINHERIT `_ +* `#16860: Use O_CLOEXEC in the tempfile module + `_ +* `#17036: Implementation of the PEP 433 + `_ +* `#16946: subprocess: _close_open_fd_range_safe() does not set + close-on-exec flag on Linux < 2.6.23 if O_CLOEXEC is defined + `_ +* `#17070: PEP 433: Use the new cloexec to improve security and avoid + bugs `_ Other languages: - * Perl sets the close-on-exec flag on newly created file decriptor if - their number is greater than ``$SYSTEM_FD_MAX`` (``$^F``). - See `$SYSTEM_FD_MAX documentation - `_. Perl does - this since the creation of Perl (it was already present in Perl 1). - * Ruby: `Set FD_CLOEXEC for all fds (except 0, 1, 2) - `_ - * Ruby: `O_CLOEXEC flag missing for Kernel::open - `_: the - `commit was reverted later - `_ - * OCaml: `PR#5256: Processes opened using Unix.open_process* inherit - all opened file descriptors (including sockets) - `_. OCaml has a - ``Unix.set_close_on_exec`` function. +* Perl sets the close-on-exec flag on newly created file decriptor if + their number is greater than ``$SYSTEM_FD_MAX`` (``$^F``). + See `$SYSTEM_FD_MAX documentation + `_. Perl does + this since the creation of Perl (it was already present in Perl 1). +* Ruby: `Set FD_CLOEXEC for all fds (except 0, 1, 2) + `_ +* Ruby: `O_CLOEXEC flag missing for Kernel::open + `_: the + `commit was reverted later + `_ +* OCaml: `PR#5256: Processes opened using Unix.open_process* inherit + all opened file descriptors (including sockets) + `_. OCaml has a + ``Unix.set_close_on_exec`` function. Footnotes @@ -732,3 +732,18 @@ has a descriptor smaller than 3, ``ValueError`` is raised. +Copyright +========= + +This document has been placed in the public domain. + + + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + coding: utf-8 + End: diff --git a/pep-0437.txt b/pep-0437.txt --- a/pep-0437.txt +++ b/pep-0437.txt @@ -313,28 +313,28 @@ Two tools are available: - * *printsemant* reads a converter header and a .c file and dumps - the semantically checked parse tree to stdout. +* *printsemant* reads a converter header and a .c file and dumps + the semantically checked parse tree to stdout. - * *preprocess* reads a converter header and a .c file and dumps - the preprocessed .c file to stdout. +* *preprocess* reads a converter header and a .c file and dumps + the preprocessed .c file to stdout. Known deficiencies: - * The Python 'test' expression is not semantically checked. The syntax - however is checked since it is part of the grammar. +* The Python 'test' expression is not semantically checked. The syntax + however is checked since it is part of the grammar. - * The lexer does not handle triple quoted strings. +* The lexer does not handle triple quoted strings. - * C declarations are parsed in a primitive way. The final implementation - should utilize 'declarator' and 'init-declarator' from the C grammar. +* C declarations are parsed in a primitive way. The final implementation + should utilize 'declarator' and 'init-declarator' from the C grammar. - * The *preprocess* tool does not emit code for the left-and-right optional - arguments case. The *printsemant* tool can deal with this case. +* The *preprocess* tool does not emit code for the left-and-right optional + arguments case. The *printsemant* tool can deal with this case. - * Since the *preprocess* tool generates the output from the parse - tree, the original indentation of the define block is lost. +* Since the *preprocess* tool generates the output from the parse + tree, the original indentation of the define block is lost. Grammar @@ -350,37 +350,37 @@ The author of this PEP has the following concerns about the DSL proposed in PEP 436: - * The whitespace sensitive configuration file like syntax looks out - of place in a C file. +* The whitespace sensitive configuration file like syntax looks out + of place in a C file. - * The structure of the function definition gets lost in the per-parameter - specifications. Keywords like positional-only, required and keyword-only - are scattered across too many different places. +* The structure of the function definition gets lost in the per-parameter + specifications. Keywords like positional-only, required and keyword-only + are scattered across too many different places. - By contrast, in the alternative DSL the structure of the function - definition can be understood at a single glance. + By contrast, in the alternative DSL the structure of the function + definition can be understood at a single glance. - * The PEP 436 DSL has 14 documented flags and at least one undocumented - (allow_fd) flag. Figuring out which of the 2**15 possible combinations - are valid places an unnecessary burden on the user. +* The PEP 436 DSL has 14 documented flags and at least one undocumented + (allow_fd) flag. Figuring out which of the 2**15 possible combinations + are valid places an unnecessary burden on the user. - Experience with the PEP-3118 buffer flags has shown that sorting out - (and exhaustively testing!) valid combinations is an extremely tedious - task. The PEP-3118 flags are still not well understood by many people. + Experience with the PEP-3118 buffer flags has shown that sorting out + (and exhaustively testing!) valid combinations is an extremely tedious + task. The PEP-3118 flags are still not well understood by many people. - By contrast, the alternative DSL has a central file Include/converters.h - that can be quickly searched for the desired converter. Many of the - converters are already known, perhaps even memorized by people (due - to frequent use). + By contrast, the alternative DSL has a central file Include/converters.h + that can be quickly searched for the desired converter. Many of the + converters are already known, perhaps even memorized by people (due + to frequent use). - * The PEP 436 DSL allows too much freedom. Types can apparently be omitted, - the preprocessor accepts (and ignores) unknown keywords, sometimes adding - white space after a docstring results in an assertion error. +* The PEP 436 DSL allows too much freedom. Types can apparently be omitted, + the preprocessor accepts (and ignores) unknown keywords, sometimes adding + white space after a docstring results in an assertion error. - The alternative DSL on the other hand allows no such freedoms. Omitting - converter or return value annotations is plainly a syntax error. The - LALR(1) grammar is unambiguous and specified for the complete translation - unit. + The alternative DSL on the other hand allows no such freedoms. Omitting + converter or return value annotations is plainly a syntax error. The + LALR(1) grammar is unambiguous and specified for the complete translation + unit. Copyright diff --git a/pep-0446.txt b/pep-0446.txt --- a/pep-0446.txt +++ b/pep-0446.txt @@ -330,9 +330,9 @@ New functions: - * ``dup3()``: available on Linux 2.6.27 (and glibc 2.9) - * ``pipe2()``: available on Linux 2.6.27 (and glibc 2.9) - * ``accept4()``: available on Linux 2.6.28 (and glibc 2.10) +* ``dup3()``: available on Linux 2.6.27 (and glibc 2.9) +* ``pipe2()``: available on Linux 2.6.27 (and glibc 2.9) +* ``accept4()``: available on Linux 2.6.28 (and glibc 2.10) On Linux older than 2.6.28, ``accept4()`` fails with ``errno`` set to ``ENOSYS``. @@ -468,23 +468,23 @@ The following functions are modified to make newly created file descriptors non-inheritable by default: - * ``asyncore.dispatcher.create_socket()`` - * ``io.FileIO`` - * ``io.open()`` - * ``open()`` - * ``os.dup()`` - * ``os.fdopen()`` - * ``os.open()`` - * ``os.openpty()`` - * ``os.pipe()`` - * ``select.devpoll()`` - * ``select.epoll()`` - * ``select.kqueue()`` - * ``socket.socket()`` - * ``socket.socket.accept()`` - * ``socket.socket.dup()`` - * ``socket.socket.fromfd()`` - * ``socket.socketpair()`` +* ``asyncore.dispatcher.create_socket()`` +* ``io.FileIO`` +* ``io.open()`` +* ``open()`` +* ``os.dup()`` +* ``os.fdopen()`` +* ``os.open()`` +* ``os.openpty()`` +* ``os.pipe()`` +* ``select.devpoll()`` +* ``select.epoll()`` +* ``select.kqueue()`` +* ``socket.socket()`` +* ``socket.socket.accept()`` +* ``socket.socket.dup()`` +* ``socket.socket.fromfd()`` +* ``socket.socketpair()`` ``os.dup2()`` still creates inheritable by default, see below. diff --git a/pep-0457.txt b/pep-0457.txt --- a/pep-0457.txt +++ b/pep-0457.txt @@ -62,14 +62,14 @@ In addition, there are some functions with particularly interesting semantics: - * ``range()``, which accepts an optional parameter - to the *left* of its required parameter. [#RANGE]_ +* ``range()``, which accepts an optional parameter + to the *left* of its required parameter. [#RANGE]_ - * ``dict()``, whose mapping/iterator parameter is optional and - semantically must be positional-only. Any externally - visible name for this parameter would occlude - that name going into the ``**kwarg`` keyword variadic - parameter dict! [#DICT]_ +* ``dict()``, whose mapping/iterator parameter is optional and + semantically must be positional-only. Any externally + visible name for this parameter would occlude + that name going into the ``**kwarg`` keyword variadic + parameter dict! [#DICT]_ Obviously one can simulate any of these in pure Python code by accepting ``(*args, **kwargs)`` and parsing the arguments @@ -85,17 +85,17 @@ parameters in Python. The goal of this PEP is simply to define the syntax, so that: - * Documentation can clearly, unambiguously, and - consistently express exactly how the arguments - for a function will be interpreted. +* Documentation can clearly, unambiguously, and + consistently express exactly how the arguments + for a function will be interpreted. - * The syntax is reserved for future use, in case - the community decides someday to add positional-only - parameters to the language. +* The syntax is reserved for future use, in case + the community decides someday to add positional-only + parameters to the language. - * Argument Clinic can use a variant of the syntax - as part of its input when defining - the arguments for built-in functions. +* Argument Clinic can use a variant of the syntax + as part of its input when defining + the arguments for built-in functions. ================================================================= The Current State Of Documentation For Positional-Only Parameters @@ -179,28 +179,28 @@ More semantics of positional-only parameters: - * Although positional-only parameter technically have names, - these names are internal-only; positional-only parameters - are *never* externally addressable by name. (Similarly - to ``*args`` and ``**kwargs``.) +* Although positional-only parameter technically have names, + these names are internal-only; positional-only parameters + are *never* externally addressable by name. (Similarly + to ``*args`` and ``**kwargs``.) - * It's possible to nest option groups. +* It's possible to nest option groups. - * If there are no required parameters, all option groups behave - as if they're to the right of the required parameter group. +* If there are no required parameters, all option groups behave + as if they're to the right of the required parameter group. - * For clarity and consistency, the comma for a parameter always - comes immediately after the parameter name. It's a syntax error - to specify a square bracket between the name of a parameter and - the following comma. (This is far more readable than putting - the comma outside the square bracket, particularly for nested - groups.) +* For clarity and consistency, the comma for a parameter always + comes immediately after the parameter name. It's a syntax error + to specify a square bracket between the name of a parameter and + the following comma. (This is far more readable than putting + the comma outside the square bracket, particularly for nested + groups.) - * If there are arguments after the ``/``, then you must specify - a comma after the ``/``, just as there is a comma - after the ``*`` denoting the shift to keyword-only parameters. +* If there are arguments after the ``/``, then you must specify + a comma after the ``/``, just as there is a comma + after the ``*`` denoting the shift to keyword-only parameters. - * This syntax has no effect on ``*args`` or ``**kwargs``. +* This syntax has no effect on ``*args`` or ``**kwargs``. It's possible to specify a function prototype where the mapping of arguments to parameters is ambiguous. Consider:: @@ -273,9 +273,9 @@ There are three types of parameters in Python: - 1. positional-only parameters, - 2. positional-or-keyword parameters, and - 3. keyword-only parameters. +1. positional-only parameters, +2. positional-or-keyword parameters, and +3. keyword-only parameters. Python allows functions to have both 2 and 3. And some builtins (e.g. range) have both 1 and 3. Does it make diff --git a/pep-0461.txt b/pep-0461.txt --- a/pep-0461.txt +++ b/pep-0461.txt @@ -95,22 +95,22 @@ ``%b`` will insert a series of bytes. These bytes are collected in one of two ways:: - - input type supports ``Py_buffer`` [4]_? - use it to collect the necessary bytes +- input type supports ``Py_buffer`` [4]_? + use it to collect the necessary bytes - - input type is something else? - use its ``__bytes__`` method [5]_ ; if there isn't one, raise a ``TypeError`` +- input type is something else? + use its ``__bytes__`` method [5]_ ; if there isn't one, raise a ``TypeError`` In particular, ``%b`` will not accept numbers nor ``str``. ``str`` is rejected as the string to bytes conversion requires an encoding, and we are refusing to guess; numbers are rejected because: - - what makes a number is fuzzy (float? Decimal? Fraction? some user type?) +- what makes a number is fuzzy (float? Decimal? Fraction? some user type?) - - allowing numbers would lead to ambiguity between numbers and textual - representations of numbers (3.14 vs '3.14') +- allowing numbers would lead to ambiguity between numbers and textual + representations of numbers (3.14 vs '3.14') - - given the nature of wire formats, explicit is definitely better than implicit +- given the nature of wire formats, explicit is definitely better than implicit ``%s`` is included as a synonym for ``%b`` for the sole purpose of making 2/3 code bases easier to maintain. Python 3 only code should use ``%b``. @@ -177,15 +177,15 @@ It has been proposed to automatically use ``.encode('ascii','strict')`` for ``str`` arguments to ``%b``. - - Rejected as this would lead to intermittent failures. Better to have the - operation always fail so the trouble-spot can be correctly fixed. +- Rejected as this would lead to intermittent failures. Better to have the + operation always fail so the trouble-spot can be correctly fixed. It has been proposed to have ``%b`` return the ascii-encoded repr when the value is a ``str`` (b'%b' % 'abc' --> b"'abc'"). - - Rejected as this would lead to hard to debug failures far from the problem - site. Better to have the operation always fail so the trouble-spot can be - easily fixed. +- Rejected as this would lead to hard to debug failures far from the problem + site. Better to have the operation always fail so the trouble-spot can be + easily fixed. Originally this PEP also proposed adding format-style formatting, but it was decided that format and its related machinery were all strictly text (aka @@ -204,12 +204,12 @@ The objections raised against this PEP were mainly variations on two themes: - - the ``bytes`` and ``bytearray`` types are for pure binary data, with no - assumptions about encodings +- the ``bytes`` and ``bytearray`` types are for pure binary data, with no + assumptions about encodings - - offering %-interpolation that assumes an ASCII encoding will be an - attractive nuisance and lead us back to the problems of the Python 2 - ``str``/``unicode`` text model +- offering %-interpolation that assumes an ASCII encoding will be an + attractive nuisance and lead us back to the problems of the Python 2 + ``str``/``unicode`` text model As was seen during the discussion, ``bytes`` and ``bytearray`` are also used for mixed binary data and ASCII-compatible segments: file formats such as diff --git a/pep-0472.txt b/pep-0472.txt --- a/pep-0472.txt +++ b/pep-0472.txt @@ -136,12 +136,12 @@ Traditionally, the full content between square brackets is turned into a single object passed to argument ``idx``: - - When a single element is passed, e.g. ``a[2]``, ``idx`` will be ``2``. - - When multiple elements are passed, they must be separated by commas: ``a[2, 3]``. - In this case, ``idx`` will be a tuple ``(2, 3)``. With ``a[2, 3, "hello", {}]`` - ``idx`` will be ``(2, 3, "hello", {})``. - - A slicing notation e.g. ``a[2:10]`` will produce a slice object, or a tuple - containing slice objects if multiple values were passed. +- When a single element is passed, e.g. ``a[2]``, ``idx`` will be ``2``. +- When multiple elements are passed, they must be separated by commas: ``a[2, 3]``. + In this case, ``idx`` will be a tuple ``(2, 3)``. With ``a[2, 3, "hello", {}]`` + ``idx`` will be ``(2, 3, "hello", {})``. +- A slicing notation e.g. ``a[2:10]`` will produce a slice object, or a tuple + containing slice objects if multiple values were passed. Except for its unique ability to handle slice notation, the indexing operation has similarities to a plain method call: it acts like one when invoked with diff --git a/pep-0488.txt b/pep-0488.txt --- a/pep-0488.txt +++ b/pep-0488.txt @@ -37,9 +37,9 @@ is not true for PYO files. To put this in terms of optimization levels and the file extension: - - 0: ``.pyc`` - - 1 (``-O``): ``.pyo`` - - 2 (``-OO``): ``.pyo`` +- 0: ``.pyc`` +- 1 (``-O``): ``.pyo`` +- 2 (``-OO``): ``.pyo`` The reuse of the ``.pyo`` file extension for both level 1 and 2 optimizations means that there is no clear way to tell what @@ -85,9 +85,9 @@ based on the interpreter's optimization level (none, ``-O``, and ``-OO``): - - 0: ``foo.cpython-35.pyc`` (i.e., no change) - - 1: ``foo.cpython-35.opt-1.pyc`` - - 2: ``foo.cpython-35.opt-2.pyc`` +- 0: ``foo.cpython-35.pyc`` (i.e., no change) +- 1: ``foo.cpython-35.opt-1.pyc`` +- 2: ``foo.cpython-35.opt-2.pyc`` Currently bytecode file names are created by ``importlib.util.cache_from_source()``, approximately using the diff --git a/pep-0498.txt b/pep-0498.txt --- a/pep-0498.txt +++ b/pep-0498.txt @@ -465,9 +465,9 @@ Most of the discussions on python-ideas [#]_ focused on three issues: - - How to denote f-strings, - - How to specify the location of expressions in f-strings, and - - Whether to allow full Python expressions. +- How to denote f-strings, +- How to specify the location of expressions in f-strings, and +- Whether to allow full Python expressions. How to denote f-strings *********************** diff --git a/pep-0628.txt b/pep-0628.txt --- a/pep-0628.txt +++ b/pep-0628.txt @@ -72,12 +72,12 @@ specific examples sufficiently persausive, here are some more resources that may be of interest: - * Michael Hartl is the primary instigator of Tau Day in his `Tau Manifesto`_ - * Bob Palais, the author of the original mathematics journal article - highlighting the problems with ``pi`` has `a page of resources`_ on the - topic - * For those that prefer videos to written text, `Pi is wrong!`_ and - `Pi is (still) wrong`_ are available on YouTube +* Michael Hartl is the primary instigator of Tau Day in his `Tau Manifesto`_ +* Bob Palais, the author of the original mathematics journal article + highlighting the problems with ``pi`` has `a page of resources`_ on the + topic +* For those that prefer videos to written text, `Pi is wrong!`_ and + `Pi is (still) wrong`_ are available on YouTube .. _Tau Manifesto: http://tauday.com/ .. _Pi is (still) wrong: http://www.youtube.com/watch?v=jG7vhMMXagQ -- Repository URL: https://hg.python.org/peps From solipsis at pitrou.net Tue May 3 04:45:45 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 03 May 2016 08:45:45 +0000 Subject: [Python-checkins] Daily reference leaks (63f4fd1ec636): sum=0 Message-ID: <20160503084542.109944.12546.A3806085@psf.io> results for 63f4fd1ec636 on branch "default" -------------------------------------------- test_collections leaked [-4, 0, 0] memory blocks, sum=-4 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogtxRZgt', '--timeout', '7200'] From python-checkins at python.org Tue May 3 05:07:10 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 03 May 2016 09:07:10 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Issue_=2326916=3A_Fixed_words?= =?utf-8?q?_duplications=2E?= Message-ID: <20160503090705.3146.4366.B939A15A@psf.io> https://hg.python.org/peps/rev/d0b969132758 changeset: 6304:d0b969132758 user: Serhiy Storchaka date: Tue May 03 12:03:16 2016 +0300 summary: Issue #26916: Fixed words duplications. files: pep-0101.txt | 2 +- pep-0205.txt | 2 +- pep-0208.txt | 2 +- pep-0237.txt | 4 ++-- pep-0253.txt | 4 ++-- pep-0262.txt | 2 +- pep-0287.txt | 2 +- pep-0304.txt | 2 +- pep-0326.txt | 2 +- pep-0344.txt | 2 +- pep-0355.txt | 2 +- pep-0374.txt | 4 ++-- pep-0386.txt | 2 +- pep-0390.txt | 2 +- pep-0405.txt | 2 +- pep-0408.txt | 4 ++-- pep-0411.txt | 2 +- pep-0416.txt | 2 +- pep-0433.txt | 2 +- pep-0436.txt | 2 +- pep-0449.txt | 2 +- pep-0452.txt | 2 +- pep-0454.txt | 2 +- pep-0456.txt | 4 ++-- pep-0458.txt | 2 +- pep-0460.txt | 2 +- pep-0463.txt | 2 +- pep-0465.txt | 4 ++-- pep-0475.txt | 2 +- pep-0484.txt | 2 +- pep-0486.txt | 2 +- pep-0498.txt | 2 +- pep-0505.txt | 4 ++-- pep-0509.txt | 2 +- pep-0510.txt | 2 +- pep-0517.txt | 4 ++-- pep-3104.txt | 2 +- pep-3116.txt | 2 +- pep-3118.txt | 2 +- pep-3119.txt | 2 +- pep-3124.txt | 2 +- pep-3127.txt | 2 +- pep-3134.txt | 2 +- pep-3139.txt | 4 ++-- pep-3144.txt | 2 +- pep-3145.txt | 2 +- pep-3148.txt | 4 ++-- pep-3156.txt | 2 +- 48 files changed, 58 insertions(+), 58 deletions(-) diff --git a/pep-0101.txt b/pep-0101.txt --- a/pep-0101.txt +++ b/pep-0101.txt @@ -258,7 +258,7 @@ ___ Add a new whatsnew/3.x.rst file (with the comment near the top and the toplevel sections copied from the previous file) and - and add it to the toctree in whatsnew/index.rst. + add it to the toctree in whatsnew/index.rst. ___ Update the version number in configure.ac and re-run autoconf. diff --git a/pep-0205.txt b/pep-0205.txt --- a/pep-0205.txt +++ b/pep-0205.txt @@ -364,7 +364,7 @@ An example vref module using this model could include the function "new"; When used as 'MyVref = vref.new(MyObject)', it - returns a new vref object such that that MyVref.object == + returns a new vref object such that MyVref.object == MyObject. MyVref.object would then change to Nothing if MyObject is ever deallocated. diff --git a/pep-0208.txt b/pep-0208.txt --- a/pep-0208.txt +++ b/pep-0208.txt @@ -83,7 +83,7 @@ style operations if the number indicates the availability of these. A new style number is considered by the interpreter as such if and - only it it sets the type flag Py_TPFLAGS_CHECKTYPES. The main + only if it sets the type flag Py_TPFLAGS_CHECKTYPES. The main difference between an old style number and a new style one is that the numeric slot functions can no longer assume to be passed arguments of identical type. New style slots must check all arguments for proper diff --git a/pep-0237.txt b/pep-0237.txt --- a/pep-0237.txt +++ b/pep-0237.txt @@ -140,7 +140,7 @@ inclusive) are "interned" -- whenever a result has such a value, an existing short int with the same value is returned. This is not done for long ints with the same values. This difference - will remain. (Since there is no guarantee of this interning, is + will remain. (Since there is no guarantee of this interning, it is debatable whether this is a semantic difference -- but code may exist that uses 'is' for comparisons of short ints and happens to work because of this interning. Such code may fail @@ -291,7 +291,7 @@ Example If you pass a long int to a C function or built-in operation that - takes an integer, it will be treated the same as as a short int as + takes an integer, it will be treated the same as a short int as long as the value fits (by virtue of how PyArg_ParseTuple() is implemented). If the long value doesn't fit, it will still raise an OverflowError. For example: diff --git a/pep-0253.txt b/pep-0253.txt --- a/pep-0253.txt +++ b/pep-0253.txt @@ -199,7 +199,7 @@ callable. Since type objects are instances of their metatype (PyType_Type), the metatype's tp_call slot (PyType_Type.tp_call) points to a function that is invoked when any type object is - called. Now, since each type has do do something different to + called. Now, since each type has to do something different to create an instance of itself, PyType_Type.tp_call immediately defers to the tp_new slot of the type that is being called. PyType_Type itself is also callable: its tp_new slot creates a new @@ -271,7 +271,7 @@ tp_new() is the type that defined the tp_new() function (in the example, if type == &PyInt_Type), and when the tp_init() slot for this type does nothing. If the type argument differs, the - tp_new() call is initiated by by a derived type's tp_new() to + tp_new() call is initiated by a derived type's tp_new() to create the object and initialize the base type portion of the object; in this case tp_new() should always return a new object (or raise an exception). diff --git a/pep-0262.txt b/pep-0262.txt --- a/pep-0262.txt +++ b/pep-0262.txt @@ -73,7 +73,7 @@ A distribution that uses the Distutils for installation should automatically update the database. Distributions that roll their - own installation will have to use the database's API to to + own installation will have to use the database's API to manually add or update their own entry. System package managers such as RPM or pkgadd can just create the new file in the INSTALLDB directory. diff --git a/pep-0287.txt b/pep-0287.txt --- a/pep-0287.txt +++ b/pep-0287.txt @@ -252,7 +252,7 @@ - SText implementations have been buggy. - - Most STexts have have had no formal specification except for the + - Most STexts have no formal specification except for the implementation itself. A buggy implementation meant a buggy spec, and vice-versa. diff --git a/pep-0304.txt b/pep-0304.txt --- a/pep-0304.txt +++ b/pep-0304.txt @@ -179,7 +179,7 @@ performance penalty is incurred each time a program importing the module is run. [3]_ Warning messages may also be generated in certain circumstances. If the directory is writable, nearly simultaneous -attempts attempts to write the bytecode file by two separate processes +attempts to write the bytecode file by two separate processes may occur, resulting in file corruption. [4]_ In environments with RAM disks available, it may be desirable for diff --git a/pep-0326.txt b/pep-0326.txt --- a/pep-0326.txt +++ b/pep-0326.txt @@ -244,7 +244,7 @@ None itself compares smaller than any other object in the standard distribution. -As an aside, it is not clear to to the author that using Nodes as a +As an aside, it is not clear to the author that using Nodes as a replacement for tuples has increased readability significantly, if at all. diff --git a/pep-0344.txt b/pep-0344.txt --- a/pep-0344.txt +++ b/pep-0344.txt @@ -112,7 +112,7 @@ To keep things simpler, the C API calls for setting an exception will not automatically set the exception's '__context__'. Guido - van Rossum has has expressed concerns with making such changes [8]. + van Rossum has expressed concerns with making such changes [8]. As for other languages, Java and Ruby both discard the original exception when another exception occurs in a 'catch'/'rescue' or diff --git a/pep-0355.txt b/pep-0355.txt --- a/pep-0355.txt +++ b/pep-0355.txt @@ -67,7 +67,7 @@ Currently, Python has a large number of different functions scattered over half a dozen modules for handling paths. This - makes it hard for newbies and experienced developers to to choose + makes it hard for newbies and experienced developers to choose the right method. The Path class provides the following enhancements over the diff --git a/pep-0374.txt b/pep-0374.txt --- a/pep-0374.txt +++ b/pep-0374.txt @@ -495,7 +495,7 @@ ``git diff master > stuff-i-did.patch``, too, but ``git format-patch | git am`` knows some tricks (empty files, renames, etc) that ordinary patch can't handle. git -grabs "Stuff I did" out of the the commit message to create the file +grabs "Stuff I did" out of the commit message to create the file name 0001-Stuff-I-did.patch. See Patch Review below for a description of the git-format-patch format. :: @@ -1322,7 +1322,7 @@ Tests/Impressions ================= -As I (Brett Cannon) am left with the task of of making the final +As I (Brett Cannon) am left with the task of making the final decision of which/any DVCS to go with and not my co-authors, I felt it only fair to write down what tests I ran and my impressions as I evaluate the various tools so as to be as transparent as possible. diff --git a/pep-0386.txt b/pep-0386.txt --- a/pep-0386.txt +++ b/pep-0386.txt @@ -240,7 +240,7 @@ Finally, to handle miscellaneous cases, the strings "pre", "preview", and "rc" are treated as if they were "c", i.e. as though they were release candidates, and therefore are not as new as a version string that does not - contain them, and "dev" is replaced with an '@' so that it sorts lower than + contain them, and "dev" is replaced with an '@' so that it sorts lower than any other pre-release tag. In other words, ``parse_version`` will return a tuple for each version string, diff --git a/pep-0390.txt b/pep-0390.txt --- a/pep-0390.txt +++ b/pep-0390.txt @@ -212,7 +212,7 @@ Compatiblity ============ -This change is is based on a new metadata ``1.2`` format meaning that +This change is based on a new metadata ``1.2`` format meaning that Distutils will be able to distinguish old PKG-INFO files from new ones. The ``setup.cfg`` file change will stay ``ConfigParser``-compatible and diff --git a/pep-0405.txt b/pep-0405.txt --- a/pep-0405.txt +++ b/pep-0405.txt @@ -103,7 +103,7 @@ same value as ``sys.prefix``.) The ``site`` and ``sysconfig`` standard-library modules are modified -such that the standard library and header files are are found relative +such that the standard library and header files are found relative to ``sys.base_prefix`` / ``sys.base_exec_prefix``, while site-package directories ("purelib" and "platlib", in ``sysconfig`` terms) are still found relative to ``sys.prefix`` / ``sys.exec_prefix``. diff --git a/pep-0408.txt b/pep-0408.txt --- a/pep-0408.txt +++ b/pep-0408.txt @@ -83,7 +83,7 @@ whether via ``__preview__`` or directly, must fulfill the acceptance conditions set by PEP 2. -It is important to stress that the aim of of this proposal is not to make the +It is important to stress that the aim of this proposal is not to make the process of adding new modules to the standard library more difficult. On the contrary, it tries to provide a means to add *more* useful libraries. Modules which are obvious candidates for entry can be added as before. Modules which @@ -118,7 +118,7 @@ from __preview__ import example -Assuming the module is then promoted to the the standard library proper in +Assuming the module is then promoted to the standard library proper in release ``3.X+1``, it will be moved to a permanent location in the library:: import example diff --git a/pep-0411.txt b/pep-0411.txt --- a/pep-0411.txt +++ b/pep-0411.txt @@ -23,7 +23,7 @@ "graduating" into a "stable" state. On one hand, this state provides the package with the benefits of being formally part of the Python distribution. On the other hand, the core development team explicitly states that no promises -are made with regards to the the stability of the package's API, which may +are made with regards to the stability of the package's API, which may change for the next release. While it is considered an unlikely outcome, such packages may even be removed from the standard library without a deprecation period if the concerns regarding their API or maintenance prove diff --git a/pep-0416.txt b/pep-0416.txt --- a/pep-0416.txt +++ b/pep-0416.txt @@ -100,7 +100,7 @@ Recipe: hashable dict ====================== -To ensure that a a frozendict is hashable, values can be checked +To ensure that a frozendict is hashable, values can be checked before creating the frozendict:: import itertools diff --git a/pep-0433.txt b/pep-0433.txt --- a/pep-0433.txt +++ b/pep-0433.txt @@ -652,7 +652,7 @@ socket type, ``socket()`` or ``socketpair()`` fail and ``errno`` is set to ``EINVAL``. -On Windows XPS3, ``WSASocket()`` with with ``WSAEPROTOTYPE`` when +On Windows XPS3, ``WSASocket()`` with ``WSAEPROTOTYPE`` when ``WSA_FLAG_NO_HANDLE_INHERIT`` flag is used. New functions: diff --git a/pep-0436.txt b/pep-0436.txt --- a/pep-0436.txt +++ b/pep-0436.txt @@ -315,7 +315,7 @@ Parameter Declaration --------------------- -The full form of the parameter declaration line as as follows:: +The full form of the parameter declaration line as follows:: name: converter [ (parameter=value [, parameter2=value2]) ] [ = default] diff --git a/pep-0449.txt b/pep-0449.txt --- a/pep-0449.txt +++ b/pep-0449.txt @@ -132,7 +132,7 @@ ========================= The mirroring protocol will continue to exist as defined in `PEP381`_ and -people are encouraged to to host public and private mirrors if they so desire. +people are encouraged to host public and private mirrors if they so desire. The recommended mirroring client is `Bandersnatch`_. diff --git a/pep-0452.txt b/pep-0452.txt --- a/pep-0452.txt +++ b/pep-0452.txt @@ -86,7 +86,7 @@ of the hash algorithm in bytes. The block size is used by the HMAC module to pad the secret key to digest_size or to hash the secret key if it is longer than digest_size. If no HMAC - algorithm is standardized for the the hash algorithm, return + algorithm is standardized for the hash algorithm, return ``NotImplemented`` instead. name diff --git a/pep-0454.txt b/pep-0454.txt --- a/pep-0454.txt +++ b/pep-0454.txt @@ -202,7 +202,7 @@ store more frames. The ``tracemalloc`` module must be tracing memory allocations to - take a snapshot, see the the ``start()`` function. + take a snapshot, see the ``start()`` function. See also the ``get_object_traceback()`` function. diff --git a/pep-0456.txt b/pep-0456.txt --- a/pep-0456.txt +++ b/pep-0456.txt @@ -88,7 +88,7 @@ Current implementation with modified FNV ======================================== -CPython currently uses uses a variant of the Fowler-Noll-Vo hash function +CPython currently uses a variant of the Fowler-Noll-Vo hash function [fnv]_. The variant is has been modified to reduce the amount and cost of hash collisions for common strings. The first character of the string is added twice, the first time with a bit shift of 7. The length of the input @@ -595,7 +595,7 @@ 3. Hash maps have a worst case of O(n) for insertion and lookup of keys. This results in a quadratic runtime during a hash collision attack. The - introduction of a new and additional data structure with with O(log n) + introduction of a new and additional data structure with O(log n) worst case behavior would eliminate the root cause. A data structures like red-black-tree or prefix trees (trie [trie]_) would have other benefits, too. Prefix trees with stringed keyed can reduce memory usage as common diff --git a/pep-0458.txt b/pep-0458.txt --- a/pep-0458.txt +++ b/pep-0458.txt @@ -1082,7 +1082,7 @@ helped us to design TUF from its predecessor Thandy of the Tor project. We appreciate the efforts of Konstantin Andrianov, Geremy Condra, Zane Fisher, -Justin Samuel, Tian Tian, Santiago Torres, John Ward, and Yuyu Zheng to to +Justin Samuel, Tian Tian, Santiago Torres, John Ward, and Yuyu Zheng to develop TUF. Vladimir Diaz, Monzur Muhammad and Sai Teja Peddinti helped us to review this diff --git a/pep-0460.txt b/pep-0460.txt --- a/pep-0460.txt +++ b/pep-0460.txt @@ -111,7 +111,7 @@ * In 3.3 encoding to ASCII or latin-1 is as fast as memcpy (but it still creates a separate object). * Developers will have to work around the lack of binary formatting anyway, - if they want to to support Python 3.4 and earlier. + if they want to support Python 3.4 and earlier. * bytes.join() is consistently faster than format to join bytes strings (XXX *is it?*). * Formatting functions could be implemented in a third party module, diff --git a/pep-0463.txt b/pep-0463.txt --- a/pep-0463.txt +++ b/pep-0463.txt @@ -637,7 +637,7 @@ `Tcl`__ has the other half of Lua's xpcall; catch is a function which returns true if an exception was caught, false otherwise, and you get the value out -in other ways. And it's all built around the the implicit quote-and-exec +in other ways. And it's all built around the implicit quote-and-exec that everything in Tcl is based on, making it even harder to describe in Python terms than Lisp macros, but something like diff --git a/pep-0465.txt b/pep-0465.txt --- a/pep-0465.txt +++ b/pep-0465.txt @@ -208,7 +208,7 @@ reverse convention would lead to more special cases.) So that's why matrix multiplication doesn't and can't just use ``*``. -Now, in the the rest of this section, we'll explain why it nonetheless +Now, in the rest of this section, we'll explain why it nonetheless meets the high bar for adding a new operator. @@ -1195,7 +1195,7 @@ test the null hypothesis that :math:`H\beta = r`; a large :math:`S` then indicates that this hypothesis is unlikely to be true. For example, in an analysis of human height, the vector :math:`\beta` - might contain one value which was the the average height of the + might contain one value which was the average height of the measured men, and another value which was the average height of the measured women, and then setting :math:`H = [1, -1], r = 0` would let us test whether men and women are the same height on diff --git a/pep-0475.txt b/pep-0475.txt --- a/pep-0475.txt +++ b/pep-0475.txt @@ -136,7 +136,7 @@ application. There are two options to interrupt an application on only *some* signals: -* Set up a custom signal signal handler which raises an exception, such as +* Set up a custom signal handler which raises an exception, such as ``KeyboardInterrupt`` for ``SIGINT``. * Use a I/O multiplexing function like ``select()`` together with Python's signal wakeup file descriptor: see the function ``signal.set_wakeup_fd()``. diff --git a/pep-0484.txt b/pep-0484.txt --- a/pep-0484.txt +++ b/pep-0484.txt @@ -1414,7 +1414,7 @@ ``NamedTuple(type_name, [(field_name, field_type), ...])`` and equivalent to ``collections.namedtuple(type_name, [field_name, ...])``. - This is useful to declare the types of the fields of a a named tuple + This is useful to declare the types of the fields of a named tuple type. * cast(), described earlier diff --git a/pep-0486.txt b/pep-0486.txt --- a/pep-0486.txt +++ b/pep-0486.txt @@ -57,7 +57,7 @@ pip install pytest py.test -Having to use different commands is is error-prone, and in many cases +Having to use different commands is error-prone, and in many cases the error is difficult to spot immediately. The PEP proposes making the ``py`` command usable with virtual environments, so that the first form of command can be used in all cases. diff --git a/pep-0498.txt b/pep-0498.txt --- a/pep-0498.txt +++ b/pep-0498.txt @@ -296,7 +296,7 @@ f'abc{expr1:spec1}{expr2!r:spec2}def{expr3}ghi' -Might be be evaluated as:: +Might be evaluated as:: 'abc' + format(expr1, spec1) + format(repr(expr2), spec2) + 'def' + format(expr3) + 'ghi' diff --git a/pep-0505.txt b/pep-0505.txt --- a/pep-0505.txt +++ b/pep-0505.txt @@ -302,7 +302,7 @@ Both ``first_seen`` and ``last_seen`` are allowed to be ``null`` in the database, and they are also allowed to be ``null`` in the JSON response. JSON -does not have a native way to represent a ``datetime``, so the the server's +does not have a native way to represent a ``datetime``, so the server's contract states that any non-``null`` date is represented as a ISO-8601 string. Note that this code is invalid by PEP-8 standards: several lines are over the @@ -925,7 +925,7 @@ The ``None``-aware attribute access operator (also called "safe navigation") checks its left operand. If the left operand is ``None``, then the operator -evaluates to ``None``. If the the left operand is not ``None``, then the +evaluates to ``None``. If the left operand is not ``None``, then the operator accesses the attribute named by the right operand. As in the previous section, we continue to use the temporary spelling ``?``:: diff --git a/pep-0509.txt b/pep-0509.txt --- a/pep-0509.txt +++ b/pep-0509.txt @@ -457,7 +457,7 @@ Method cache and type version tag --------------------------------- -In 2007, Armin Rigo wrote a patch to to implement a cache of methods. It +In 2007, Armin Rigo wrote a patch to implement a cache of methods. It was merged into Python 2.6. The patch adds a "type attribute cache version tag" (``tp_version_tag``) and a "valid version tag" flag to types (the ``PyTypeObject`` structure). diff --git a/pep-0510.txt b/pep-0510.txt --- a/pep-0510.txt +++ b/pep-0510.txt @@ -348,7 +348,7 @@ and must not have specialized code. If *code* is a Python function or a code object, a new code object is -created and the code name and first number number of the code object of +created and the code name and first line number of the code object of *func* are copied. The specialized code must have the same cell variables and the same free variables. diff --git a/pep-0517.txt b/pep-0517.txt --- a/pep-0517.txt +++ b/pep-0517.txt @@ -100,7 +100,7 @@ to it as the ``setup.py``\-style. Here we define a new ``pypackage.json``\-style source tree. This -consists of any any directory which contains a file named +consists of any directory which contains a file named ``pypackage.json``. (If a tree contains both ``pypackage.json`` and ``setup.py`` then it is a ``pypackage.json``\-style source tree, and ``pypackage.json``\-aware tools should ignore the ``setup.py``; this @@ -560,7 +560,7 @@ In general, the need to isolate build backends into their own process means that we can't remove IPC complexity entirely -- but by placing both sides of the IPC channel under the control of a single project, -we make it much much cheaper to fix bugs in the IPC interface than if +we make it much cheaper to fix bugs in the IPC interface than if fixing bugs requires coordinated agreement and coordinated changes across the ecosystem. diff --git a/pep-3104.txt b/pep-3104.txt --- a/pep-3104.txt +++ b/pep-3104.txt @@ -82,7 +82,7 @@ languages, including JavaScript, Perl, Ruby, Scheme, Smalltalk, C with GNU extensions, and C# 2.0. -It has been argued that that such a feature isn't necessary, because +It has been argued that such a feature isn't necessary, because a rebindable outer variable can be simulated by wrapping it in a mutable object:: diff --git a/pep-3116.txt b/pep-3116.txt --- a/pep-3116.txt +++ b/pep-3116.txt @@ -422,7 +422,7 @@ Unicode encoding/decoding Issues -------------------------------- -We should allow allow changing the encoding and error-handling +We should allow changing the encoding and error-handling setting later. The behavior of Text I/O operations in the face of Unicode problems and ambiguities (e.g. diacritics, surrogates, invalid bytes in an encoding) should be the same as that of the unicode diff --git a/pep-3118.txt b/pep-3118.txt --- a/pep-3118.txt +++ b/pep-3118.txt @@ -551,7 +551,7 @@ readable, writable, or set to update the original buffer if a copy must be made. If buffertype is PyBUF_WRITE and the buffer is not contiguous an error will be raised. In this circumstance, the user -can use PyBUF_UPDATEIFCOPY to ensure that a a writable temporary +can use PyBUF_UPDATEIFCOPY to ensure that a writable temporary contiguous buffer is returned. The contents of this contiguous buffer will be copied back into the original object after the memoryview object is deleted as long as the original object is writable. If this diff --git a/pep-3119.txt b/pep-3119.txt --- a/pep-3119.txt +++ b/pep-3119.txt @@ -250,7 +250,7 @@ ``x.__class__`` are not the same object, e.g. when x is a proxy object.) -These methods are intended to be be called on classes whose metaclass +These methods are intended to be called on classes whose metaclass is (derived from) ``ABCMeta``; for example:: from abc import ABCMeta diff --git a/pep-3124.txt b/pep-3124.txt --- a/pep-3124.txt +++ b/pep-3124.txt @@ -220,7 +220,7 @@ The default predicate implementation is a tuple of types with positional matching to the overloaded function's arguments. However, -an arbitrary number of other kinds of of predicates can be created and +an arbitrary number of other kinds of predicates can be created and registered using the `Extension API`_, and will then be usable with ``@when`` and other decorators created by this module (like ``@before``, ``@after``, and ``@around``). diff --git a/pep-3127.txt b/pep-3127.txt --- a/pep-3127.txt +++ b/pep-3127.txt @@ -402,7 +402,7 @@ Syntax for supported radices ----------------------------- -This proposal is to to use a "0o" prefix with either uppercase +This proposal is to use a "0o" prefix with either uppercase or lowercase "o" for octal, and a "0b" prefix with either uppercase or lowercase "b" for binary. diff --git a/pep-3134.txt b/pep-3134.txt --- a/pep-3134.txt +++ b/pep-3134.txt @@ -112,7 +112,7 @@ To keep things simpler, the C API calls for setting an exception will not automatically set the exception's '__context__'. Guido - van Rossum has has expressed concerns with making such changes [8]. + van Rossum has expressed concerns with making such changes [8]. As for other languages, Java and Ruby both discard the original exception when another exception occurs in a 'catch'/'rescue' or diff --git a/pep-3139.txt b/pep-3139.txt --- a/pep-3139.txt +++ b/pep-3139.txt @@ -78,7 +78,7 @@ causing clutter in sys. Guido has even said he doesn't recognize some of things in it [#bug-1522]_! -Moving these items items off to another module would send a clear message to +Moving these items off to another module would send a clear message to other Python implementations about what functions need and need not be implemented. @@ -119,7 +119,7 @@ =============== Once implemented in 3.x, the interpreter module will be back-ported to 2.6. -Py3k warnings will be added the the sys functions it replaces. +Py3k warnings will be added to the sys functions it replaces. Open Issues diff --git a/pep-3144.txt b/pep-3144.txt --- a/pep-3144.txt +++ b/pep-3144.txt @@ -150,7 +150,7 @@ [1] Appealing to authority is a logical fallacy, but Vint Cerf is an - an authority who can't be ignored. Full text of the email + authority who can't be ignored. Full text of the email follows: """ diff --git a/pep-3145.txt b/pep-3145.txt --- a/pep-3145.txt +++ b/pep-3145.txt @@ -52,7 +52,7 @@ Windows builds of Python. Practically every I/O object in Python has a file-like wrapper of some sort. Sockets already act as such and for strings there is StringIO. Popen can be made to act like a file by simply - using the methods attached the the subprocess.Popen.stderr, stdout and + using the methods attached to the subprocess.Popen.stderr, stdout and stdin file-like objects. But when using the read and write methods of those options, you do not have the benefit of asynchronous I/O. In the proposed solution the wrapper wraps the asynchronous methods to mimic a diff --git a/pep-3148.txt b/pep-3148.txt --- a/pep-3148.txt +++ b/pep-3148.txt @@ -389,11 +389,11 @@ Rationale ========= -The proposed design of this module was heavily influenced by the the +The proposed design of this module was heavily influenced by the Java java.util.concurrent package [1]_. The conceptual basis of the module, as in Java, is the Future class, which represents the progress and result of an asynchronous computation. The Future class makes -little commitment to the evaluation mode being used e.g. it can be be +little commitment to the evaluation mode being used e.g. it can be used to represent lazy or eager evaluation, for evaluation using threads, processes or remote procedure call. diff --git a/pep-3156.txt b/pep-3156.txt --- a/pep-3156.txt +++ b/pep-3156.txt @@ -984,7 +984,7 @@ - ``cancel()``. If the Future is already done (or cancelled), do nothing and return ``False``. Otherwise, this attempts to cancel - the Future and returns ``True``. If the the cancellation attempt is + the Future and returns ``True``. If the cancellation attempt is successful, eventually the Future's state will change to cancelled (so that ``cancelled()`` will return ``True``) and the callbacks will be scheduled. For regular Futures, -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 3 06:28:15 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 03 May 2016 10:28:15 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Convert_to_Unix_newlines=2E?= Message-ID: <20160503102813.34489.44527.A1A86216@psf.io> https://hg.python.org/peps/rev/8cc3b2c1eb31 changeset: 6305:8cc3b2c1eb31 user: Serhiy Storchaka date: Tue May 03 13:27:59 2016 +0300 summary: Convert to Unix newlines. files: pep-0506.txt | 898 +++++++++++++++++++------------------- pep-0514.txt | 504 ++++++++++---------- 2 files changed, 701 insertions(+), 701 deletions(-) diff --git a/pep-0506.txt b/pep-0506.txt --- a/pep-0506.txt +++ b/pep-0506.txt @@ -1,449 +1,449 @@ -PEP: 506 -Title: Adding A Secrets Module To The Standard Library -Version: $Revision$ -Last-Modified: $Date$ -Author: Steven D'Aprano -Status: Accepted -Type: Standards Track -Content-Type: text/x-rst -Created: 19-Sep-2015 -Python-Version: 3.6 -Post-History: - - -Abstract -======== - -This PEP proposes the addition of a module for common security-related -functions such as generating tokens to the Python standard library. - - -Definitions -=========== - -Some common abbreviations used in this proposal: - -* PRNG: - - Pseudo Random Number Generator. A deterministic algorithm used - to produce random-looking numbers with certain desirable - statistical properties. - -* CSPRNG: - - Cryptographically Strong Pseudo Random Number Generator. An - algorithm used to produce random-looking numbers which are - resistant to prediction. - -* MT: - - Mersenne Twister. An extensively studied PRNG which is currently - used by the ``random`` module as the default. - - -Rationale -========= - -This proposal is motivated by concerns that Python's standard library -makes it too easy for developers to inadvertently make serious security -errors. Theo de Raadt, the founder of OpenBSD, contacted Guido van Rossum -and expressed some concern [#]_ about the use of MT for generating sensitive -information such as passwords, secure tokens, session keys and similar. - -Although the documentation for the ``random`` module explicitly states that -the default is not suitable for security purposes [#]_, it is strongly -believed that this warning may be missed, ignored or misunderstood by -many Python developers. In particular: - -* developers may not have read the documentation and consequently - not seen the warning; - -* they may not realise that their specific use of the module has security - implications; or - -* not realising that there could be a problem, they have copied code - (or learned techniques) from websites which don't offer best - practises. - -The first [#]_ hit when searching for "python how to generate passwords" on -Google is a tutorial that uses the default functions from the ``random`` -module [#]_. Although it is not intended for use in web applications, it is -likely that similar techniques find themselves used in that situation. -The second hit is to a StackOverflow question about generating -passwords [#]_. Most of the answers given, including the accepted one, use -the default functions. When one user warned that the default could be -easily compromised, they were told "I think you worry too much." [#]_ - -This strongly suggests that the existing ``random`` module is an attractive -nuisance when it comes to generating (for example) passwords or secure -tokens. - -Additional motivation (of a more philosophical bent) can be found in the -post which first proposed this idea [#]_. - - -Proposal -======== - -Alternative proposals have focused on the default PRNG in the ``random`` -module, with the aim of providing "secure by default" cryptographically -strong primitives that developers can build upon without thinking about -security. (See Alternatives below.) This proposes a different approach: - -* The standard library already provides cryptographically strong - primitives, but many users don't know they exist or when to use them. - -* Instead of requiring crypto-naive users to write secure code, the - standard library should include a set of ready-to-use "batteries" for - the most common needs, such as generating secure tokens. This code - will both directly satisfy a need ("How do I generate a password reset - token?"), and act as an example of acceptable practises which - developers can learn from [#]_. - -To do this, this PEP proposes that we add a new module to the standard -library, with the suggested name ``secrets``. This module will contain a -set of ready-to-use functions for common activities with security -implications, together with some lower-level primitives. - -The suggestion is that ``secrets`` becomes the go-to module for dealing -with anything which should remain secret (passwords, tokens, etc.) -while the ``random`` module remains backward-compatible. - - -API and Implementation -====================== - -This PEP proposes the following functions for the ``secrets`` module: - -* Functions for generating tokens suitable for use in (e.g.) password - recovery, as session keys, etc., in the following formats: - - - as bytes, ``secrets.token_bytes``; - - as text, using hexadecimal digits, ``secrets.token_hex``; - - as text, using URL-safe base-64 encoding, ``secrets.token_urlsafe``. - -* A limited interface to the system CSPRNG, using either ``os.urandom`` - directly or ``random.SystemRandom``. Unlike the ``random`` module, this - does not need to provide methods for seeding, getting or setting the - state, or any non-uniform distributions. It should provide the - following: - - - A function for choosing items from a sequence, ``secrets.choice``. - - A function for generating a given number of random bits and/or bytes - as an integer, ``secrets.randbits``. - - A function for returning a random integer in the half-open range - 0 to the given upper limit, ``secrets.randbelow`` [#]_. - -* A function for comparing text or bytes digests for equality while being - resistent to timing attacks, ``secrets.compare_digest``. - -The consensus appears to be that there is no need to add a new CSPRNG to -the ``random`` module to support these uses, ``SystemRandom`` will be -sufficient. - -Some illustrative implementations have been given by Nick Coghlan [#]_ -and a minimalist API by Tim Peters [#]_. This idea has also been discussed -on the issue tracker for the "cryptography" module [#]_. The following -pseudo-code should be taken as the starting point for the real -implementation:: - - from random import SystemRandom - from hmac import compare_digest - - _sysrand = SystemRandom() - - randbits = _sysrand.getrandbits - choice = _sysrand.choice - - def randbelow(exclusive_upper_bound): - return _sysrand._randbelow(exclusive_upper_bound) - - DEFAULT_ENTROPY = 32 # bytes - - def token_bytes(nbytes=None): - if nbytes is None: - nbytes = DEFAULT_ENTROPY - return os.urandom(nbytes) - - def token_hex(nbytes=None): - return binascii.hexlify(token_bytes(nbytes)).decode('ascii') - - def token_urlsafe(nbytes=None): - tok = token_bytes(nbytes) - return base64.urlsafe_b64encode(tok).rstrip(b'=').decode('ascii') - - -The ``secrets`` module itself will be pure Python, and other Python -implementations can easily make use of it unchanged, or adapt it as -necessary. An implementation can be found on BitBucket [#]_. - -Default arguments -~~~~~~~~~~~~~~~~~ - -One difficult question is "How many bytes should my token be?". We can -help with this question by providing a default amount of entropy for the -"token_*" functions. If the ``nbytes`` argument is None or not given, the -default entropy will be used. This default value should be large enough -to be expected to be secure for medium-security uses, but is expected to -change in the future, possibly even in a maintenance release [#]_. - -Naming conventions -~~~~~~~~~~~~~~~~~~ - -One question is the naming conventions used in the module [#]_, whether to -use C-like naming conventions such as "randrange" or more Pythonic names -such as "random_range". - -Functions which are simply bound methods of the private ``SystemRandom`` -instance (e.g. ``randrange``), or a thin wrapper around such, should keep -the familiar names. Those which are something new (such as the various -``token_*`` functions) will use more Pythonic names. - -Alternatives -============ - -One alternative is to change the default PRNG provided by the ``random`` -module [#]_. This received considerable scepticism and outright opposition: - -* There is fear that a CSPRNG may be slower than the current PRNG (which - in the case of MT is already quite slow). - -* Some applications (such as scientific simulations, and replaying - gameplay) require the ability to seed the PRNG into a known state, - which a CSPRNG lacks by design. - -* Another major use of the ``random`` module is for simple "guess a number" - games written by beginners, and many people are loath to make any - change to the ``random`` module which may make that harder. - -* Although there is no proposal to remove MT from the ``random`` module, - there was considerable hostility to the idea of having to opt-in to - a non-CSPRNG or any backwards-incompatible changes. - -* Demonstrated attacks against MT are typically against PHP applications. - It is believed that PHP's version of MT is a significantly softer target - than Python's version, due to a poor seeding technique [#]_. Consequently, - without a proven attack against Python applications, many people object - to a backwards-incompatible change. - -Nick Coghlan made an earlier suggestion for a globally configurable PRNG -which uses the system CSPRNG by default [#]_, but has since withdrawn it -in favour of this proposal. - - -Comparison To Other Languages -============================= - -* PHP - - PHP includes a function ``uniqid`` [#]_ which by default returns a - thirteen character string based on the current time in microseconds. - Translated into Python syntax, it has the following signature:: - - def uniqid(prefix='', more_entropy=False)->str - - The PHP documentation warns that this function is not suitable for - security purposes. Nevertheless, various mature, well-known PHP - applications use it for that purpose (citation needed). - - PHP 5.3 and better also includes a function ``openssl_random_pseudo_bytes`` - [#]_. Translated into Python syntax, it has roughly the following - signature:: - - def openssl_random_pseudo_bytes(length:int)->Tuple[str, bool] - - This function returns a pseudo-random string of bytes of the given - length, and an boolean flag giving whether the string is considered - cryptographically strong. The PHP manual suggests that returning - anything but True should be rare except for old or broken platforms. - -* JavaScript - - Based on a rather cursory search [#]_, there do not appear to be any - well-known standard functions for producing strong random values in - JavaScript. ``Math.random`` is often used, despite serious weaknesses - making it unsuitable for cryptographic purposes [#]_. In recent years - the majority of browsers have gained support for ``window.crypto.getRandomValues`` [#]_. - - Node.js offers a rich cryptographic module, ``crypto`` [#]_, most of - which is beyond the scope of this PEP. It does include a single function - for generating random bytes, ``crypto.randomBytes``. - -* Ruby - - The Ruby standard library includes a module ``SecureRandom`` [#]_ - which includes the following methods: - - * base64 - returns a Base64 encoded random string. - - * hex - returns a random hexadecimal string. - - * random_bytes - returns a random byte string. - - * random_number - depending on the argument, returns either a random - integer in the range(0, n), or a random float between 0.0 and 1.0. - - * urlsafe_base64 - returns a random URL-safe Base64 encoded string. - - * uuid - return a version 4 random Universally Unique IDentifier. - - -What Should Be The Name Of The Module? -====================================== - -There was a proposal to add a "random.safe" submodule, quoting the Zen -of Python "Namespaces are one honking great idea" koan. However, the -author of the Zen, Tim Peters, has come out against this idea [#]_, and -recommends a top-level module. - -In discussion on the python-ideas mailing list so far, the name "secrets" -has received some approval, and no strong opposition. - -There is already an existing third-party module with the same name [#]_, -but it appears to be unused and abandoned. - - -Frequently Asked Questions -========================== - -* Q: Is this a real problem? Surely MT is random enough that nobody can - predict its output. - - A: The consensus among security professionals is that MT is not safe - in security contexts. It is not difficult to reconstruct the internal - state of MT [#]_ [#]_ and so predict all past and future values. There - are a number of known, practical attacks on systems using MT for - randomness [#]_. - - While there are currently no known direct attacks on applications - written in Python due to the use of MT, there is widespread agreement - that such usage is unsafe. - -* Q: Is this an alternative to specialise cryptographic software such as SSL? - - A: No. This is a "batteries included" solution, not a full-featured - "nuclear reactor". It is intended to mitigate against some basic - security errors, not be a solution to all security-related issues. To - quote Nick Coghlan referring to his earlier proposal [#]_:: - - "...folks really are better off learning to use things like - cryptography.io for security sensitive software, so this change - is just about harm mitigation given that it's inevitable that a - non-trivial proportion of the millions of current and future - Python developers won't do that." - -* Q: What about a password generator? - - A: The consensus is that the requirements for password generators are too - variable for it to be a good match for the standard library [#]_. No - password generator will be included in the initial release of the - module, instead it will be given in the documentation as a recipe (? la - the recipes in the ``itertools`` module) [#]_. - -* Q: Will ``secrets`` use /dev/random (which blocks) or /dev/urandom (which - doesn't block) on Linux? What about other platforms? - - A: ``secrets`` will be based on ``os.urandom`` and ``random.SystemRandom``, - which are interfaces to your operating system's best source of - cryptographic randomness. On Linux, that may be ``/dev/urandom`` [#]_, - on Windows it may be ``CryptGenRandom()``, but see the documentation - and/or source code for the detailed implementation details. - - -References -========== - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/035820.html - -.. [#] https://docs.python.org/3/library/random.html - -.. [#] As of the date of writing. Also, as Google search terms may be - automatically customised for the user without their knowledge, some - readers may see different results. - -.. [#] http://interactivepython.org/runestone/static/everyday/2013/01/3_password.html - -.. [#] http://stackoverflow.com/questions/3854692/generate-password-in-python - -.. [#] http://stackoverflow.com/questions/3854692/generate-password-in-python/3854766#3854766 - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036238.html - -.. [#] At least those who are motivated to read the source code and documentation. - -.. [#] After considerable discussion, Guido ruled that the module need only - provide ``randbelow``, and not similar functions ``randrange`` or - ``randint``. http://code.activestate.com/lists/python-dev/138375/ - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036271.html - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036350.html - -.. [#] https://github.com/pyca/cryptography/issues/2347 - -.. [#] https://bitbucket.org/sdaprano/secrets - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036517.html - https://mail.python.org/pipermail/python-ideas/2015-September/036515.html - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036474.html - -.. [#] Link needed. - -.. [#] By default PHP seeds the MT PRNG with the time (citation needed), - which is exploitable by attackers, while Python seeds the PRNG with - output from the system CSPRNG, which is believed to be much harder to - exploit. - -.. [#] http://legacy.python.org/dev/peps/pep-0504/ - -.. [#] http://php.net/manual/en/function.uniqid.php - -.. [#] http://php.net/manual/en/function.openssl-random-pseudo-bytes.php - -.. [#] Volunteers and patches are welcome. - -.. [#] http://ifsec.blogspot.fr/2012/05/cross-domain-mathrandom-prediction.html - -.. [#] https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues - -.. [#] https://nodejs.org/api/crypto.html - -.. [#] http://ruby-doc.org/stdlib-2.1.2/libdoc/securerandom/rdoc/SecureRandom.html - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036254.html - -.. [#] https://pypi.python.org/pypi/secrets - -.. [#] https://jazzy.id.au/2010/09/22/cracking_random_number_generators_part_3.html - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036077.html - -.. [#] https://media.blackhat.com/bh-us-12/Briefings/Argyros/BH_US_12_Argyros_PRNG_WP.pdf - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036157.html - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036476.html - https://mail.python.org/pipermail/python-ideas/2015-September/036478.html - -.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036488.html - -.. [#] http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ - http://www.2uo.de/myths-about-urandom/ - - -Copyright -========= - -This document has been placed in the public domain. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: +PEP: 506 +Title: Adding A Secrets Module To The Standard Library +Version: $Revision$ +Last-Modified: $Date$ +Author: Steven D'Aprano +Status: Accepted +Type: Standards Track +Content-Type: text/x-rst +Created: 19-Sep-2015 +Python-Version: 3.6 +Post-History: + + +Abstract +======== + +This PEP proposes the addition of a module for common security-related +functions such as generating tokens to the Python standard library. + + +Definitions +=========== + +Some common abbreviations used in this proposal: + +* PRNG: + + Pseudo Random Number Generator. A deterministic algorithm used + to produce random-looking numbers with certain desirable + statistical properties. + +* CSPRNG: + + Cryptographically Strong Pseudo Random Number Generator. An + algorithm used to produce random-looking numbers which are + resistant to prediction. + +* MT: + + Mersenne Twister. An extensively studied PRNG which is currently + used by the ``random`` module as the default. + + +Rationale +========= + +This proposal is motivated by concerns that Python's standard library +makes it too easy for developers to inadvertently make serious security +errors. Theo de Raadt, the founder of OpenBSD, contacted Guido van Rossum +and expressed some concern [#]_ about the use of MT for generating sensitive +information such as passwords, secure tokens, session keys and similar. + +Although the documentation for the ``random`` module explicitly states that +the default is not suitable for security purposes [#]_, it is strongly +believed that this warning may be missed, ignored or misunderstood by +many Python developers. In particular: + +* developers may not have read the documentation and consequently + not seen the warning; + +* they may not realise that their specific use of the module has security + implications; or + +* not realising that there could be a problem, they have copied code + (or learned techniques) from websites which don't offer best + practises. + +The first [#]_ hit when searching for "python how to generate passwords" on +Google is a tutorial that uses the default functions from the ``random`` +module [#]_. Although it is not intended for use in web applications, it is +likely that similar techniques find themselves used in that situation. +The second hit is to a StackOverflow question about generating +passwords [#]_. Most of the answers given, including the accepted one, use +the default functions. When one user warned that the default could be +easily compromised, they were told "I think you worry too much." [#]_ + +This strongly suggests that the existing ``random`` module is an attractive +nuisance when it comes to generating (for example) passwords or secure +tokens. + +Additional motivation (of a more philosophical bent) can be found in the +post which first proposed this idea [#]_. + + +Proposal +======== + +Alternative proposals have focused on the default PRNG in the ``random`` +module, with the aim of providing "secure by default" cryptographically +strong primitives that developers can build upon without thinking about +security. (See Alternatives below.) This proposes a different approach: + +* The standard library already provides cryptographically strong + primitives, but many users don't know they exist or when to use them. + +* Instead of requiring crypto-naive users to write secure code, the + standard library should include a set of ready-to-use "batteries" for + the most common needs, such as generating secure tokens. This code + will both directly satisfy a need ("How do I generate a password reset + token?"), and act as an example of acceptable practises which + developers can learn from [#]_. + +To do this, this PEP proposes that we add a new module to the standard +library, with the suggested name ``secrets``. This module will contain a +set of ready-to-use functions for common activities with security +implications, together with some lower-level primitives. + +The suggestion is that ``secrets`` becomes the go-to module for dealing +with anything which should remain secret (passwords, tokens, etc.) +while the ``random`` module remains backward-compatible. + + +API and Implementation +====================== + +This PEP proposes the following functions for the ``secrets`` module: + +* Functions for generating tokens suitable for use in (e.g.) password + recovery, as session keys, etc., in the following formats: + + - as bytes, ``secrets.token_bytes``; + - as text, using hexadecimal digits, ``secrets.token_hex``; + - as text, using URL-safe base-64 encoding, ``secrets.token_urlsafe``. + +* A limited interface to the system CSPRNG, using either ``os.urandom`` + directly or ``random.SystemRandom``. Unlike the ``random`` module, this + does not need to provide methods for seeding, getting or setting the + state, or any non-uniform distributions. It should provide the + following: + + - A function for choosing items from a sequence, ``secrets.choice``. + - A function for generating a given number of random bits and/or bytes + as an integer, ``secrets.randbits``. + - A function for returning a random integer in the half-open range + 0 to the given upper limit, ``secrets.randbelow`` [#]_. + +* A function for comparing text or bytes digests for equality while being + resistent to timing attacks, ``secrets.compare_digest``. + +The consensus appears to be that there is no need to add a new CSPRNG to +the ``random`` module to support these uses, ``SystemRandom`` will be +sufficient. + +Some illustrative implementations have been given by Nick Coghlan [#]_ +and a minimalist API by Tim Peters [#]_. This idea has also been discussed +on the issue tracker for the "cryptography" module [#]_. The following +pseudo-code should be taken as the starting point for the real +implementation:: + + from random import SystemRandom + from hmac import compare_digest + + _sysrand = SystemRandom() + + randbits = _sysrand.getrandbits + choice = _sysrand.choice + + def randbelow(exclusive_upper_bound): + return _sysrand._randbelow(exclusive_upper_bound) + + DEFAULT_ENTROPY = 32 # bytes + + def token_bytes(nbytes=None): + if nbytes is None: + nbytes = DEFAULT_ENTROPY + return os.urandom(nbytes) + + def token_hex(nbytes=None): + return binascii.hexlify(token_bytes(nbytes)).decode('ascii') + + def token_urlsafe(nbytes=None): + tok = token_bytes(nbytes) + return base64.urlsafe_b64encode(tok).rstrip(b'=').decode('ascii') + + +The ``secrets`` module itself will be pure Python, and other Python +implementations can easily make use of it unchanged, or adapt it as +necessary. An implementation can be found on BitBucket [#]_. + +Default arguments +~~~~~~~~~~~~~~~~~ + +One difficult question is "How many bytes should my token be?". We can +help with this question by providing a default amount of entropy for the +"token_*" functions. If the ``nbytes`` argument is None or not given, the +default entropy will be used. This default value should be large enough +to be expected to be secure for medium-security uses, but is expected to +change in the future, possibly even in a maintenance release [#]_. + +Naming conventions +~~~~~~~~~~~~~~~~~~ + +One question is the naming conventions used in the module [#]_, whether to +use C-like naming conventions such as "randrange" or more Pythonic names +such as "random_range". + +Functions which are simply bound methods of the private ``SystemRandom`` +instance (e.g. ``randrange``), or a thin wrapper around such, should keep +the familiar names. Those which are something new (such as the various +``token_*`` functions) will use more Pythonic names. + +Alternatives +============ + +One alternative is to change the default PRNG provided by the ``random`` +module [#]_. This received considerable scepticism and outright opposition: + +* There is fear that a CSPRNG may be slower than the current PRNG (which + in the case of MT is already quite slow). + +* Some applications (such as scientific simulations, and replaying + gameplay) require the ability to seed the PRNG into a known state, + which a CSPRNG lacks by design. + +* Another major use of the ``random`` module is for simple "guess a number" + games written by beginners, and many people are loath to make any + change to the ``random`` module which may make that harder. + +* Although there is no proposal to remove MT from the ``random`` module, + there was considerable hostility to the idea of having to opt-in to + a non-CSPRNG or any backwards-incompatible changes. + +* Demonstrated attacks against MT are typically against PHP applications. + It is believed that PHP's version of MT is a significantly softer target + than Python's version, due to a poor seeding technique [#]_. Consequently, + without a proven attack against Python applications, many people object + to a backwards-incompatible change. + +Nick Coghlan made an earlier suggestion for a globally configurable PRNG +which uses the system CSPRNG by default [#]_, but has since withdrawn it +in favour of this proposal. + + +Comparison To Other Languages +============================= + +* PHP + + PHP includes a function ``uniqid`` [#]_ which by default returns a + thirteen character string based on the current time in microseconds. + Translated into Python syntax, it has the following signature:: + + def uniqid(prefix='', more_entropy=False)->str + + The PHP documentation warns that this function is not suitable for + security purposes. Nevertheless, various mature, well-known PHP + applications use it for that purpose (citation needed). + + PHP 5.3 and better also includes a function ``openssl_random_pseudo_bytes`` + [#]_. Translated into Python syntax, it has roughly the following + signature:: + + def openssl_random_pseudo_bytes(length:int)->Tuple[str, bool] + + This function returns a pseudo-random string of bytes of the given + length, and an boolean flag giving whether the string is considered + cryptographically strong. The PHP manual suggests that returning + anything but True should be rare except for old or broken platforms. + +* JavaScript + + Based on a rather cursory search [#]_, there do not appear to be any + well-known standard functions for producing strong random values in + JavaScript. ``Math.random`` is often used, despite serious weaknesses + making it unsuitable for cryptographic purposes [#]_. In recent years + the majority of browsers have gained support for ``window.crypto.getRandomValues`` [#]_. + + Node.js offers a rich cryptographic module, ``crypto`` [#]_, most of + which is beyond the scope of this PEP. It does include a single function + for generating random bytes, ``crypto.randomBytes``. + +* Ruby + + The Ruby standard library includes a module ``SecureRandom`` [#]_ + which includes the following methods: + + * base64 - returns a Base64 encoded random string. + + * hex - returns a random hexadecimal string. + + * random_bytes - returns a random byte string. + + * random_number - depending on the argument, returns either a random + integer in the range(0, n), or a random float between 0.0 and 1.0. + + * urlsafe_base64 - returns a random URL-safe Base64 encoded string. + + * uuid - return a version 4 random Universally Unique IDentifier. + + +What Should Be The Name Of The Module? +====================================== + +There was a proposal to add a "random.safe" submodule, quoting the Zen +of Python "Namespaces are one honking great idea" koan. However, the +author of the Zen, Tim Peters, has come out against this idea [#]_, and +recommends a top-level module. + +In discussion on the python-ideas mailing list so far, the name "secrets" +has received some approval, and no strong opposition. + +There is already an existing third-party module with the same name [#]_, +but it appears to be unused and abandoned. + + +Frequently Asked Questions +========================== + +* Q: Is this a real problem? Surely MT is random enough that nobody can + predict its output. + + A: The consensus among security professionals is that MT is not safe + in security contexts. It is not difficult to reconstruct the internal + state of MT [#]_ [#]_ and so predict all past and future values. There + are a number of known, practical attacks on systems using MT for + randomness [#]_. + + While there are currently no known direct attacks on applications + written in Python due to the use of MT, there is widespread agreement + that such usage is unsafe. + +* Q: Is this an alternative to specialise cryptographic software such as SSL? + + A: No. This is a "batteries included" solution, not a full-featured + "nuclear reactor". It is intended to mitigate against some basic + security errors, not be a solution to all security-related issues. To + quote Nick Coghlan referring to his earlier proposal [#]_:: + + "...folks really are better off learning to use things like + cryptography.io for security sensitive software, so this change + is just about harm mitigation given that it's inevitable that a + non-trivial proportion of the millions of current and future + Python developers won't do that." + +* Q: What about a password generator? + + A: The consensus is that the requirements for password generators are too + variable for it to be a good match for the standard library [#]_. No + password generator will be included in the initial release of the + module, instead it will be given in the documentation as a recipe (? la + the recipes in the ``itertools`` module) [#]_. + +* Q: Will ``secrets`` use /dev/random (which blocks) or /dev/urandom (which + doesn't block) on Linux? What about other platforms? + + A: ``secrets`` will be based on ``os.urandom`` and ``random.SystemRandom``, + which are interfaces to your operating system's best source of + cryptographic randomness. On Linux, that may be ``/dev/urandom`` [#]_, + on Windows it may be ``CryptGenRandom()``, but see the documentation + and/or source code for the detailed implementation details. + + +References +========== + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/035820.html + +.. [#] https://docs.python.org/3/library/random.html + +.. [#] As of the date of writing. Also, as Google search terms may be + automatically customised for the user without their knowledge, some + readers may see different results. + +.. [#] http://interactivepython.org/runestone/static/everyday/2013/01/3_password.html + +.. [#] http://stackoverflow.com/questions/3854692/generate-password-in-python + +.. [#] http://stackoverflow.com/questions/3854692/generate-password-in-python/3854766#3854766 + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036238.html + +.. [#] At least those who are motivated to read the source code and documentation. + +.. [#] After considerable discussion, Guido ruled that the module need only + provide ``randbelow``, and not similar functions ``randrange`` or + ``randint``. http://code.activestate.com/lists/python-dev/138375/ + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036271.html + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036350.html + +.. [#] https://github.com/pyca/cryptography/issues/2347 + +.. [#] https://bitbucket.org/sdaprano/secrets + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036517.html + https://mail.python.org/pipermail/python-ideas/2015-September/036515.html + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036474.html + +.. [#] Link needed. + +.. [#] By default PHP seeds the MT PRNG with the time (citation needed), + which is exploitable by attackers, while Python seeds the PRNG with + output from the system CSPRNG, which is believed to be much harder to + exploit. + +.. [#] http://legacy.python.org/dev/peps/pep-0504/ + +.. [#] http://php.net/manual/en/function.uniqid.php + +.. [#] http://php.net/manual/en/function.openssl-random-pseudo-bytes.php + +.. [#] Volunteers and patches are welcome. + +.. [#] http://ifsec.blogspot.fr/2012/05/cross-domain-mathrandom-prediction.html + +.. [#] https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues + +.. [#] https://nodejs.org/api/crypto.html + +.. [#] http://ruby-doc.org/stdlib-2.1.2/libdoc/securerandom/rdoc/SecureRandom.html + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036254.html + +.. [#] https://pypi.python.org/pypi/secrets + +.. [#] https://jazzy.id.au/2010/09/22/cracking_random_number_generators_part_3.html + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036077.html + +.. [#] https://media.blackhat.com/bh-us-12/Briefings/Argyros/BH_US_12_Argyros_PRNG_WP.pdf + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036157.html + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036476.html + https://mail.python.org/pipermail/python-ideas/2015-September/036478.html + +.. [#] https://mail.python.org/pipermail/python-ideas/2015-September/036488.html + +.. [#] http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ + http://www.2uo.de/myths-about-urandom/ + + +Copyright +========= + +This document has been placed in the public domain. + + + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + coding: utf-8 + End: diff --git a/pep-0514.txt b/pep-0514.txt --- a/pep-0514.txt +++ b/pep-0514.txt @@ -1,253 +1,253 @@ -PEP: 514 -Title: Python registration in the Windows registry -Version: $Revision$ -Last-Modified: $Date$ -Author: Steve Dower -Status: Draft -Type: Informational -Content-Type: text/x-rst -Created: 02-Feb-2016 -Post-History: 02-Feb-2016, 01-Mar-2016 - -Abstract -======== - -This PEP defines a schema for the Python registry key to allow third-party -installers to register their installation, and to allow applications to detect -and correctly display all Python environments on a user's machine. No -implementation changes to Python are proposed with this PEP. - -Python environments are not required to be registered unless they want to be -automatically discoverable by external tools. - -The schema matches the registry values that have been used by the official -installer since at least Python 2.5, and the resolution behaviour matches the -behaviour of the official Python releases. - -Motivation -========== - -When installed on Windows, the official Python installer creates a registry key -for discovery and detection by other applications. This allows tools such as -installers or IDEs to automatically detect and display a user's Python -installations. - -Third-party installers, such as those used by distributions, typically create -identical keys for the same purpose. Most tools that use the registry to detect -Python installations only inspect the keys used by the official installer. As a -result, third-party installations that wish to be discoverable will overwrite -these values, resulting in users "losing" their Python installation. - -By describing a layout for registry keys that allows third-party installations -to register themselves uniquely, as well as providing tool developers guidance -for discovering all available Python installations, these collisions should be -prevented. - -Definitions -=========== - -A "registry key" is the equivalent of a file-system path into the registry. Each -key may contain "subkeys" (keys nested within keys) and "values" (named and -typed attributes attached to a key). - -``HKEY_CURRENT_USER`` is the root of settings for the currently logged-in user, -and this user can generally read and write all settings under this root. - -``HKEY_LOCAL_MACHINE`` is the root of settings for all users. Generally, any -user can read these settings but only administrators can modify them. It is -typical for values under ``HKEY_CURRENT_USER`` to take precedence over those in -``HKEY_LOCAL_MACHINE``. - -On 64-bit Windows, ``HKEY_LOCAL_MACHINE\Software\Wow6432Node`` is a special key -that 32-bit processes transparently read and write to rather than accessing the -``Software`` key directly. - -Structure -========= - -We consider there to be a single collection of Python environments on a machine, -where the collection may be different for each user of the machine. There are -three potential registry locations where the collection may be stored based on -the installation options of each environment:: - - HKEY_CURRENT_USER\Software\Python\\ - HKEY_LOCAL_MACHINE\Software\Python\\ - HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\\ - -Environments are uniquely identified by their Company-Tag pair, with two options -for conflict resolution: include everything, or give priority to user -preferences. - -Tools that include every installed environment, even where the Company-Tag pairs -match, should ensure users can easily identify whether the registration was -per-user or per-machine. - -When tools are selecting a single installed environment from all registered -environments, the intent is that user preferences from ``HKEY_CURRENT_USER`` -will override matching Company-Tag pairs in ``HKEY_LOCAL_MACHINE``. - -Official Python releases use ``PythonCore`` for Company, and the value of -``sys.winver`` for Tag. Other registered environments may use any values for -Company and Tag. Recommendations are made in the following sections. - -Python environments are not required to register themselves unless they want to -be automatically discoverable by external tools. - -Backwards Compatibility ------------------------ - -Python 3.4 and earlier did not distinguish between 32-bit and 64-bit builds in -``sys.winver``. As a result, it is possible to have valid side-by-side -installations of both 32-bit and 64-bit interpreters. - -To ensure backwards compatibility, applications should treat environments listed -under the following two registry keys as distinct, even when the Tag matches:: - - HKEY_LOCAL_MACHINE\Software\Python\PythonCore\ - HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\PythonCore\ - -Environments listed under ``HKEY_CURRENT_USER`` may be treated as distinct from -both of the above keys, potentially resulting in three environments discovered -using the same Tag. Alternatively, a tool may determine whether the per-user -environment is 64-bit or 32-bit and give it priority over the per-machine -environment, resulting in a maximum of two discovered environments. - -It is not possible to detect side-by-side installations of both 64-bit and -32-bit versions of Python prior to 3.5 when they have been installed for the -current user. Python 3.5 and later always uses different Tags for 64-bit and -32-bit versions. - -Environments registered under other Company names must use distinct Tags to -support side-by-side installations. Tools consuming these registrations are -not required to disambiguate tags other than by preferring the user's setting. - -Company -------- - -The Company part of the key is intended to group related environments and to -ensure that Tags are namespaced appropriately. The key name should be -alphanumeric without spaces and likely to be unique. For example, a trademarked -name, a UUID, or a hostname would be appropriate:: - - HKEY_CURRENT_USER\Software\Python\ExampleCorp - HKEY_CURRENT_USER\Software\Python\6C465E66-5A8C-4942-9E6A-D29159480C60 - HKEY_CURRENT_USER\Software\Python\www.example.com - -The company name ``PyLauncher`` is reserved for the PEP 397 launcher -(``py.exe``). It does not follow this convention and should be ignored by tools. - -If a string value named ``DisplayName`` exists, it should be used to identify -the environment category to users. Otherwise, the name of the key should be -used. - -If a string value named ``SupportUrl`` exists, it may be displayed or otherwise -used to direct users to a web site related to the environment. - -A complete example may look like:: - - HKEY_CURRENT_USER\Software\Python\ExampleCorp - (Default) = (value not set) - DisplayName = "Example Corp" - SupportUrl = "http://www.example.com" - -Tag ---- - -The Tag part of the key is intended to uniquely identify an environment within -those provided by a single company. The key name should be alphanumeric without -spaces and stable across installations. For example, the Python language -version, a UUID or a partial/complete hash would be appropriate; an integer -counter that increases for each new environment may not:: - - HKEY_CURRENT_USER\Software\Python\ExampleCorp\3.6 - HKEY_CURRENT_USER\Software\Python\ExampleCorp\6C465E66 - -If a string value named ``DisplayName`` exists, it should be used to identify -the environment to users. Otherwise, the name of the key should be used. - -If a string value named ``SupportUrl`` exists, it may be displayed or otherwise -used to direct users to a web site related to the environment. - -If a string value named ``Version`` exists, it should be used to identify the -version of the environment. This is independent from the version of Python -implemented by the environment. - -If a string value named ``SysVersion`` exists, it must be in ``x.y`` or -``x.y.z`` format matching the version returned by ``sys.version_info`` in the -interpreter. Otherwise, if the Tag matches this format it is used. If not, the -Python version is unknown. - -Note that each of these values is recommended, but optional. A complete example -may look like this:: - - HKEY_CURRENT_USER\Software\Python\ExampleCorp\6C465E66 - (Default) = (value not set) - DisplayName = "Distro 3" - SupportUrl = "http://www.example.com/distro-3" - Version = "3.0.12345.0" - SysVersion = "3.6.0" - -InstallPath ------------ - -Beneath the environment key, an ``InstallPath`` key must be created. This key is -always named ``InstallPath``, and the default value must match ``sys.prefix``:: - - HKEY_CURRENT_USER\Software\Python\ExampleCorp\3.6\InstallPath - (Default) = "C:\ExampleCorpPy36" - -If a string value named ``ExecutablePath`` exists, it must be a path to the -``python.exe`` (or equivalent) executable. Otherwise, the interpreter executable -is assumed to be called ``python.exe`` and exist in the directory referenced by -the default value. - -If a string value named ``WindowedExecutablePath`` exists, it must be a path to -the ``pythonw.exe`` (or equivalent) executable. Otherwise, the windowed -interpreter executable is assumed to be called ``pythonw.exe`` and exist in the -directory referenced by the default value. - -A complete example may look like:: - - HKEY_CURRENT_USER\Software\Python\ExampleCorp\6C465E66\InstallPath - (Default) = "C:\ExampleDistro30" - ExecutablePath = "C:\ExampleDistro30\ex_python.exe" - WindowedExecutablePath = "C:\ExampleDistro30\ex_pythonw.exe" - -Help ----- - -Beneath the environment key, a ``Help`` key may be created. This key is always -named ``Help`` if present and has no default value. - -Each subkey of ``Help`` specifies a documentation file, tool, or URL associated -with the environment. The subkey may have any name, and the default value is a -string appropriate for passing to ``os.startfile`` or equivalent. - -If a string value named ``DisplayName`` exists, it should be used to identify -the help file to users. Otherwise, the key name should be used. - -A complete example may look like:: - - HKEY_CURRENT_USER\Software\Python\ExampleCorp\6C465E66\Help - Python\ - (Default) = "C:\ExampleDistro30\python36.chm" - DisplayName = "Python Documentation" - Extras\ - (Default) = "http://www.example.com/tutorial" - DisplayName = "Example Distro Online Tutorial" - -Other Keys ----------- - -Some other registry keys are used for defining or inferring search paths under -certain conditions. A third-party installation is permitted to define these keys -under their Company-Tag key, however, the interpreter must be modified and -rebuilt in order to read these values. Alternatively, the interpreter may be -modified to not use any registry keys for determining search paths. Making such -changes is a decision for the third party; this PEP makes no recommendation -either way. - -Copyright -========= - +PEP: 514 +Title: Python registration in the Windows registry +Version: $Revision$ +Last-Modified: $Date$ +Author: Steve Dower +Status: Draft +Type: Informational +Content-Type: text/x-rst +Created: 02-Feb-2016 +Post-History: 02-Feb-2016, 01-Mar-2016 + +Abstract +======== + +This PEP defines a schema for the Python registry key to allow third-party +installers to register their installation, and to allow applications to detect +and correctly display all Python environments on a user's machine. No +implementation changes to Python are proposed with this PEP. + +Python environments are not required to be registered unless they want to be +automatically discoverable by external tools. + +The schema matches the registry values that have been used by the official +installer since at least Python 2.5, and the resolution behaviour matches the +behaviour of the official Python releases. + +Motivation +========== + +When installed on Windows, the official Python installer creates a registry key +for discovery and detection by other applications. This allows tools such as +installers or IDEs to automatically detect and display a user's Python +installations. + +Third-party installers, such as those used by distributions, typically create +identical keys for the same purpose. Most tools that use the registry to detect +Python installations only inspect the keys used by the official installer. As a +result, third-party installations that wish to be discoverable will overwrite +these values, resulting in users "losing" their Python installation. + +By describing a layout for registry keys that allows third-party installations +to register themselves uniquely, as well as providing tool developers guidance +for discovering all available Python installations, these collisions should be +prevented. + +Definitions +=========== + +A "registry key" is the equivalent of a file-system path into the registry. Each +key may contain "subkeys" (keys nested within keys) and "values" (named and +typed attributes attached to a key). + +``HKEY_CURRENT_USER`` is the root of settings for the currently logged-in user, +and this user can generally read and write all settings under this root. + +``HKEY_LOCAL_MACHINE`` is the root of settings for all users. Generally, any +user can read these settings but only administrators can modify them. It is +typical for values under ``HKEY_CURRENT_USER`` to take precedence over those in +``HKEY_LOCAL_MACHINE``. + +On 64-bit Windows, ``HKEY_LOCAL_MACHINE\Software\Wow6432Node`` is a special key +that 32-bit processes transparently read and write to rather than accessing the +``Software`` key directly. + +Structure +========= + +We consider there to be a single collection of Python environments on a machine, +where the collection may be different for each user of the machine. There are +three potential registry locations where the collection may be stored based on +the installation options of each environment:: + + HKEY_CURRENT_USER\Software\Python\\ + HKEY_LOCAL_MACHINE\Software\Python\\ + HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\\ + +Environments are uniquely identified by their Company-Tag pair, with two options +for conflict resolution: include everything, or give priority to user +preferences. + +Tools that include every installed environment, even where the Company-Tag pairs +match, should ensure users can easily identify whether the registration was +per-user or per-machine. + +When tools are selecting a single installed environment from all registered +environments, the intent is that user preferences from ``HKEY_CURRENT_USER`` +will override matching Company-Tag pairs in ``HKEY_LOCAL_MACHINE``. + +Official Python releases use ``PythonCore`` for Company, and the value of +``sys.winver`` for Tag. Other registered environments may use any values for +Company and Tag. Recommendations are made in the following sections. + +Python environments are not required to register themselves unless they want to +be automatically discoverable by external tools. + +Backwards Compatibility +----------------------- + +Python 3.4 and earlier did not distinguish between 32-bit and 64-bit builds in +``sys.winver``. As a result, it is possible to have valid side-by-side +installations of both 32-bit and 64-bit interpreters. + +To ensure backwards compatibility, applications should treat environments listed +under the following two registry keys as distinct, even when the Tag matches:: + + HKEY_LOCAL_MACHINE\Software\Python\PythonCore\ + HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\PythonCore\ + +Environments listed under ``HKEY_CURRENT_USER`` may be treated as distinct from +both of the above keys, potentially resulting in three environments discovered +using the same Tag. Alternatively, a tool may determine whether the per-user +environment is 64-bit or 32-bit and give it priority over the per-machine +environment, resulting in a maximum of two discovered environments. + +It is not possible to detect side-by-side installations of both 64-bit and +32-bit versions of Python prior to 3.5 when they have been installed for the +current user. Python 3.5 and later always uses different Tags for 64-bit and +32-bit versions. + +Environments registered under other Company names must use distinct Tags to +support side-by-side installations. Tools consuming these registrations are +not required to disambiguate tags other than by preferring the user's setting. + +Company +------- + +The Company part of the key is intended to group related environments and to +ensure that Tags are namespaced appropriately. The key name should be +alphanumeric without spaces and likely to be unique. For example, a trademarked +name, a UUID, or a hostname would be appropriate:: + + HKEY_CURRENT_USER\Software\Python\ExampleCorp + HKEY_CURRENT_USER\Software\Python\6C465E66-5A8C-4942-9E6A-D29159480C60 + HKEY_CURRENT_USER\Software\Python\www.example.com + +The company name ``PyLauncher`` is reserved for the PEP 397 launcher +(``py.exe``). It does not follow this convention and should be ignored by tools. + +If a string value named ``DisplayName`` exists, it should be used to identify +the environment category to users. Otherwise, the name of the key should be +used. + +If a string value named ``SupportUrl`` exists, it may be displayed or otherwise +used to direct users to a web site related to the environment. + +A complete example may look like:: + + HKEY_CURRENT_USER\Software\Python\ExampleCorp + (Default) = (value not set) + DisplayName = "Example Corp" + SupportUrl = "http://www.example.com" + +Tag +--- + +The Tag part of the key is intended to uniquely identify an environment within +those provided by a single company. The key name should be alphanumeric without +spaces and stable across installations. For example, the Python language +version, a UUID or a partial/complete hash would be appropriate; an integer +counter that increases for each new environment may not:: + + HKEY_CURRENT_USER\Software\Python\ExampleCorp\3.6 + HKEY_CURRENT_USER\Software\Python\ExampleCorp\6C465E66 + +If a string value named ``DisplayName`` exists, it should be used to identify +the environment to users. Otherwise, the name of the key should be used. + +If a string value named ``SupportUrl`` exists, it may be displayed or otherwise +used to direct users to a web site related to the environment. + +If a string value named ``Version`` exists, it should be used to identify the +version of the environment. This is independent from the version of Python +implemented by the environment. + +If a string value named ``SysVersion`` exists, it must be in ``x.y`` or +``x.y.z`` format matching the version returned by ``sys.version_info`` in the +interpreter. Otherwise, if the Tag matches this format it is used. If not, the +Python version is unknown. + +Note that each of these values is recommended, but optional. A complete example +may look like this:: + + HKEY_CURRENT_USER\Software\Python\ExampleCorp\6C465E66 + (Default) = (value not set) + DisplayName = "Distro 3" + SupportUrl = "http://www.example.com/distro-3" + Version = "3.0.12345.0" + SysVersion = "3.6.0" + +InstallPath +----------- + +Beneath the environment key, an ``InstallPath`` key must be created. This key is +always named ``InstallPath``, and the default value must match ``sys.prefix``:: + + HKEY_CURRENT_USER\Software\Python\ExampleCorp\3.6\InstallPath + (Default) = "C:\ExampleCorpPy36" + +If a string value named ``ExecutablePath`` exists, it must be a path to the +``python.exe`` (or equivalent) executable. Otherwise, the interpreter executable +is assumed to be called ``python.exe`` and exist in the directory referenced by +the default value. + +If a string value named ``WindowedExecutablePath`` exists, it must be a path to +the ``pythonw.exe`` (or equivalent) executable. Otherwise, the windowed +interpreter executable is assumed to be called ``pythonw.exe`` and exist in the +directory referenced by the default value. + +A complete example may look like:: + + HKEY_CURRENT_USER\Software\Python\ExampleCorp\6C465E66\InstallPath + (Default) = "C:\ExampleDistro30" + ExecutablePath = "C:\ExampleDistro30\ex_python.exe" + WindowedExecutablePath = "C:\ExampleDistro30\ex_pythonw.exe" + +Help +---- + +Beneath the environment key, a ``Help`` key may be created. This key is always +named ``Help`` if present and has no default value. + +Each subkey of ``Help`` specifies a documentation file, tool, or URL associated +with the environment. The subkey may have any name, and the default value is a +string appropriate for passing to ``os.startfile`` or equivalent. + +If a string value named ``DisplayName`` exists, it should be used to identify +the help file to users. Otherwise, the key name should be used. + +A complete example may look like:: + + HKEY_CURRENT_USER\Software\Python\ExampleCorp\6C465E66\Help + Python\ + (Default) = "C:\ExampleDistro30\python36.chm" + DisplayName = "Python Documentation" + Extras\ + (Default) = "http://www.example.com/tutorial" + DisplayName = "Example Distro Online Tutorial" + +Other Keys +---------- + +Some other registry keys are used for defining or inferring search paths under +certain conditions. A third-party installation is permitted to define these keys +under their Company-Tag key, however, the interpreter must be modified and +rebuilt in order to read these values. Alternatively, the interpreter may be +modified to not use any registry keys for determining search paths. Making such +changes is a decision for the third party; this PEP makes no recommendation +either way. + +Copyright +========= + This document has been placed in the public domain. \ No newline at end of file -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 3 06:52:34 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 03 May 2016 10:52:34 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Issue_=2326921=3A_Fixed_a/an_?= =?utf-8?q?articles=2E?= Message-ID: <20160503105234.12899.64768.E57359E7@psf.io> https://hg.python.org/peps/rev/d617c7ba4e14 changeset: 6306:d617c7ba4e14 user: Serhiy Storchaka date: Tue May 03 13:52:22 2016 +0300 summary: Issue #26921: Fixed a/an articles. files: pep-0203.txt | 2 +- pep-0207.txt | 2 +- pep-0227.txt | 2 +- pep-0228.txt | 2 +- pep-0234.txt | 2 +- pep-0275.txt | 2 +- pep-0289.txt | 2 +- pep-0319.txt | 2 +- pep-0330.txt | 6 +++--- pep-0369.txt | 2 +- pep-0370.txt | 2 +- pep-0371.txt | 2 +- pep-0372.txt | 4 ++-- pep-0376.txt | 2 +- pep-0382.txt | 2 +- pep-0393.txt | 2 +- pep-0400.txt | 2 +- pep-0410.txt | 4 ++-- pep-0418.txt | 4 ++-- pep-0433.txt | 4 ++-- pep-0434.txt | 4 ++-- pep-0447.txt | 2 +- pep-0454.txt | 2 +- pep-0455.txt | 2 +- pep-0474.txt | 2 +- pep-0485.txt | 4 ++-- pep-0501.txt | 2 +- pep-0506.txt | 2 +- pep-0509.txt | 4 ++-- pep-0510.txt | 2 +- pep-0516.txt | 2 +- pep-0754.txt | 2 +- pep-3131.txt | 2 +- pep-3133.txt | 2 +- pep-3136.txt | 2 +- pep-3146.txt | 2 +- pep-3153.txt | 2 +- pep-3154.txt | 4 ++-- 38 files changed, 48 insertions(+), 48 deletions(-) diff --git a/pep-0203.txt b/pep-0203.txt --- a/pep-0203.txt +++ b/pep-0203.txt @@ -146,7 +146,7 @@ Adding augmented assignment will make Python's syntax more complex. Instead of a single assignment operation, there are now twelve - assignment operations, eleven of which also perform an binary + assignment operations, eleven of which also perform a binary operation. However, these eleven new forms of assignment are easy to understand as the coupling between assignment and the binary operation, and they require no large conceptual leap to diff --git a/pep-0207.txt b/pep-0207.txt --- a/pep-0207.txt +++ b/pep-0207.txt @@ -242,7 +242,7 @@ argument to the comparison function is less than the right one, +1 indicating the contrapositive, and 0 indicating that the two objects are equal. While this mechanism allows the establishment - of a order relationship (e.g. for use by the sort() method of list + of an order relationship (e.g. for use by the sort() method of list objects), it has proven to be limited in the context of Numeric Python (NumPy). diff --git a/pep-0227.txt b/pep-0227.txt --- a/pep-0227.txt +++ b/pep-0227.txt @@ -12,7 +12,7 @@ Abstract This PEP describes the addition of statically nested scoping - (lexical scoping) for Python 2.2, and as an source level option + (lexical scoping) for Python 2.2, and as a source level option for python 2.1. In addition, Python 2.1 will issue warnings about constructs whose meaning may change when this feature is enabled. diff --git a/pep-0228.txt b/pep-0228.txt --- a/pep-0228.txt +++ b/pep-0228.txt @@ -35,7 +35,7 @@ the fact that integer division returns the floor of the division. This makes it hard to program correctly, requiring casts to float() in various parts through the code. Python's numerical - model stems from C, while an model that might be easier to work with + model stems from C, while a model that might be easier to work with can be based on the mathematical understanding of numbers. diff --git a/pep-0234.txt b/pep-0234.txt --- a/pep-0234.txt +++ b/pep-0234.txt @@ -377,7 +377,7 @@ - Using the same name for two different operations (getting an iterator from an object and making an iterator for a function - with an sentinel value) is somewhat ugly. I haven't seen a + with a sentinel value) is somewhat ugly. I haven't seen a better name for the second operation though, and since they both return an iterator, it's easy to remember. diff --git a/pep-0275.txt b/pep-0275.txt --- a/pep-0275.txt +++ b/pep-0275.txt @@ -68,7 +68,7 @@ 1. Adding an optimization to the Python compiler and VM which detects the above if-elif-else construct and - generates special opcodes for it which use an read-only + generates special opcodes for it which use a read-only dictionary for storing jump offsets. 2. Adding new syntax to Python which mimics the C style diff --git a/pep-0289.txt b/pep-0289.txt --- a/pep-0289.txt +++ b/pep-0289.txt @@ -66,7 +66,7 @@ dotproduct = sum(x*y for x,y in itertools.izip(x_vector, y_vector)) Having a syntax similar to list comprehensions also makes it easy to -convert existing code into an generator expression when scaling up +convert existing code into a generator expression when scaling up application. Early timings showed that generators had a significant performance diff --git a/pep-0319.txt b/pep-0319.txt --- a/pep-0319.txt +++ b/pep-0319.txt @@ -349,7 +349,7 @@ unlocked during a synchronized block. During an unqualified synchronized block (the use of the - `synchronize' keyword without an target argument) a lock could be + `synchronize' keyword without a target argument) a lock could be created and associated with the synchronized code block object. Any threads that are to execute the block must first acquire the code block lock. diff --git a/pep-0330.txt b/pep-0330.txt --- a/pep-0330.txt +++ b/pep-0330.txt @@ -123,10 +123,10 @@ boundaries and must fall on an instruction, never between an instruction and its operands. - 2. The operand of a LOAD_* instruction must be an valid index into + 2. The operand of a LOAD_* instruction must be a valid index into its corresponding data structure. - 3. The operand of a STORE_* instruction must be an valid index + 3. The operand of a STORE_* instruction must be a valid index into its corresponding data structure. @@ -149,7 +149,7 @@ Implementation - This PEP is the working document for an Python bytecode + This PEP is the working document for a Python bytecode verification implementation written in Python. This implementation is not used implicitly by the PVM before executing any bytecode, but is to be used explicitly by users concerned diff --git a/pep-0369.txt b/pep-0369.txt --- a/pep-0369.txt +++ b/pep-0369.txt @@ -166,7 +166,7 @@ ``PyObject* PyImport_NotifyLoadedByModule(PyObject *module)`` Notify the post import system that a module was requested. Returns the a borrowed reference to the same module object or NULL if an error has - occured. The function calls only the hooks for the module itself an not + occured. The function calls only the hooks for the module itself and not its parents. The function must be called with the import lock acquired. ``PyObject* PyImport_NotifyLoadedByName(const char *name)`` diff --git a/pep-0370.txt b/pep-0370.txt --- a/pep-0370.txt +++ b/pep-0370.txt @@ -174,7 +174,7 @@ ``distutils.sysconfig`` will get methods to access the private variables of site. (not yet implemented) -The Windows updater needs to be updated, too. It should create an menu +The Windows updater needs to be updated, too. It should create a menu item which opens the user site directory in a new explorer windows. diff --git a/pep-0371.txt b/pep-0371.txt --- a/pep-0371.txt +++ b/pep-0371.txt @@ -149,7 +149,7 @@ picking the best run of that 100 iterations via the timeit module. First, to identify the overhead of the spawning of the workers, we - execute an function which is simply a pass statement (empty): + execute a function which is simply a pass statement (empty): cmd: python run_benchmarks.py empty_func.py Importing empty_func diff --git a/pep-0372.txt b/pep-0372.txt --- a/pep-0372.txt +++ b/pep-0372.txt @@ -176,7 +176,7 @@ the order of key insertion. The only sequence-like addition is support for ``reversed``. - An further advantage of not allowing indexing is that it leaves open + A further advantage of not allowing indexing is that it leaves open the possibility of a fast C implementation using linked lists. Does OrderedDict support alternate sort orders such as alphabetical? @@ -235,7 +235,7 @@ insensitive comparison is used. This allows ordered dictionaries to be substituted anywhere regular dictionaries are used. -How __repr__ format will maintain order during an repr/eval round-trip? +How __repr__ format will maintain order during a repr/eval round-trip? OrderedDict([('a', 1), ('b', 2)]) diff --git a/pep-0376.txt b/pep-0376.txt --- a/pep-0376.txt +++ b/pep-0376.txt @@ -269,7 +269,7 @@ --------- The `install` command has a new option called `installer`. This option -is the name of the tool used to invoke the installation. It's an normalized +is the name of the tool used to invoke the installation. It's a normalized lower-case string matching `[a-z0-9_\-\.]`. $ python setup.py install --installer=pkg-system diff --git a/pep-0382.txt b/pep-0382.txt --- a/pep-0382.txt +++ b/pep-0382.txt @@ -144,7 +144,7 @@ finder.find_package_portion(fullname) This method will be called in the same manner as find_module, and it -must return an string to be added to the package's ``__path__``. +must return a string to be added to the package's ``__path__``. If the finder doesn't find a portion of the package, it shall return ``None``. Raising ``AttributeError`` from above call will be treated as non-conformance with this PEP, and the exception will be ignored. diff --git a/pep-0393.txt b/pep-0393.txt --- a/pep-0393.txt +++ b/pep-0393.txt @@ -160,7 +160,7 @@ Both parameters must denote the eventual size/range of the strings. In particular, codecs using this API must compute both the number of -characters and the maximum character in advance. An string is +characters and the maximum character in advance. A string is allocated according to the specified size and character range and is null-terminated; the actual characters in it may be uninitialized. diff --git a/pep-0400.txt b/pep-0400.txt --- a/pep-0400.txt +++ b/pep-0400.txt @@ -90,7 +90,7 @@ (e.g. UTF-16). * Each codec has to reimplement its own StreamReader and StreamWriter class, even if it's trivial (just call the encoder/decoder). -* codecs.open(filename, "r") creates a io.TextIOWrapper object. +* codecs.open(filename, "r") creates an io.TextIOWrapper object. * No codec implements an optimized method in StreamReader or StreamWriter based on the specificities of the codec. diff --git a/pep-0410.txt b/pep-0410.txt --- a/pep-0410.txt +++ b/pep-0410.txt @@ -391,7 +391,7 @@ Add a string argument to specify the return type ------------------------------------------------ -Add an string argument to function returning timestamps, example: +Add a string argument to function returning timestamps, example: time.time(format="datetime"). A string is more extensible than a type: it is possible to request a format that has no type, like a tuple of integers. @@ -477,7 +477,7 @@ Because we only need one new type (Decimal), a simple boolean flag can be added. Example: time.time(decimal=True) or time.time(hires=True). -Such flag would require to do an hidden import which is considered as a bad +Such flag would require to do a hidden import which is considered as a bad practice. The boolean argument API was rejected because it is not "pythonic". Changing diff --git a/pep-0418.txt b/pep-0418.txt --- a/pep-0418.txt +++ b/pep-0418.txt @@ -709,7 +709,7 @@ List of hardware clocks ----------------------- -* HPET: An High Precision Event Timer (HPET) chip consists of a 64-bit +* HPET: A High Precision Event Timer (HPET) chip consists of a 64-bit up-counter (main counter) counting at least at 10 MHz and a set of up to 256 comparators (at least 3). Each HPET can have up to 32 timers. HPET can cause around 3 seconds of drift per day. @@ -1502,7 +1502,7 @@ Footnotes ========= -.. [#pseudo] "_time" is an hypothetical module only used for the example. +.. [#pseudo] "_time" is a hypothetical module only used for the example. The time module is implemented in C and so there is no need for such a module. diff --git a/pep-0433.txt b/pep-0433.txt --- a/pep-0433.txt +++ b/pep-0433.txt @@ -41,7 +41,7 @@ ``subprocess.Popen`` is created with ``close_fds=False`` for example). Windows does not have "close-on-exec" flag but an inheritance flag which is just the opposite value. For example, setting close-on-exec flag -means clearing the ``HANDLE_FLAG_INHERIT`` flag of an handle. +means clearing the ``HANDLE_FLAG_INHERIT`` flag of a handle. Status in Python 3.3 @@ -263,7 +263,7 @@ the most convervative option. This option does not solve issues listed in the `Rationale`_ -section, it only provides an helper to fix them. All functions creating +section, it only provides a helper to fix them. All functions creating file descriptors have to be modified to set *cloexec=True* in each module used by an application to fix all these issues. diff --git a/pep-0434.txt b/pep-0434.txt --- a/pep-0434.txt +++ b/pep-0434.txt @@ -65,10 +65,10 @@ allowing more liberal backporting than for other stdlib modules. Python does have many advanced features yet Python is well known for -being a easy computer language for beginners [3]_. A major Python +being an easy computer language for beginners [3]_. A major Python philosophy is "batteries included" which is best demonstrated in Python's standard library with many modules that are not typically -included with other programming languages [4]_. IDLE is a important +included with other programming languages [4]_. IDLE is an important "battery" in the Python toolbox because it allows a beginner to get started quickly without downloading and configuring a third party IDE. IDLE represents a commitment by the Python community to encouage the diff --git a/pep-0447.txt b/pep-0447.txt --- a/pep-0447.txt +++ b/pep-0447.txt @@ -388,7 +388,7 @@ The pybench output below compares an implementation of this PEP with the regular source tree, both based on changeset a5681f50bae2, run on an idle -machine an Core i7 processor running Centos 6.4. +machine and Core i7 processor running Centos 6.4. Even though the machine was idle there were clear differences between runs, I've seen difference in "minimum time" vary from -0.1% to +1.5%, with similar diff --git a/pep-0454.txt b/pep-0454.txt --- a/pep-0454.txt +++ b/pep-0454.txt @@ -77,7 +77,7 @@ implemented in the PySizer project in 2005. PySizer was implemented differently: the traceback was stored in frame objects and some Python types were linked the trace with the name of object type. PySizer patch -on CPython adds a overhead on performances and memory footprint, even if +on CPython adds an overhead on performances and memory footprint, even if the PySizer was not used. tracemalloc attachs a traceback to the underlying layer, to memory blocks, and has no overhead when the module is not tracing memory allocations. diff --git a/pep-0455.txt b/pep-0455.txt --- a/pep-0455.txt +++ b/pep-0455.txt @@ -25,7 +25,7 @@ See the rationale at https://mail.python.org/pipermail/python-dev/2015-May/140003.html -and for a earlier partial review, see +and for an earlier partial review, see https://mail.python.org/pipermail/python-dev/2013-October/129937.html . Rationale diff --git a/pep-0474.txt b/pep-0474.txt --- a/pep-0474.txt +++ b/pep-0474.txt @@ -240,7 +240,7 @@ directly integrate the two by offering online merges. This creates the opportunity to blend the low barrier to entry benefits of the GitHub/BitBucket pull request model with the mentoring and task hand-off benefits of Gerrit -in defining a online code merging model for Kallithea in collaboration with +in defining an online code merging model for Kallithea in collaboration with the upstream Kallithea developers. diff --git a/pep-0485.txt b/pep-0485.txt --- a/pep-0485.txt +++ b/pep-0485.txt @@ -27,7 +27,7 @@ their being unable to exactly represent some values, and for errors to accumulate with repeated computation. As a result, it is common advice to only use an equality comparison in very specific situations. -Often a inequality comparison fits the bill, but there are times +Often an inequality comparison fits the bill, but there are times (often in testing) where the programmer wants to determine whether a computed value is "close" to an expected value, without requiring them to be exactly equal. This is common enough, particularly in testing, @@ -88,7 +88,7 @@ which assures that the two values are the same within about 9 decimal digits. ``rel_tol`` must be greater than 0.0 -``abs_tol``: is an minimum absolute tolerance level -- useful for +``abs_tol``: is a minimum absolute tolerance level -- useful for comparisons near zero. Modulo error checking, etc, the function will return the result of:: diff --git a/pep-0501.txt b/pep-0501.txt --- a/pep-0501.txt +++ b/pep-0501.txt @@ -201,7 +201,7 @@ field values and format specifiers include variable substitution expressions. The raw template is just the interpolation template as a string. By default, -it is used to provide an human readable representation for the interpolation +it is used to provide a human readable representation for the interpolation template. The parsed template consists of a tuple of 2-tuples, with each 2-tuple diff --git a/pep-0506.txt b/pep-0506.txt --- a/pep-0506.txt +++ b/pep-0506.txt @@ -253,7 +253,7 @@ def openssl_random_pseudo_bytes(length:int)->Tuple[str, bool] This function returns a pseudo-random string of bytes of the given - length, and an boolean flag giving whether the string is considered + length, and a boolean flag giving whether the string is considered cryptographically strong. The PHP manual suggests that returning anything but True should be rare except for old or broken platforms. diff --git a/pep-0509.txt b/pep-0509.txt --- a/pep-0509.txt +++ b/pep-0509.txt @@ -65,7 +65,7 @@ ============= Pseudo-code of a fast guard to check if a dictionary entry was modified -(created, updated or deleted) using an hypothetical +(created, updated or deleted) using a hypothetical ``dict_get_version(dict)`` function:: UNSET = object() @@ -227,7 +227,7 @@ The version increase must be atomic. In CPython, the Global Interpreter Lock (GIL) already protects ``dict`` methods to make changes atomic. -Example using an hypothetical ``dict_get_version(dict)`` function:: +Example using a hypothetical ``dict_get_version(dict)`` function:: >>> d = {} >>> dict_get_version(d) diff --git a/pep-0510.txt b/pep-0510.txt --- a/pep-0510.txt +++ b/pep-0510.txt @@ -114,7 +114,7 @@ Hypothetical myoptimizer module ------------------------------- -Examples in this PEP uses an hypothetical ``myoptimizer`` module which +Examples in this PEP uses a hypothetical ``myoptimizer`` module which provides the following functions and types: * ``specialize(func, code, guards)``: add the specialized code `code` diff --git a/pep-0516.txt b/pep-0516.txt --- a/pep-0516.txt +++ b/pep-0516.txt @@ -357,7 +357,7 @@ ========= This PEP started with a long mailing list thread on distutils-sig [#thread]_. -Subsequent to that a online meeting was held to debug all the positions folk +Subsequent to that an online meeting was held to debug all the positions folk had. Minutes from that were posted to the list [#minutes]_. This specification is a translation of the consensus reached there into PEP diff --git a/pep-0754.txt b/pep-0754.txt --- a/pep-0754.txt +++ b/pep-0754.txt @@ -146,7 +146,7 @@ Determine if the argument is a IEEE 754 negative infinity value. isFinite(value) - Determine if the argument is an finite IEEE 754 value (i.e., is + Determine if the argument is a finite IEEE 754 value (i.e., is not NaN, positive, or negative infinity). isInf(value) diff --git a/pep-3131.txt b/pep-3131.txt --- a/pep-3131.txt +++ b/pep-3131.txt @@ -208,7 +208,7 @@ subtly/unknowingly wrong; rarely wrong is worse than obviously wrong. 2. Better to raise a warning than to fail silently when encountering - an probably unexpected situation. + a probably unexpected situation. 3. All of current usage is ASCII-only; the vast majority of future usage will be ASCII-only. diff --git a/pep-3133.txt b/pep-3133.txt --- a/pep-3133.txt +++ b/pep-3133.txt @@ -306,7 +306,7 @@ discussion and deliberation, a compromise and a delegation of responsibilities and use-cases has been worked out as follows: -* Roles provide a way of indicating a object's semantics and abstract +* Roles provide a way of indicating an object's semantics and abstract capabilities. A role may define abstract methods, but only as a way of delineating an interface through which a particular set of semantics are accessed. An ``Ordering`` role might require that diff --git a/pep-3136.txt b/pep-3136.txt --- a/pep-3136.txt +++ b/pep-3136.txt @@ -359,7 +359,7 @@ Rather than embellishing for and while loop syntax with labels, the programmer wishing to use labeled breaks would be required to create -the iterator explicitly and assign it to a identifier if he or she +the iterator explicitly and assign it to an identifier if he or she wanted to ``break`` out of or ``continue`` that loop from within a deeper loop. diff --git a/pep-3146.txt b/pep-3146.txt --- a/pep-3146.txt +++ b/pep-3146.txt @@ -1032,7 +1032,7 @@ There is a chance that we will not be able to reduce memory usage or startup time to a level satisfactory to the CPython community. Our primary contingency -plan for this situation is to shift from a online just-in-time compilation +plan for this situation is to shift from an online just-in-time compilation strategy to an offline ahead-of-time strategy using an instrumented CPython interpreter loop to obtain feedback. This is the same model used by gcc's feedback-directed optimizations (`-fprofile-generate`) [#gcc-fdo]_ and diff --git a/pep-3153.txt b/pep-3153.txt --- a/pep-3153.txt +++ b/pep-3153.txt @@ -16,7 +16,7 @@ This PEP describes an abstraction of asynchronous IO for the Python standard library. -The goal is to reach a abstraction that can be implemented by many +The goal is to reach an abstraction that can be implemented by many different asynchronous IO backends and provides a target for library developers to write code portable between those different backends. diff --git a/pep-3154.txt b/pep-3154.txt --- a/pep-3154.txt +++ b/pep-3154.txt @@ -172,11 +172,11 @@ * ``SHORT_BINUNICODE``: push a utf8-encoded str object with a one-byte size prefix (therefore less than 256 bytes long). -* ``BINUNICODE8``: push a utf8-encoded str object with a eight-byte +* ``BINUNICODE8``: push a utf8-encoded str object with an eight-byte size prefix (for strings longer than 2**32 bytes, which therefore cannot be serialized using ``BINUNICODE``). -* ``BINBYTES8``: push a bytes object with a eight-byte size prefix +* ``BINBYTES8``: push a bytes object with an eight-byte size prefix (for bytes objects longer than 2**32 bytes, which therefore cannot be serialized using ``BINBYTES``). -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 3 07:11:05 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 03 May 2016 11:11:05 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Backed_out_changeset=3A_c4aef?= =?utf-8?q?26d128b?= Message-ID: <20160503111100.12168.50282.CEADA460@psf.io> https://hg.python.org/peps/rev/4e2a90d0a496 changeset: 6307:4e2a90d0a496 user: Serhiy Storchaka date: Tue May 03 14:10:04 2016 +0300 summary: Backed out changeset: c4aef26d128b Unknown interpreted text role "kbd". files: pep-0008.txt | 2 +- pep-0352.txt | 2 +- pep-0475.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pep-0008.txt b/pep-0008.txt --- a/pep-0008.txt +++ b/pep-0008.txt @@ -1111,7 +1111,7 @@ A bare ``except:`` clause will catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a - program with :kbd:`Control-C`, and can disguise other problems. If you + program with Control-C, and can disguise other problems. If you want to catch all exceptions that signal program errors, use ``except Exception:`` (bare except is equivalent to ``except BaseException:``). diff --git a/pep-0352.txt b/pep-0352.txt --- a/pep-0352.txt +++ b/pep-0352.txt @@ -134,7 +134,7 @@ propagate up and allow the interpreter to terminate. KeyboardInterrupt has been moved since users typically expect an -application to exit when they press the interrupt key (usually :kbd:`Ctrl-C`). +application to exit when they press the interrupt key (usually Ctrl-C). If people have overly broad ``except`` clauses the expected behaviour does not occur. diff --git a/pep-0475.txt b/pep-0475.txt --- a/pep-0475.txt +++ b/pep-0475.txt @@ -353,7 +353,7 @@ interrupted. ``PyOS_StdioReadline()`` also used ``sigint_event`` when ``fgets()`` -failed to check if :kbd:`Ctrl-C` or :kbd:`Ctrl-Z` was pressed. +failed to check if Ctrl-C or Ctrl-Z was pressed. Links -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 3 13:07:12 2016 From: python-checkins at python.org (kushal.das) Date: Tue, 03 May 2016 17:07:12 +0000 Subject: [Python-checkins] =?utf-8?q?devguide=3A_motivations=3A_Adding_mys?= =?utf-8?q?elf?= Message-ID: <20160503170702.21831.73559.19AB3B4F@psf.io> https://hg.python.org/devguide/rev/1e58a0e723f0 changeset: 802:1e58a0e723f0 user: Kushal Das date: Tue May 03 22:33:02 2016 +0530 summary: motivations: Adding myself files: motivations.rst | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/motivations.rst b/motivations.rst --- a/motivations.rst +++ b/motivations.rst @@ -233,3 +233,8 @@ Victor is hacking the development version of CPython to make Python better than ever. +.. topic:: Kushal Das (India) + + * `Personal website `_ + * Red Hat (Fedora Cloud Engineer) + * Python Software Foundation (Fellow) -- Repository URL: https://hg.python.org/devguide From python-checkins at python.org Tue May 3 14:19:06 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 03 May 2016 18:19:06 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2324950=3A_Fixed_expanduser_tests_when_the_users_?= =?utf-8?q?home_directory_in_pwd_is?= Message-ID: <20160503181901.84506.37845.29CE992E@psf.io> https://hg.python.org/cpython/rev/b9b99cb85a5f changeset: 101218:b9b99cb85a5f parent: 101216:63f4fd1ec636 parent: 101217:194b356c84f5 user: Serhiy Storchaka date: Tue May 03 21:17:52 2016 +0300 summary: Issue #24950: Fixed expanduser tests when the users home directory in pwd is "/". Based on patch by SilentGhost. files: Lib/test/test_pathlib.py | 2 +- Lib/test/test_posixpath.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -2062,7 +2062,7 @@ import pwd pwdent = pwd.getpwuid(os.getuid()) username = pwdent.pw_name - userhome = pwdent.pw_dir.rstrip('/') + userhome = pwdent.pw_dir.rstrip('/') or '/' # find arbitrary different user (if exists) for pwdent in pwd.getpwall(): othername = pwdent.pw_name diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -214,6 +214,13 @@ def test_expanduser(self): self.assertEqual(posixpath.expanduser("foo"), "foo") self.assertEqual(posixpath.expanduser(b"foo"), b"foo") + with support.EnvironmentVarGuard() as env: + for home in '/', '', '//', '///': + with self.subTest(home=home): + env['HOME'] = home + self.assertEqual(posixpath.expanduser("~"), "/") + self.assertEqual(posixpath.expanduser("~/"), "/") + self.assertEqual(posixpath.expanduser("~/foo"), "/foo") try: import pwd except ImportError: @@ -237,14 +244,12 @@ self.assertIsInstance(posixpath.expanduser(b"~foo/"), bytes) with support.EnvironmentVarGuard() as env: - env['HOME'] = '/' - self.assertEqual(posixpath.expanduser("~"), "/") - self.assertEqual(posixpath.expanduser("~/foo"), "/foo") # expanduser should fall back to using the password database del env['HOME'] home = pwd.getpwuid(os.getuid()).pw_dir # $HOME can end with a trailing /, so strip it (see #17809) - self.assertEqual(posixpath.expanduser("~"), home.rstrip("/")) + home = home.rstrip("/") or '/' + self.assertEqual(posixpath.expanduser("~"), home) def test_normpath(self): self.assertEqual(posixpath.normpath(""), ".") -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 3 14:19:51 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 03 May 2016 18:19:51 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI0OTUw?= =?utf-8?q?=3A_Fixed_expanduser_tests_when_the_users_home_directory_in_pwd?= =?utf-8?q?_is?= Message-ID: <20160503181900.3400.75066.A236C26C@psf.io> https://hg.python.org/cpython/rev/194b356c84f5 changeset: 101217:194b356c84f5 branch: 3.5 parent: 101215:5ef3eda91051 user: Serhiy Storchaka date: Tue May 03 21:17:03 2016 +0300 summary: Issue #24950: Fixed expanduser tests when the users home directory in pwd is "/". Based on patch by SilentGhost. files: Lib/test/test_pathlib.py | 2 +- Lib/test/test_posixpath.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -2062,7 +2062,7 @@ import pwd pwdent = pwd.getpwuid(os.getuid()) username = pwdent.pw_name - userhome = pwdent.pw_dir.rstrip('/') + userhome = pwdent.pw_dir.rstrip('/') or '/' # find arbitrary different user (if exists) for pwdent in pwd.getpwall(): othername = pwdent.pw_name diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -216,6 +216,13 @@ def test_expanduser(self): self.assertEqual(posixpath.expanduser("foo"), "foo") self.assertEqual(posixpath.expanduser(b"foo"), b"foo") + with support.EnvironmentVarGuard() as env: + for home in '/', '', '//', '///': + with self.subTest(home=home): + env['HOME'] = home + self.assertEqual(posixpath.expanduser("~"), "/") + self.assertEqual(posixpath.expanduser("~/"), "/") + self.assertEqual(posixpath.expanduser("~/foo"), "/foo") try: import pwd except ImportError: @@ -239,14 +246,12 @@ self.assertIsInstance(posixpath.expanduser(b"~foo/"), bytes) with support.EnvironmentVarGuard() as env: - env['HOME'] = '/' - self.assertEqual(posixpath.expanduser("~"), "/") - self.assertEqual(posixpath.expanduser("~/foo"), "/foo") # expanduser should fall back to using the password database del env['HOME'] home = pwd.getpwuid(os.getuid()).pw_dir # $HOME can end with a trailing /, so strip it (see #17809) - self.assertEqual(posixpath.expanduser("~"), home.rstrip("/")) + home = home.rstrip("/") or '/' + self.assertEqual(posixpath.expanduser("~"), home) def test_normpath(self): self.assertEqual(posixpath.normpath(""), ".") -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 3 15:15:57 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 03 May 2016 19:15:57 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Backported_tes?= =?utf-8?q?t_for_posixpath=2Eexpanduser=28=29=2E?= Message-ID: <20160503191553.100784.65428.4D21D41A@psf.io> https://hg.python.org/cpython/rev/e07e2b8c9429 changeset: 101219:e07e2b8c9429 branch: 2.7 parent: 101214:21d18f09822b user: Serhiy Storchaka date: Tue May 03 22:15:29 2016 +0300 summary: Backported test for posixpath.expanduser(). files: Lib/test/test_posixpath.py | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -198,6 +198,12 @@ def test_expanduser(self): self.assertEqual(posixpath.expanduser("foo"), "foo") + with test_support.EnvironmentVarGuard() as env: + for home in '/', '', '//', '///': + env['HOME'] = home + self.assertEqual(posixpath.expanduser("~"), "/") + self.assertEqual(posixpath.expanduser("~/"), "/") + self.assertEqual(posixpath.expanduser("~/foo"), "/foo") try: import pwd except ImportError: @@ -214,9 +220,12 @@ self.assertIsInstance(posixpath.expanduser("~foo/"), basestring) with test_support.EnvironmentVarGuard() as env: - env['HOME'] = '/' - self.assertEqual(posixpath.expanduser("~"), "/") - self.assertEqual(posixpath.expanduser("~/foo"), "/foo") + # expanduser should fall back to using the password database + del env['HOME'] + home = pwd.getpwuid(os.getuid()).pw_dir + # $HOME can end with a trailing /, so strip it (see #17809) + home = home.rstrip("/") or '/' + self.assertEqual(posixpath.expanduser("~"), home) def test_normpath(self): self.assertEqual(posixpath.normpath(""), ".") -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 02:45:18 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 04 May 2016 06:45:18 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326932=3A_Fixed_su?= =?utf-8?q?pport_of_RTLD=5F*_constants_defined_as_enum_values=2C?= Message-ID: <20160504064518.13894.44787.CF8D0C53@psf.io> https://hg.python.org/cpython/rev/811ccdee6f87 changeset: 101220:811ccdee6f87 parent: 101218:b9b99cb85a5f user: Serhiy Storchaka date: Wed May 04 09:44:44 2016 +0300 summary: Issue #26932: Fixed support of RTLD_* constants defined as enum values, not via macros (in particular on Android). Patch by Chi Hsuan Yen. files: Misc/NEWS | 3 + Modules/_ctypes/_ctypes.c | 4 +- Modules/_ctypes/callproc.c | 2 +- Modules/posixmodule.c | 14 ++-- Python/pystate.c | 4 +- configure | 79 ++++++++++++++++++++++++++ configure.ac | 2 + pyconfig.h.in | 28 +++++++++ 8 files changed, 124 insertions(+), 12 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1045,6 +1045,9 @@ Build ----- +- Issue #26932: Fixed support of RTLD_* constants defined as enum values, + not via macros (in particular on Android). Patch by Chi Hsuan Yen. + - Issue #22359: Disable the rules for running _freeze_importlib and pgen when cross-compiling. The output of these programs is normally saved with the source code anyway, and is still regenerated when doing a native build. diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -5480,14 +5480,14 @@ #endif /* If RTLD_LOCAL is not defined (Windows!), set it to zero. */ -#ifndef RTLD_LOCAL +#if !HAVE_DECL_RTLD_LOCAL #define RTLD_LOCAL 0 #endif /* If RTLD_GLOBAL is not defined (cygwin), set it to the same value as RTLD_LOCAL. */ -#ifndef RTLD_GLOBAL +#if !HAVE_DECL_RTLD_GLOBAL #define RTLD_GLOBAL RTLD_LOCAL #endif diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1307,7 +1307,7 @@ PyObject *name, *name2; char *name_str; void * handle; -#ifdef RTLD_LOCAL +#if HAVE_DECL_RTLD_LOCAL int mode = RTLD_NOW | RTLD_LOCAL; #else /* cygwin doesn't define RTLD_LOCAL */ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -12895,25 +12895,25 @@ if (PyModule_AddIntMacro(m, XATTR_SIZE_MAX)) return -1; #endif -#ifdef RTLD_LAZY +#if HAVE_DECL_RTLD_LAZY if (PyModule_AddIntMacro(m, RTLD_LAZY)) return -1; #endif -#ifdef RTLD_NOW +#if HAVE_DECL_RTLD_NOW if (PyModule_AddIntMacro(m, RTLD_NOW)) return -1; #endif -#ifdef RTLD_GLOBAL +#if HAVE_DECL_RTLD_GLOBAL if (PyModule_AddIntMacro(m, RTLD_GLOBAL)) return -1; #endif -#ifdef RTLD_LOCAL +#if HAVE_DECL_RTLD_LOCAL if (PyModule_AddIntMacro(m, RTLD_LOCAL)) return -1; #endif -#ifdef RTLD_NODELETE +#if HAVE_DECL_RTLD_NODELETE if (PyModule_AddIntMacro(m, RTLD_NODELETE)) return -1; #endif -#ifdef RTLD_NOLOAD +#if HAVE_DECL_RTLD_NOLOAD if (PyModule_AddIntMacro(m, RTLD_NOLOAD)) return -1; #endif -#ifdef RTLD_DEEPBIND +#if HAVE_DECL_RTLD_DEEPBIND if (PyModule_AddIntMacro(m, RTLD_DEEPBIND)) return -1; #endif diff --git a/Python/pystate.c b/Python/pystate.c --- a/Python/pystate.c +++ b/Python/pystate.c @@ -25,7 +25,7 @@ #ifdef HAVE_DLFCN_H #include #endif -#ifndef RTLD_LAZY +#if !HAVE_DECL_RTLD_LAZY #define RTLD_LAZY 1 #endif #endif @@ -91,7 +91,7 @@ interp->fscodec_initialized = 0; interp->importlib = NULL; #ifdef HAVE_DLOPEN -#ifdef RTLD_NOW +#if HAVE_DECL_RTLD_NOW interp->dlopenflags = RTLD_NOW; #else interp->dlopenflags = RTLD_LAZY; diff --git a/configure b/configure --- a/configure +++ b/configure @@ -14255,6 +14255,85 @@ fi +ac_fn_c_check_decl "$LINENO" "RTLD_LAZY" "ac_cv_have_decl_RTLD_LAZY" "#include +" +if test "x$ac_cv_have_decl_RTLD_LAZY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_LAZY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_NOW" "ac_cv_have_decl_RTLD_NOW" "#include +" +if test "x$ac_cv_have_decl_RTLD_NOW" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_NOW $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_GLOBAL" "ac_cv_have_decl_RTLD_GLOBAL" "#include +" +if test "x$ac_cv_have_decl_RTLD_GLOBAL" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_GLOBAL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_LOCAL" "ac_cv_have_decl_RTLD_LOCAL" "#include +" +if test "x$ac_cv_have_decl_RTLD_LOCAL" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_LOCAL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_NODELETE" "ac_cv_have_decl_RTLD_NODELETE" "#include +" +if test "x$ac_cv_have_decl_RTLD_NODELETE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_NODELETE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_NOLOAD" "ac_cv_have_decl_RTLD_NOLOAD" "#include +" +if test "x$ac_cv_have_decl_RTLD_NOLOAD" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_NOLOAD $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "RTLD_DEEPBIND" "ac_cv_have_decl_RTLD_DEEPBIND" "#include +" +if test "x$ac_cv_have_decl_RTLD_DEEPBIND" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_RTLD_DEEPBIND $ac_have_decl +_ACEOF + + # determine what size digit to use for Python's longs { $as_echo "$as_me:${as_lineno-$LINENO}: checking digit size for Python's longs" >&5 $as_echo_n "checking digit size for Python's longs... " >&6; } diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -4342,6 +4342,8 @@ [define to 1 if your sem_getvalue is broken.]) fi +AC_CHECK_DECLS([RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_DEEPBIND], [], [], [[#include ]]) + # determine what size digit to use for Python's longs AC_MSG_CHECKING([digit size for Python's longs]) AC_ARG_ENABLE(big-digits, diff --git a/pyconfig.h.in b/pyconfig.h.in --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -167,6 +167,34 @@ */ #undef HAVE_DECL_ISNAN +/* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you + don't. */ +#undef HAVE_DECL_RTLD_DEEPBIND + +/* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you + don't. */ +#undef HAVE_DECL_RTLD_GLOBAL + +/* Define to 1 if you have the declaration of `RTLD_LAZY', and to 0 if you + don't. */ +#undef HAVE_DECL_RTLD_LAZY + +/* Define to 1 if you have the declaration of `RTLD_LOCAL', and to 0 if you + don't. */ +#undef HAVE_DECL_RTLD_LOCAL + +/* Define to 1 if you have the declaration of `RTLD_NODELETE', and to 0 if you + don't. */ +#undef HAVE_DECL_RTLD_NODELETE + +/* Define to 1 if you have the declaration of `RTLD_NOLOAD', and to 0 if you + don't. */ +#undef HAVE_DECL_RTLD_NOLOAD + +/* Define to 1 if you have the declaration of `RTLD_NOW', and to 0 if you + don't. */ +#undef HAVE_DECL_RTLD_NOW + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 04:28:35 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 04 May 2016 08:28:35 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2ODcz?= =?utf-8?q?=3A_xmlrpc_now_raises_ResponseError_on_unsupported_type_tags?= Message-ID: <20160504082834.1512.70370.66DC8428@psf.io> https://hg.python.org/cpython/rev/0d015f6aba8b changeset: 101221:0d015f6aba8b branch: 3.5 parent: 101217:194b356c84f5 user: Serhiy Storchaka date: Wed May 04 11:26:42 2016 +0300 summary: Issue #26873: xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result. files: Lib/test/test_xmlrpc.py | 14 ++++++++++++++ Lib/xmlrpc/client.py | 3 +++ Misc/NEWS | 3 +++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -224,6 +224,20 @@ self.assertIs(type(newvalue), xmlrpclib.Binary) self.assertIsNone(m) + def test_loads_unsupported(self): + ResponseError = xmlrpclib.ResponseError + data = '' + self.assertRaises(ResponseError, xmlrpclib.loads, data) + data = ('' + '' + '') + self.assertRaises(ResponseError, xmlrpclib.loads, data) + data = ('' + 'a' + 'b' + '') + self.assertRaises(ResponseError, xmlrpclib.loads, data) + def test_get_host_info(self): # see bug #3613, this raised a TypeError transp = xmlrpc.client.Transport() diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -640,6 +640,7 @@ self._stack = [] self._marks = [] self._data = [] + self._value = False self._methodname = None self._encoding = "utf-8" self.append = self._stack.append @@ -669,6 +670,8 @@ if tag == "array" or tag == "struct": self._marks.append(len(self._stack)) self._data = [] + if self._value and tag not in self.dispatch: + raise ResponseError("unknown tag %r" % tag) self._value = (tag == "value") def data(self, text): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -107,6 +107,9 @@ Library ------- +- Issue #26873: xmlrpc now raises ResponseError on unsupported type tags + instead of silently return incorrect result. + - Issue #26711: Fixed the comparison of plistlib.Data with other types. - Issue #24114: Fix an uninitialized variable in `ctypes.util`. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 04:28:35 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 04 May 2016 08:28:35 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326873=3A_xmlrpc_now_raises_ResponseError_on_uns?= =?utf-8?q?upported_type_tags?= Message-ID: <20160504082834.7003.38303.984DE04B@psf.io> https://hg.python.org/cpython/rev/8f7cb3b171f3 changeset: 101222:8f7cb3b171f3 parent: 101220:811ccdee6f87 parent: 101221:0d015f6aba8b user: Serhiy Storchaka date: Wed May 04 11:27:17 2016 +0300 summary: Issue #26873: xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result. files: Lib/test/test_xmlrpc.py | 14 ++++++++++++++ Lib/xmlrpc/client.py | 3 +++ Misc/NEWS | 3 +++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -223,6 +223,20 @@ self.assertIs(type(newvalue), xmlrpclib.Binary) self.assertIsNone(m) + def test_loads_unsupported(self): + ResponseError = xmlrpclib.ResponseError + data = '' + self.assertRaises(ResponseError, xmlrpclib.loads, data) + data = ('' + '' + '') + self.assertRaises(ResponseError, xmlrpclib.loads, data) + data = ('' + 'a' + 'b' + '') + self.assertRaises(ResponseError, xmlrpclib.loads, data) + def test_get_host_info(self): # see bug #3613, this raised a TypeError transp = xmlrpc.client.Transport() diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -640,6 +640,7 @@ self._stack = [] self._marks = [] self._data = [] + self._value = False self._methodname = None self._encoding = "utf-8" self.append = self._stack.append @@ -669,6 +670,8 @@ if tag == "array" or tag == "struct": self._marks.append(len(self._stack)) self._data = [] + if self._value and tag not in self.dispatch: + raise ResponseError("unknown tag %r" % tag) self._value = (tag == "value") def data(self, text): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -256,6 +256,9 @@ Library ------- +- Issue #26873: xmlrpc now raises ResponseError on unsupported type tags + instead of silently return incorrect result. + - Issue #26711: Fixed the comparison of plistlib.Data with other types. - Issue #24114: Fix an uninitialized variable in `ctypes.util`. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 04:28:45 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 04 May 2016 08:28:45 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2ODcz?= =?utf-8?q?=3A_xmlrpclib_now_raises_ResponseError_on_unsupported_type_tags?= Message-ID: <20160504082835.49941.14093.D9AD7F7C@psf.io> https://hg.python.org/cpython/rev/7050c9fc1f72 changeset: 101223:7050c9fc1f72 branch: 2.7 parent: 101219:e07e2b8c9429 user: Serhiy Storchaka date: Wed May 04 11:28:09 2016 +0300 summary: Issue #26873: xmlrpclib now raises ResponseError on unsupported type tags instead of silently return incorrect result. files: Lib/test/test_xmlrpc.py | 14 ++++++++++++++ Lib/xmlrpclib.py | 3 +++ Misc/NEWS | 3 +++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -208,6 +208,20 @@ self.assertEqual(s, "abc \xc2\x95") self.assertEqual(items, [("def \xc2\x96", "ghi \xc2\x97")]) + def test_loads_unsupported(self): + ResponseError = xmlrpclib.ResponseError + data = '' + self.assertRaises(ResponseError, xmlrpclib.loads, data) + data = ('' + '' + '') + self.assertRaises(ResponseError, xmlrpclib.loads, data) + data = ('' + 'a' + 'b' + '') + self.assertRaises(ResponseError, xmlrpclib.loads, data) + class HelperTestCase(unittest.TestCase): def test_escape(self): diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py --- a/Lib/xmlrpclib.py +++ b/Lib/xmlrpclib.py @@ -784,6 +784,7 @@ self._stack = [] self._marks = [] self._data = [] + self._value = False self._methodname = None self._encoding = "utf-8" self.append = self._stack.append @@ -814,6 +815,8 @@ if tag == "array" or tag == "struct": self._marks.append(len(self._stack)) self._data = [] + if self._value and tag not in self.dispatch: + raise ResponseError("unknown tag %r" % tag) self._value = (tag == "value") def data(self, text): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -77,6 +77,9 @@ Library ------- +- Issue #26873: xmlrpclib now raises ResponseError on unsupported type tags + instead of silently return incorrect result. + - Issue #24114: Fix an uninitialized variable in `ctypes.util`. The bug only occurs on SunOS when the ctypes implementation searches -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Wed May 4 04:52:41 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 04 May 2016 08:52:41 +0000 Subject: [Python-checkins] Daily reference leaks (b9b99cb85a5f): sum=8 Message-ID: <20160504085240.28489.93789.3612814D@psf.io> results for b9b99cb85a5f on branch "default" -------------------------------------------- test_collections leaked [0, 4, 0] memory blocks, sum=4 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogBPf4o2', '--timeout', '7200'] From python-checkins at python.org Wed May 4 07:13:50 2016 From: python-checkins at python.org (donald.stufft) Date: Wed, 04 May 2016 11:13:50 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Withdraw_PEP_481_in_favor_of_?= =?utf-8?q?PEP_512?= Message-ID: <20160504111226.71101.95321.B8E9AC66@psf.io> https://hg.python.org/peps/rev/83296b026727 changeset: 6308:83296b026727 user: Donald Stufft date: Wed May 04 07:12:23 2016 -0400 summary: Withdraw PEP 481 in favor of PEP 512 files: pep-0481.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/pep-0481.txt b/pep-0481.txt --- a/pep-0481.txt +++ b/pep-0481.txt @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Donald Stufft -Status: Draft +Status: Withdrawn Type: Process Content-Type: text/x-rst Created: 29-Nov-2014 -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Wed May 4 07:17:32 2016 From: python-checkins at python.org (donald.stufft) Date: Wed, 04 May 2016 11:17:32 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Direct_people_from_PEP_481_to?= =?utf-8?q?_PEP_512?= Message-ID: <20160504111556.46286.88977.70AC78EF@psf.io> https://hg.python.org/peps/rev/3d16df35d679 changeset: 6309:3d16df35d679 user: Donald Stufft date: Wed May 04 07:15:53 2016 -0400 summary: Direct people from PEP 481 to PEP 512 files: pep-0481.txt | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/pep-0481.txt b/pep-0481.txt --- a/pep-0481.txt +++ b/pep-0481.txt @@ -13,6 +13,9 @@ Abstract ======== +.. note:: This PEP has been withdrawn, if you're looking for the PEP + documenting the move to Github, please refer to PEP 512. + This PEP proposes migrating the repository hosting of CPython and the supporting repositories to Git and Github. It also proposes adding Phabricator as an alternative to Github Pull Requests to handle reviewing changes. This -- Repository URL: https://hg.python.org/peps From lp_benchmark_robot at intel.com Wed May 4 10:51:17 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Wed, 4 May 2016 15:51:17 +0100 Subject: [Python-checkins] UGLY Benchmark Results for Python Default 2016-05-04 Message-ID: <3af27d45-a9bc-4af2-8901-d379ae594959@irsmsx102.ger.corp.intel.com> Results for project Python default, build date 2016-05-04 13:48:53 +0000 commit: 8f7cb3b171f3 previous commit: aaf2ad84ae1c revision date: 2016-05-04 08:27:17 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.21% 1.13% 10.82% 15.96% :-| pybench 0.26% 0.15% 1.02% 5.52% :-( regex_v8 3.15% -7.52% -11.05% 9.20% :-| nbody 0.12% 0.19% -2.00% 12.26% :-| json_dump_v2 0.30% 0.12% 0.09% 12.79% :-| normal_startup 0.94% 0.30% 0.87% 5.53% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/ugly-benchmark-results-for-python-default-2016-05-04/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Wed May 4 10:51:55 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Wed, 4 May 2016 15:51:55 +0100 Subject: [Python-checkins] NEUTRAL Benchmark Results for Python 2.7 2016-05-04 Message-ID: <7996e57e-f03f-4f12-961f-7b2b3c7208e6@irsmsx102.ger.corp.intel.com> Results for project Python 2.7, build date 2016-05-04 07:36:47 +0000 commit: e07e2b8c9429 previous commit: 5a578ec4b3b3 revision date: 2016-05-03 19:15:29 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.17% -0.93% 5.59% 5.94% :-) pybench 0.11% 0.00% 5.90% 4.57% :-( regex_v8 0.75% -0.27% -2.28% 10.41% :-) nbody 0.14% -0.19% 6.86% 4.47% :-) json_dump_v2 0.54% -0.03% 2.20% 8.89% :-( normal_startup 1.66% -0.02% -5.42% 2.48% :-) ssbench 0.18% -0.04% 2.57% 0.67% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/neutral-benchmark-results-for-python-2-7-2016-05-04/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Wed May 4 11:24:32 2016 From: python-checkins at python.org (guido.van.rossum) Date: Wed, 04 May 2016 15:24:32 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Update_status_of_PEP_438?= Message-ID: <20160504152427.14769.49762.096B838E@psf.io> https://hg.python.org/peps/rev/ef15e4336ba8 changeset: 6310:ef15e4336ba8 user: Guido van Rossum date: Wed May 04 08:22:20 2016 -0700 summary: Update status of PEP 438 files: pep-0438.txt | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/pep-0438.txt b/pep-0438.txt --- a/pep-0438.txt +++ b/pep-0438.txt @@ -5,12 +5,13 @@ Author: Holger Krekel , Carl Meyer BDFL-Delegate: Richard Jones Discussions-To: distutils-sig at python.org -Status: Accepted +Status: Superseded Type: Process Content-Type: text/x-rst Created: 15-Mar-2013 Post-History: 19-May-2013 Resolution: http://mail.python.org/pipermail/distutils-sig/2013-May/020773.html +Superseded-by: 470 Abstract -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Wed May 4 12:01:06 2016 From: python-checkins at python.org (jason.coombs) Date: Wed, 04 May 2016 16:01:06 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2320120=3A_Merge_with_3=2E5?= Message-ID: <20160504160100.5473.54538.FE0CC64F@psf.io> https://hg.python.org/cpython/rev/89116bd505cb changeset: 101225:89116bd505cb parent: 101222:8f7cb3b171f3 parent: 101224:eae59b6bf133 user: Jason R. Coombs date: Wed May 04 12:00:32 2016 -0400 summary: Issue #20120: Merge with 3.5 files: Lib/distutils/config.py | 4 ++-- Misc/NEWS | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py --- a/Lib/distutils/config.py +++ b/Lib/distutils/config.py @@ -4,7 +4,7 @@ that uses .pypirc in the distutils.command package. """ import os -from configparser import ConfigParser +from configparser import RawConfigParser from distutils.cmd import Command @@ -53,7 +53,7 @@ repository = self.repository or self.DEFAULT_REPOSITORY realm = self.realm or self.DEFAULT_REALM - config = ConfigParser() + config = RawConfigParser() config.read(rc) sections = config.sections() if 'distutils' in sections: diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,12 @@ Core and Builtins ----------------- +- Issue #20120: Use RawConfigParser for .pypirc parsing, + removing support for interpolation unintentionally added + with move to Python 3. Behavior no longer does any + interpolation in .pypirc files, matching behavior in Python + 2.7 and Setuptools 19.0. + - Issue #26249: Memory functions of the :c:func:`PyMem_Malloc` domain (:c:data:`PYMEM_DOMAIN_MEM`) now use the :ref:`pymalloc allocator ` rather than system :c:func:`malloc`. Applications calling -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 12:01:54 2016 From: python-checkins at python.org (jason.coombs) Date: Wed, 04 May 2016 16:01:54 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzIwMTIw?= =?utf-8?q?=3A_Use_RawConfigParser_for_=2Epypirc_parsing=2C_removing_suppo?= =?utf-8?q?rt_for?= Message-ID: <20160504160100.53099.42782.53DBC6E4@psf.io> https://hg.python.org/cpython/rev/eae59b6bf133 changeset: 101224:eae59b6bf133 branch: 3.5 parent: 101221:0d015f6aba8b user: Jason R. Coombs date: Wed May 04 11:57:32 2016 -0400 summary: Issue #20120: Use RawConfigParser for .pypirc parsing, removing support for interpolation unintentionally added with move to Python 3. Behavior no longer does any interpolation in .pypirc files, matching behavior in Python 2.7 and Setuptools 19.0. files: Lib/distutils/config.py | 4 ++-- Misc/NEWS | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py --- a/Lib/distutils/config.py +++ b/Lib/distutils/config.py @@ -4,7 +4,7 @@ that uses .pypirc in the distutils.command package. """ import os -from configparser import ConfigParser +from configparser import RawConfigParser from distutils.cmd import Command @@ -53,7 +53,7 @@ repository = self.repository or self.DEFAULT_REPOSITORY realm = self.realm or self.DEFAULT_REALM - config = ConfigParser() + config = RawConfigParser() config.read(rc) sections = config.sections() if 'distutils' in sections: diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,12 @@ Core and Builtins ----------------- +- Issue #20120: Use RawConfigParser for .pypirc parsing, + removing support for interpolation unintentionally added + with move to Python 3. Behavior no longer does any + interpolation in .pypirc files, matching behavior in Python + 2.7 and Setuptools 19.0. + - Issue #26659: Make the builtin slice type support cycle collection. - Issue #26718: super.__init__ no longer leaks memory if called multiple times. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 14:43:39 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 04 May 2016 18:43:39 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2ODEx?= =?utf-8?q?=3A_gc=2Eget=5Fobjects=28=29_no_longer_contains_a_broken_tuple_?= =?utf-8?q?with_NULL?= Message-ID: <20160504184335.15831.71673.9E8C98BA@psf.io> https://hg.python.org/cpython/rev/a98ef122d73d changeset: 101226:a98ef122d73d branch: 3.5 parent: 101224:eae59b6bf133 user: Serhiy Storchaka date: Wed May 04 21:42:05 2016 +0300 summary: Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL pointer. files: Misc/NEWS | 3 +++ Objects/descrobject.c | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL + pointer. + - Issue #20120: Use RawConfigParser for .pypirc parsing, removing support for interpolation unintentionally added with move to Python 3. Behavior no longer does any diff --git a/Objects/descrobject.c b/Objects/descrobject.c --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1386,27 +1386,27 @@ return NULL; } args = cached_args; - if (!args || Py_REFCNT(args) != 1) { - Py_CLEAR(cached_args); - if (!(cached_args = args = PyTuple_New(1))) + cached_args = NULL; + if (!args) { + args = PyTuple_New(1); + if (!args) return NULL; + _PyObject_GC_UNTRACK(args); } - Py_INCREF(args); - assert (Py_REFCNT(args) == 2); Py_INCREF(obj); PyTuple_SET_ITEM(args, 0, obj); ret = PyObject_Call(gs->prop_get, args, NULL); - if (args == cached_args) { - if (Py_REFCNT(args) == 2) { - obj = PyTuple_GET_ITEM(args, 0); - PyTuple_SET_ITEM(args, 0, NULL); - Py_XDECREF(obj); - } - else { - Py_CLEAR(cached_args); - } + if (cached_args == NULL && Py_REFCNT(args) == 1) { + assert(Py_SIZE(args) == 1); + assert(PyTuple_GET_ITEM(args, 0) == obj); + cached_args = args; + Py_DECREF(obj); } - Py_DECREF(args); + else { + assert(Py_REFCNT(args) >= 1); + _PyObject_GC_TRACK(args); + Py_DECREF(args); + } return ret; } -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 14:43:39 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 04 May 2016 18:43:39 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326811=3A_gc=2Eget=5Fobjects=28=29_no_longer_con?= =?utf-8?q?tains_a_broken_tuple_with_NULL?= Message-ID: <20160504184335.15805.26102.B09F785E@psf.io> https://hg.python.org/cpython/rev/3fe1c7ad3b58 changeset: 101227:3fe1c7ad3b58 parent: 101225:89116bd505cb parent: 101226:a98ef122d73d user: Serhiy Storchaka date: Wed May 04 21:42:52 2016 +0300 summary: Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL pointer. files: Misc/NEWS | 3 +++ Objects/descrobject.c | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL + pointer. + - Issue #20120: Use RawConfigParser for .pypirc parsing, removing support for interpolation unintentionally added with move to Python 3. Behavior no longer does any diff --git a/Objects/descrobject.c b/Objects/descrobject.c --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1386,27 +1386,27 @@ return NULL; } args = cached_args; - if (!args || Py_REFCNT(args) != 1) { - Py_CLEAR(cached_args); - if (!(cached_args = args = PyTuple_New(1))) + cached_args = NULL; + if (!args) { + args = PyTuple_New(1); + if (!args) return NULL; + _PyObject_GC_UNTRACK(args); } - Py_INCREF(args); - assert (Py_REFCNT(args) == 2); Py_INCREF(obj); PyTuple_SET_ITEM(args, 0, obj); ret = PyObject_Call(gs->prop_get, args, NULL); - if (args == cached_args) { - if (Py_REFCNT(args) == 2) { - obj = PyTuple_GET_ITEM(args, 0); - PyTuple_SET_ITEM(args, 0, NULL); - Py_XDECREF(obj); - } - else { - Py_CLEAR(cached_args); - } + if (cached_args == NULL && Py_REFCNT(args) == 1) { + assert(Py_SIZE(args) == 1); + assert(PyTuple_GET_ITEM(args, 0) == obj); + cached_args = args; + Py_DECREF(obj); } - Py_DECREF(args); + else { + assert(Py_REFCNT(args) >= 1); + _PyObject_GC_TRACK(args); + Py_DECREF(args); + } return ret; } -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 15:15:18 2016 From: python-checkins at python.org (steven.daprano) Date: Wed, 04 May 2016 19:15:18 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_26002_and_25974?= Message-ID: <20160504184721.49925.27404.DB41F432@psf.io> https://hg.python.org/cpython/rev/7b2fafd78c1d changeset: 101228:7b2fafd78c1d parent: 101225:89116bd505cb user: Steven D'Aprano date: Thu May 05 03:54:29 2016 +1000 summary: Issue 26002 and 25974 patches by Upendra Kumar and Stefan Krah speed up median by using bisect, and general speedup for Decimals using as_integer_ratio files: Lib/statistics.py | 68 +++++++++++------------- Lib/test/test_statistics.py | 31 +++++------ 2 files changed, 44 insertions(+), 55 deletions(-) diff --git a/Lib/statistics.py b/Lib/statistics.py --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -105,6 +105,7 @@ from fractions import Fraction from decimal import Decimal from itertools import groupby +from bisect import bisect_left, bisect_right @@ -223,56 +224,26 @@ # Optimise the common case of floats. We expect that the most often # used numeric type will be builtin floats, so try to make this as # fast as possible. - if type(x) is float: + if type(x) is float or type(x) is Decimal: return x.as_integer_ratio() try: # x may be an int, Fraction, or Integral ABC. return (x.numerator, x.denominator) except AttributeError: try: - # x may be a float subclass. + # x may be a float or Decimal subclass. return x.as_integer_ratio() except AttributeError: - try: - # x may be a Decimal. - return _decimal_to_ratio(x) - except AttributeError: - # Just give up? - pass + # Just give up? + pass except (OverflowError, ValueError): # float NAN or INF. - assert not math.isfinite(x) + assert not _isfinite(x) return (x, None) msg = "can't convert type '{}' to numerator/denominator" raise TypeError(msg.format(type(x).__name__)) -# FIXME This is faster than Fraction.from_decimal, but still too slow. -def _decimal_to_ratio(d): - """Convert Decimal d to exact integer ratio (numerator, denominator). - - >>> from decimal import Decimal - >>> _decimal_to_ratio(Decimal("2.6")) - (26, 10) - - """ - sign, digits, exp = d.as_tuple() - if exp in ('F', 'n', 'N'): # INF, NAN, sNAN - assert not d.is_finite() - return (d, None) - num = 0 - for digit in digits: - num = num*10 + digit - if exp < 0: - den = 10**-exp - else: - num *= 10**exp - den = 1 - if sign: - num = -num - return (num, den) - - def _convert(value, T): """Convert value to given numeric type T.""" if type(value) is T: @@ -305,6 +276,21 @@ return table +def _find_lteq(a, x): + 'Locate the leftmost value exactly equal to x' + i = bisect_left(a, x) + if i != len(a) and a[i] == x: + return i + raise ValueError + + +def _find_rteq(a, l, x): + 'Locate the rightmost value exactly equal to x' + i = bisect_right(a, x, lo=l) + if i != (len(a)+1) and a[i-1] == x: + return i-1 + raise ValueError + # === Measures of central tendency (averages) === def mean(data): @@ -442,9 +428,15 @@ except TypeError: # Mixed type. For now we just coerce to float. L = float(x) - float(interval)/2 - cf = data.index(x) # Number of values below the median interval. - # FIXME The following line could be more efficient for big lists. - f = data.count(x) # Number of data points in the median interval. + + # Uses bisection search to search for x in data with log(n) time complexity + # Find the position of leftmost occurence of x in data + l1 = _find_lteq(data, x) + # Find the position of rightmost occurence of x in data[l1...len(data)] + # Assuming always l1 <= l2 + l2 = _find_rteq(data, l1, x) + cf = l1 + f = l2 - l1 + 1 return L + interval*(n/2 - cf)/f diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py --- a/Lib/test/test_statistics.py +++ b/Lib/test/test_statistics.py @@ -699,13 +699,12 @@ num, den = statistics._exact_ratio(x) self.assertEqual(x, num/den) - @unittest.skipIf(True, "temporarily disabled: see #25928") def test_decimal(self): D = Decimal _exact_ratio = statistics._exact_ratio - self.assertEqual(_exact_ratio(D("0.125")), (125, 1000)) - self.assertEqual(_exact_ratio(D("12.345")), (12345, 1000)) - self.assertEqual(_exact_ratio(D("-1.98")), (-198, 100)) + self.assertEqual(_exact_ratio(D("0.125")), (1, 8)) + self.assertEqual(_exact_ratio(D("12.345")), (2469, 200)) + self.assertEqual(_exact_ratio(D("-1.98")), (-99, 50)) def test_inf(self): INF = float("INF") @@ -731,7 +730,6 @@ self.assertIs(ratio[1], None) self.assertEqual(type(ratio[0]), type(nan)) - @unittest.skipIf(True, "temporarily disabled: see #25928") def test_decimal_nan(self): NAN = Decimal("NAN") sNAN = Decimal("sNAN") @@ -745,18 +743,18 @@ class DecimalToRatioTest(unittest.TestCase): - # Test _decimal_to_ratio private function. + # Test _exact_ratio private function. def test_infinity(self): # Test that INFs are handled correctly. inf = Decimal('INF') - self.assertEqual(statistics._decimal_to_ratio(inf), (inf, None)) - self.assertEqual(statistics._decimal_to_ratio(-inf), (-inf, None)) + self.assertEqual(statistics._exact_ratio(inf), (inf, None)) + self.assertEqual(statistics._exact_ratio(-inf), (-inf, None)) def test_nan(self): # Test that NANs are handled correctly. for nan in (Decimal('NAN'), Decimal('sNAN')): - num, den = statistics._decimal_to_ratio(nan) + num, den = statistics._exact_ratio(nan) # Because NANs always compare non-equal, we cannot use assertEqual. # Nor can we use an identity test, as we don't guarantee anything # about the object identity. @@ -769,30 +767,30 @@ for d in numbers: # First test positive decimals. assert d > 0 - num, den = statistics._decimal_to_ratio(d) + num, den = statistics._exact_ratio(d) self.assertGreaterEqual(num, 0) self.assertGreater(den, 0) # Then test negative decimals. - num, den = statistics._decimal_to_ratio(-d) + num, den = statistics._exact_ratio(-d) self.assertLessEqual(num, 0) self.assertGreater(den, 0) def test_negative_exponent(self): # Test result when the exponent is negative. - t = statistics._decimal_to_ratio(Decimal("0.1234")) - self.assertEqual(t, (1234, 10000)) + t = statistics._exact_ratio(Decimal("0.1234")) + self.assertEqual(t, (617, 5000)) def test_positive_exponent(self): # Test results when the exponent is positive. - t = statistics._decimal_to_ratio(Decimal("1.234e7")) + t = statistics._exact_ratio(Decimal("1.234e7")) self.assertEqual(t, (12340000, 1)) def test_regression_20536(self): # Regression test for issue 20536. # See http://bugs.python.org/issue20536 - t = statistics._decimal_to_ratio(Decimal("1e2")) + t = statistics._exact_ratio(Decimal("1e2")) self.assertEqual(t, (100, 1)) - t = statistics._decimal_to_ratio(Decimal("1.47e5")) + t = statistics._exact_ratio(Decimal("1.47e5")) self.assertEqual(t, (147000, 1)) @@ -1260,7 +1258,6 @@ with decimal.localcontext(decimal.BasicContext): self.assertRaises(decimal.InvalidOperation, statistics._sum, data) - @unittest.skipIf(True, "temporarily disabled: see #25928") def test_decimal_snan_raises(self): # Adding sNAN should raise InvalidOperation. sNAN = Decimal('sNAN') -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 15:15:28 2016 From: python-checkins at python.org (steven.daprano) Date: Wed, 04 May 2016 19:15:28 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_default_-=3E_default?= =?utf-8?q?=29=3A_Automated_merge_with_ssh=3A//hg=2Epython=2Eorg/cpython?= Message-ID: <20160504184722.49919.57967.F9672739@psf.io> https://hg.python.org/cpython/rev/f7d34f271104 changeset: 101229:f7d34f271104 parent: 101227:3fe1c7ad3b58 parent: 101228:7b2fafd78c1d user: Steven D'Aprano date: Thu May 05 04:47:10 2016 +1000 summary: Automated merge with ssh://hg.python.org/cpython files: Lib/statistics.py | 68 +++++++++++------------- Lib/test/test_statistics.py | 31 +++++------ 2 files changed, 44 insertions(+), 55 deletions(-) diff --git a/Lib/statistics.py b/Lib/statistics.py --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -105,6 +105,7 @@ from fractions import Fraction from decimal import Decimal from itertools import groupby +from bisect import bisect_left, bisect_right @@ -223,56 +224,26 @@ # Optimise the common case of floats. We expect that the most often # used numeric type will be builtin floats, so try to make this as # fast as possible. - if type(x) is float: + if type(x) is float or type(x) is Decimal: return x.as_integer_ratio() try: # x may be an int, Fraction, or Integral ABC. return (x.numerator, x.denominator) except AttributeError: try: - # x may be a float subclass. + # x may be a float or Decimal subclass. return x.as_integer_ratio() except AttributeError: - try: - # x may be a Decimal. - return _decimal_to_ratio(x) - except AttributeError: - # Just give up? - pass + # Just give up? + pass except (OverflowError, ValueError): # float NAN or INF. - assert not math.isfinite(x) + assert not _isfinite(x) return (x, None) msg = "can't convert type '{}' to numerator/denominator" raise TypeError(msg.format(type(x).__name__)) -# FIXME This is faster than Fraction.from_decimal, but still too slow. -def _decimal_to_ratio(d): - """Convert Decimal d to exact integer ratio (numerator, denominator). - - >>> from decimal import Decimal - >>> _decimal_to_ratio(Decimal("2.6")) - (26, 10) - - """ - sign, digits, exp = d.as_tuple() - if exp in ('F', 'n', 'N'): # INF, NAN, sNAN - assert not d.is_finite() - return (d, None) - num = 0 - for digit in digits: - num = num*10 + digit - if exp < 0: - den = 10**-exp - else: - num *= 10**exp - den = 1 - if sign: - num = -num - return (num, den) - - def _convert(value, T): """Convert value to given numeric type T.""" if type(value) is T: @@ -305,6 +276,21 @@ return table +def _find_lteq(a, x): + 'Locate the leftmost value exactly equal to x' + i = bisect_left(a, x) + if i != len(a) and a[i] == x: + return i + raise ValueError + + +def _find_rteq(a, l, x): + 'Locate the rightmost value exactly equal to x' + i = bisect_right(a, x, lo=l) + if i != (len(a)+1) and a[i-1] == x: + return i-1 + raise ValueError + # === Measures of central tendency (averages) === def mean(data): @@ -442,9 +428,15 @@ except TypeError: # Mixed type. For now we just coerce to float. L = float(x) - float(interval)/2 - cf = data.index(x) # Number of values below the median interval. - # FIXME The following line could be more efficient for big lists. - f = data.count(x) # Number of data points in the median interval. + + # Uses bisection search to search for x in data with log(n) time complexity + # Find the position of leftmost occurence of x in data + l1 = _find_lteq(data, x) + # Find the position of rightmost occurence of x in data[l1...len(data)] + # Assuming always l1 <= l2 + l2 = _find_rteq(data, l1, x) + cf = l1 + f = l2 - l1 + 1 return L + interval*(n/2 - cf)/f diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py --- a/Lib/test/test_statistics.py +++ b/Lib/test/test_statistics.py @@ -699,13 +699,12 @@ num, den = statistics._exact_ratio(x) self.assertEqual(x, num/den) - @unittest.skipIf(True, "temporarily disabled: see #25928") def test_decimal(self): D = Decimal _exact_ratio = statistics._exact_ratio - self.assertEqual(_exact_ratio(D("0.125")), (125, 1000)) - self.assertEqual(_exact_ratio(D("12.345")), (12345, 1000)) - self.assertEqual(_exact_ratio(D("-1.98")), (-198, 100)) + self.assertEqual(_exact_ratio(D("0.125")), (1, 8)) + self.assertEqual(_exact_ratio(D("12.345")), (2469, 200)) + self.assertEqual(_exact_ratio(D("-1.98")), (-99, 50)) def test_inf(self): INF = float("INF") @@ -731,7 +730,6 @@ self.assertIs(ratio[1], None) self.assertEqual(type(ratio[0]), type(nan)) - @unittest.skipIf(True, "temporarily disabled: see #25928") def test_decimal_nan(self): NAN = Decimal("NAN") sNAN = Decimal("sNAN") @@ -745,18 +743,18 @@ class DecimalToRatioTest(unittest.TestCase): - # Test _decimal_to_ratio private function. + # Test _exact_ratio private function. def test_infinity(self): # Test that INFs are handled correctly. inf = Decimal('INF') - self.assertEqual(statistics._decimal_to_ratio(inf), (inf, None)) - self.assertEqual(statistics._decimal_to_ratio(-inf), (-inf, None)) + self.assertEqual(statistics._exact_ratio(inf), (inf, None)) + self.assertEqual(statistics._exact_ratio(-inf), (-inf, None)) def test_nan(self): # Test that NANs are handled correctly. for nan in (Decimal('NAN'), Decimal('sNAN')): - num, den = statistics._decimal_to_ratio(nan) + num, den = statistics._exact_ratio(nan) # Because NANs always compare non-equal, we cannot use assertEqual. # Nor can we use an identity test, as we don't guarantee anything # about the object identity. @@ -769,30 +767,30 @@ for d in numbers: # First test positive decimals. assert d > 0 - num, den = statistics._decimal_to_ratio(d) + num, den = statistics._exact_ratio(d) self.assertGreaterEqual(num, 0) self.assertGreater(den, 0) # Then test negative decimals. - num, den = statistics._decimal_to_ratio(-d) + num, den = statistics._exact_ratio(-d) self.assertLessEqual(num, 0) self.assertGreater(den, 0) def test_negative_exponent(self): # Test result when the exponent is negative. - t = statistics._decimal_to_ratio(Decimal("0.1234")) - self.assertEqual(t, (1234, 10000)) + t = statistics._exact_ratio(Decimal("0.1234")) + self.assertEqual(t, (617, 5000)) def test_positive_exponent(self): # Test results when the exponent is positive. - t = statistics._decimal_to_ratio(Decimal("1.234e7")) + t = statistics._exact_ratio(Decimal("1.234e7")) self.assertEqual(t, (12340000, 1)) def test_regression_20536(self): # Regression test for issue 20536. # See http://bugs.python.org/issue20536 - t = statistics._decimal_to_ratio(Decimal("1e2")) + t = statistics._exact_ratio(Decimal("1e2")) self.assertEqual(t, (100, 1)) - t = statistics._decimal_to_ratio(Decimal("1.47e5")) + t = statistics._exact_ratio(Decimal("1.47e5")) self.assertEqual(t, (147000, 1)) @@ -1260,7 +1258,6 @@ with decimal.localcontext(decimal.BasicContext): self.assertRaises(decimal.InvalidOperation, statistics._sum, data) - @unittest.skipIf(True, "temporarily disabled: see #25928") def test_decimal_snan_raises(self): # Adding sNAN should raise InvalidOperation. sNAN = Decimal('sNAN') -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 15:24:08 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 04 May 2016 19:24:08 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326765=3A_Moved_co?= =?utf-8?q?mmon_code_and_docstrings_for_bytes_and_bytearray_methods?= Message-ID: <20160504192353.49917.35973.29766397@psf.io> https://hg.python.org/cpython/rev/41969033eb9d changeset: 101230:41969033eb9d user: Serhiy Storchaka date: Wed May 04 22:23:26 2016 +0300 summary: Issue #26765: Moved common code and docstrings for bytes and bytearray methods to bytes_methods.c. files: Include/bytes_methods.h | 21 + Objects/bytearrayobject.c | 352 +-------------- Objects/bytes_methods.c | 424 +++++++++++++++++++ Objects/bytesobject.c | 362 +--------------- Objects/stringlib/find.h | 73 --- Objects/stringlib/transmogrify.h | 30 - Objects/unicodeobject.c | 34 +- 7 files changed, 519 insertions(+), 777 deletions(-) diff --git a/Include/bytes_methods.h b/Include/bytes_methods.h --- a/Include/bytes_methods.h +++ b/Include/bytes_methods.h @@ -21,6 +21,15 @@ extern void _Py_bytes_capitalize(char *result, const char *s, Py_ssize_t len); extern void _Py_bytes_swapcase(char *result, const char *s, Py_ssize_t len); +extern PyObject *_Py_bytes_find(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *args); +extern int _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg); +extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len, PyObject *args); + /* The maketrans() static method. */ extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to); @@ -37,7 +46,19 @@ extern const char _Py_title__doc__[]; extern const char _Py_capitalize__doc__[]; extern const char _Py_swapcase__doc__[]; +extern const char _Py_count__doc__[]; +extern const char _Py_find__doc__[]; +extern const char _Py_index__doc__[]; +extern const char _Py_rfind__doc__[]; +extern const char _Py_rindex__doc__[]; +extern const char _Py_startswith__doc__[]; +extern const char _Py_endswith__doc__[]; extern const char _Py_maketrans__doc__[]; +extern const char _Py_expandtabs__doc__[]; +extern const char _Py_ljust__doc__[]; +extern const char _Py_rjust__doc__[]; +extern const char _Py_center__doc__[]; +extern const char _Py_zfill__doc__[]; /* this is needed because some docs are shared from the .o, not static */ #define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str) diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -1097,147 +1097,16 @@ #include "stringlib/transmogrify.h" -/* The following Py_LOCAL_INLINE and Py_LOCAL functions -were copied from the old char* style string object. */ - -/* helper macro to fixup start/end slice values */ -#define ADJUST_INDICES(start, end, len) \ - if (end > len) \ - end = len; \ - else if (end < 0) { \ - end += len; \ - if (end < 0) \ - end = 0; \ - } \ - if (start < 0) { \ - start += len; \ - if (start < 0) \ - start = 0; \ - } - -Py_LOCAL_INLINE(Py_ssize_t) -bytearray_find_internal(PyByteArrayObject *self, PyObject *args, int dir) -{ - PyObject *subobj; - char byte; - Py_buffer subbuf; - const char *sub; - Py_ssize_t len, sub_len; - Py_ssize_t start=0, end=PY_SSIZE_T_MAX; - Py_ssize_t res; - - if (!stringlib_parse_args_finds_byte("find/rfind/index/rindex", - args, &subobj, &byte, &start, &end)) - return -2; - - if (subobj) { - if (PyObject_GetBuffer(subobj, &subbuf, PyBUF_SIMPLE) != 0) - return -2; - - sub = subbuf.buf; - sub_len = subbuf.len; - } - else { - sub = &byte; - sub_len = 1; - } - len = PyByteArray_GET_SIZE(self); - - ADJUST_INDICES(start, end, len); - if (end - start < sub_len) - res = -1; - else if (sub_len == 1) { - if (dir > 0) - res = stringlib_find_char( - PyByteArray_AS_STRING(self) + start, end - start, - *sub); - else - res = stringlib_rfind_char( - PyByteArray_AS_STRING(self) + start, end - start, - *sub); - if (res >= 0) - res += start; - } - else { - if (dir > 0) - res = stringlib_find_slice( - PyByteArray_AS_STRING(self), len, - sub, sub_len, start, end); - else - res = stringlib_rfind_slice( - PyByteArray_AS_STRING(self), len, - sub, sub_len, start, end); - } - - if (subobj) - PyBuffer_Release(&subbuf); - - return res; -} - -PyDoc_STRVAR(find__doc__, -"B.find(sub[, start[, end]]) -> int\n\ -\n\ -Return the lowest index in B where subsection sub is found,\n\ -such that sub is contained within B[start,end]. Optional\n\ -arguments start and end are interpreted as in slice notation.\n\ -\n\ -Return -1 on failure."); - static PyObject * bytearray_find(PyByteArrayObject *self, PyObject *args) { - Py_ssize_t result = bytearray_find_internal(self, args, +1); - if (result == -2) - return NULL; - return PyLong_FromSsize_t(result); + return _Py_bytes_find(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), args); } -PyDoc_STRVAR(count__doc__, -"B.count(sub[, start[, end]]) -> int\n\ -\n\ -Return the number of non-overlapping occurrences of subsection sub in\n\ -bytes B[start:end]. Optional arguments start and end are interpreted\n\ -as in slice notation."); - static PyObject * bytearray_count(PyByteArrayObject *self, PyObject *args) { - PyObject *sub_obj; - const char *str = PyByteArray_AS_STRING(self), *sub; - Py_ssize_t sub_len; - char byte; - Py_ssize_t start = 0, end = PY_SSIZE_T_MAX; - - Py_buffer vsub; - PyObject *count_obj; - - if (!stringlib_parse_args_finds_byte("count", args, &sub_obj, &byte, - &start, &end)) - return NULL; - - if (sub_obj) { - if (PyObject_GetBuffer(sub_obj, &vsub, PyBUF_SIMPLE) != 0) - return NULL; - - sub = vsub.buf; - sub_len = vsub.len; - } - else { - sub = &byte; - sub_len = 1; - } - - ADJUST_INDICES(start, end, PyByteArray_GET_SIZE(self)); - - count_obj = PyLong_FromSsize_t( - stringlib_count(str + start, end - start, sub, sub_len, PY_SSIZE_T_MAX) - ); - - if (sub_obj) - PyBuffer_Release(&vsub); - - return count_obj; + return _Py_bytes_count(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), args); } /*[clinic input] @@ -1269,216 +1138,40 @@ PyByteArray_GET_SIZE(self)); } -PyDoc_STRVAR(index__doc__, -"B.index(sub[, start[, end]]) -> int\n\ -\n\ -Like B.find() but raise ValueError when the subsection is not found."); - static PyObject * bytearray_index(PyByteArrayObject *self, PyObject *args) { - Py_ssize_t result = bytearray_find_internal(self, args, +1); - if (result == -2) - return NULL; - if (result == -1) { - PyErr_SetString(PyExc_ValueError, - "subsection not found"); - return NULL; - } - return PyLong_FromSsize_t(result); + return _Py_bytes_index(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), args); } - -PyDoc_STRVAR(rfind__doc__, -"B.rfind(sub[, start[, end]]) -> int\n\ -\n\ -Return the highest index in B where subsection sub is found,\n\ -such that sub is contained within B[start,end]. Optional\n\ -arguments start and end are interpreted as in slice notation.\n\ -\n\ -Return -1 on failure."); - static PyObject * bytearray_rfind(PyByteArrayObject *self, PyObject *args) { - Py_ssize_t result = bytearray_find_internal(self, args, -1); - if (result == -2) - return NULL; - return PyLong_FromSsize_t(result); + return _Py_bytes_rfind(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), args); } - -PyDoc_STRVAR(rindex__doc__, -"B.rindex(sub[, start[, end]]) -> int\n\ -\n\ -Like B.rfind() but raise ValueError when the subsection is not found."); - static PyObject * bytearray_rindex(PyByteArrayObject *self, PyObject *args) { - Py_ssize_t result = bytearray_find_internal(self, args, -1); - if (result == -2) - return NULL; - if (result == -1) { - PyErr_SetString(PyExc_ValueError, - "subsection not found"); - return NULL; - } - return PyLong_FromSsize_t(result); + return _Py_bytes_rindex(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), args); } - static int bytearray_contains(PyObject *self, PyObject *arg) { - Py_ssize_t ival = PyNumber_AsSsize_t(arg, PyExc_ValueError); - if (ival == -1 && PyErr_Occurred()) { - Py_buffer varg; - Py_ssize_t pos; - PyErr_Clear(); - if (PyObject_GetBuffer(arg, &varg, PyBUF_SIMPLE) != 0) - return -1; - pos = stringlib_find(PyByteArray_AS_STRING(self), Py_SIZE(self), - varg.buf, varg.len, 0); - PyBuffer_Release(&varg); - return pos >= 0; - } - if (ival < 0 || ival >= 256) { - PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)"); - return -1; - } - - return memchr(PyByteArray_AS_STRING(self), (int) ival, Py_SIZE(self)) != NULL; + return _Py_bytes_contains(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), arg); } - -/* Matches the end (direction >= 0) or start (direction < 0) of self - * against substr, using the start and end arguments. Returns - * -1 on error, 0 if not found and 1 if found. - */ -Py_LOCAL(int) -_bytearray_tailmatch(PyByteArrayObject *self, PyObject *substr, Py_ssize_t start, - Py_ssize_t end, int direction) -{ - Py_ssize_t len = PyByteArray_GET_SIZE(self); - const char* str; - Py_buffer vsubstr; - int rv = 0; - - str = PyByteArray_AS_STRING(self); - - if (PyObject_GetBuffer(substr, &vsubstr, PyBUF_SIMPLE) != 0) - return -1; - - ADJUST_INDICES(start, end, len); - - if (direction < 0) { - /* startswith */ - if (start+vsubstr.len > len) { - goto done; - } - } else { - /* endswith */ - if (end-start < vsubstr.len || start > len) { - goto done; - } - - if (end-vsubstr.len > start) - start = end - vsubstr.len; - } - if (end-start >= vsubstr.len) - rv = ! memcmp(str+start, vsubstr.buf, vsubstr.len); - -done: - PyBuffer_Release(&vsubstr); - return rv; -} - - -PyDoc_STRVAR(startswith__doc__, -"B.startswith(prefix[, start[, end]]) -> bool\n\ -\n\ -Return True if B starts with the specified prefix, False otherwise.\n\ -With optional start, test B beginning at that position.\n\ -With optional end, stop comparing B at that position.\n\ -prefix can also be a tuple of bytes to try."); - static PyObject * bytearray_startswith(PyByteArrayObject *self, PyObject *args) { - Py_ssize_t start = 0; - Py_ssize_t end = PY_SSIZE_T_MAX; - PyObject *subobj; - int result; - - if (!stringlib_parse_args_finds("startswith", args, &subobj, &start, &end)) - return NULL; - if (PyTuple_Check(subobj)) { - Py_ssize_t i; - for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { - result = _bytearray_tailmatch(self, - PyTuple_GET_ITEM(subobj, i), - start, end, -1); - if (result == -1) - return NULL; - else if (result) { - Py_RETURN_TRUE; - } - } - Py_RETURN_FALSE; - } - result = _bytearray_tailmatch(self, subobj, start, end, -1); - if (result == -1) { - if (PyErr_ExceptionMatches(PyExc_TypeError)) - PyErr_Format(PyExc_TypeError, "startswith first arg must be bytes " - "or a tuple of bytes, not %s", Py_TYPE(subobj)->tp_name); - return NULL; - } - else - return PyBool_FromLong(result); + return _Py_bytes_startswith(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), args); } -PyDoc_STRVAR(endswith__doc__, -"B.endswith(suffix[, start[, end]]) -> bool\n\ -\n\ -Return True if B ends with the specified suffix, False otherwise.\n\ -With optional start, test B beginning at that position.\n\ -With optional end, stop comparing B at that position.\n\ -suffix can also be a tuple of bytes to try."); - static PyObject * bytearray_endswith(PyByteArrayObject *self, PyObject *args) { - Py_ssize_t start = 0; - Py_ssize_t end = PY_SSIZE_T_MAX; - PyObject *subobj; - int result; - - if (!stringlib_parse_args_finds("endswith", args, &subobj, &start, &end)) - return NULL; - if (PyTuple_Check(subobj)) { - Py_ssize_t i; - for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { - result = _bytearray_tailmatch(self, - PyTuple_GET_ITEM(subobj, i), - start, end, +1); - if (result == -1) - return NULL; - else if (result) { - Py_RETURN_TRUE; - } - } - Py_RETURN_FALSE; - } - result = _bytearray_tailmatch(self, subobj, start, end, +1); - if (result == -1) { - if (PyErr_ExceptionMatches(PyExc_TypeError)) - PyErr_Format(PyExc_TypeError, "endswith first arg must be bytes or " - "a tuple of bytes, not %s", Py_TYPE(subobj)->tp_name); - return NULL; - } - else - return PyBool_FromLong(result); + return _Py_bytes_endswith(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), args); } @@ -1544,7 +1237,7 @@ result = PyByteArray_FromStringAndSize((char *)NULL, inlen); if (result == NULL) goto done; - output_start = output = PyByteArray_AsString(result); + output_start = output = PyByteArray_AS_STRING(result); input = PyByteArray_AS_STRING(input_obj); if (vdel.len == 0 && table_chars != NULL) { @@ -2919,19 +2612,22 @@ BYTEARRAY_APPEND_METHODDEF {"capitalize", (PyCFunction)stringlib_capitalize, METH_NOARGS, _Py_capitalize__doc__}, - {"center", (PyCFunction)stringlib_center, METH_VARARGS, center__doc__}, + {"center", (PyCFunction)stringlib_center, METH_VARARGS, _Py_center__doc__}, BYTEARRAY_CLEAR_METHODDEF BYTEARRAY_COPY_METHODDEF - {"count", (PyCFunction)bytearray_count, METH_VARARGS, count__doc__}, + {"count", (PyCFunction)bytearray_count, METH_VARARGS, + _Py_count__doc__}, BYTEARRAY_DECODE_METHODDEF - {"endswith", (PyCFunction)bytearray_endswith, METH_VARARGS, endswith__doc__}, + {"endswith", (PyCFunction)bytearray_endswith, METH_VARARGS, + _Py_endswith__doc__}, {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS | METH_KEYWORDS, - expandtabs__doc__}, + _Py_expandtabs__doc__}, BYTEARRAY_EXTEND_METHODDEF - {"find", (PyCFunction)bytearray_find, METH_VARARGS, find__doc__}, + {"find", (PyCFunction)bytearray_find, METH_VARARGS, + _Py_find__doc__}, BYTEARRAY_FROMHEX_METHODDEF {"hex", (PyCFunction)bytearray_hex, METH_NOARGS, hex__doc__}, - {"index", (PyCFunction)bytearray_index, METH_VARARGS, index__doc__}, + {"index", (PyCFunction)bytearray_index, METH_VARARGS, _Py_index__doc__}, BYTEARRAY_INSERT_METHODDEF {"isalnum", (PyCFunction)stringlib_isalnum, METH_NOARGS, _Py_isalnum__doc__}, @@ -2948,7 +2644,7 @@ {"isupper", (PyCFunction)stringlib_isupper, METH_NOARGS, _Py_isupper__doc__}, BYTEARRAY_JOIN_METHODDEF - {"ljust", (PyCFunction)stringlib_ljust, METH_VARARGS, ljust__doc__}, + {"ljust", (PyCFunction)stringlib_ljust, METH_VARARGS, _Py_ljust__doc__}, {"lower", (PyCFunction)stringlib_lower, METH_NOARGS, _Py_lower__doc__}, BYTEARRAY_LSTRIP_METHODDEF BYTEARRAY_MAKETRANS_METHODDEF @@ -2957,23 +2653,23 @@ BYTEARRAY_REMOVE_METHODDEF BYTEARRAY_REPLACE_METHODDEF BYTEARRAY_REVERSE_METHODDEF - {"rfind", (PyCFunction)bytearray_rfind, METH_VARARGS, rfind__doc__}, - {"rindex", (PyCFunction)bytearray_rindex, METH_VARARGS, rindex__doc__}, - {"rjust", (PyCFunction)stringlib_rjust, METH_VARARGS, rjust__doc__}, + {"rfind", (PyCFunction)bytearray_rfind, METH_VARARGS, _Py_rfind__doc__}, + {"rindex", (PyCFunction)bytearray_rindex, METH_VARARGS, _Py_rindex__doc__}, + {"rjust", (PyCFunction)stringlib_rjust, METH_VARARGS, _Py_rjust__doc__}, BYTEARRAY_RPARTITION_METHODDEF BYTEARRAY_RSPLIT_METHODDEF BYTEARRAY_RSTRIP_METHODDEF BYTEARRAY_SPLIT_METHODDEF BYTEARRAY_SPLITLINES_METHODDEF {"startswith", (PyCFunction)bytearray_startswith, METH_VARARGS , - startswith__doc__}, + _Py_startswith__doc__}, BYTEARRAY_STRIP_METHODDEF {"swapcase", (PyCFunction)stringlib_swapcase, METH_NOARGS, _Py_swapcase__doc__}, {"title", (PyCFunction)stringlib_title, METH_NOARGS, _Py_title__doc__}, BYTEARRAY_TRANSLATE_METHODDEF {"upper", (PyCFunction)stringlib_upper, METH_NOARGS, _Py_upper__doc__}, - {"zfill", (PyCFunction)stringlib_zfill, METH_VARARGS, zfill__doc__}, + {"zfill", (PyCFunction)stringlib_zfill, METH_VARARGS, _Py_zfill__doc__}, {NULL} }; diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -387,3 +387,427 @@ return res; } + +#define FASTSEARCH fastsearch +#define STRINGLIB(F) stringlib_##F +#define STRINGLIB_CHAR char +#define STRINGLIB_SIZEOF_CHAR 1 + +#include "stringlib/fastsearch.h" +#include "stringlib/count.h" +#include "stringlib/find.h" + +/* +Wraps stringlib_parse_args_finds() and additionally checks whether the +first argument is an integer in range(0, 256). + +If this is the case, writes the integer value to the byte parameter +and sets subobj to NULL. Otherwise, sets the first argument to subobj +and doesn't touch byte. The other parameters are similar to those of +stringlib_parse_args_finds(). +*/ + +Py_LOCAL_INLINE(int) +parse_args_finds_byte(const char *function_name, PyObject *args, + PyObject **subobj, char *byte, + Py_ssize_t *start, Py_ssize_t *end) +{ + PyObject *tmp_subobj; + Py_ssize_t ival; + PyObject *err; + + if(!stringlib_parse_args_finds(function_name, args, &tmp_subobj, + start, end)) + return 0; + + if (!PyNumber_Check(tmp_subobj)) { + *subobj = tmp_subobj; + return 1; + } + + ival = PyNumber_AsSsize_t(tmp_subobj, PyExc_OverflowError); + if (ival == -1) { + err = PyErr_Occurred(); + if (err && !PyErr_GivenExceptionMatches(err, PyExc_OverflowError)) { + PyErr_Clear(); + *subobj = tmp_subobj; + return 1; + } + } + + if (ival < 0 || ival > 255) { + PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)"); + return 0; + } + + *subobj = NULL; + *byte = (char)ival; + return 1; +} + +/* helper macro to fixup start/end slice values */ +#define ADJUST_INDICES(start, end, len) \ + if (end > len) \ + end = len; \ + else if (end < 0) { \ + end += len; \ + if (end < 0) \ + end = 0; \ + } \ + if (start < 0) { \ + start += len; \ + if (start < 0) \ + start = 0; \ + } + +Py_LOCAL_INLINE(Py_ssize_t) +find_internal(const char *str, Py_ssize_t len, + const char *function_name, PyObject *args, int dir) +{ + PyObject *subobj; + char byte; + Py_buffer subbuf; + const char *sub; + Py_ssize_t sub_len; + Py_ssize_t start = 0, end = PY_SSIZE_T_MAX; + Py_ssize_t res; + + if (!parse_args_finds_byte(function_name, args, + &subobj, &byte, &start, &end)) + return -2; + + if (subobj) { + if (PyObject_GetBuffer(subobj, &subbuf, PyBUF_SIMPLE) != 0) + return -2; + + sub = subbuf.buf; + sub_len = subbuf.len; + } + else { + sub = &byte; + sub_len = 1; + } + + ADJUST_INDICES(start, end, len); + if (end - start < sub_len) + res = -1; + else if (sub_len == 1) { + if (dir > 0) + res = stringlib_find_char( + str + start, end - start, + *sub); + else + res = stringlib_rfind_char( + str + start, end - start, + *sub); + if (res >= 0) + res += start; + } + else { + if (dir > 0) + res = stringlib_find_slice( + str, len, + sub, sub_len, start, end); + else + res = stringlib_rfind_slice( + str, len, + sub, sub_len, start, end); + } + + if (subobj) + PyBuffer_Release(&subbuf); + + return res; +} + +PyDoc_STRVAR_shared(_Py_find__doc__, +"B.find(sub[, start[, end]]) -> int\n\ +\n\ +Return the lowest index in B where subsection sub is found,\n\ +such that sub is contained within B[start,end]. Optional\n\ +arguments start and end are interpreted as in slice notation.\n\ +\n\ +Return -1 on failure."); + +PyObject * +_Py_bytes_find(const char *str, Py_ssize_t len, PyObject *args) +{ + Py_ssize_t result = find_internal(str, len, "find", args, +1); + if (result == -2) + return NULL; + return PyLong_FromSsize_t(result); +} + +PyDoc_STRVAR_shared(_Py_index__doc__, +"B.index(sub[, start[, end]]) -> int\n\ +\n\ +Like B.find() but raise ValueError when the subsection is not found."); + +PyObject * +_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *args) +{ + Py_ssize_t result = find_internal(str, len, "index", args, +1); + if (result == -2) + return NULL; + if (result == -1) { + PyErr_SetString(PyExc_ValueError, + "subsection not found"); + return NULL; + } + return PyLong_FromSsize_t(result); +} + +PyDoc_STRVAR_shared(_Py_rfind__doc__, +"B.rfind(sub[, start[, end]]) -> int\n\ +\n\ +Return the highest index in B where subsection sub is found,\n\ +such that sub is contained within B[start,end]. Optional\n\ +arguments start and end are interpreted as in slice notation.\n\ +\n\ +Return -1 on failure."); + +PyObject * +_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *args) +{ + Py_ssize_t result = find_internal(str, len, "rfind", args, -1); + if (result == -2) + return NULL; + return PyLong_FromSsize_t(result); +} + +PyDoc_STRVAR_shared(_Py_rindex__doc__, +"B.rindex(sub[, start[, end]]) -> int\n\ +\n\ +Like B.rfind() but raise ValueError when the subsection is not found."); + +PyObject * +_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *args) +{ + Py_ssize_t result = find_internal(str, len, "rindex", args, -1); + if (result == -2) + return NULL; + if (result == -1) { + PyErr_SetString(PyExc_ValueError, + "subsection not found"); + return NULL; + } + return PyLong_FromSsize_t(result); +} + +PyDoc_STRVAR_shared(_Py_count__doc__, +"B.count(sub[, start[, end]]) -> int\n\ +\n\ +Return the number of non-overlapping occurrences of subsection sub in\n\ +bytes B[start:end]. Optional arguments start and end are interpreted\n\ +as in slice notation."); + +PyObject * +_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *args) +{ + PyObject *sub_obj; + const char *sub; + Py_ssize_t sub_len; + char byte; + Py_ssize_t start = 0, end = PY_SSIZE_T_MAX; + + Py_buffer vsub; + PyObject *count_obj; + + if (!parse_args_finds_byte("count", args, + &sub_obj, &byte, &start, &end)) + return NULL; + + if (sub_obj) { + if (PyObject_GetBuffer(sub_obj, &vsub, PyBUF_SIMPLE) != 0) + return NULL; + + sub = vsub.buf; + sub_len = vsub.len; + } + else { + sub = &byte; + sub_len = 1; + } + + ADJUST_INDICES(start, end, len); + + count_obj = PyLong_FromSsize_t( + stringlib_count(str + start, end - start, sub, sub_len, PY_SSIZE_T_MAX) + ); + + if (sub_obj) + PyBuffer_Release(&vsub); + + return count_obj; +} + +int +_Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg) +{ + Py_ssize_t ival = PyNumber_AsSsize_t(arg, PyExc_ValueError); + if (ival == -1 && PyErr_Occurred()) { + Py_buffer varg; + Py_ssize_t pos; + PyErr_Clear(); + if (PyObject_GetBuffer(arg, &varg, PyBUF_SIMPLE) != 0) + return -1; + pos = stringlib_find(str, len, + varg.buf, varg.len, 0); + PyBuffer_Release(&varg); + return pos >= 0; + } + if (ival < 0 || ival >= 256) { + PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)"); + return -1; + } + + return memchr(str, (int) ival, len) != NULL; +} + + +/* Matches the end (direction >= 0) or start (direction < 0) of the buffer + * against substr, using the start and end arguments. Returns + * -1 on error, 0 if not found and 1 if found. + */ +Py_LOCAL(int) +tailmatch(const char *str, Py_ssize_t len, PyObject *substr, + Py_ssize_t start, Py_ssize_t end, int direction) +{ + Py_buffer sub_view = {NULL, NULL}; + const char *sub; + Py_ssize_t slen; + + if (PyBytes_Check(substr)) { + sub = PyBytes_AS_STRING(substr); + slen = PyBytes_GET_SIZE(substr); + } + else { + if (PyObject_GetBuffer(substr, &sub_view, PyBUF_SIMPLE) != 0) + return -1; + sub = sub_view.buf; + slen = sub_view.len; + } + + ADJUST_INDICES(start, end, len); + + if (direction < 0) { + /* startswith */ + if (start + slen > len) + goto notfound; + } else { + /* endswith */ + if (end - start < slen || start > len) + goto notfound; + + if (end - slen > start) + start = end - slen; + } + if (end - start < slen) + goto notfound; + if (memcmp(str + start, sub, slen) != 0) + goto notfound; + + PyBuffer_Release(&sub_view); + return 1; + +notfound: + PyBuffer_Release(&sub_view); + return 0; +} + +Py_LOCAL(PyObject *) +_Py_bytes_tailmatch(const char *str, Py_ssize_t len, + const char *function_name, PyObject *args, + int direction) +{ + Py_ssize_t start = 0; + Py_ssize_t end = PY_SSIZE_T_MAX; + PyObject *subobj; + int result; + + if (!stringlib_parse_args_finds(function_name, args, &subobj, &start, &end)) + return NULL; + if (PyTuple_Check(subobj)) { + Py_ssize_t i; + for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { + result = tailmatch(str, len, PyTuple_GET_ITEM(subobj, i), + start, end, direction); + if (result == -1) + return NULL; + else if (result) { + Py_RETURN_TRUE; + } + } + Py_RETURN_FALSE; + } + result = tailmatch(str, len, subobj, start, end, direction); + if (result == -1) { + if (PyErr_ExceptionMatches(PyExc_TypeError)) + PyErr_Format(PyExc_TypeError, + "%s first arg must be bytes or a tuple of bytes, " + "not %s", + function_name, Py_TYPE(subobj)->tp_name); + return NULL; + } + else + return PyBool_FromLong(result); +} + +PyDoc_STRVAR_shared(_Py_startswith__doc__, +"B.startswith(prefix[, start[, end]]) -> bool\n\ +\n\ +Return True if B starts with the specified prefix, False otherwise.\n\ +With optional start, test B beginning at that position.\n\ +With optional end, stop comparing B at that position.\n\ +prefix can also be a tuple of bytes to try."); + +PyObject * +_Py_bytes_startswith(const char *str, Py_ssize_t len, PyObject *args) +{ + return _Py_bytes_tailmatch(str, len, "startswith", args, -1); +} + +PyDoc_STRVAR_shared(_Py_endswith__doc__, +"B.endswith(suffix[, start[, end]]) -> bool\n\ +\n\ +Return True if B ends with the specified suffix, False otherwise.\n\ +With optional start, test B beginning at that position.\n\ +With optional end, stop comparing B at that position.\n\ +suffix can also be a tuple of bytes to try."); + +PyObject * +_Py_bytes_endswith(const char *str, Py_ssize_t len, PyObject *args) +{ + return _Py_bytes_tailmatch(str, len, "endswith", args, +1); +} + +PyDoc_STRVAR_shared(_Py_expandtabs__doc__, +"B.expandtabs(tabsize=8) -> copy of B\n\ +\n\ +Return a copy of B where all tab characters are expanded using spaces.\n\ +If tabsize is not given, a tab size of 8 characters is assumed."); + +PyDoc_STRVAR_shared(_Py_ljust__doc__, +"B.ljust(width[, fillchar]) -> copy of B\n" +"\n" +"Return B left justified in a string of length width. Padding is\n" +"done using the specified fill character (default is a space)."); + +PyDoc_STRVAR_shared(_Py_rjust__doc__, +"B.rjust(width[, fillchar]) -> copy of B\n" +"\n" +"Return B right justified in a string of length width. Padding is\n" +"done using the specified fill character (default is a space)"); + +PyDoc_STRVAR_shared(_Py_center__doc__, +"B.center(width[, fillchar]) -> copy of B\n" +"\n" +"Return B centered in a string of length width. Padding is\n" +"done using the specified fill character (default is a space)."); + +PyDoc_STRVAR_shared(_Py_zfill__doc__, +"B.zfill(width) -> copy of B\n" +"\n" +"Pad a numeric string B with zeros on the left, to fill a field\n" +"of the specified width. B is never truncated."); + diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -486,11 +486,11 @@ static int byte_converter(PyObject *arg, char *p) { - if (PyBytes_Check(arg) && PyBytes_Size(arg) == 1) { + if (PyBytes_Check(arg) && PyBytes_GET_SIZE(arg) == 1) { *p = PyBytes_AS_STRING(arg)[0]; return 1; } - else if (PyByteArray_Check(arg) && PyByteArray_Size(arg) == 1) { + else if (PyByteArray_Check(arg) && PyByteArray_GET_SIZE(arg) == 1) { *p = PyByteArray_AS_STRING(arg)[0]; return 1; } @@ -1488,24 +1488,7 @@ static int bytes_contains(PyObject *self, PyObject *arg) { - Py_ssize_t ival = PyNumber_AsSsize_t(arg, PyExc_ValueError); - if (ival == -1 && PyErr_Occurred()) { - Py_buffer varg; - Py_ssize_t pos; - PyErr_Clear(); - if (PyObject_GetBuffer(arg, &varg, PyBUF_SIMPLE) != 0) - return -1; - pos = stringlib_find(PyBytes_AS_STRING(self), Py_SIZE(self), - varg.buf, varg.len, 0); - PyBuffer_Release(&varg); - return pos >= 0; - } - if (ival < 0 || ival >= 256) { - PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)"); - return -1; - } - - return memchr(PyBytes_AS_STRING(self), (int) ival, Py_SIZE(self)) != NULL; + return _Py_bytes_contains(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), arg); } static PyObject * @@ -1890,157 +1873,30 @@ return bytes_join((PyBytesObject*)sep, x); } -/* helper macro to fixup start/end slice values */ -#define ADJUST_INDICES(start, end, len) \ - if (end > len) \ - end = len; \ - else if (end < 0) { \ - end += len; \ - if (end < 0) \ - end = 0; \ - } \ - if (start < 0) { \ - start += len; \ - if (start < 0) \ - start = 0; \ - } - -Py_LOCAL_INLINE(Py_ssize_t) -bytes_find_internal(PyBytesObject *self, PyObject *args, int dir) -{ - PyObject *subobj; - char byte; - Py_buffer subbuf; - const char *sub; - Py_ssize_t len, sub_len; - Py_ssize_t start=0, end=PY_SSIZE_T_MAX; - Py_ssize_t res; - - if (!stringlib_parse_args_finds_byte("find/rfind/index/rindex", - args, &subobj, &byte, &start, &end)) - return -2; - - if (subobj) { - if (PyObject_GetBuffer(subobj, &subbuf, PyBUF_SIMPLE) != 0) - return -2; - - sub = subbuf.buf; - sub_len = subbuf.len; - } - else { - sub = &byte; - sub_len = 1; - } - len = PyBytes_GET_SIZE(self); - - ADJUST_INDICES(start, end, len); - if (end - start < sub_len) - res = -1; - else if (sub_len == 1) { - if (dir > 0) - res = stringlib_find_char( - PyBytes_AS_STRING(self) + start, end - start, - *sub); - else - res = stringlib_rfind_char( - PyBytes_AS_STRING(self) + start, end - start, - *sub); - if (res >= 0) - res += start; - } - else { - if (dir > 0) - res = stringlib_find_slice( - PyBytes_AS_STRING(self), len, - sub, sub_len, start, end); - else - res = stringlib_rfind_slice( - PyBytes_AS_STRING(self), len, - sub, sub_len, start, end); - } - - if (subobj) - PyBuffer_Release(&subbuf); - - return res; -} - - -PyDoc_STRVAR(find__doc__, -"B.find(sub[, start[, end]]) -> int\n\ -\n\ -Return the lowest index in B where substring sub is found,\n\ -such that sub is contained within B[start:end]. Optional\n\ -arguments start and end are interpreted as in slice notation.\n\ -\n\ -Return -1 on failure."); - static PyObject * bytes_find(PyBytesObject *self, PyObject *args) { - Py_ssize_t result = bytes_find_internal(self, args, +1); - if (result == -2) - return NULL; - return PyLong_FromSsize_t(result); + return _Py_bytes_find(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args); } - -PyDoc_STRVAR(index__doc__, -"B.index(sub[, start[, end]]) -> int\n\ -\n\ -Like B.find() but raise ValueError when the substring is not found."); - static PyObject * bytes_index(PyBytesObject *self, PyObject *args) { - Py_ssize_t result = bytes_find_internal(self, args, +1); - if (result == -2) - return NULL; - if (result == -1) { - PyErr_SetString(PyExc_ValueError, - "substring not found"); - return NULL; - } - return PyLong_FromSsize_t(result); + return _Py_bytes_index(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args); } -PyDoc_STRVAR(rfind__doc__, -"B.rfind(sub[, start[, end]]) -> int\n\ -\n\ -Return the highest index in B where substring sub is found,\n\ -such that sub is contained within B[start:end]. Optional\n\ -arguments start and end are interpreted as in slice notation.\n\ -\n\ -Return -1 on failure."); - static PyObject * bytes_rfind(PyBytesObject *self, PyObject *args) { - Py_ssize_t result = bytes_find_internal(self, args, -1); - if (result == -2) - return NULL; - return PyLong_FromSsize_t(result); + return _Py_bytes_rfind(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args); } -PyDoc_STRVAR(rindex__doc__, -"B.rindex(sub[, start[, end]]) -> int\n\ -\n\ -Like B.rfind() but raise ValueError when the substring is not found."); - static PyObject * bytes_rindex(PyBytesObject *self, PyObject *args) { - Py_ssize_t result = bytes_find_internal(self, args, -1); - if (result == -2) - return NULL; - if (result == -1) { - PyErr_SetString(PyExc_ValueError, - "substring not found"); - return NULL; - } - return PyLong_FromSsize_t(result); + return _Py_bytes_rindex(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args); } @@ -2179,51 +2035,10 @@ } -PyDoc_STRVAR(count__doc__, -"B.count(sub[, start[, end]]) -> int\n\ -\n\ -Return the number of non-overlapping occurrences of substring sub in\n\ -string B[start:end]. Optional arguments start and end are interpreted\n\ -as in slice notation."); - static PyObject * bytes_count(PyBytesObject *self, PyObject *args) { - PyObject *sub_obj; - const char *str = PyBytes_AS_STRING(self), *sub; - Py_ssize_t sub_len; - char byte; - Py_ssize_t start = 0, end = PY_SSIZE_T_MAX; - - Py_buffer vsub; - PyObject *count_obj; - - if (!stringlib_parse_args_finds_byte("count", args, &sub_obj, &byte, - &start, &end)) - return NULL; - - if (sub_obj) { - if (PyObject_GetBuffer(sub_obj, &vsub, PyBUF_SIMPLE) != 0) - return NULL; - - sub = vsub.buf; - sub_len = vsub.len; - } - else { - sub = &byte; - sub_len = 1; - } - - ADJUST_INDICES(start, end, PyBytes_GET_SIZE(self)); - - count_obj = PyLong_FromSsize_t( - stringlib_count(str + start, end - start, sub, sub_len, PY_SSIZE_T_MAX) - ); - - if (sub_obj) - PyBuffer_Release(&vsub); - - return count_obj; + return _Py_bytes_count(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args); } @@ -2307,7 +2122,7 @@ PyBuffer_Release(&table_view); return NULL; } - output_start = output = PyBytes_AsString(result); + output_start = output = PyBytes_AS_STRING(result); input = PyBytes_AS_STRING(input_obj); if (dellen == 0 && table_chars != NULL) { @@ -2914,145 +2729,17 @@ /** End DALKE **/ -/* Matches the end (direction >= 0) or start (direction < 0) of self - * against substr, using the start and end arguments. Returns - * -1 on error, 0 if not found and 1 if found. - */ -Py_LOCAL(int) -_bytes_tailmatch(PyBytesObject *self, PyObject *substr, Py_ssize_t start, - Py_ssize_t end, int direction) -{ - Py_ssize_t len = PyBytes_GET_SIZE(self); - Py_ssize_t slen; - Py_buffer sub_view = {NULL, NULL}; - const char* sub; - const char* str; - - if (PyBytes_Check(substr)) { - sub = PyBytes_AS_STRING(substr); - slen = PyBytes_GET_SIZE(substr); - } - else { - if (PyObject_GetBuffer(substr, &sub_view, PyBUF_SIMPLE) != 0) - return -1; - sub = sub_view.buf; - slen = sub_view.len; - } - str = PyBytes_AS_STRING(self); - - ADJUST_INDICES(start, end, len); - - if (direction < 0) { - /* startswith */ - if (start+slen > len) - goto notfound; - } else { - /* endswith */ - if (end-start < slen || start > len) - goto notfound; - - if (end-slen > start) - start = end - slen; - } - if (end-start < slen) - goto notfound; - if (memcmp(str+start, sub, slen) != 0) - goto notfound; - - PyBuffer_Release(&sub_view); - return 1; - -notfound: - PyBuffer_Release(&sub_view); - return 0; -} - - -PyDoc_STRVAR(startswith__doc__, -"B.startswith(prefix[, start[, end]]) -> bool\n\ -\n\ -Return True if B starts with the specified prefix, False otherwise.\n\ -With optional start, test B beginning at that position.\n\ -With optional end, stop comparing B at that position.\n\ -prefix can also be a tuple of bytes to try."); static PyObject * bytes_startswith(PyBytesObject *self, PyObject *args) { - Py_ssize_t start = 0; - Py_ssize_t end = PY_SSIZE_T_MAX; - PyObject *subobj; - int result; - - if (!stringlib_parse_args_finds("startswith", args, &subobj, &start, &end)) - return NULL; - if (PyTuple_Check(subobj)) { - Py_ssize_t i; - for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { - result = _bytes_tailmatch(self, - PyTuple_GET_ITEM(subobj, i), - start, end, -1); - if (result == -1) - return NULL; - else if (result) { - Py_RETURN_TRUE; - } - } - Py_RETURN_FALSE; - } - result = _bytes_tailmatch(self, subobj, start, end, -1); - if (result == -1) { - if (PyErr_ExceptionMatches(PyExc_TypeError)) - PyErr_Format(PyExc_TypeError, "startswith first arg must be bytes " - "or a tuple of bytes, not %s", Py_TYPE(subobj)->tp_name); - return NULL; - } - else - return PyBool_FromLong(result); + return _Py_bytes_startswith(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args); } - -PyDoc_STRVAR(endswith__doc__, -"B.endswith(suffix[, start[, end]]) -> bool\n\ -\n\ -Return True if B ends with the specified suffix, False otherwise.\n\ -With optional start, test B beginning at that position.\n\ -With optional end, stop comparing B at that position.\n\ -suffix can also be a tuple of bytes to try."); - static PyObject * bytes_endswith(PyBytesObject *self, PyObject *args) { - Py_ssize_t start = 0; - Py_ssize_t end = PY_SSIZE_T_MAX; - PyObject *subobj; - int result; - - if (!stringlib_parse_args_finds("endswith", args, &subobj, &start, &end)) - return NULL; - if (PyTuple_Check(subobj)) { - Py_ssize_t i; - for (i = 0; i < PyTuple_GET_SIZE(subobj); i++) { - result = _bytes_tailmatch(self, - PyTuple_GET_ITEM(subobj, i), - start, end, +1); - if (result == -1) - return NULL; - else if (result) { - Py_RETURN_TRUE; - } - } - Py_RETURN_FALSE; - } - result = _bytes_tailmatch(self, subobj, start, end, +1); - if (result == -1) { - if (PyErr_ExceptionMatches(PyExc_TypeError)) - PyErr_Format(PyExc_TypeError, "endswith first arg must be bytes or " - "a tuple of bytes, not %s", Py_TYPE(subobj)->tp_name); - return NULL; - } - else - return PyBool_FromLong(result); + return _Py_bytes_endswith(PyBytes_AS_STRING(self), PyBytes_GET_SIZE(self), args); } @@ -3224,17 +2911,20 @@ {"__getnewargs__", (PyCFunction)bytes_getnewargs, METH_NOARGS}, {"capitalize", (PyCFunction)stringlib_capitalize, METH_NOARGS, _Py_capitalize__doc__}, - {"center", (PyCFunction)stringlib_center, METH_VARARGS, center__doc__}, - {"count", (PyCFunction)bytes_count, METH_VARARGS, count__doc__}, + {"center", (PyCFunction)stringlib_center, METH_VARARGS, + _Py_center__doc__}, + {"count", (PyCFunction)bytes_count, METH_VARARGS, + _Py_count__doc__}, BYTES_DECODE_METHODDEF {"endswith", (PyCFunction)bytes_endswith, METH_VARARGS, - endswith__doc__}, + _Py_endswith__doc__}, {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS | METH_KEYWORDS, - expandtabs__doc__}, - {"find", (PyCFunction)bytes_find, METH_VARARGS, find__doc__}, + _Py_expandtabs__doc__}, + {"find", (PyCFunction)bytes_find, METH_VARARGS, + _Py_find__doc__}, BYTES_FROMHEX_METHODDEF {"hex", (PyCFunction)bytes_hex, METH_NOARGS, hex__doc__}, - {"index", (PyCFunction)bytes_index, METH_VARARGS, index__doc__}, + {"index", (PyCFunction)bytes_index, METH_VARARGS, _Py_index__doc__}, {"isalnum", (PyCFunction)stringlib_isalnum, METH_NOARGS, _Py_isalnum__doc__}, {"isalpha", (PyCFunction)stringlib_isalpha, METH_NOARGS, @@ -3250,29 +2940,29 @@ {"isupper", (PyCFunction)stringlib_isupper, METH_NOARGS, _Py_isupper__doc__}, BYTES_JOIN_METHODDEF - {"ljust", (PyCFunction)stringlib_ljust, METH_VARARGS, ljust__doc__}, + {"ljust", (PyCFunction)stringlib_ljust, METH_VARARGS, _Py_ljust__doc__}, {"lower", (PyCFunction)stringlib_lower, METH_NOARGS, _Py_lower__doc__}, BYTES_LSTRIP_METHODDEF BYTES_MAKETRANS_METHODDEF BYTES_PARTITION_METHODDEF BYTES_REPLACE_METHODDEF - {"rfind", (PyCFunction)bytes_rfind, METH_VARARGS, rfind__doc__}, - {"rindex", (PyCFunction)bytes_rindex, METH_VARARGS, rindex__doc__}, - {"rjust", (PyCFunction)stringlib_rjust, METH_VARARGS, rjust__doc__}, + {"rfind", (PyCFunction)bytes_rfind, METH_VARARGS, _Py_rfind__doc__}, + {"rindex", (PyCFunction)bytes_rindex, METH_VARARGS, _Py_rindex__doc__}, + {"rjust", (PyCFunction)stringlib_rjust, METH_VARARGS, _Py_rjust__doc__}, BYTES_RPARTITION_METHODDEF BYTES_RSPLIT_METHODDEF BYTES_RSTRIP_METHODDEF BYTES_SPLIT_METHODDEF BYTES_SPLITLINES_METHODDEF {"startswith", (PyCFunction)bytes_startswith, METH_VARARGS, - startswith__doc__}, + _Py_startswith__doc__}, BYTES_STRIP_METHODDEF {"swapcase", (PyCFunction)stringlib_swapcase, METH_NOARGS, _Py_swapcase__doc__}, {"title", (PyCFunction)stringlib_title, METH_NOARGS, _Py_title__doc__}, BYTES_TRANSLATE_METHODDEF {"upper", (PyCFunction)stringlib_upper, METH_NOARGS, _Py_upper__doc__}, - {"zfill", (PyCFunction)stringlib_zfill, METH_VARARGS, zfill__doc__}, + {"zfill", (PyCFunction)stringlib_zfill, METH_VARARGS, _Py_zfill__doc__}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/stringlib/find.h b/Objects/stringlib/find.h --- a/Objects/stringlib/find.h +++ b/Objects/stringlib/find.h @@ -117,76 +117,3 @@ } #undef FORMAT_BUFFER_SIZE - -#if STRINGLIB_IS_UNICODE - -/* -Wraps stringlib_parse_args_finds() and additionally ensures that the -first argument is a unicode object. -*/ - -Py_LOCAL_INLINE(int) -STRINGLIB(parse_args_finds_unicode)(const char * function_name, PyObject *args, - PyObject **substring, - Py_ssize_t *start, Py_ssize_t *end) -{ - if(STRINGLIB(parse_args_finds)(function_name, args, substring, - start, end)) { - if (ensure_unicode(*substring) < 0) - return 0; - return 1; - } - return 0; -} - -#else /* !STRINGLIB_IS_UNICODE */ - -/* -Wraps stringlib_parse_args_finds() and additionally checks whether the -first argument is an integer in range(0, 256). - -If this is the case, writes the integer value to the byte parameter -and sets subobj to NULL. Otherwise, sets the first argument to subobj -and doesn't touch byte. The other parameters are similar to those of -stringlib_parse_args_finds(). -*/ - -Py_LOCAL_INLINE(int) -STRINGLIB(parse_args_finds_byte)(const char *function_name, PyObject *args, - PyObject **subobj, char *byte, - Py_ssize_t *start, Py_ssize_t *end) -{ - PyObject *tmp_subobj; - Py_ssize_t ival; - PyObject *err; - - if(!STRINGLIB(parse_args_finds)(function_name, args, &tmp_subobj, - start, end)) - return 0; - - if (!PyNumber_Check(tmp_subobj)) { - *subobj = tmp_subobj; - return 1; - } - - ival = PyNumber_AsSsize_t(tmp_subobj, PyExc_OverflowError); - if (ival == -1) { - err = PyErr_Occurred(); - if (err && !PyErr_GivenExceptionMatches(err, PyExc_OverflowError)) { - PyErr_Clear(); - *subobj = tmp_subobj; - return 1; - } - } - - if (ival < 0 || ival > 255) { - PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)"); - return 0; - } - - *subobj = NULL; - *byte = (char)ival; - return 1; -} - -#endif /* STRINGLIB_IS_UNICODE */ diff --git a/Objects/stringlib/transmogrify.h b/Objects/stringlib/transmogrify.h --- a/Objects/stringlib/transmogrify.h +++ b/Objects/stringlib/transmogrify.h @@ -4,12 +4,6 @@ /* the more complicated methods. parts of these should be pulled out into the shared code in bytes_methods.c to cut down on duplicate code bloat. */ -PyDoc_STRVAR(expandtabs__doc__, -"B.expandtabs(tabsize=8) -> copy of B\n\ -\n\ -Return a copy of B where all tab characters are expanded using spaces.\n\ -If tabsize is not given, a tab size of 8 characters is assumed."); - static PyObject* stringlib_expandtabs(PyObject *self, PyObject *args, PyObject *kwds) { @@ -120,12 +114,6 @@ return u; } -PyDoc_STRVAR(ljust__doc__, -"B.ljust(width[, fillchar]) -> copy of B\n" -"\n" -"Return B left justified in a string of length width. Padding is\n" -"done using the specified fill character (default is a space)."); - static PyObject * stringlib_ljust(PyObject *self, PyObject *args) { @@ -150,12 +138,6 @@ } -PyDoc_STRVAR(rjust__doc__, -"B.rjust(width[, fillchar]) -> copy of B\n" -"\n" -"Return B right justified in a string of length width. Padding is\n" -"done using the specified fill character (default is a space)"); - static PyObject * stringlib_rjust(PyObject *self, PyObject *args) { @@ -180,12 +162,6 @@ } -PyDoc_STRVAR(center__doc__, -"B.center(width[, fillchar]) -> copy of B\n" -"\n" -"Return B centered in a string of length width. Padding is\n" -"done using the specified fill character (default is a space)."); - static PyObject * stringlib_center(PyObject *self, PyObject *args) { @@ -213,12 +189,6 @@ return pad(self, left, marg - left, fillchar); } -PyDoc_STRVAR(zfill__doc__, -"B.zfill(width) -> copy of B\n" -"\n" -"Pad a numeric string B with zeros on the left, to fill a field\n" -"of the specified width. B is never truncated."); - static PyObject * stringlib_zfill(PyObject *self, PyObject *args) { diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -11244,6 +11244,25 @@ Py_XDECREF(right); } +/* +Wraps stringlib_parse_args_finds() and additionally ensures that the +first argument is a unicode object. +*/ + +Py_LOCAL_INLINE(int) +parse_args_finds_unicode(const char * function_name, PyObject *args, + PyObject **substring, + Py_ssize_t *start, Py_ssize_t *end) +{ + if(stringlib_parse_args_finds(function_name, args, substring, + start, end)) { + if (ensure_unicode(*substring) < 0) + return 0; + return 1; + } + return 0; +} + PyDoc_STRVAR(count__doc__, "S.count(sub[, start[, end]]) -> int\n\ \n\ @@ -11262,8 +11281,7 @@ void *buf1, *buf2; Py_ssize_t len1, len2, iresult; - if (!stringlib_parse_args_finds_unicode("count", args, &substring, - &start, &end)) + if (!parse_args_finds_unicode("count", args, &substring, &start, &end)) return NULL; kind1 = PyUnicode_KIND(self); @@ -11445,8 +11463,7 @@ Py_ssize_t end = 0; Py_ssize_t result; - if (!stringlib_parse_args_finds_unicode("find", args, &substring, - &start, &end)) + if (!parse_args_finds_unicode("find", args, &substring, &start, &end)) return NULL; if (PyUnicode_READY(self) == -1) @@ -11525,8 +11542,7 @@ Py_ssize_t start = 0; Py_ssize_t end = 0; - if (!stringlib_parse_args_finds_unicode("index", args, &substring, - &start, &end)) + if (!parse_args_finds_unicode("index", args, &substring, &start, &end)) return NULL; if (PyUnicode_READY(self) == -1) @@ -12555,8 +12571,7 @@ Py_ssize_t end = 0; Py_ssize_t result; - if (!stringlib_parse_args_finds_unicode("rfind", args, &substring, - &start, &end)) + if (!parse_args_finds_unicode("rfind", args, &substring, &start, &end)) return NULL; if (PyUnicode_READY(self) == -1) @@ -12584,8 +12599,7 @@ Py_ssize_t end = 0; Py_ssize_t result; - if (!stringlib_parse_args_finds_unicode("rindex", args, &substring, - &start, &end)) + if (!parse_args_finds_unicode("rindex", args, &substring, &start, &end)) return NULL; if (PyUnicode_READY(self) == -1) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 16:25:52 2016 From: python-checkins at python.org (berker.peksag) Date: Wed, 04 May 2016 20:25:52 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2OTU3?= =?utf-8?q?=3A_Remove_duplicate_=27the=27_from_datetime_documentation?= Message-ID: <20160504202549.29225.67777.077343D9@psf.io> https://hg.python.org/cpython/rev/580ddeccd689 changeset: 101231:580ddeccd689 branch: 3.5 parent: 101226:a98ef122d73d user: Berker Peksag date: Wed May 04 23:25:44 2016 +0300 summary: Issue #26957: Remove duplicate 'the' from datetime documentation Patch by Alex Chan. files: Doc/library/datetime.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1869,7 +1869,7 @@ +-----------+--------------------------------+------------------------+-------+ | ``%z`` | UTC offset in the form +HHMM | (empty), +0000, -0400, | \(6) | | | or -HHMM (empty string if the | +1030 | | -| | the object is naive). | | | +| | object is naive). | | | +-----------+--------------------------------+------------------------+-------+ | ``%Z`` | Time zone name (empty string | (empty), UTC, EST, CST | | | | if the object is naive). | | | -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 4 16:26:03 2016 From: python-checkins at python.org (berker.peksag) Date: Wed, 04 May 2016 20:26:03 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326957=3A_Remove_duplicate_=27the=27_from_dateti?= =?utf-8?q?me_documentation?= Message-ID: <20160504202550.70745.44274.EF9FF6E3@psf.io> https://hg.python.org/cpython/rev/3a069e5593ef changeset: 101232:3a069e5593ef parent: 101230:41969033eb9d parent: 101231:580ddeccd689 user: Berker Peksag date: Wed May 04 23:26:04 2016 +0300 summary: Issue #26957: Remove duplicate 'the' from datetime documentation Patch by Alex Chan. files: Doc/library/datetime.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1941,7 +1941,7 @@ +-----------+--------------------------------+------------------------+-------+ | ``%z`` | UTC offset in the form +HHMM | (empty), +0000, -0400, | \(6) | | | or -HHMM (empty string if the | +1030 | | -| | the object is naive). | | | +| | object is naive). | | | +-----------+--------------------------------+------------------------+-------+ | ``%Z`` | Time zone name (empty string | (empty), UTC, EST, CST | | | | if the object is naive). | | | -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 5 02:26:29 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Thu, 05 May 2016 06:26:29 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326765=3A_Moved_co?= =?utf-8?q?mmon_code_for_the_replace=28=29_method_of_bytes_and_bytearray?= Message-ID: <20160505062627.22563.67001.911C7F57@psf.io> https://hg.python.org/cpython/rev/f4406d746d27 changeset: 101233:f4406d746d27 user: Serhiy Storchaka date: Thu May 05 09:26:07 2016 +0300 summary: Issue #26765: Moved common code for the replace() method of bytes and bytearray to a template file. files: Objects/bytearrayobject.c | 503 +---------------- Objects/bytesobject.c | 508 +---------------- Objects/stringlib/transmogrify.h | 578 +++++++++++++++++- 3 files changed, 527 insertions(+), 1062 deletions(-) diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -1307,503 +1307,6 @@ } -/* find and count characters and substrings */ - -#define findchar(target, target_len, c) \ - ((char *)memchr((const void *)(target), c, target_len)) - - -/* Bytes ops must return a string, create a copy */ -Py_LOCAL(PyByteArrayObject *) -return_self(PyByteArrayObject *self) -{ - /* always return a new bytearray */ - return (PyByteArrayObject *)PyByteArray_FromStringAndSize( - PyByteArray_AS_STRING(self), - PyByteArray_GET_SIZE(self)); -} - -Py_LOCAL_INLINE(Py_ssize_t) -countchar(const char *target, Py_ssize_t target_len, char c, Py_ssize_t maxcount) -{ - Py_ssize_t count=0; - const char *start=target; - const char *end=target+target_len; - - while ( (start=findchar(start, end-start, c)) != NULL ) { - count++; - if (count >= maxcount) - break; - start += 1; - } - return count; -} - - -/* Algorithms for different cases of string replacement */ - -/* len(self)>=1, from="", len(to)>=1, maxcount>=1 */ -Py_LOCAL(PyByteArrayObject *) -replace_interleave(PyByteArrayObject *self, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - char *self_s, *result_s; - Py_ssize_t self_len, result_len; - Py_ssize_t count, i; - PyByteArrayObject *result; - - self_len = PyByteArray_GET_SIZE(self); - - /* 1 at the end plus 1 after every character; - count = min(maxcount, self_len + 1) */ - if (maxcount <= self_len) - count = maxcount; - else - /* Can't overflow: self_len + 1 <= maxcount <= PY_SSIZE_T_MAX. */ - count = self_len + 1; - - /* Check for overflow */ - /* result_len = count * to_len + self_len; */ - assert(count > 0); - if (to_len > (PY_SSIZE_T_MAX - self_len) / count) { - PyErr_SetString(PyExc_OverflowError, - "replace string is too long"); - return NULL; - } - result_len = count * to_len + self_len; - - if (! (result = (PyByteArrayObject *) - PyByteArray_FromStringAndSize(NULL, result_len)) ) - return NULL; - - self_s = PyByteArray_AS_STRING(self); - result_s = PyByteArray_AS_STRING(result); - - if (to_len > 1) { - /* Lay the first one down (guaranteed this will occur) */ - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - count -= 1; - - for (i = 0; i < count; i++) { - *result_s++ = *self_s++; - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - } - } - else { - result_s[0] = to_s[0]; - result_s += to_len; - count -= 1; - for (i = 0; i < count; i++) { - *result_s++ = *self_s++; - result_s[0] = to_s[0]; - result_s += to_len; - } - } - - /* Copy the rest of the original string */ - Py_MEMCPY(result_s, self_s, self_len-i); - - return result; -} - -/* Special case for deleting a single character */ -/* len(self)>=1, len(from)==1, to="", maxcount>=1 */ -Py_LOCAL(PyByteArrayObject *) -replace_delete_single_character(PyByteArrayObject *self, - char from_c, Py_ssize_t maxcount) -{ - char *self_s, *result_s; - char *start, *next, *end; - Py_ssize_t self_len, result_len; - Py_ssize_t count; - PyByteArrayObject *result; - - self_len = PyByteArray_GET_SIZE(self); - self_s = PyByteArray_AS_STRING(self); - - count = countchar(self_s, self_len, from_c, maxcount); - if (count == 0) { - return return_self(self); - } - - result_len = self_len - count; /* from_len == 1 */ - assert(result_len>=0); - - if ( (result = (PyByteArrayObject *) - PyByteArray_FromStringAndSize(NULL, result_len)) == NULL) - return NULL; - result_s = PyByteArray_AS_STRING(result); - - start = self_s; - end = self_s + self_len; - while (count-- > 0) { - next = findchar(start, end-start, from_c); - if (next == NULL) - break; - Py_MEMCPY(result_s, start, next-start); - result_s += (next-start); - start = next+1; - } - Py_MEMCPY(result_s, start, end-start); - - return result; -} - -/* len(self)>=1, len(from)>=2, to="", maxcount>=1 */ - -Py_LOCAL(PyByteArrayObject *) -replace_delete_substring(PyByteArrayObject *self, - const char *from_s, Py_ssize_t from_len, - Py_ssize_t maxcount) -{ - char *self_s, *result_s; - char *start, *next, *end; - Py_ssize_t self_len, result_len; - Py_ssize_t count, offset; - PyByteArrayObject *result; - - self_len = PyByteArray_GET_SIZE(self); - self_s = PyByteArray_AS_STRING(self); - - count = stringlib_count(self_s, self_len, - from_s, from_len, - maxcount); - - if (count == 0) { - /* no matches */ - return return_self(self); - } - - result_len = self_len - (count * from_len); - assert (result_len>=0); - - if ( (result = (PyByteArrayObject *) - PyByteArray_FromStringAndSize(NULL, result_len)) == NULL ) - return NULL; - - result_s = PyByteArray_AS_STRING(result); - - start = self_s; - end = self_s + self_len; - while (count-- > 0) { - offset = stringlib_find(start, end-start, - from_s, from_len, - 0); - if (offset == -1) - break; - next = start + offset; - - Py_MEMCPY(result_s, start, next-start); - - result_s += (next-start); - start = next+from_len; - } - Py_MEMCPY(result_s, start, end-start); - return result; -} - -/* len(self)>=1, len(from)==len(to)==1, maxcount>=1 */ -Py_LOCAL(PyByteArrayObject *) -replace_single_character_in_place(PyByteArrayObject *self, - char from_c, char to_c, - Py_ssize_t maxcount) -{ - char *self_s, *result_s, *start, *end, *next; - Py_ssize_t self_len; - PyByteArrayObject *result; - - /* The result string will be the same size */ - self_s = PyByteArray_AS_STRING(self); - self_len = PyByteArray_GET_SIZE(self); - - next = findchar(self_s, self_len, from_c); - - if (next == NULL) { - /* No matches; return the original bytes */ - return return_self(self); - } - - /* Need to make a new bytes */ - result = (PyByteArrayObject *) PyByteArray_FromStringAndSize(NULL, self_len); - if (result == NULL) - return NULL; - result_s = PyByteArray_AS_STRING(result); - Py_MEMCPY(result_s, self_s, self_len); - - /* change everything in-place, starting with this one */ - start = result_s + (next-self_s); - *start = to_c; - start++; - end = result_s + self_len; - - while (--maxcount > 0) { - next = findchar(start, end-start, from_c); - if (next == NULL) - break; - *next = to_c; - start = next+1; - } - - return result; -} - -/* len(self)>=1, len(from)==len(to)>=2, maxcount>=1 */ -Py_LOCAL(PyByteArrayObject *) -replace_substring_in_place(PyByteArrayObject *self, - const char *from_s, Py_ssize_t from_len, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - char *result_s, *start, *end; - char *self_s; - Py_ssize_t self_len, offset; - PyByteArrayObject *result; - - /* The result bytes will be the same size */ - - self_s = PyByteArray_AS_STRING(self); - self_len = PyByteArray_GET_SIZE(self); - - offset = stringlib_find(self_s, self_len, - from_s, from_len, - 0); - if (offset == -1) { - /* No matches; return the original bytes */ - return return_self(self); - } - - /* Need to make a new bytes */ - result = (PyByteArrayObject *) PyByteArray_FromStringAndSize(NULL, self_len); - if (result == NULL) - return NULL; - result_s = PyByteArray_AS_STRING(result); - Py_MEMCPY(result_s, self_s, self_len); - - /* change everything in-place, starting with this one */ - start = result_s + offset; - Py_MEMCPY(start, to_s, from_len); - start += from_len; - end = result_s + self_len; - - while ( --maxcount > 0) { - offset = stringlib_find(start, end-start, - from_s, from_len, - 0); - if (offset==-1) - break; - Py_MEMCPY(start+offset, to_s, from_len); - start += offset+from_len; - } - - return result; -} - -/* len(self)>=1, len(from)==1, len(to)>=2, maxcount>=1 */ -Py_LOCAL(PyByteArrayObject *) -replace_single_character(PyByteArrayObject *self, - char from_c, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - char *self_s, *result_s; - char *start, *next, *end; - Py_ssize_t self_len, result_len; - Py_ssize_t count; - PyByteArrayObject *result; - - self_s = PyByteArray_AS_STRING(self); - self_len = PyByteArray_GET_SIZE(self); - - count = countchar(self_s, self_len, from_c, maxcount); - if (count == 0) { - /* no matches, return unchanged */ - return return_self(self); - } - - /* use the difference between current and new, hence the "-1" */ - /* result_len = self_len + count * (to_len-1) */ - assert(count > 0); - if (to_len - 1 > (PY_SSIZE_T_MAX - self_len) / count) { - PyErr_SetString(PyExc_OverflowError, "replace bytes is too long"); - return NULL; - } - result_len = self_len + count * (to_len - 1); - - if ( (result = (PyByteArrayObject *) - PyByteArray_FromStringAndSize(NULL, result_len)) == NULL) - return NULL; - result_s = PyByteArray_AS_STRING(result); - - start = self_s; - end = self_s + self_len; - while (count-- > 0) { - next = findchar(start, end-start, from_c); - if (next == NULL) - break; - - if (next == start) { - /* replace with the 'to' */ - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - start += 1; - } else { - /* copy the unchanged old then the 'to' */ - Py_MEMCPY(result_s, start, next-start); - result_s += (next-start); - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - start = next+1; - } - } - /* Copy the remainder of the remaining bytes */ - Py_MEMCPY(result_s, start, end-start); - - return result; -} - -/* len(self)>=1, len(from)>=2, len(to)>=2, maxcount>=1 */ -Py_LOCAL(PyByteArrayObject *) -replace_substring(PyByteArrayObject *self, - const char *from_s, Py_ssize_t from_len, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - char *self_s, *result_s; - char *start, *next, *end; - Py_ssize_t self_len, result_len; - Py_ssize_t count, offset; - PyByteArrayObject *result; - - self_s = PyByteArray_AS_STRING(self); - self_len = PyByteArray_GET_SIZE(self); - - count = stringlib_count(self_s, self_len, - from_s, from_len, - maxcount); - - if (count == 0) { - /* no matches, return unchanged */ - return return_self(self); - } - - /* Check for overflow */ - /* result_len = self_len + count * (to_len-from_len) */ - assert(count > 0); - if (to_len - from_len > (PY_SSIZE_T_MAX - self_len) / count) { - PyErr_SetString(PyExc_OverflowError, "replace bytes is too long"); - return NULL; - } - result_len = self_len + count * (to_len - from_len); - - if ( (result = (PyByteArrayObject *) - PyByteArray_FromStringAndSize(NULL, result_len)) == NULL) - return NULL; - result_s = PyByteArray_AS_STRING(result); - - start = self_s; - end = self_s + self_len; - while (count-- > 0) { - offset = stringlib_find(start, end-start, - from_s, from_len, - 0); - if (offset == -1) - break; - next = start+offset; - if (next == start) { - /* replace with the 'to' */ - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - start += from_len; - } else { - /* copy the unchanged old then the 'to' */ - Py_MEMCPY(result_s, start, next-start); - result_s += (next-start); - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - start = next+from_len; - } - } - /* Copy the remainder of the remaining bytes */ - Py_MEMCPY(result_s, start, end-start); - - return result; -} - - -Py_LOCAL(PyByteArrayObject *) -replace(PyByteArrayObject *self, - const char *from_s, Py_ssize_t from_len, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - if (maxcount < 0) { - maxcount = PY_SSIZE_T_MAX; - } else if (maxcount == 0 || PyByteArray_GET_SIZE(self) == 0) { - /* nothing to do; return the original bytes */ - return return_self(self); - } - - if (maxcount == 0 || - (from_len == 0 && to_len == 0)) { - /* nothing to do; return the original bytes */ - return return_self(self); - } - - /* Handle zero-length special cases */ - - if (from_len == 0) { - /* insert the 'to' bytes everywhere. */ - /* >>> "Python".replace("", ".") */ - /* '.P.y.t.h.o.n.' */ - return replace_interleave(self, to_s, to_len, maxcount); - } - - /* Except for "".replace("", "A") == "A" there is no way beyond this */ - /* point for an empty self bytes to generate a non-empty bytes */ - /* Special case so the remaining code always gets a non-empty bytes */ - if (PyByteArray_GET_SIZE(self) == 0) { - return return_self(self); - } - - if (to_len == 0) { - /* delete all occurrences of 'from' bytes */ - if (from_len == 1) { - return replace_delete_single_character( - self, from_s[0], maxcount); - } else { - return replace_delete_substring(self, from_s, from_len, maxcount); - } - } - - /* Handle special case where both bytes have the same length */ - - if (from_len == to_len) { - if (from_len == 1) { - return replace_single_character_in_place( - self, - from_s[0], - to_s[0], - maxcount); - } else { - return replace_substring_in_place( - self, from_s, from_len, to_s, to_len, maxcount); - } - } - - /* Otherwise use the more generic algorithms */ - if (from_len == 1) { - return replace_single_character(self, from_s[0], - to_s, to_len, maxcount); - } else { - /* len('from')>=2, len('to')>=1 */ - return replace_substring(self, from_s, from_len, to_s, to_len, maxcount); - } -} - - /*[clinic input] bytearray.replace @@ -1825,9 +1328,9 @@ Py_buffer *new, Py_ssize_t count) /*[clinic end generated code: output=d39884c4dc59412a input=aa379d988637c7fb]*/ { - return (PyObject *)replace((PyByteArrayObject *) self, - old->buf, old->len, - new->buf, new->len, count); + return stringlib_replace((PyObject *)self, + (const char *)old->buf, old->len, + (const char *)new->buf, new->len, count); } /*[clinic input] diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2198,508 +2198,6 @@ return _Py_bytes_maketrans(frm, to); } -/* find and count characters and substrings */ - -#define findchar(target, target_len, c) \ - ((char *)memchr((const void *)(target), c, target_len)) - -/* String ops must return a string. */ -/* If the object is subclass of string, create a copy */ -Py_LOCAL(PyBytesObject *) -return_self(PyBytesObject *self) -{ - if (PyBytes_CheckExact(self)) { - Py_INCREF(self); - return self; - } - return (PyBytesObject *)PyBytes_FromStringAndSize( - PyBytes_AS_STRING(self), - PyBytes_GET_SIZE(self)); -} - -Py_LOCAL_INLINE(Py_ssize_t) -countchar(const char *target, Py_ssize_t target_len, char c, Py_ssize_t maxcount) -{ - Py_ssize_t count=0; - const char *start=target; - const char *end=target+target_len; - - while ( (start=findchar(start, end-start, c)) != NULL ) { - count++; - if (count >= maxcount) - break; - start += 1; - } - return count; -} - - -/* Algorithms for different cases of string replacement */ - -/* len(self)>=1, from="", len(to)>=1, maxcount>=1 */ -Py_LOCAL(PyBytesObject *) -replace_interleave(PyBytesObject *self, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - char *self_s, *result_s; - Py_ssize_t self_len, result_len; - Py_ssize_t count, i; - PyBytesObject *result; - - self_len = PyBytes_GET_SIZE(self); - - /* 1 at the end plus 1 after every character; - count = min(maxcount, self_len + 1) */ - if (maxcount <= self_len) - count = maxcount; - else - /* Can't overflow: self_len + 1 <= maxcount <= PY_SSIZE_T_MAX. */ - count = self_len + 1; - - /* Check for overflow */ - /* result_len = count * to_len + self_len; */ - assert(count > 0); - if (to_len > (PY_SSIZE_T_MAX - self_len) / count) { - PyErr_SetString(PyExc_OverflowError, - "replacement bytes are too long"); - return NULL; - } - result_len = count * to_len + self_len; - - if (! (result = (PyBytesObject *) - PyBytes_FromStringAndSize(NULL, result_len)) ) - return NULL; - - self_s = PyBytes_AS_STRING(self); - result_s = PyBytes_AS_STRING(result); - - if (to_len > 1) { - /* Lay the first one down (guaranteed this will occur) */ - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - count -= 1; - - for (i = 0; i < count; i++) { - *result_s++ = *self_s++; - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - } - } - else { - result_s[0] = to_s[0]; - result_s += to_len; - count -= 1; - for (i = 0; i < count; i++) { - *result_s++ = *self_s++; - result_s[0] = to_s[0]; - result_s += to_len; - } - } - - /* Copy the rest of the original string */ - Py_MEMCPY(result_s, self_s, self_len-i); - - return result; -} - -/* Special case for deleting a single character */ -/* len(self)>=1, len(from)==1, to="", maxcount>=1 */ -Py_LOCAL(PyBytesObject *) -replace_delete_single_character(PyBytesObject *self, - char from_c, Py_ssize_t maxcount) -{ - char *self_s, *result_s; - char *start, *next, *end; - Py_ssize_t self_len, result_len; - Py_ssize_t count; - PyBytesObject *result; - - self_len = PyBytes_GET_SIZE(self); - self_s = PyBytes_AS_STRING(self); - - count = countchar(self_s, self_len, from_c, maxcount); - if (count == 0) { - return return_self(self); - } - - result_len = self_len - count; /* from_len == 1 */ - assert(result_len>=0); - - if ( (result = (PyBytesObject *) - PyBytes_FromStringAndSize(NULL, result_len)) == NULL) - return NULL; - result_s = PyBytes_AS_STRING(result); - - start = self_s; - end = self_s + self_len; - while (count-- > 0) { - next = findchar(start, end-start, from_c); - if (next == NULL) - break; - Py_MEMCPY(result_s, start, next-start); - result_s += (next-start); - start = next+1; - } - Py_MEMCPY(result_s, start, end-start); - - return result; -} - -/* len(self)>=1, len(from)>=2, to="", maxcount>=1 */ - -Py_LOCAL(PyBytesObject *) -replace_delete_substring(PyBytesObject *self, - const char *from_s, Py_ssize_t from_len, - Py_ssize_t maxcount) { - char *self_s, *result_s; - char *start, *next, *end; - Py_ssize_t self_len, result_len; - Py_ssize_t count, offset; - PyBytesObject *result; - - self_len = PyBytes_GET_SIZE(self); - self_s = PyBytes_AS_STRING(self); - - count = stringlib_count(self_s, self_len, - from_s, from_len, - maxcount); - - if (count == 0) { - /* no matches */ - return return_self(self); - } - - result_len = self_len - (count * from_len); - assert (result_len>=0); - - if ( (result = (PyBytesObject *) - PyBytes_FromStringAndSize(NULL, result_len)) == NULL ) - return NULL; - - result_s = PyBytes_AS_STRING(result); - - start = self_s; - end = self_s + self_len; - while (count-- > 0) { - offset = stringlib_find(start, end-start, - from_s, from_len, - 0); - if (offset == -1) - break; - next = start + offset; - - Py_MEMCPY(result_s, start, next-start); - - result_s += (next-start); - start = next+from_len; - } - Py_MEMCPY(result_s, start, end-start); - return result; -} - -/* len(self)>=1, len(from)==len(to)==1, maxcount>=1 */ -Py_LOCAL(PyBytesObject *) -replace_single_character_in_place(PyBytesObject *self, - char from_c, char to_c, - Py_ssize_t maxcount) -{ - char *self_s, *result_s, *start, *end, *next; - Py_ssize_t self_len; - PyBytesObject *result; - - /* The result string will be the same size */ - self_s = PyBytes_AS_STRING(self); - self_len = PyBytes_GET_SIZE(self); - - next = findchar(self_s, self_len, from_c); - - if (next == NULL) { - /* No matches; return the original string */ - return return_self(self); - } - - /* Need to make a new string */ - result = (PyBytesObject *) PyBytes_FromStringAndSize(NULL, self_len); - if (result == NULL) - return NULL; - result_s = PyBytes_AS_STRING(result); - Py_MEMCPY(result_s, self_s, self_len); - - /* change everything in-place, starting with this one */ - start = result_s + (next-self_s); - *start = to_c; - start++; - end = result_s + self_len; - - while (--maxcount > 0) { - next = findchar(start, end-start, from_c); - if (next == NULL) - break; - *next = to_c; - start = next+1; - } - - return result; -} - -/* len(self)>=1, len(from)==len(to)>=2, maxcount>=1 */ -Py_LOCAL(PyBytesObject *) -replace_substring_in_place(PyBytesObject *self, - const char *from_s, Py_ssize_t from_len, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - char *result_s, *start, *end; - char *self_s; - Py_ssize_t self_len, offset; - PyBytesObject *result; - - /* The result string will be the same size */ - - self_s = PyBytes_AS_STRING(self); - self_len = PyBytes_GET_SIZE(self); - - offset = stringlib_find(self_s, self_len, - from_s, from_len, - 0); - if (offset == -1) { - /* No matches; return the original string */ - return return_self(self); - } - - /* Need to make a new string */ - result = (PyBytesObject *) PyBytes_FromStringAndSize(NULL, self_len); - if (result == NULL) - return NULL; - result_s = PyBytes_AS_STRING(result); - Py_MEMCPY(result_s, self_s, self_len); - - /* change everything in-place, starting with this one */ - start = result_s + offset; - Py_MEMCPY(start, to_s, from_len); - start += from_len; - end = result_s + self_len; - - while ( --maxcount > 0) { - offset = stringlib_find(start, end-start, - from_s, from_len, - 0); - if (offset==-1) - break; - Py_MEMCPY(start+offset, to_s, from_len); - start += offset+from_len; - } - - return result; -} - -/* len(self)>=1, len(from)==1, len(to)>=2, maxcount>=1 */ -Py_LOCAL(PyBytesObject *) -replace_single_character(PyBytesObject *self, - char from_c, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - char *self_s, *result_s; - char *start, *next, *end; - Py_ssize_t self_len, result_len; - Py_ssize_t count; - PyBytesObject *result; - - self_s = PyBytes_AS_STRING(self); - self_len = PyBytes_GET_SIZE(self); - - count = countchar(self_s, self_len, from_c, maxcount); - if (count == 0) { - /* no matches, return unchanged */ - return return_self(self); - } - - /* use the difference between current and new, hence the "-1" */ - /* result_len = self_len + count * (to_len-1) */ - assert(count > 0); - if (to_len - 1 > (PY_SSIZE_T_MAX - self_len) / count) { - PyErr_SetString(PyExc_OverflowError, - "replacement bytes are too long"); - return NULL; - } - result_len = self_len + count * (to_len - 1); - - if ( (result = (PyBytesObject *) - PyBytes_FromStringAndSize(NULL, result_len)) == NULL) - return NULL; - result_s = PyBytes_AS_STRING(result); - - start = self_s; - end = self_s + self_len; - while (count-- > 0) { - next = findchar(start, end-start, from_c); - if (next == NULL) - break; - - if (next == start) { - /* replace with the 'to' */ - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - start += 1; - } else { - /* copy the unchanged old then the 'to' */ - Py_MEMCPY(result_s, start, next-start); - result_s += (next-start); - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - start = next+1; - } - } - /* Copy the remainder of the remaining string */ - Py_MEMCPY(result_s, start, end-start); - - return result; -} - -/* len(self)>=1, len(from)>=2, len(to)>=2, maxcount>=1 */ -Py_LOCAL(PyBytesObject *) -replace_substring(PyBytesObject *self, - const char *from_s, Py_ssize_t from_len, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) { - char *self_s, *result_s; - char *start, *next, *end; - Py_ssize_t self_len, result_len; - Py_ssize_t count, offset; - PyBytesObject *result; - - self_s = PyBytes_AS_STRING(self); - self_len = PyBytes_GET_SIZE(self); - - count = stringlib_count(self_s, self_len, - from_s, from_len, - maxcount); - - if (count == 0) { - /* no matches, return unchanged */ - return return_self(self); - } - - /* Check for overflow */ - /* result_len = self_len + count * (to_len-from_len) */ - assert(count > 0); - if (to_len - from_len > (PY_SSIZE_T_MAX - self_len) / count) { - PyErr_SetString(PyExc_OverflowError, - "replacement bytes are too long"); - return NULL; - } - result_len = self_len + count * (to_len-from_len); - - if ( (result = (PyBytesObject *) - PyBytes_FromStringAndSize(NULL, result_len)) == NULL) - return NULL; - result_s = PyBytes_AS_STRING(result); - - start = self_s; - end = self_s + self_len; - while (count-- > 0) { - offset = stringlib_find(start, end-start, - from_s, from_len, - 0); - if (offset == -1) - break; - next = start+offset; - if (next == start) { - /* replace with the 'to' */ - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - start += from_len; - } else { - /* copy the unchanged old then the 'to' */ - Py_MEMCPY(result_s, start, next-start); - result_s += (next-start); - Py_MEMCPY(result_s, to_s, to_len); - result_s += to_len; - start = next+from_len; - } - } - /* Copy the remainder of the remaining string */ - Py_MEMCPY(result_s, start, end-start); - - return result; -} - - -Py_LOCAL(PyBytesObject *) -replace(PyBytesObject *self, - const char *from_s, Py_ssize_t from_len, - const char *to_s, Py_ssize_t to_len, - Py_ssize_t maxcount) -{ - if (maxcount < 0) { - maxcount = PY_SSIZE_T_MAX; - } else if (maxcount == 0 || PyBytes_GET_SIZE(self) == 0) { - /* nothing to do; return the original string */ - return return_self(self); - } - - if (maxcount == 0 || - (from_len == 0 && to_len == 0)) { - /* nothing to do; return the original string */ - return return_self(self); - } - - /* Handle zero-length special cases */ - - if (from_len == 0) { - /* insert the 'to' string everywhere. */ - /* >>> "Python".replace("", ".") */ - /* '.P.y.t.h.o.n.' */ - return replace_interleave(self, to_s, to_len, maxcount); - } - - /* Except for "".replace("", "A") == "A" there is no way beyond this */ - /* point for an empty self string to generate a non-empty string */ - /* Special case so the remaining code always gets a non-empty string */ - if (PyBytes_GET_SIZE(self) == 0) { - return return_self(self); - } - - if (to_len == 0) { - /* delete all occurrences of 'from' string */ - if (from_len == 1) { - return replace_delete_single_character( - self, from_s[0], maxcount); - } else { - return replace_delete_substring(self, from_s, - from_len, maxcount); - } - } - - /* Handle special case where both strings have the same length */ - - if (from_len == to_len) { - if (from_len == 1) { - return replace_single_character_in_place( - self, - from_s[0], - to_s[0], - maxcount); - } else { - return replace_substring_in_place( - self, from_s, from_len, to_s, to_len, - maxcount); - } - } - - /* Otherwise use the more generic algorithms */ - if (from_len == 1) { - return replace_single_character(self, from_s[0], - to_s, to_len, maxcount); - } else { - /* len('from')>=2, len('to')>=1 */ - return replace_substring(self, from_s, from_len, to_s, to_len, - maxcount); - } -} - /*[clinic input] bytes.replace @@ -2722,9 +2220,9 @@ Py_ssize_t count) /*[clinic end generated code: output=994fa588b6b9c104 input=b2fbbf0bf04de8e5]*/ { - return (PyObject *)replace((PyBytesObject *) self, - (const char *)old->buf, old->len, - (const char *)new->buf, new->len, count); + return stringlib_replace((PyObject *)self, + (const char *)old->buf, old->len, + (const char *)new->buf, new->len, count); } /** End DALKE **/ diff --git a/Objects/stringlib/transmogrify.h b/Objects/stringlib/transmogrify.h --- a/Objects/stringlib/transmogrify.h +++ b/Objects/stringlib/transmogrify.h @@ -4,6 +4,18 @@ /* the more complicated methods. parts of these should be pulled out into the shared code in bytes_methods.c to cut down on duplicate code bloat. */ +Py_LOCAL_INLINE(PyObject *) +return_self(PyObject *self) +{ +#if !STRINGLIB_MUTABLE + if (STRINGLIB_CHECK_EXACT(self)) { + Py_INCREF(self); + return self; + } +#endif + return STRINGLIB_NEW(STRINGLIB_STR(self), STRINGLIB_LEN(self)); +} + static PyObject* stringlib_expandtabs(PyObject *self, PyObject *args, PyObject *kwds) { @@ -87,28 +99,20 @@ if (right < 0) right = 0; - if (left == 0 && right == 0 && STRINGLIB_CHECK_EXACT(self)) { -#if STRINGLIB_MUTABLE - /* We're defined as returning a copy; If the object is mutable - * that means we must make an identical copy. */ - return STRINGLIB_NEW(STRINGLIB_STR(self), STRINGLIB_LEN(self)); -#else - Py_INCREF(self); - return (PyObject *)self; -#endif /* STRINGLIB_MUTABLE */ + if (left == 0 && right == 0) { + return return_self(self); } - u = STRINGLIB_NEW(NULL, - left + STRINGLIB_LEN(self) + right); + u = STRINGLIB_NEW(NULL, left + STRINGLIB_LEN(self) + right); if (u) { if (left) memset(STRINGLIB_STR(u), fill, left); Py_MEMCPY(STRINGLIB_STR(u) + left, - STRINGLIB_STR(self), - STRINGLIB_LEN(self)); + STRINGLIB_STR(self), + STRINGLIB_LEN(self)); if (right) memset(STRINGLIB_STR(u) + left + STRINGLIB_LEN(self), - fill, right); + fill, right); } return u; @@ -123,15 +127,8 @@ if (!PyArg_ParseTuple(args, "n|c:ljust", &width, &fillchar)) return NULL; - if (STRINGLIB_LEN(self) >= width && STRINGLIB_CHECK_EXACT(self)) { -#if STRINGLIB_MUTABLE - /* We're defined as returning a copy; If the object is mutable - * that means we must make an identical copy. */ - return STRINGLIB_NEW(STRINGLIB_STR(self), STRINGLIB_LEN(self)); -#else - Py_INCREF(self); - return (PyObject*) self; -#endif + if (STRINGLIB_LEN(self) >= width) { + return return_self(self); } return pad(self, 0, width - STRINGLIB_LEN(self), fillchar); @@ -147,15 +144,8 @@ if (!PyArg_ParseTuple(args, "n|c:rjust", &width, &fillchar)) return NULL; - if (STRINGLIB_LEN(self) >= width && STRINGLIB_CHECK_EXACT(self)) { -#if STRINGLIB_MUTABLE - /* We're defined as returning a copy; If the object is mutable - * that means we must make an identical copy. */ - return STRINGLIB_NEW(STRINGLIB_STR(self), STRINGLIB_LEN(self)); -#else - Py_INCREF(self); - return (PyObject*) self; -#endif + if (STRINGLIB_LEN(self) >= width) { + return return_self(self); } return pad(self, width - STRINGLIB_LEN(self), 0, fillchar); @@ -172,15 +162,8 @@ if (!PyArg_ParseTuple(args, "n|c:center", &width, &fillchar)) return NULL; - if (STRINGLIB_LEN(self) >= width && STRINGLIB_CHECK_EXACT(self)) { -#if STRINGLIB_MUTABLE - /* We're defined as returning a copy; If the object is mutable - * that means we must make an identical copy. */ - return STRINGLIB_NEW(STRINGLIB_STR(self), STRINGLIB_LEN(self)); -#else - Py_INCREF(self); - return (PyObject*) self; -#endif + if (STRINGLIB_LEN(self) >= width) { + return return_self(self); } marg = width - STRINGLIB_LEN(self); @@ -201,21 +184,7 @@ return NULL; if (STRINGLIB_LEN(self) >= width) { - if (STRINGLIB_CHECK_EXACT(self)) { -#if STRINGLIB_MUTABLE - /* We're defined as returning a copy; If the object is mutable - * that means we must make an identical copy. */ - return STRINGLIB_NEW(STRINGLIB_STR(self), STRINGLIB_LEN(self)); -#else - Py_INCREF(self); - return (PyObject*) self; -#endif - } - else - return STRINGLIB_NEW( - STRINGLIB_STR(self), - STRINGLIB_LEN(self) - ); + return return_self(self); } fill = width - STRINGLIB_LEN(self); @@ -232,5 +201,500 @@ p[fill] = '0'; } - return (PyObject*) s; + return s; } + + +/* find and count characters and substrings */ + +#define findchar(target, target_len, c) \ + ((char *)memchr((const void *)(target), c, target_len)) + + +Py_LOCAL_INLINE(Py_ssize_t) +countchar(const char *target, Py_ssize_t target_len, char c, + Py_ssize_t maxcount) +{ + Py_ssize_t count = 0; + const char *start = target; + const char *end = target + target_len; + + while ((start = findchar(start, end - start, c)) != NULL) { + count++; + if (count >= maxcount) + break; + start += 1; + } + return count; +} + + +/* Algorithms for different cases of string replacement */ + +/* len(self)>=1, from="", len(to)>=1, maxcount>=1 */ +Py_LOCAL(PyObject *) +stringlib_replace_interleave(PyObject *self, + const char *to_s, Py_ssize_t to_len, + Py_ssize_t maxcount) +{ + const char *self_s; + char *result_s; + Py_ssize_t self_len, result_len; + Py_ssize_t count, i; + PyObject *result; + + self_len = STRINGLIB_LEN(self); + + /* 1 at the end plus 1 after every character; + count = min(maxcount, self_len + 1) */ + if (maxcount <= self_len) { + count = maxcount; + } + else { + /* Can't overflow: self_len + 1 <= maxcount <= PY_SSIZE_T_MAX. */ + count = self_len + 1; + } + + /* Check for overflow */ + /* result_len = count * to_len + self_len; */ + assert(count > 0); + if (to_len > (PY_SSIZE_T_MAX - self_len) / count) { + PyErr_SetString(PyExc_OverflowError, + "replace bytes are too long"); + return NULL; + } + result_len = count * to_len + self_len; + result = STRINGLIB_NEW(NULL, result_len); + if (result == NULL) { + return NULL; + } + + self_s = STRINGLIB_STR(self); + result_s = STRINGLIB_STR(result); + + if (to_len > 1) { + /* Lay the first one down (guaranteed this will occur) */ + Py_MEMCPY(result_s, to_s, to_len); + result_s += to_len; + count -= 1; + + for (i = 0; i < count; i++) { + *result_s++ = *self_s++; + Py_MEMCPY(result_s, to_s, to_len); + result_s += to_len; + } + } + else { + result_s[0] = to_s[0]; + result_s += to_len; + count -= 1; + for (i = 0; i < count; i++) { + *result_s++ = *self_s++; + result_s[0] = to_s[0]; + result_s += to_len; + } + } + + /* Copy the rest of the original string */ + Py_MEMCPY(result_s, self_s, self_len - i); + + return result; +} + +/* Special case for deleting a single character */ +/* len(self)>=1, len(from)==1, to="", maxcount>=1 */ +Py_LOCAL(PyObject *) +stringlib_replace_delete_single_character(PyObject *self, + char from_c, Py_ssize_t maxcount) +{ + const char *self_s, *start, *next, *end; + char *result_s; + Py_ssize_t self_len, result_len; + Py_ssize_t count; + PyObject *result; + + self_len = STRINGLIB_LEN(self); + self_s = STRINGLIB_STR(self); + + count = countchar(self_s, self_len, from_c, maxcount); + if (count == 0) { + return return_self(self); + } + + result_len = self_len - count; /* from_len == 1 */ + assert(result_len>=0); + + result = STRINGLIB_NEW(NULL, result_len); + if (result == NULL) { + return NULL; + } + result_s = STRINGLIB_STR(result); + + start = self_s; + end = self_s + self_len; + while (count-- > 0) { + next = findchar(start, end - start, from_c); + if (next == NULL) + break; + Py_MEMCPY(result_s, start, next - start); + result_s += (next - start); + start = next + 1; + } + Py_MEMCPY(result_s, start, end - start); + + return result; +} + +/* len(self)>=1, len(from)>=2, to="", maxcount>=1 */ + +Py_LOCAL(PyObject *) +stringlib_replace_delete_substring(PyObject *self, + const char *from_s, Py_ssize_t from_len, + Py_ssize_t maxcount) +{ + const char *self_s, *start, *next, *end; + char *result_s; + Py_ssize_t self_len, result_len; + Py_ssize_t count, offset; + PyObject *result; + + self_len = STRINGLIB_LEN(self); + self_s = STRINGLIB_STR(self); + + count = stringlib_count(self_s, self_len, + from_s, from_len, + maxcount); + + if (count == 0) { + /* no matches */ + return return_self(self); + } + + result_len = self_len - (count * from_len); + assert (result_len>=0); + + result = STRINGLIB_NEW(NULL, result_len); + if (result == NULL) { + return NULL; + } + result_s = STRINGLIB_STR(result); + + start = self_s; + end = self_s + self_len; + while (count-- > 0) { + offset = stringlib_find(start, end - start, + from_s, from_len, + 0); + if (offset == -1) + break; + next = start + offset; + + Py_MEMCPY(result_s, start, next - start); + + result_s += (next - start); + start = next + from_len; + } + Py_MEMCPY(result_s, start, end - start); + return result; +} + +/* len(self)>=1, len(from)==len(to)==1, maxcount>=1 */ +Py_LOCAL(PyObject *) +stringlib_replace_single_character_in_place(PyObject *self, + char from_c, char to_c, + Py_ssize_t maxcount) +{ + const char *self_s, *end; + char *result_s, *start, *next; + Py_ssize_t self_len; + PyObject *result; + + /* The result string will be the same size */ + self_s = STRINGLIB_STR(self); + self_len = STRINGLIB_LEN(self); + + next = findchar(self_s, self_len, from_c); + + if (next == NULL) { + /* No matches; return the original bytes */ + return return_self(self); + } + + /* Need to make a new bytes */ + result = STRINGLIB_NEW(NULL, self_len); + if (result == NULL) { + return NULL; + } + result_s = STRINGLIB_STR(result); + Py_MEMCPY(result_s, self_s, self_len); + + /* change everything in-place, starting with this one */ + start = result_s + (next - self_s); + *start = to_c; + start++; + end = result_s + self_len; + + while (--maxcount > 0) { + next = findchar(start, end - start, from_c); + if (next == NULL) + break; + *next = to_c; + start = next + 1; + } + + return result; +} + +/* len(self)>=1, len(from)==len(to)>=2, maxcount>=1 */ +Py_LOCAL(PyObject *) +stringlib_replace_substring_in_place(PyObject *self, + const char *from_s, Py_ssize_t from_len, + const char *to_s, Py_ssize_t to_len, + Py_ssize_t maxcount) +{ + const char *self_s, *end; + char *result_s, *start; + Py_ssize_t self_len, offset; + PyObject *result; + + /* The result bytes will be the same size */ + + self_s = STRINGLIB_STR(self); + self_len = STRINGLIB_LEN(self); + + offset = stringlib_find(self_s, self_len, + from_s, from_len, + 0); + if (offset == -1) { + /* No matches; return the original bytes */ + return return_self(self); + } + + /* Need to make a new bytes */ + result = STRINGLIB_NEW(NULL, self_len); + if (result == NULL) { + return NULL; + } + result_s = STRINGLIB_STR(result); + Py_MEMCPY(result_s, self_s, self_len); + + /* change everything in-place, starting with this one */ + start = result_s + offset; + Py_MEMCPY(start, to_s, from_len); + start += from_len; + end = result_s + self_len; + + while ( --maxcount > 0) { + offset = stringlib_find(start, end - start, + from_s, from_len, + 0); + if (offset == -1) + break; + Py_MEMCPY(start + offset, to_s, from_len); + start += offset + from_len; + } + + return result; +} + +/* len(self)>=1, len(from)==1, len(to)>=2, maxcount>=1 */ +Py_LOCAL(PyObject *) +stringlib_replace_single_character(PyObject *self, + char from_c, + const char *to_s, Py_ssize_t to_len, + Py_ssize_t maxcount) +{ + const char *self_s, *start, *next, *end; + char *result_s; + Py_ssize_t self_len, result_len; + Py_ssize_t count; + PyObject *result; + + self_s = STRINGLIB_STR(self); + self_len = STRINGLIB_LEN(self); + + count = countchar(self_s, self_len, from_c, maxcount); + if (count == 0) { + /* no matches, return unchanged */ + return return_self(self); + } + + /* use the difference between current and new, hence the "-1" */ + /* result_len = self_len + count * (to_len-1) */ + assert(count > 0); + if (to_len - 1 > (PY_SSIZE_T_MAX - self_len) / count) { + PyErr_SetString(PyExc_OverflowError, "replace bytes is too long"); + return NULL; + } + result_len = self_len + count * (to_len - 1); + + result = STRINGLIB_NEW(NULL, result_len); + if (result == NULL) { + return NULL; + } + result_s = STRINGLIB_STR(result); + + start = self_s; + end = self_s + self_len; + while (count-- > 0) { + next = findchar(start, end - start, from_c); + if (next == NULL) + break; + + if (next == start) { + /* replace with the 'to' */ + Py_MEMCPY(result_s, to_s, to_len); + result_s += to_len; + start += 1; + } else { + /* copy the unchanged old then the 'to' */ + Py_MEMCPY(result_s, start, next - start); + result_s += (next - start); + Py_MEMCPY(result_s, to_s, to_len); + result_s += to_len; + start = next + 1; + } + } + /* Copy the remainder of the remaining bytes */ + Py_MEMCPY(result_s, start, end - start); + + return result; +} + +/* len(self)>=1, len(from)>=2, len(to)>=2, maxcount>=1 */ +Py_LOCAL(PyObject *) +stringlib_replace_substring(PyObject *self, + const char *from_s, Py_ssize_t from_len, + const char *to_s, Py_ssize_t to_len, + Py_ssize_t maxcount) +{ + const char *self_s, *start, *next, *end; + char *result_s; + Py_ssize_t self_len, result_len; + Py_ssize_t count, offset; + PyObject *result; + + self_s = STRINGLIB_STR(self); + self_len = STRINGLIB_LEN(self); + + count = stringlib_count(self_s, self_len, + from_s, from_len, + maxcount); + + if (count == 0) { + /* no matches, return unchanged */ + return return_self(self); + } + + /* Check for overflow */ + /* result_len = self_len + count * (to_len-from_len) */ + assert(count > 0); + if (to_len - from_len > (PY_SSIZE_T_MAX - self_len) / count) { + PyErr_SetString(PyExc_OverflowError, "replace bytes is too long"); + return NULL; + } + result_len = self_len + count * (to_len - from_len); + + result = STRINGLIB_NEW(NULL, result_len); + if (result == NULL) { + return NULL; + } + result_s = STRINGLIB_STR(result); + + start = self_s; + end = self_s + self_len; + while (count-- > 0) { + offset = stringlib_find(start, end - start, + from_s, from_len, + 0); + if (offset == -1) + break; + next = start + offset; + if (next == start) { + /* replace with the 'to' */ + Py_MEMCPY(result_s, to_s, to_len); + result_s += to_len; + start += from_len; + } else { + /* copy the unchanged old then the 'to' */ + Py_MEMCPY(result_s, start, next - start); + result_s += (next - start); + Py_MEMCPY(result_s, to_s, to_len); + result_s += to_len; + start = next + from_len; + } + } + /* Copy the remainder of the remaining bytes */ + Py_MEMCPY(result_s, start, end - start); + + return result; +} + + +Py_LOCAL(PyObject *) +stringlib_replace(PyObject *self, + const char *from_s, Py_ssize_t from_len, + const char *to_s, Py_ssize_t to_len, + Py_ssize_t maxcount) +{ + if (maxcount < 0) { + maxcount = PY_SSIZE_T_MAX; + } else if (maxcount == 0 || STRINGLIB_LEN(self) == 0) { + /* nothing to do; return the original bytes */ + return return_self(self); + } + + /* Handle zero-length special cases */ + if (from_len == 0) { + if (to_len == 0) { + /* nothing to do; return the original bytes */ + return return_self(self); + } + /* insert the 'to' bytes everywhere. */ + /* >>> b"Python".replace(b"", b".") */ + /* b'.P.y.t.h.o.n.' */ + return stringlib_replace_interleave(self, to_s, to_len, maxcount); + } + + /* Except for b"".replace(b"", b"A") == b"A" there is no way beyond this */ + /* point for an empty self bytes to generate a non-empty bytes */ + /* Special case so the remaining code always gets a non-empty bytes */ + if (STRINGLIB_LEN(self) == 0) { + return return_self(self); + } + + if (to_len == 0) { + /* delete all occurrences of 'from' bytes */ + if (from_len == 1) { + return stringlib_replace_delete_single_character( + self, from_s[0], maxcount); + } else { + return stringlib_replace_delete_substring( + self, from_s, from_len, maxcount); + } + } + + /* Handle special case where both bytes have the same length */ + + if (from_len == to_len) { + if (from_len == 1) { + return stringlib_replace_single_character_in_place( + self, from_s[0], to_s[0], maxcount); + } else { + return stringlib_replace_substring_in_place( + self, from_s, from_len, to_s, to_len, maxcount); + } + } + + /* Otherwise use the more generic algorithms */ + if (from_len == 1) { + return stringlib_replace_single_character( + self, from_s[0], to_s, to_len, maxcount); + } else { + /* len('from')>=2, len('to')>=1 */ + return stringlib_replace_substring( + self, from_s, from_len, to_s, to_len, maxcount); + } +} + +#undef findchar -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 5 03:56:25 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Thu, 05 May 2016 07:56:25 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326918=3A_Skipped_?= =?utf-8?q?some_tests_in_test=5Fpipes_on_Android=2E?= Message-ID: <20160505075624.89095.30277.34E6E5B6@psf.io> https://hg.python.org/cpython/rev/3bad4b0f7612 changeset: 101234:3bad4b0f7612 user: Serhiy Storchaka date: Thu May 05 10:55:45 2016 +0300 summary: Issue #26918: Skipped some tests in test_pipes on Android. Patch by Xavier de Gaye. files: Lib/test/test_pipes.py | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/Lib/test/test_pipes.py b/Lib/test/test_pipes.py --- a/Lib/test/test_pipes.py +++ b/Lib/test/test_pipes.py @@ -2,6 +2,7 @@ import os import string import unittest +import shutil from test.support import TESTFN, run_unittest, unlink, reap_children if os.name != 'posix': @@ -18,6 +19,8 @@ unlink(f) def testSimplePipe1(self): + if shutil.which('tr') is None: + self.skipTest('tr is not available') t = pipes.Template() t.append(s_command, pipes.STDIN_STDOUT) f = t.open(TESTFN, 'w') @@ -27,6 +30,8 @@ self.assertEqual(f.read(), 'HELLO WORLD #1') def testSimplePipe2(self): + if shutil.which('tr') is None: + self.skipTest('tr is not available') with open(TESTFN, 'w') as f: f.write('hello world #2') t = pipes.Template() @@ -36,6 +41,8 @@ self.assertEqual(f.read(), 'HELLO WORLD #2') def testSimplePipe3(self): + if shutil.which('tr') is None: + self.skipTest('tr is not available') with open(TESTFN, 'w') as f: f.write('hello world #2') t = pipes.Template() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 5 04:05:34 2016 From: python-checkins at python.org (berker.peksag) Date: Thu, 05 May 2016 08:05:34 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2OTYy?= =?utf-8?q?=3A_Backport_23d986228c6b_to_2=2E7?= Message-ID: <20160505080532.31189.69932.39C1CBC9@psf.io> https://hg.python.org/cpython/rev/4462e193f089 changeset: 101235:4462e193f089 branch: 2.7 parent: 101223:7050c9fc1f72 user: Berker Peksag date: Thu May 05 11:05:49 2016 +0300 summary: Issue #26962: Backport 23d986228c6b to 2.7 files: Doc/library/curses.rst | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -1474,9 +1474,9 @@ +------------------+-----------+ | :kbd:`End` | KEY_END | +------------------+-----------+ -| :kbd:`Page Up` | KEY_NPAGE | +| :kbd:`Page Up` | KEY_PPAGE | +------------------+-----------+ -| :kbd:`Page Down` | KEY_PPAGE | +| :kbd:`Page Down` | KEY_NPAGE | +------------------+-----------+ The following table lists characters from the alternate character set. These are -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 5 04:14:16 2016 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 05 May 2016 08:14:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_26915=3A__Add_identi?= =?utf-8?q?ty_checks_to_the_collections_ABC_=5F=5Fcontains=5F=5F_methods?= =?utf-8?q?=2E?= Message-ID: <20160505081412.130779.35800.834666F8@psf.io> https://hg.python.org/cpython/rev/1c6cf4010df3 changeset: 101236:1c6cf4010df3 parent: 101234:3bad4b0f7612 user: Raymond Hettinger date: Thu May 05 11:14:06 2016 +0300 summary: Issue 26915: Add identity checks to the collections ABC __contains__ methods. files: Lib/_collections_abc.py | 7 ++++--- Lib/test/test_collections.py | 22 +++++++++++++++++++++- Misc/NEWS | 5 +++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py --- a/Lib/_collections_abc.py +++ b/Lib/_collections_abc.py @@ -689,7 +689,7 @@ except KeyError: return False else: - return v == value + return v is value or v == value def __iter__(self): for key in self._mapping: @@ -704,7 +704,8 @@ def __contains__(self, value): for key in self._mapping: - if value == self._mapping[key]: + v = self._mapping[key] + if v is value or v == value: return True return False @@ -839,7 +840,7 @@ def __contains__(self, value): for v in self: - if v == value: + if v is value or v == value: return True return False diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -23,7 +23,7 @@ from collections.abc import Hashable, Iterable, Iterator, Generator, Reversible from collections.abc import Sized, Container, Callable from collections.abc import Set, MutableSet -from collections.abc import Mapping, MutableMapping, KeysView, ItemsView +from collections.abc import Mapping, MutableMapping, KeysView, ItemsView, ValuesView from collections.abc import Sequence, MutableSequence from collections.abc import ByteString @@ -1074,6 +1074,26 @@ self.assertFalse(ncs > cs) self.assertTrue(ncs >= cs) + def test_issue26915(self): + # Container membership test should check identity first + class CustomEqualObject: + def __eq__(self, other): + return False + class CustomSequence(list): + def __contains__(self, value): + return Sequence.__contains__(self, value) + + nan = float('nan') + obj = CustomEqualObject() + containers = [ + CustomSequence([nan, obj]), + ItemsView({1: nan, 2: obj}), + ValuesView({1: nan, 2: obj}) + ] + for container in containers: + for elem in container: + self.assertIn(elem, container) + def assertSameSet(self, s1, s2): # coerce both to a real set then check equality self.assertSetEqual(set(s1), set(s2)) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -268,6 +268,11 @@ - Issue #26873: xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result. +- Issue #26915: The __contains__ methods in the collections ABCs now check + for identity before checking equality. This better matches the behavior + of the concrete classes, allows sensible handling of NaNs, and makes it + easier to reason about container invariants. + - Issue #26711: Fixed the comparison of plistlib.Data with other types. - Issue #24114: Fix an uninitialized variable in `ctypes.util`. -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Thu May 5 04:48:29 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 05 May 2016 08:48:29 +0000 Subject: [Python-checkins] Daily reference leaks (3a069e5593ef): sum=4 Message-ID: <20160505084829.22567.87180.AB9ACCC2@psf.io> results for 3a069e5593ef on branch "default" -------------------------------------------- test_collections leaked [4, -4, 0] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [0, -2, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogR1_n8S', '--timeout', '7200'] From lp_benchmark_robot at intel.com Thu May 5 08:12:23 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Thu, 5 May 2016 13:12:23 +0100 Subject: [Python-checkins] UGLY Benchmark Results for Python Default 2016-05-05 Message-ID: Results for project Python default, build date 2016-05-05 02:02:03 +0000 commit: 3a069e5593ef previous commit: 8f7cb3b171f3 revision date: 2016-05-04 20:26:04 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.16% -2.72% 8.40% 17.04% :-| pybench 0.11% -0.34% 0.69% 5.23% :-( regex_v8 3.07% 0.49% -10.51% 8.76% :-| nbody 0.15% 0.94% -1.03% 10.91% :-| json_dump_v2 0.38% 1.29% 1.38% 10.77% :-| normal_startup 0.83% -0.18% 1.09% 4.76% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/ugly-benchmark-results-for-python-default-2016-05-05/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Thu May 5 08:12:59 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Thu, 5 May 2016 13:12:59 +0100 Subject: [Python-checkins] GOOD Benchmark Results for Python 2.7 2016-05-05 Message-ID: <509c1fc5-2557-4e55-b8f8-0d14e8861f6b@irsmsx102.ger.corp.intel.com> Results for project Python 2.7, build date 2016-05-05 02:46:06 +0000 commit: 7050c9fc1f72 previous commit: e07e2b8c9429 revision date: 2016-05-04 08:28:09 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.58% 1.39% 6.90% 3.07% :-) pybench 0.15% 0.06% 5.96% 4.32% :-| regex_v8 0.74% 0.32% -1.96% 10.39% :-) nbody 0.50% -0.39% 6.50% 4.70% :-) json_dump_v2 0.53% 0.19% 2.39% 9.74% :-( normal_startup 1.82% 0.10% -5.32% 2.19% :-) ssbench 0.15% -0.14% 2.43% 1.57% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/good-benchmark-results-for-python-2-7-2016-05-05/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Thu May 5 09:22:09 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Thu, 05 May 2016 13:22:09 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Restored_parameter_name_?= =?utf-8?q?=22self=22_since_gdb_needs_exact_specific_parameter_names=2E?= Message-ID: <20160505132205.67123.59920.A68C0CE5@psf.io> https://hg.python.org/cpython/rev/66a1fbdbe4bb changeset: 101237:66a1fbdbe4bb user: Serhiy Storchaka date: Thu May 05 16:21:35 2016 +0300 summary: Restored parameter name "self" since gdb needs exact specific parameter names. files: Python/bltinmodule.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1078,6 +1078,7 @@ /*[clinic input] id as builtin_id + self: self(type="PyModuleDef *") obj as v: object / @@ -1088,8 +1089,8 @@ [clinic start generated code]*/ static PyObject * -builtin_id(PyModuleDef *module, PyObject *v) -/*[clinic end generated code: output=63635e497e09c2f7 input=57fb4a9aaff96384]*/ +builtin_id(PyModuleDef *self, PyObject *v) +/*[clinic end generated code: output=0aa640785f697f65 input=5a534136419631f4]*/ { return PyLong_FromVoidPtr(v); } -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Fri May 6 04:51:15 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 06 May 2016 08:51:15 +0000 Subject: [Python-checkins] Daily reference leaks (66a1fbdbe4bb): sum=2 Message-ID: <20160506085111.67141.87003.D17AE2DD@psf.io> results for 66a1fbdbe4bb on branch "default" -------------------------------------------- test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [0, 0, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogjIJNps', '--timeout', '7200'] From lp_benchmark_robot at intel.com Fri May 6 08:56:17 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Fri, 6 May 2016 13:56:17 +0100 Subject: [Python-checkins] UGLY Benchmark Results for Python Default 2016-05-06 Message-ID: Results for project Python default, build date 2016-05-06 02:02:48 +0000 commit: 66a1fbdbe4bb previous commit: 3a069e5593ef revision date: 2016-05-05 13:21:35 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.21% 1.11% 9.42% 14.62% :-| pybench 0.19% -0.09% 0.60% 6.16% :-) regex_v8 2.84% 7.86% -1.83% 4.71% :-( nbody 0.11% -1.39% -2.44% 10.19% :-( json_dump_v2 0.34% -2.78% -1.37% 12.26% :-| normal_startup 0.71% -0.12% 0.27% 5.48% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/ugly-benchmark-results-for-python-default-2016-05-06/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Fri May 6 08:57:07 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Fri, 6 May 2016 13:57:07 +0100 Subject: [Python-checkins] NEUTRAL Benchmark Results for Python 2.7 2016-05-06 Message-ID: <3e30ae3f-c1a0-4b86-adfb-122d335694c8@irsmsx103.ger.corp.intel.com> Results for project Python 2.7, build date 2016-05-06 02:47:19 +0000 commit: 4462e193f089 previous commit: 7050c9fc1f72 revision date: 2016-05-05 08:05:49 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.17% -0.37% 6.56% 8.35% :-) pybench 0.16% -0.30% 5.68% 4.97% :-( regex_v8 0.72% -0.22% -2.18% 10.95% :-) nbody 0.14% 0.38% 6.85% 6.26% :-) json_dump_v2 0.56% 0.07% 2.46% 9.18% :-( normal_startup 1.92% -0.32% -5.66% 3.05% :-) ssbench 0.12% -0.23% 2.20% 1.93% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/neutral-benchmark-results-for-python-2-7-2016-05-06/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Fri May 6 11:42:07 2016 From: python-checkins at python.org (larry.hastings) Date: Fri, 06 May 2016 15:42:07 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Add_release_schedule_for_3=2E?= =?utf-8?q?4=2E5=2E?= Message-ID: <20160506154200.88886.2706.41EBBE80@psf.io> https://hg.python.org/peps/rev/afd473e4a99d changeset: 6311:afd473e4a99d user: Larry Hastings date: Fri May 06 08:41:31 2016 -0700 summary: Add release schedule for 3.4.5. files: pep-0429.txt | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/pep-0429.txt b/pep-0429.txt --- a/pep-0429.txt +++ b/pep-0429.txt @@ -76,7 +76,8 @@ Planned future releases: -- tba +- 3.4.5 candidate 1: June 12, 2015 +- 3.4.5 final: June 26, 2015 Features for 3.4 -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Fri May 6 15:58:28 2016 From: python-checkins at python.org (terry.reedy) Date: Fri, 06 May 2016 19:58:28 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgMjY5MTE6?= =?utf-8?q?_fix_import_=28other_problems_remain=29=2E?= Message-ID: <20160506195827.88900.98442.925CD6D6@psf.io> https://hg.python.org/cpython/rev/3279c910d0e0 changeset: 101238:3279c910d0e0 branch: 3.5 parent: 101231:580ddeccd689 user: Terry Jan Reedy date: Fri May 06 15:57:57 2016 -0400 summary: Issue 26911: fix import (other problems remain). files: Lib/lib2to3/tests/pytree_idempotency.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/lib2to3/tests/pytree_idempotency.py b/Lib/lib2to3/tests/pytree_idempotency.py --- a/Lib/lib2to3/tests/pytree_idempotency.py +++ b/Lib/lib2to3/tests/pytree_idempotency.py @@ -18,8 +18,8 @@ # Local imports from .. import pytree -import pgen2 -from pgen2 import driver +from .. import pgen2 +from ..pgen2 import driver logging.basicConfig() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 6 15:58:28 2016 From: python-checkins at python.org (terry.reedy) Date: Fri, 06 May 2016 19:58:28 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_with_3=2E5?= Message-ID: <20160506195827.17976.91315.C56DFC5C@psf.io> https://hg.python.org/cpython/rev/697dfcadfc99 changeset: 101239:697dfcadfc99 parent: 101237:66a1fbdbe4bb parent: 101238:3279c910d0e0 user: Terry Jan Reedy date: Fri May 06 15:58:13 2016 -0400 summary: Merge with 3.5 files: Lib/lib2to3/tests/pytree_idempotency.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/lib2to3/tests/pytree_idempotency.py b/Lib/lib2to3/tests/pytree_idempotency.py --- a/Lib/lib2to3/tests/pytree_idempotency.py +++ b/Lib/lib2to3/tests/pytree_idempotency.py @@ -18,8 +18,8 @@ # Local imports from .. import pytree -import pgen2 -from pgen2 import driver +from .. import pgen2 +from ..pgen2 import driver logging.basicConfig() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 6 17:35:36 2016 From: python-checkins at python.org (terry.reedy) Date: Fri, 06 May 2016 21:35:36 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_with_3=2E5?= Message-ID: <20160506213535.31177.25192.675EC3E0@psf.io> https://hg.python.org/cpython/rev/786de3f37ca7 changeset: 101241:786de3f37ca7 parent: 101239:697dfcadfc99 parent: 101240:e7da216ba17c user: Terry Jan Reedy date: Fri May 06 17:35:21 2016 -0400 summary: Merge with 3.5 files: Lib/test/test_email/test_asian_codecs.py | 6 ++-- Lib/test/test_email/torture_test.py | 15 ++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Lib/test/test_email/test_asian_codecs.py b/Lib/test/test_email/test_asian_codecs.py --- a/Lib/test/test_email/test_asian_codecs.py +++ b/Lib/test/test_email/test_asian_codecs.py @@ -4,7 +4,7 @@ import unittest -from test.test_email.test_email import TestEmailBase +from test.test_email import TestEmailBase from email.charset import Charset from email.header import Header, decode_header from email.message import Message @@ -17,7 +17,7 @@ raise unittest.SkipTest - + class TestEmailAsianCodecs(TestEmailBase): def test_japanese_codecs(self): eq = self.ndiffAssertEqual @@ -76,6 +76,6 @@ self.assertEqual(jhello, ustr) - + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_email/torture_test.py b/Lib/test/test_email/torture_test.py --- a/Lib/test/test_email/torture_test.py +++ b/Lib/test/test_email/torture_test.py @@ -10,10 +10,9 @@ import os import unittest from io import StringIO -from types import ListType -from email.test.test_email import TestEmailBase -from test.support import TestSkipped, run_unittest +from test.test_email import TestEmailBase +from test.support import run_unittest import email from email import __file__ as testfile @@ -28,10 +27,10 @@ try: openfile('crispin-torture.txt') except OSError: - raise TestSkipped + raise unittest.SkipTest - + class TortureBase(TestEmailBase): def _msgobj(self, filename): fp = openfile(filename) @@ -42,7 +41,7 @@ return msg - + class TestCrispinTorture(TortureBase): # Mark Crispin's torture test from the SquirrelMail project def test_mondo_message(self): @@ -50,7 +49,7 @@ neq = self.ndiffAssertEqual msg = self._msgobj('crispin-torture.txt') payload = msg.get_payload() - eq(type(payload), ListType) + eq(type(payload), list) eq(len(payload), 12) eq(msg.preamble, None) eq(msg.epilogue, '\n') @@ -113,7 +112,6 @@ audio/x-sun """) - def _testclasses(): mod = sys.modules[__name__] return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] @@ -131,6 +129,5 @@ run_unittest(testclass) - if __name__ == '__main__': unittest.main(defaultTest='suite') -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 6 17:35:36 2016 From: python-checkins at python.org (terry.reedy) Date: Fri, 06 May 2016 21:35:36 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgMjY5MTI6?= =?utf-8?q?_fix_broken_imports_in_test=5Femail_package=2E?= Message-ID: <20160506213535.42349.62670.CBD0777E@psf.io> https://hg.python.org/cpython/rev/e7da216ba17c changeset: 101240:e7da216ba17c branch: 3.5 parent: 101238:3279c910d0e0 user: Terry Jan Reedy date: Fri May 06 17:35:05 2016 -0400 summary: Issue 26912: fix broken imports in test_email package. files: Lib/test/test_email/test_asian_codecs.py | 6 ++-- Lib/test/test_email/torture_test.py | 15 ++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Lib/test/test_email/test_asian_codecs.py b/Lib/test/test_email/test_asian_codecs.py --- a/Lib/test/test_email/test_asian_codecs.py +++ b/Lib/test/test_email/test_asian_codecs.py @@ -5,7 +5,7 @@ import unittest from test.support import run_unittest -from test.test_email.test_email import TestEmailBase +from test.test_email import TestEmailBase from email.charset import Charset from email.header import Header, decode_header from email.message import Message @@ -18,7 +18,7 @@ raise unittest.SkipTest - + class TestEmailAsianCodecs(TestEmailBase): def test_japanese_codecs(self): eq = self.ndiffAssertEqual @@ -77,6 +77,6 @@ self.assertEqual(jhello, ustr) - + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_email/torture_test.py b/Lib/test/test_email/torture_test.py --- a/Lib/test/test_email/torture_test.py +++ b/Lib/test/test_email/torture_test.py @@ -10,10 +10,9 @@ import os import unittest from io import StringIO -from types import ListType -from email.test.test_email import TestEmailBase -from test.support import TestSkipped, run_unittest +from test.test_email import TestEmailBase +from test.support import run_unittest import email from email import __file__ as testfile @@ -28,10 +27,10 @@ try: openfile('crispin-torture.txt') except OSError: - raise TestSkipped + raise unittest.SkipTest - + class TortureBase(TestEmailBase): def _msgobj(self, filename): fp = openfile(filename) @@ -42,7 +41,7 @@ return msg - + class TestCrispinTorture(TortureBase): # Mark Crispin's torture test from the SquirrelMail project def test_mondo_message(self): @@ -50,7 +49,7 @@ neq = self.ndiffAssertEqual msg = self._msgobj('crispin-torture.txt') payload = msg.get_payload() - eq(type(payload), ListType) + eq(type(payload), list) eq(len(payload), 12) eq(msg.preamble, None) eq(msg.epilogue, '\n') @@ -113,7 +112,6 @@ audio/x-sun """) - def _testclasses(): mod = sys.modules[__name__] return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] @@ -131,6 +129,5 @@ run_unittest(testclass) - if __name__ == '__main__': unittest.main(defaultTest='suite') -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 6 19:07:26 2016 From: python-checkins at python.org (guido.van.rossum) Date: Fri, 06 May 2016 23:07:26 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Edits_by_Ivan_Levkivskyi_to_b?= =?utf-8?q?e_more_precise_about_types_vs=2E_classes=2E?= Message-ID: <20160506230724.42375.96741.9145CE86@psf.io> https://hg.python.org/peps/rev/6836e79adbc3 changeset: 6312:6836e79adbc3 user: Guido van Rossum date: Fri May 06 16:06:56 2016 -0700 summary: Edits by Ivan Levkivskyi to be more precise about types vs. classes. From https://github.com/python/typing/pull/214. files: pep-0484.txt | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pep-0484.txt b/pep-0484.txt --- a/pep-0484.txt +++ b/pep-0484.txt @@ -587,7 +587,7 @@ A type variable may specify an upper bound using ``bound=``. This means that an actual type substituted (explicitly or implictly) -for the type variable must be a subclass of the boundary type. A +for the type variable must be a subtype of the boundary type. A common example is the definition of a Comparable type that works well enough to catch the most common errors:: @@ -618,7 +618,7 @@ An upper bound cannot be combined with type constraints (as in used ``AnyStr``, see the example earlier); type constraints cause the inferred type to be _exactly_ one of the constraint types, while an -upper bound just requires that the actual type is a subclass of the +upper bound just requires that the actual type is a subtype of the boundary type. @@ -819,9 +819,10 @@ e = [e] ... -A type factored by ``Union[T1, T2, ...]`` responds ``True`` to -``issubclass`` checks for ``T1`` and any of its subtypes, ``T2`` and -any of its subtypes, and so on. +A type factored by ``Union[T1, T2, ...]`` is a supertype +of all types ``T1``, ``T2``, etc., so that a value that +is a member of one of these types is acceptable for an argument +annotated by ``Union[T1, T2, ...]``. One common case of union types are *optional* types. By default, ``None`` is an invalid value for any type, unless a default value of @@ -1294,6 +1295,12 @@ collection ABCs (e.g. ``Sequence``), and a small collection of convenience definitions. +Note that special type constructs, such as ``Any``, ``Union``, +and type variables defined using ``TypeVar`` are only supported +in the type annotation context, and ``Generic`` may only be used +as a base class. All of these will raise ``TypeError`` if appear +in ``isinstance`` or ``issubclass``. + Fundamental building blocks: * Any, used as ``def get(key: str) -> Any: ...`` -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Fri May 6 21:03:57 2016 From: python-checkins at python.org (brett.cannon) Date: Sat, 07 May 2016 01:03:57 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Update_status?= Message-ID: <20160507010356.130972.2842.6D7CCFBD@psf.io> https://hg.python.org/peps/rev/7ee0d785a550 changeset: 6313:7ee0d785a550 user: Brett Cannon date: Fri May 06 18:03:51 2016 -0700 summary: Update status files: pep-0512.txt | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pep-0512.txt b/pep-0512.txt --- a/pep-0512.txt +++ b/pep-0512.txt @@ -137,14 +137,14 @@ benchmarks repository does not; therefore, it will be named "python-benchmarks". -Create a 'python-dev' team -'''''''''''''''''''''''''' -To manage permissions, a 'python-dev' team will be created as part of +Create a 'Python core' team +''''''''''''''''''''''''''' +To manage permissions, a 'Python core' team will be created as part of the python organization [#github-python-org]_. Any repository that is -moved will have the 'python-dev' team added to it with write +moved will have the 'Python core' team added to it with write permissions [#github-org-perms]_. Anyone who previously had rights to manage SSH keys on hg.python.org will become a team maintainer for the -'python-dev' team. +'Python core' team. Define commands to move a Mercurial repository to Git ''''''''''''''''''''''''''''''''''''''''''''''''''''' @@ -531,10 +531,6 @@ Requirements for migrating the devinabox [#devinabox-repo]_ and benchmarks [#benchmarks-repo]_ repositories: -* Not started - - - `Create a 'python-dev' team`_ - * In progress - `Define commands to move a Mercurial repository to Git`_: @@ -546,6 +542,7 @@ (Maciej Szulik and Ezio Melotti) - `A bot to enforce CLA signing`_: https://github.com/python/the-knights-who-say-ni (Brett Cannon) + - `Create a 'Python core' team`_ Repositories whose build steps need updating: -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Sat May 7 01:45:33 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 05:45:33 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2ODg5?= =?utf-8?q?=3A_Tweaked_xmlrpc=2Eclient_documentation=2E?= Message-ID: <20160507054533.22583.3375.EBDC8E3C@psf.io> https://hg.python.org/cpython/rev/04250fc723e6 changeset: 101242:04250fc723e6 branch: 3.5 parent: 101240:e7da216ba17c user: Serhiy Storchaka date: Sat May 07 08:44:15 2016 +0300 summary: Issue #26889: Tweaked xmlrpc.client documentation. files: Doc/library/xmlrpc.client.rst | 191 +++++++++++---------- 1 files changed, 102 insertions(+), 89 deletions(-) diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -14,7 +14,7 @@ -------------- -XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP as a +XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP(S) as a transport. With it, a client can call methods with parameters on a remote server (the server is named by a URI) and get back structured data. This module supports writing XML-RPC client code; it handles all the details of translating @@ -30,7 +30,7 @@ .. versionchanged:: 3.5 For https URIs, :mod:`xmlrpc.client` now performs all the necessary - certificate and hostname checks by default + certificate and hostname checks by default. .. class:: ServerProxy(uri, transport=None, encoding=None, verbose=False, \ allow_none=False, use_datetime=False, \ @@ -46,15 +46,19 @@ :class:`SafeTransport` instance for https: URLs and an internal HTTP :class:`Transport` instance otherwise. The optional third argument is an encoding, by default UTF-8. The optional fourth argument is a debugging flag. + + The following parameters govern the use of the returned proxy instance. If *allow_none* is true, the Python constant ``None`` will be translated into XML; the default behaviour is for ``None`` to raise a :exc:`TypeError`. This is a commonly-used extension to the XML-RPC specification, but isn't supported by - all clients and servers; see http://ontosys.com/xml-rpc/extensions.php for a - description. The *use_builtin_types* flag can be used to cause date/time values + all clients and servers; see `http://ontosys.com/xml-rpc/extensions.php + ` + for a description. + The *use_builtin_types* flag can be used to cause date/time values to be presented as :class:`datetime.datetime` objects and binary data to be presented as :class:`bytes` objects; this flag is false by default. - :class:`datetime.datetime` and :class:`bytes` objects may be passed to calls. - + :class:`datetime.datetime`, :class:`bytes` and :class:`bytearray` objects + may be passed to calls. The obsolete *use_datetime* flag is similar to *use_builtin_types* but it applies only to date/time values. @@ -73,42 +77,43 @@ methods it supports (service discovery) and fetch other server-associated metadata. - :class:`ServerProxy` instance methods take Python basic types and objects as - arguments and return Python basic types and classes. Types that are conformable - (e.g. that can be marshalled through XML), include the following (and except - where noted, they are unmarshalled as the same Python type): + Types that are conformable (e.g. that can be marshalled through XML), + include the following (and except where noted, they are unmarshalled + as the same Python type): .. tabularcolumns:: |l|L| - +---------------------------------+---------------------------------------------+ - | Name | Meaning | - +=================================+=============================================+ - | :const:`boolean` | The :const:`True` and :const:`False` | - | | constants | - +---------------------------------+---------------------------------------------+ - | :const:`integers` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`floating-point numbers` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`strings` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`arrays` | Any Python sequence type containing | - | | conformable elements. Arrays are returned | - | | as lists | - +---------------------------------+---------------------------------------------+ - | :const:`structures` | A Python dictionary. Keys must be strings, | - | | values may be any conformable type. Objects | - | | of user-defined classes can be passed in; | - | | only their *__dict__* attribute is | - | | transmitted. | - +---------------------------------+---------------------------------------------+ - | :const:`dates` | In seconds since the epoch. Pass in an | - | | instance of the :class:`DateTime` class or | - | | a :class:`datetime.datetime` instance. | - +---------------------------------+---------------------------------------------+ - | :const:`binary data` | Pass in an instance of the :class:`Binary` | - | | wrapper class or a :class:`bytes` instance. | - +---------------------------------+---------------------------------------------+ + +----------------------+-------------------------------------------------------+ + | XML-RPC type | Python type | + +======================+=======================================================+ + | ``boolean`` | :class:`bool` | + +----------------------+-------------------------------------------------------+ + | ``int`` or ``i4`` | :class:`int` in range from -2147483648 to 2147483647. | + +----------------------+-------------------------------------------------------+ + | ``double`` | :class:`float` | + +----------------------+-------------------------------------------------------+ + | ``string`` | :class:`str` | + +----------------------+-------------------------------------------------------+ + | ``array`` | :class:`list` or :class:`tuple` containing | + | | conformable elements. Arrays are returned as | + | | :class:`list`\ s. | + +----------------------+-------------------------------------------------------+ + | ``struct`` | :class:`dict`. Keys must be strings, values may be | + | | any conformable type. Objects of user-defined | + | | classes can be passed in; only their :attr:`__dict__` | + | | attribute is transmitted. | + +----------------------+-------------------------------------------------------+ + | ``dateTime.iso8601`` | :class:`DateTime` or :class:`datetime.datetime`. | + | | Returned type depends on values of | + | | *use_builtin_types* and *use_datetime* flags. | + +----------------------+-------------------------------------------------------+ + | ``base64`` | :class:`Binary`, :class:`bytes` or | + | | :class:`bytearray`. Returned type depends on the | + | | value of the *use_builtin_types* flag. | + +----------------------+-------------------------------------------------------+ + | ``nil`` | The ``None`` constant. Passing is allowed only if | + | | *allow_none* is true. | + +----------------------+-------------------------------------------------------+ This is the full set of data types supported by XML-RPC. Method calls may also raise a special :exc:`Fault` instance, used to signal XML-RPC server errors, or @@ -123,8 +128,8 @@ the control characters with ASCII values between 0 and 31 (except, of course, tab, newline and carriage return); failing to do this will result in an XML-RPC request that isn't well-formed XML. If you have to pass arbitrary bytes - via XML-RPC, use the :class:`bytes` class or the class:`Binary` wrapper class - described below. + via XML-RPC, use :class:`bytes` or :class:`bytearray` classes or the + :class:`Binary` wrapper class described below. :class:`Server` is retained as an alias for :class:`ServerProxy` for backwards compatibility. New code should use :class:`ServerProxy`. @@ -164,7 +169,7 @@ :class:`Fault` or :class:`ProtocolError` object indicating an error. Servers that support the XML introspection API support some common methods -grouped under the reserved :attr:`system` attribute: +grouped under the reserved :attr:`~ServerProxy.system` attribute: .. method:: ServerProxy.system.listMethods() @@ -231,24 +236,26 @@ DateTime Objects ---------------- -This class may be initialized with seconds since the epoch, a time -tuple, an ISO 8601 time/date string, or a :class:`datetime.datetime` -instance. It has the following methods, supported mainly for internal -use by the marshalling/unmarshalling code: +.. class:: DateTime + This class may be initialized with seconds since the epoch, a time + tuple, an ISO 8601 time/date string, or a :class:`datetime.datetime` + instance. It has the following methods, supported mainly for internal + use by the marshalling/unmarshalling code: -.. method:: DateTime.decode(string) - Accept a string as the instance's new time value. + .. method:: decode(string) + Accept a string as the instance's new time value. -.. method:: DateTime.encode(out) - Write the XML-RPC encoding of this :class:`DateTime` item to the *out* stream - object. + .. method:: encode(out) -It also supports certain of Python's built-in operators through rich comparison -and :meth:`__repr__` methods. + Write the XML-RPC encoding of this :class:`DateTime` item to the *out* stream + object. + + It also supports certain of Python's built-in operators through rich comparison + and :meth:`__repr__` methods. A working example follows. The server code:: @@ -282,36 +289,38 @@ Binary Objects -------------- -This class may be initialized from bytes data (which may include NULs). The -primary access to the content of a :class:`Binary` object is provided by an -attribute: +.. class:: Binary + This class may be initialized from bytes data (which may include NULs). The + primary access to the content of a :class:`Binary` object is provided by an + attribute: -.. attribute:: Binary.data - The binary data encapsulated by the :class:`Binary` instance. The data is - provided as a :class:`bytes` object. + .. attribute:: data -:class:`Binary` objects have the following methods, supported mainly for -internal use by the marshalling/unmarshalling code: + The binary data encapsulated by the :class:`Binary` instance. The data is + provided as a :class:`bytes` object. + :class:`Binary` objects have the following methods, supported mainly for + internal use by the marshalling/unmarshalling code: -.. method:: Binary.decode(bytes) - Accept a base64 :class:`bytes` object and decode it as the instance's new data. + .. method:: decode(bytes) + Accept a base64 :class:`bytes` object and decode it as the instance's new data. -.. method:: Binary.encode(out) - Write the XML-RPC base 64 encoding of this binary item to the out stream object. + .. method:: encode(out) - The encoded data will have newlines every 76 characters as per - `RFC 2045 section 6.8 `_, - which was the de facto standard base64 specification when the - XML-RPC spec was written. + Write the XML-RPC base 64 encoding of this binary item to the *out* stream object. -It also supports certain of Python's built-in operators through :meth:`__eq__` -and :meth:`__ne__` methods. + The encoded data will have newlines every 76 characters as per + `RFC 2045 section 6.8 `_, + which was the de facto standard base64 specification when the + XML-RPC spec was written. + + It also supports certain of Python's built-in operators through :meth:`__eq__` + and :meth:`__ne__` methods. Example usage of the binary objects. We're going to transfer an image over XMLRPC:: @@ -342,18 +351,20 @@ Fault Objects ------------- -A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. Fault -objects have the following attributes: +.. class:: Fault + A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. Fault + objects have the following attributes: -.. attribute:: Fault.faultCode - A string indicating the fault type. + .. attribute:: faultCode + A string indicating the fault type. -.. attribute:: Fault.faultString - A string containing a diagnostic message associated with the fault. + .. attribute:: faultString + + A string containing a diagnostic message associated with the fault. In the following example we're going to intentionally cause a :exc:`Fault` by returning a complex type object. The server code:: @@ -390,30 +401,32 @@ ProtocolError Objects --------------------- -A :class:`ProtocolError` object describes a protocol error in the underlying -transport layer (such as a 404 'not found' error if the server named by the URI -does not exist). It has the following attributes: +.. class:: ProtocolError + A :class:`ProtocolError` object describes a protocol error in the underlying + transport layer (such as a 404 'not found' error if the server named by the URI + does not exist). It has the following attributes: -.. attribute:: ProtocolError.url - The URI or URL that triggered the error. + .. attribute:: url + The URI or URL that triggered the error. -.. attribute:: ProtocolError.errcode - The error code. + .. attribute:: errcode + The error code. -.. attribute:: ProtocolError.errmsg - The error message or diagnostic string. + .. attribute:: errmsg + The error message or diagnostic string. -.. attribute:: ProtocolError.headers - A dict containing the headers of the HTTP/HTTPS request that triggered the - error. + .. attribute:: headers + + A dict containing the headers of the HTTP/HTTPS request that triggered the + error. In the following example we're going to intentionally cause a :exc:`ProtocolError` by providing an invalid URI:: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 01:45:33 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 05:45:33 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2ODg5?= =?utf-8?q?=3A_Tweaked_xmlrpclib_documentation=2E?= Message-ID: <20160507054533.31187.23060.C9DA53B3@psf.io> https://hg.python.org/cpython/rev/fb5bd513751f changeset: 101244:fb5bd513751f branch: 2.7 parent: 101235:4462e193f089 user: Serhiy Storchaka date: Sat May 07 08:44:58 2016 +0300 summary: Issue #26889: Tweaked xmlrpclib documentation. files: Doc/library/xmlrpclib.rst | 184 +++++++++++++------------ 1 files changed, 99 insertions(+), 85 deletions(-) diff --git a/Doc/library/xmlrpclib.rst b/Doc/library/xmlrpclib.rst --- a/Doc/library/xmlrpclib.rst +++ b/Doc/library/xmlrpclib.rst @@ -21,7 +21,7 @@ -------------- -XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP as a +XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP(S) as a transport. With it, a client can call methods with parameters on a remote server (the server is named by a URI) and get back structured data. This module supports writing XML-RPC client code; it handles all the details of translating @@ -37,7 +37,7 @@ .. versionchanged:: 2.7.9 For https URIs, :mod:`xmlrpclib` now performs all the necessary certificate - and hostname checks by default + and hostname checks by default. .. class:: ServerProxy(uri[, transport[, encoding[, verbose[, allow_none[, use_datetime[, context]]]]]]) @@ -48,11 +48,15 @@ :class:`SafeTransport` instance for https: URLs and an internal HTTP :class:`Transport` instance otherwise. The optional third argument is an encoding, by default UTF-8. The optional fourth argument is a debugging flag. + + The following parameters govern the use of the returned proxy instance. If *allow_none* is true, the Python constant ``None`` will be translated into XML; the default behaviour is for ``None`` to raise a :exc:`TypeError`. This is a commonly-used extension to the XML-RPC specification, but isn't supported by - all clients and servers; see http://ontosys.com/xml-rpc/extensions.php for a - description. The *use_datetime* flag can be used to cause date/time values to + all clients and servers; see `http://ontosys.com/xml-rpc/extensions.php + ` + for a description. + The *use_datetime* flag can be used to cause date/time values to be presented as :class:`datetime.datetime` objects; this is false by default. :class:`datetime.datetime` objects may be passed to calls. @@ -71,40 +75,42 @@ methods it supports (service discovery) and fetch other server-associated metadata. - :class:`ServerProxy` instance methods take Python basic types and objects as - arguments and return Python basic types and classes. Types that are conformable - (e.g. that can be marshalled through XML), include the following (and except - where noted, they are unmarshalled as the same Python type): + Types that are conformable (e.g. that can be marshalled through XML), + include the following (and except where noted, they are unmarshalled + as the same Python type): - +---------------------------------+---------------------------------------------+ - | Name | Meaning | - +=================================+=============================================+ - | :const:`boolean` | The :const:`True` and :const:`False` | - | | constants | - +---------------------------------+---------------------------------------------+ - | :const:`integers` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`floating-point numbers` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`strings` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`arrays` | Any Python sequence type containing | - | | conformable elements. Arrays are returned | - | | as lists | - +---------------------------------+---------------------------------------------+ - | :const:`structures` | A Python dictionary. Keys must be strings, | - | | values may be any conformable type. Objects | - | | of user-defined classes can be passed in; | - | | only their *__dict__* attribute is | - | | transmitted. | - +---------------------------------+---------------------------------------------+ - | :const:`dates` | in seconds since the epoch (pass in an | - | | instance of the :class:`DateTime` class) or | - | | a :class:`datetime.datetime` instance. | - +---------------------------------+---------------------------------------------+ - | :const:`binary data` | pass in an instance of the :class:`Binary` | - | | wrapper class | - +---------------------------------+---------------------------------------------+ + .. tabularcolumns:: |l|L| + + +----------------------+-------------------------------------------------------+ + | XML-RPC type | Python type | + +======================+=======================================================+ + | ``boolean`` | :class:`bool` | + +----------------------+-------------------------------------------------------+ + | ``int`` or ``i4`` | :class:`int` or :class:`long` in range from | + | | -2147483648 to 2147483647. | + +----------------------+-------------------------------------------------------+ + | ``double`` | :class:`float` | + +----------------------+-------------------------------------------------------+ + | ``string`` | :class:`str` or :class:`unicode` | + +----------------------+-------------------------------------------------------+ + | ``array`` | :class:`list` or :class:`tuple` containing | + | | conformable elements. Arrays are returned as | + | | :class:`list`\ s. | + +----------------------+-------------------------------------------------------+ + | ``struct`` | :class:`dict`. Keys must be strings, values may be | + | | any conformable type. Objects of user-defined | + | | classes can be passed in; only their :attr:`__dict__` | + | | attribute is transmitted. | + +----------------------+-------------------------------------------------------+ + | ``dateTime.iso8601`` | :class:`DateTime` or :class:`datetime.datetime`. | + | | Returned type depends on values of the *use_datetime* | + | | flags. | + +----------------------+-------------------------------------------------------+ + | ``base64`` | :class:`Binary` | + +----------------------+-------------------------------------------------------+ + | ``nil`` | The ``None`` constant. Passing is allowed only if | + | | *allow_none* is true. | + +----------------------+-------------------------------------------------------+ This is the full set of data types supported by XML-RPC. Method calls may also raise a special :exc:`Fault` instance, used to signal XML-RPC server errors, or @@ -168,7 +174,7 @@ :class:`Fault` or :class:`ProtocolError` object indicating an error. Servers that support the XML introspection API support some common methods -grouped under the reserved :attr:`system` attribute: +grouped under the reserved :attr:`~ServerProxy.system` attribute: .. method:: ServerProxy.system.listMethods() @@ -249,24 +255,26 @@ DateTime Objects ---------------- -This class may be initialized with seconds since the epoch, a time -tuple, an ISO 8601 time/date string, or a :class:`datetime.datetime` -instance. It has the following methods, supported mainly for internal -use by the marshalling/unmarshalling code: +.. class:: DateTime + This class may be initialized with seconds since the epoch, a time + tuple, an ISO 8601 time/date string, or a :class:`datetime.datetime` + instance. It has the following methods, supported mainly for internal + use by the marshalling/unmarshalling code: -.. method:: DateTime.decode(string) - Accept a string as the instance's new time value. + .. method:: decode(string) + Accept a string as the instance's new time value. -.. method:: DateTime.encode(out) - Write the XML-RPC encoding of this :class:`DateTime` item to the *out* stream - object. + .. method:: encode(out) -It also supports certain of Python's built-in operators through :meth:`__cmp__` -and :meth:`__repr__` methods. + Write the XML-RPC encoding of this :class:`DateTime` item to the *out* stream + object. + + It also supports certain of Python's built-in operators through :meth:`__cmp__` + and :meth:`__repr__` methods. A working example follows. The server code:: @@ -300,36 +308,38 @@ Binary Objects -------------- -This class may be initialized from string data (which may include NULs). The -primary access to the content of a :class:`Binary` object is provided by an -attribute: +.. class:: Binary + This class may be initialized from string data (which may include NULs). The + primary access to the content of a :class:`Binary` object is provided by an + attribute: -.. attribute:: Binary.data - The binary data encapsulated by the :class:`Binary` instance. The data is - provided as an 8-bit string. + .. attribute:: data -:class:`Binary` objects have the following methods, supported mainly for -internal use by the marshalling/unmarshalling code: + The binary data encapsulated by the :class:`Binary` instance. The data is + provided as an 8-bit string. + :class:`Binary` objects have the following methods, supported mainly for + internal use by the marshalling/unmarshalling code: -.. method:: Binary.decode(string) - Accept a base64 string and decode it as the instance's new data. + .. method:: decode(string) + Accept a base64 string and decode it as the instance's new data. -.. method:: Binary.encode(out) - Write the XML-RPC base 64 encoding of this binary item to the out stream object. + .. method:: encode(out) - The encoded data will have newlines every 76 characters as per - `RFC 2045 section 6.8 `_, - which was the de facto standard base64 specification when the - XML-RPC spec was written. + Write the XML-RPC base 64 encoding of this binary item to the *out* stream object. -It also supports certain of Python's built-in operators through a -:meth:`__cmp__` method. + The encoded data will have newlines every 76 characters as per + `RFC 2045 section 6.8 `_, + which was the de facto standard base64 specification when the + XML-RPC spec was written. + + It also supports certain of Python's built-in operators through a + :meth:`__cmp__` method. Example usage of the binary objects. We're going to transfer an image over XMLRPC:: @@ -360,18 +370,20 @@ Fault Objects ------------- -A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. Fault -objects have the following attributes: +.. class:: Fault + A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. Fault + objects have the following attributes: -.. attribute:: Fault.faultCode - A string indicating the fault type. + .. attribute:: faultCode + A string indicating the fault type. -.. attribute:: Fault.faultString - A string containing a diagnostic message associated with the fault. + .. attribute:: faultString + + A string containing a diagnostic message associated with the fault. In the following example we're going to intentionally cause a :exc:`Fault` by returning a complex type object. The server code:: @@ -408,30 +420,32 @@ ProtocolError Objects --------------------- -A :class:`ProtocolError` object describes a protocol error in the underlying -transport layer (such as a 404 'not found' error if the server named by the URI -does not exist). It has the following attributes: +.. class:: ProtocolError + A :class:`ProtocolError` object describes a protocol error in the underlying + transport layer (such as a 404 'not found' error if the server named by the URI + does not exist). It has the following attributes: -.. attribute:: ProtocolError.url - The URI or URL that triggered the error. + .. attribute:: url + The URI or URL that triggered the error. -.. attribute:: ProtocolError.errcode - The error code. + .. attribute:: errcode + The error code. -.. attribute:: ProtocolError.errmsg - The error message or diagnostic string. + .. attribute:: errmsg + The error message or diagnostic string. -.. attribute:: ProtocolError.headers - A string containing the headers of the HTTP/HTTPS request that triggered the - error. + .. attribute:: headers + + A string containing the headers of the HTTP/HTTPS request that triggered the + error. In the following example we're going to intentionally cause a :exc:`ProtocolError` by providing a URI that doesn't point to an XMLRPC server:: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 01:45:33 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 05:45:33 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326889=3A_Tweaked_xmlrpc=2Eclient_documentation?= =?utf-8?q?=2E?= Message-ID: <20160507054533.89109.15663.A5F36EC4@psf.io> https://hg.python.org/cpython/rev/9bdec549bad3 changeset: 101243:9bdec549bad3 parent: 101241:786de3f37ca7 parent: 101242:04250fc723e6 user: Serhiy Storchaka date: Sat May 07 08:44:36 2016 +0300 summary: Issue #26889: Tweaked xmlrpc.client documentation. files: Doc/library/xmlrpc.client.rst | 191 +++++++++++---------- 1 files changed, 102 insertions(+), 89 deletions(-) diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -14,7 +14,7 @@ -------------- -XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP as a +XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP(S) as a transport. With it, a client can call methods with parameters on a remote server (the server is named by a URI) and get back structured data. This module supports writing XML-RPC client code; it handles all the details of translating @@ -30,7 +30,7 @@ .. versionchanged:: 3.5 For https URIs, :mod:`xmlrpc.client` now performs all the necessary - certificate and hostname checks by default + certificate and hostname checks by default. .. class:: ServerProxy(uri, transport=None, encoding=None, verbose=False, \ allow_none=False, use_datetime=False, \ @@ -46,15 +46,19 @@ :class:`SafeTransport` instance for https: URLs and an internal HTTP :class:`Transport` instance otherwise. The optional third argument is an encoding, by default UTF-8. The optional fourth argument is a debugging flag. + + The following parameters govern the use of the returned proxy instance. If *allow_none* is true, the Python constant ``None`` will be translated into XML; the default behaviour is for ``None`` to raise a :exc:`TypeError`. This is a commonly-used extension to the XML-RPC specification, but isn't supported by - all clients and servers; see http://ontosys.com/xml-rpc/extensions.php for a - description. The *use_builtin_types* flag can be used to cause date/time values + all clients and servers; see `http://ontosys.com/xml-rpc/extensions.php + ` + for a description. + The *use_builtin_types* flag can be used to cause date/time values to be presented as :class:`datetime.datetime` objects and binary data to be presented as :class:`bytes` objects; this flag is false by default. - :class:`datetime.datetime` and :class:`bytes` objects may be passed to calls. - + :class:`datetime.datetime`, :class:`bytes` and :class:`bytearray` objects + may be passed to calls. The obsolete *use_datetime* flag is similar to *use_builtin_types* but it applies only to date/time values. @@ -73,42 +77,43 @@ methods it supports (service discovery) and fetch other server-associated metadata. - :class:`ServerProxy` instance methods take Python basic types and objects as - arguments and return Python basic types and classes. Types that are conformable - (e.g. that can be marshalled through XML), include the following (and except - where noted, they are unmarshalled as the same Python type): + Types that are conformable (e.g. that can be marshalled through XML), + include the following (and except where noted, they are unmarshalled + as the same Python type): .. tabularcolumns:: |l|L| - +---------------------------------+---------------------------------------------+ - | Name | Meaning | - +=================================+=============================================+ - | :const:`boolean` | The :const:`True` and :const:`False` | - | | constants | - +---------------------------------+---------------------------------------------+ - | :const:`integers` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`floating-point numbers` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`strings` | Pass in directly | - +---------------------------------+---------------------------------------------+ - | :const:`arrays` | Any Python sequence type containing | - | | conformable elements. Arrays are returned | - | | as lists | - +---------------------------------+---------------------------------------------+ - | :const:`structures` | A Python dictionary. Keys must be strings, | - | | values may be any conformable type. Objects | - | | of user-defined classes can be passed in; | - | | only their *__dict__* attribute is | - | | transmitted. | - +---------------------------------+---------------------------------------------+ - | :const:`dates` | In seconds since the epoch. Pass in an | - | | instance of the :class:`DateTime` class or | - | | a :class:`datetime.datetime` instance. | - +---------------------------------+---------------------------------------------+ - | :const:`binary data` | Pass in an instance of the :class:`Binary` | - | | wrapper class or a :class:`bytes` instance. | - +---------------------------------+---------------------------------------------+ + +----------------------+-------------------------------------------------------+ + | XML-RPC type | Python type | + +======================+=======================================================+ + | ``boolean`` | :class:`bool` | + +----------------------+-------------------------------------------------------+ + | ``int`` or ``i4`` | :class:`int` in range from -2147483648 to 2147483647. | + +----------------------+-------------------------------------------------------+ + | ``double`` | :class:`float` | + +----------------------+-------------------------------------------------------+ + | ``string`` | :class:`str` | + +----------------------+-------------------------------------------------------+ + | ``array`` | :class:`list` or :class:`tuple` containing | + | | conformable elements. Arrays are returned as | + | | :class:`list`\ s. | + +----------------------+-------------------------------------------------------+ + | ``struct`` | :class:`dict`. Keys must be strings, values may be | + | | any conformable type. Objects of user-defined | + | | classes can be passed in; only their :attr:`__dict__` | + | | attribute is transmitted. | + +----------------------+-------------------------------------------------------+ + | ``dateTime.iso8601`` | :class:`DateTime` or :class:`datetime.datetime`. | + | | Returned type depends on values of | + | | *use_builtin_types* and *use_datetime* flags. | + +----------------------+-------------------------------------------------------+ + | ``base64`` | :class:`Binary`, :class:`bytes` or | + | | :class:`bytearray`. Returned type depends on the | + | | value of the *use_builtin_types* flag. | + +----------------------+-------------------------------------------------------+ + | ``nil`` | The ``None`` constant. Passing is allowed only if | + | | *allow_none* is true. | + +----------------------+-------------------------------------------------------+ This is the full set of data types supported by XML-RPC. Method calls may also raise a special :exc:`Fault` instance, used to signal XML-RPC server errors, or @@ -123,8 +128,8 @@ the control characters with ASCII values between 0 and 31 (except, of course, tab, newline and carriage return); failing to do this will result in an XML-RPC request that isn't well-formed XML. If you have to pass arbitrary bytes - via XML-RPC, use the :class:`bytes` class or the class:`Binary` wrapper class - described below. + via XML-RPC, use :class:`bytes` or :class:`bytearray` classes or the + :class:`Binary` wrapper class described below. :class:`Server` is retained as an alias for :class:`ServerProxy` for backwards compatibility. New code should use :class:`ServerProxy`. @@ -164,7 +169,7 @@ :class:`Fault` or :class:`ProtocolError` object indicating an error. Servers that support the XML introspection API support some common methods -grouped under the reserved :attr:`system` attribute: +grouped under the reserved :attr:`~ServerProxy.system` attribute: .. method:: ServerProxy.system.listMethods() @@ -231,24 +236,26 @@ DateTime Objects ---------------- -This class may be initialized with seconds since the epoch, a time -tuple, an ISO 8601 time/date string, or a :class:`datetime.datetime` -instance. It has the following methods, supported mainly for internal -use by the marshalling/unmarshalling code: +.. class:: DateTime + This class may be initialized with seconds since the epoch, a time + tuple, an ISO 8601 time/date string, or a :class:`datetime.datetime` + instance. It has the following methods, supported mainly for internal + use by the marshalling/unmarshalling code: -.. method:: DateTime.decode(string) - Accept a string as the instance's new time value. + .. method:: decode(string) + Accept a string as the instance's new time value. -.. method:: DateTime.encode(out) - Write the XML-RPC encoding of this :class:`DateTime` item to the *out* stream - object. + .. method:: encode(out) -It also supports certain of Python's built-in operators through rich comparison -and :meth:`__repr__` methods. + Write the XML-RPC encoding of this :class:`DateTime` item to the *out* stream + object. + + It also supports certain of Python's built-in operators through rich comparison + and :meth:`__repr__` methods. A working example follows. The server code:: @@ -282,36 +289,38 @@ Binary Objects -------------- -This class may be initialized from bytes data (which may include NULs). The -primary access to the content of a :class:`Binary` object is provided by an -attribute: +.. class:: Binary + This class may be initialized from bytes data (which may include NULs). The + primary access to the content of a :class:`Binary` object is provided by an + attribute: -.. attribute:: Binary.data - The binary data encapsulated by the :class:`Binary` instance. The data is - provided as a :class:`bytes` object. + .. attribute:: data -:class:`Binary` objects have the following methods, supported mainly for -internal use by the marshalling/unmarshalling code: + The binary data encapsulated by the :class:`Binary` instance. The data is + provided as a :class:`bytes` object. + :class:`Binary` objects have the following methods, supported mainly for + internal use by the marshalling/unmarshalling code: -.. method:: Binary.decode(bytes) - Accept a base64 :class:`bytes` object and decode it as the instance's new data. + .. method:: decode(bytes) + Accept a base64 :class:`bytes` object and decode it as the instance's new data. -.. method:: Binary.encode(out) - Write the XML-RPC base 64 encoding of this binary item to the out stream object. + .. method:: encode(out) - The encoded data will have newlines every 76 characters as per - `RFC 2045 section 6.8 `_, - which was the de facto standard base64 specification when the - XML-RPC spec was written. + Write the XML-RPC base 64 encoding of this binary item to the *out* stream object. -It also supports certain of Python's built-in operators through :meth:`__eq__` -and :meth:`__ne__` methods. + The encoded data will have newlines every 76 characters as per + `RFC 2045 section 6.8 `_, + which was the de facto standard base64 specification when the + XML-RPC spec was written. + + It also supports certain of Python's built-in operators through :meth:`__eq__` + and :meth:`__ne__` methods. Example usage of the binary objects. We're going to transfer an image over XMLRPC:: @@ -342,18 +351,20 @@ Fault Objects ------------- -A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. Fault -objects have the following attributes: +.. class:: Fault + A :class:`Fault` object encapsulates the content of an XML-RPC fault tag. Fault + objects have the following attributes: -.. attribute:: Fault.faultCode - A string indicating the fault type. + .. attribute:: faultCode + A string indicating the fault type. -.. attribute:: Fault.faultString - A string containing a diagnostic message associated with the fault. + .. attribute:: faultString + + A string containing a diagnostic message associated with the fault. In the following example we're going to intentionally cause a :exc:`Fault` by returning a complex type object. The server code:: @@ -390,30 +401,32 @@ ProtocolError Objects --------------------- -A :class:`ProtocolError` object describes a protocol error in the underlying -transport layer (such as a 404 'not found' error if the server named by the URI -does not exist). It has the following attributes: +.. class:: ProtocolError + A :class:`ProtocolError` object describes a protocol error in the underlying + transport layer (such as a 404 'not found' error if the server named by the URI + does not exist). It has the following attributes: -.. attribute:: ProtocolError.url - The URI or URL that triggered the error. + .. attribute:: url + The URI or URL that triggered the error. -.. attribute:: ProtocolError.errcode - The error code. + .. attribute:: errcode + The error code. -.. attribute:: ProtocolError.errmsg - The error message or diagnostic string. + .. attribute:: errmsg + The error message or diagnostic string. -.. attribute:: ProtocolError.headers - A dict containing the headers of the HTTP/HTTPS request that triggered the - error. + .. attribute:: headers + + A dict containing the headers of the HTTP/HTTPS request that triggered the + error. In the following example we're going to intentionally cause a :exc:`ProtocolError` by providing an invalid URI:: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 03:07:25 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 07:07:25 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2ODg5?= =?utf-8?q?=3A_Fixed_hyperlinks_formatting=2E?= Message-ID: <20160507070724.67131.48870.D2510F69@psf.io> https://hg.python.org/cpython/rev/52924d962027 changeset: 101245:52924d962027 branch: 3.5 parent: 101242:04250fc723e6 user: Serhiy Storchaka date: Sat May 07 10:05:02 2016 +0300 summary: Issue #26889: Fixed hyperlinks formatting. files: Doc/library/xmlrpc.client.rst | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -52,7 +52,7 @@ XML; the default behaviour is for ``None`` to raise a :exc:`TypeError`. This is a commonly-used extension to the XML-RPC specification, but isn't supported by all clients and servers; see `http://ontosys.com/xml-rpc/extensions.php - ` + `_ for a description. The *use_builtin_types* flag can be used to cause date/time values to be presented as :class:`datetime.datetime` objects and binary data to be @@ -96,12 +96,12 @@ +----------------------+-------------------------------------------------------+ | ``array`` | :class:`list` or :class:`tuple` containing | | | conformable elements. Arrays are returned as | - | | :class:`list`\ s. | + | | :class:`lists `. | +----------------------+-------------------------------------------------------+ | ``struct`` | :class:`dict`. Keys must be strings, values may be | | | any conformable type. Objects of user-defined | - | | classes can be passed in; only their :attr:`__dict__` | - | | attribute is transmitted. | + | | classes can be passed in; only their | + | | :attr:`~object.__dict__` attribute is transmitted. | +----------------------+-------------------------------------------------------+ | ``dateTime.iso8601`` | :class:`DateTime` or :class:`datetime.datetime`. | | | Returned type depends on values of | -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 03:07:25 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 07:07:25 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2ODg5?= =?utf-8?q?=3A_Fixed_hyperlinks_formatting=2E?= Message-ID: <20160507070724.21003.47636.2F8EB7E8@psf.io> https://hg.python.org/cpython/rev/29a927c524cb changeset: 101247:29a927c524cb branch: 2.7 parent: 101244:fb5bd513751f user: Serhiy Storchaka date: Sat May 07 10:06:53 2016 +0300 summary: Issue #26889: Fixed hyperlinks formatting. files: Doc/library/xmlrpclib.rst | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/xmlrpclib.rst b/Doc/library/xmlrpclib.rst --- a/Doc/library/xmlrpclib.rst +++ b/Doc/library/xmlrpclib.rst @@ -54,7 +54,7 @@ XML; the default behaviour is for ``None`` to raise a :exc:`TypeError`. This is a commonly-used extension to the XML-RPC specification, but isn't supported by all clients and servers; see `http://ontosys.com/xml-rpc/extensions.php - ` + `_ for a description. The *use_datetime* flag can be used to cause date/time values to be presented as :class:`datetime.datetime` objects; this is false by default. @@ -95,12 +95,12 @@ +----------------------+-------------------------------------------------------+ | ``array`` | :class:`list` or :class:`tuple` containing | | | conformable elements. Arrays are returned as | - | | :class:`list`\ s. | + | | :class:`lists `. | +----------------------+-------------------------------------------------------+ | ``struct`` | :class:`dict`. Keys must be strings, values may be | | | any conformable type. Objects of user-defined | - | | classes can be passed in; only their :attr:`__dict__` | - | | attribute is transmitted. | + | | classes can be passed in; only their | + | | :attr:`~object.__dict__` attribute is transmitted. | +----------------------+-------------------------------------------------------+ | ``dateTime.iso8601`` | :class:`DateTime` or :class:`datetime.datetime`. | | | Returned type depends on values of the *use_datetime* | -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 03:07:25 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 07:07:25 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326889=3A_Fixed_hyperlinks_formatting=2E?= Message-ID: <20160507070724.89093.75303.C6C325C1@psf.io> https://hg.python.org/cpython/rev/ea9d69a4d0fe changeset: 101246:ea9d69a4d0fe parent: 101243:9bdec549bad3 parent: 101245:52924d962027 user: Serhiy Storchaka date: Sat May 07 10:06:39 2016 +0300 summary: Issue #26889: Fixed hyperlinks formatting. files: Doc/library/xmlrpc.client.rst | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -52,7 +52,7 @@ XML; the default behaviour is for ``None`` to raise a :exc:`TypeError`. This is a commonly-used extension to the XML-RPC specification, but isn't supported by all clients and servers; see `http://ontosys.com/xml-rpc/extensions.php - ` + `_ for a description. The *use_builtin_types* flag can be used to cause date/time values to be presented as :class:`datetime.datetime` objects and binary data to be @@ -96,12 +96,12 @@ +----------------------+-------------------------------------------------------+ | ``array`` | :class:`list` or :class:`tuple` containing | | | conformable elements. Arrays are returned as | - | | :class:`list`\ s. | + | | :class:`lists `. | +----------------------+-------------------------------------------------------+ | ``struct`` | :class:`dict`. Keys must be strings, values may be | | | any conformable type. Objects of user-defined | - | | classes can be passed in; only their :attr:`__dict__` | - | | attribute is transmitted. | + | | classes can be passed in; only their | + | | :attr:`~object.__dict__` attribute is transmitted. | +----------------------+-------------------------------------------------------+ | ``dateTime.iso8601`` | :class:`DateTime` or :class:`datetime.datetime`. | | | Returned type depends on values of | -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 03:50:41 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 07:50:41 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2NzM2?= =?utf-8?q?=3A_Used_HTTPS_for_external_links_in_the_documentation_if_possi?= =?utf-8?q?ble=2E?= Message-ID: <20160507075041.9140.36579.5462809C@psf.io> https://hg.python.org/cpython/rev/e3af25d70976 changeset: 101250:e3af25d70976 branch: 2.7 parent: 101247:29a927c524cb user: Serhiy Storchaka date: Sat May 07 10:50:12 2016 +0300 summary: Issue #26736: Used HTTPS for external links in the documentation if possible. files: Doc/c-api/init.rst | 2 +- Doc/faq/design.rst | 4 +- Doc/faq/extending.rst | 2 +- Doc/faq/general.rst | 2 +- Doc/faq/gui.rst | 4 +- Doc/faq/programming.rst | 16 +++++++------- Doc/faq/windows.rst | 2 +- Doc/howto/functional.rst | 6 ++-- Doc/howto/logging-cookbook.rst | 4 +- Doc/howto/pyporting.rst | 4 +- Doc/howto/unicode.rst | 2 +- Doc/howto/urllib2.rst | 6 ++-- Doc/install/index.rst | 6 ++-- Doc/library/array.rst | 2 +- Doc/library/bisect.rst | 2 +- Doc/library/codecs.rst | 2 +- Doc/library/collections.rst | 10 ++++---- Doc/library/colorsys.rst | 2 +- Doc/library/cookielib.rst | 2 +- Doc/library/datetime.rst | 4 +- Doc/library/difflib.rst | 2 +- Doc/library/htmllib.rst | 2 +- Doc/library/htmlparser.rst | 4 +- Doc/library/imaplib.rst | 2 +- Doc/library/json.rst | 2 +- Doc/library/mailbox.rst | 6 ++-- Doc/library/mimetypes.rst | 2 +- Doc/library/othergui.rst | 4 +- Doc/library/pyexpat.rst | 4 +- Doc/library/select.rst | 2 +- Doc/library/sqlite3.rst | 4 +- Doc/library/ssl.rst | 14 ++++++------ Doc/library/tarfile.rst | 2 +- Doc/library/tkinter.rst | 4 +- Doc/library/ttk.rst | 2 +- Doc/library/urllib2.rst | 2 +- Doc/library/urlparse.rst | 2 +- Doc/library/xml.dom.minidom.rst | 6 ++-- Doc/library/xml.dom.rst | 12 +++++----- Doc/library/xml.etree.elementtree.rst | 8 +++--- Doc/library/xmlrpclib.rst | 4 +- Doc/license.rst | 6 ++-- Doc/tutorial/interactive.rst | 2 +- Doc/tutorial/whatnow.rst | 2 +- Doc/using/mac.rst | 6 ++-- Doc/using/unix.rst | 8 +++--- Doc/using/windows.rst | 4 +- Doc/whatsnew/2.0.rst | 2 +- Doc/whatsnew/2.2.rst | 4 +- Doc/whatsnew/2.3.rst | 4 +- Doc/whatsnew/2.5.rst | 6 ++-- Doc/whatsnew/2.6.rst | 8 +++--- Doc/whatsnew/2.7.rst | 10 ++++---- Misc/NEWS | 2 + 54 files changed, 120 insertions(+), 118 deletions(-) diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -297,7 +297,7 @@ It is recommended that applications embedding the Python interpreter for purposes other than executing a single script pass 0 as *updatepath*, and update :data:`sys.path` themselves if desired. - See `CVE-2008-5983 `_. + See `CVE-2008-5983 `_. On versions before 2.6.6, you can achieve the same effect by manually popping the first :data:`sys.path` element after having called diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -431,10 +431,10 @@ There are also several programs which make it easier to intermingle Python and C code in various ways to increase performance. See, for example, `Cython `_ , `Psyco `_, `Pyrex -`_, `PyInline +`_, `PyInline `_, `Py2Cmod `_, and -`Weave `_. +`Weave `_. How does Python manage memory? diff --git a/Doc/faq/extending.rst b/Doc/faq/extending.rst --- a/Doc/faq/extending.rst +++ b/Doc/faq/extending.rst @@ -45,7 +45,7 @@ x86-compatible processor. `Cython `_ and its relative `Pyrex -`_ are compilers +`_ are compilers that accept a slightly modified form of Python and generate the corresponding C code. Pyrex makes it possible to write an extension without having to learn Python's C API. diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -271,7 +271,7 @@ The Python project's infrastructure is located all over the world. `www.python.org `_ is graciously hosted by `Rackspace -`_, with CDN caching provided by `Fastly +`_, with CDN caching provided by `Fastly `_. `Upfront Systems `_ hosts `bugs.python.org `_. Many other Python services like `the Wiki diff --git a/Doc/faq/gui.rst b/Doc/faq/gui.rst --- a/Doc/faq/gui.rst +++ b/Doc/faq/gui.rst @@ -21,13 +21,13 @@ Standard builds of Python include an object-oriented interface to the Tcl/Tk widget set, called Tkinter. This is probably the easiest to install and use. For more info about Tk, including pointers to the source, see the Tcl/Tk home -page at http://www.tcl.tk. Tcl/Tk is fully portable to the Mac OS X, Windows, +page at https://www.tcl.tk. Tcl/Tk is fully portable to the Mac OS X, Windows, and Unix platforms. wxWidgets --------- -wxWidgets (http://www.wxwidgets.org) is a free, portable GUI class +wxWidgets (https://www.wxwidgets.org) is a free, portable GUI class library written in C++ that provides a native look and feel on a number of platforms, with Windows, Mac OS X, GTK, X11, all listed as current stable targets. Language bindings are available for a number diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -28,9 +28,9 @@ PythonWin is a Python IDE that includes a GUI debugger based on pdb. The Pythonwin debugger colors breakpoints and has quite a few cool features such as debugging non-Pythonwin programs. Pythonwin is available as part of the `Python -for Windows Extensions `__ project and +for Windows Extensions `__ project and as a part of the ActivePython distribution (see -http://www.activestate.com/activepython\ ). +https://www.activestate.com/activepython\ ). `Boa Constructor `_ is an IDE and GUI builder that uses wxWidgets. It offers visual frame creation and manipulation, @@ -44,13 +44,13 @@ Pydb is a version of the standard Python debugger pdb, modified for use with DDD (Data Display Debugger), a popular graphical debugger front end. Pydb can be found at http://bashdb.sourceforge.net/pydb/ and DDD can be found at -http://www.gnu.org/software/ddd. +https://www.gnu.org/software/ddd. There are a number of commercial Python IDEs that include graphical debuggers. They include: -* Wing IDE (http://wingware.com/) -* Komodo IDE (http://komodoide.com/) +* Wing IDE (https://wingware.com/) +* Komodo IDE (https://komodoide.com/) * PyCharm (https://www.jetbrains.com/pycharm/) @@ -63,13 +63,13 @@ warns about code complexity and style. You can get PyChecker from http://pychecker.sourceforge.net/. -`Pylint `_ is another tool that checks +`Pylint `_ is another tool that checks if a module satisfies a coding standard, and also makes it possible to write plug-ins to add a custom feature. In addition to the bug checking that PyChecker performs, Pylint offers some additional features such as checking line length, whether variable names are well-formed according to your coding standard, whether declared interfaces are fully implemented, and more. -http://docs.pylint.org/ provides a full list of Pylint's features. +https://docs.pylint.org/ provides a full list of Pylint's features. How can I create a stand-alone binary from a Python script? @@ -1225,7 +1225,7 @@ See the Python Cookbook for a long discussion of many ways to do this: - http://code.activestate.com/recipes/52560/ + https://code.activestate.com/recipes/52560/ If you don't mind reordering the list, sort it and then scan from the end of the list, deleting duplicates as you go:: diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -334,5 +334,5 @@ Simply rename the downloaded file to have the .TGZ extension, and WinZip will be able to handle it. (If your copy of WinZip doesn't, get a newer one from -http://www.winzip.com.) +https://www.winzip.com.) diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst --- a/Doc/howto/functional.rst +++ b/Doc/howto/functional.rst @@ -1171,9 +1171,9 @@ Mertz also wrote a 3-part series of articles on functional programming for IBM's DeveloperWorks site; see -`part 1 `__, -`part 2 `__, and -`part 3 `__, +`part 1 `__, +`part 2 `__, and +`part 3 `__, Python documentation diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -767,11 +767,11 @@ Inserting a BOM into messages sent to a SysLogHandler ----------------------------------------------------- -`RFC 5424 `_ requires that a +`RFC 5424 `_ requires that a Unicode message be sent to a syslog daemon as a set of bytes which have the following structure: an optional pure-ASCII component, followed by a UTF-8 Byte Order Mark (BOM), followed by Unicode encoded using UTF-8. (See the `relevant -section of the specification `_.) +section of the specification `_.) In Python 2.6 and 2.7, code was added to :class:`~logging.handlers.SysLogHandler` to insert a BOM into the message, but diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst --- a/Doc/howto/pyporting.rst +++ b/Doc/howto/pyporting.rst @@ -379,10 +379,10 @@ .. _cheat sheet: http://python-future.org/compatible_idioms.html .. _coverage.py: https://pypi.python.org/pypi/coverage .. _Futurize: http://python-future.org/automatic_conversion.html -.. _Modernize: http://python-modernize.readthedocs.org/en/latest/ +.. _Modernize: https://python-modernize.readthedocs.org/en/latest/ .. _Porting to Python 3: http://python3porting.com/ .. _Pylint: https://pypi.python.org/pypi/pylint -.. _Python 3 Q & A: http://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html +.. _Python 3 Q & A: https://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html .. _python-future: http://python-future.org/ .. _python-porting: https://mail.python.org/mailman/listinfo/python-porting diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst --- a/Doc/howto/unicode.rst +++ b/Doc/howto/unicode.rst @@ -211,7 +211,7 @@ To help understand the standard, Jukka Korpela has written an introductory guide to reading the Unicode character tables, available at -. +. Another good introductory article was written by Joel Spolsky . diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -112,7 +112,7 @@ Note that other encodings are sometimes required (e.g. for file upload from HTML forms - see `HTML Specification, Form Submission -`_ for more +`_ for more details). If you do not pass the ``data`` argument, urllib2 uses a **GET** request. One @@ -388,7 +388,7 @@ ``httplib.HTTPMessage`` instance. Typical headers include 'Content-length', 'Content-type', and so on. See the -`Quick Reference to HTTP Headers `_ +`Quick Reference to HTTP Headers `_ for a useful listing of HTTP headers with brief explanations of their meaning and use. @@ -573,5 +573,5 @@ scripts with a localhost server, I have to prevent urllib2 from using the proxy. .. [#] urllib2 opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe - `_. + `_. diff --git a/Doc/install/index.rst b/Doc/install/index.rst --- a/Doc/install/index.rst +++ b/Doc/install/index.rst @@ -1009,7 +1009,7 @@ .. seealso:: - `C++Builder Compiler `_ + `C++Builder Compiler `_ Information about the free C++ compiler from Borland, including links to the download pages. @@ -1052,7 +1052,7 @@ for Borland's C++, because there is no program to convert the library. First you have to create a list of symbols which the Python DLL exports. (You can find a good program for this task at -http://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/). +https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/). .. I don't understand what the next line means. --amk .. (inclusive the references on data structures.) @@ -1090,7 +1090,7 @@ .. [#] This also means you could replace all existing COFF-libraries with OMF-libraries of the same name. -.. [#] Check http://www.sourceware.org/cygwin/ and http://www.mingw.org/ for more +.. [#] Check https://www.sourceware.org/cygwin/ and http://www.mingw.org/ for more information .. [#] Then you have no POSIX emulation available, but you also don't need diff --git a/Doc/library/array.rst b/Doc/library/array.rst --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -268,7 +268,7 @@ Packing and unpacking of External Data Representation (XDR) data as used in some remote procedure call systems. - `The Numerical Python Documentation `_ + `The Numerical Python Documentation `_ The Numeric Python extension (NumPy) defines another array type; see http://www.numpy.org/ for further information about Numerical Python. diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst --- a/Doc/library/bisect.rst +++ b/Doc/library/bisect.rst @@ -62,7 +62,7 @@ .. seealso:: `SortedCollection recipe - `_ that uses + `_ that uses bisect to build a full-featured collection class with straight-forward search methods and support for a key-function. The keys are precomputed to save unnecessary calls to the key function during searches. diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1273,7 +1273,7 @@ (:mod:`httplib` then also transparently sends an IDNA hostname in the :mailheader:`Host` field if it sends that field at all). -.. _section 3.1: http://tools.ietf.org/html/rfc3490#section-3.1 +.. _section 3.1: https://tools.ietf.org/html/rfc3490#section-3.1 When receiving host names from the wire (such as in reverse name lookup), no automatic conversion to Unicode is performed: Applications wishing to present diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -196,9 +196,9 @@ .. seealso:: - * `Counter class `_ + * `Counter class `_ adapted for Python 2.5 and an early `Bag recipe - `_ for Python 2.4. + `_ for Python 2.4. in Smalltalk. @@ -785,7 +785,7 @@ .. seealso:: - `Named tuple recipe `_ + `Named tuple recipe `_ adapted for Python 2.4. @@ -828,7 +828,7 @@ .. seealso:: - `Equivalent OrderedDict recipe `_ + `Equivalent OrderedDict recipe `_ that runs on Python 2.4 or later. :class:`OrderedDict` Examples and Recipes @@ -1040,7 +1040,7 @@ .. seealso:: - * `OrderedSet recipe `_ for an + * `OrderedSet recipe `_ for an example built on :class:`MutableSet`. * For more about ABCs, see the :mod:`abc` module and :pep:`3119`. diff --git a/Doc/library/colorsys.rst b/Doc/library/colorsys.rst --- a/Doc/library/colorsys.rst +++ b/Doc/library/colorsys.rst @@ -21,7 +21,7 @@ More information about color spaces can be found at http://www.poynton.com/ColorFAQ.html and - http://www.cambridgeincolour.com/tutorials/color-spaces.htm. + https://www.cambridgeincolour.com/tutorials/color-spaces.htm. The :mod:`colorsys` module defines the following functions: diff --git a/Doc/library/cookielib.rst b/Doc/library/cookielib.rst --- a/Doc/library/cookielib.rst +++ b/Doc/library/cookielib.rst @@ -122,7 +122,7 @@ HTTP cookie classes, principally useful for server-side code. The :mod:`cookielib` and :mod:`Cookie` modules do not depend on each other. - http://curl.haxx.se/rfc/cookie_spec.html + https://curl.haxx.se/rfc/cookie_spec.html The specification of the original Netscape cookie protocol. Though this is still the dominant protocol, the 'Netscape cookie protocol' implemented by all the major browsers (and :mod:`cookielib`) only bears a passing resemblance to diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -515,7 +515,7 @@ Return a 3-tuple, (ISO year, ISO week number, ISO weekday). The ISO calendar is a widely used variant of the Gregorian calendar. See - http://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm for a good + https://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm for a good explanation. The ISO year consists of 52 or 53 full weeks, and where a week starts on a @@ -1573,7 +1573,7 @@ *pytz* contains up-to-date information and its usage is recommended. - `IANA timezone database `_ + `IANA timezone database `_ The Time Zone Database (often called tz or zoneinfo) contains code and data that represent the history of local time for many representative locations around the globe. It is updated periodically to reflect changes diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -594,7 +594,7 @@ work. * `Simple version control recipe - `_ for a small application + `_ for a small application built with :class:`SequenceMatcher`. diff --git a/Doc/library/htmllib.rst b/Doc/library/htmllib.rst --- a/Doc/library/htmllib.rst +++ b/Doc/library/htmllib.rst @@ -64,7 +64,7 @@ .. class:: HTMLParser(formatter) This is the basic HTML parser class. It supports all entity names required by - the XHTML 1.0 Recommendation (http://www.w3.org/TR/xhtml1). It also defines + the XHTML 1.0 Recommendation (https://www.w3.org/TR/xhtml1). It also defines handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements. diff --git a/Doc/library/htmlparser.rst b/Doc/library/htmlparser.rst --- a/Doc/library/htmlparser.rst +++ b/Doc/library/htmlparser.rst @@ -148,8 +148,8 @@ and quotes in the *value* have been removed, and character and entity references have been replaced. - For instance, for the tag ````, this method - would be called as ``handle_starttag('a', [('href', 'http://www.cwi.nl/')])``. + For instance, for the tag ````, this method + would be called as ``handle_starttag('a', [('href', 'https://www.cwi.nl/')])``. .. versionchanged:: 2.6 All entity references from :mod:`htmlentitydefs` are now replaced in the diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -125,7 +125,7 @@ Documents describing the protocol, and sources and binaries for servers implementing it, can all be found at the University of Washington's *IMAP - Information Center* (http://www.washington.edu/imap/). + Information Center* (https://www.washington.edu/imap/). .. _imap4-objects: diff --git a/Doc/library/json.rst b/Doc/library/json.rst --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -613,7 +613,7 @@ .. rubric:: Footnotes .. [#rfc-errata] As noted in `the errata for RFC 7159 - `_, + `_, JSON permits literal U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH SEPARATOR) characters in strings, whereas JavaScript (as of ECMAScript Edition 5.1) does not. diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst --- a/Doc/library/mailbox.rst +++ b/Doc/library/mailbox.rst @@ -409,7 +409,7 @@ `maildir man page from qmail `_ The original specification of the format. - `Using maildir format `_ + `Using maildir format `_ Notes on Maildir by its inventor. Includes an updated name-creation scheme and details on "info" semantics. @@ -677,10 +677,10 @@ .. seealso:: - `Format of Version 5 Babyl Files `_ + `Format of Version 5 Babyl Files `_ A specification of the Babyl format. - `Reading Mail with Rmail `_ + `Reading Mail with Rmail `_ The Rmail manual, with some information on Babyl semantics. diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -44,7 +44,7 @@ The optional *strict* argument is a flag specifying whether the list of known MIME types is limited to only the official types `registered with IANA - `_. + `_. When *strict* is ``True`` (the default), only the IANA types are supported; when *strict* is ``False``, some additional non-standard but commonly used MIME types are also recognized. diff --git a/Doc/library/othergui.rst b/Doc/library/othergui.rst --- a/Doc/library/othergui.rst +++ b/Doc/library/othergui.rst @@ -25,12 +25,12 @@ book, `GUI Programming with Python: QT Edition `_ by Boudewijn Rempt. The *PyQt4* bindings also have a book, `Rapid GUI Programming - with Python and Qt `_, by Mark + with Python and Qt `_, by Mark Summerfield. `wxPython `_ wxPython is a cross-platform GUI toolkit for Python that is built around - the popular `wxWidgets `_ (formerly wxWindows) + the popular `wxWidgets `_ (formerly wxWindows) C++ toolkit. It provides a native look and feel for applications on Windows, Mac OS X, and Unix systems by using each platform's native widgets where ever possible, (GTK+ on Unix-like systems). In addition to diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst --- a/Doc/library/pyexpat.rst +++ b/Doc/library/pyexpat.rst @@ -911,6 +911,6 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is - not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/select.rst b/Doc/library/select.rst --- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -305,7 +305,7 @@ Kevent Objects -------------- -http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 +https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 .. attribute:: kevent.ident diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -55,7 +55,7 @@ Usually your SQL operations will need to use values from Python variables. You shouldn't assemble your query using Python's string operations because doing so is insecure; it makes your program vulnerable to an SQL injection attack -(see http://xkcd.com/327/ for humorous example of what can go wrong). +(see https://xkcd.com/327/ for humorous example of what can go wrong). Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder wherever you want to use a value, and then provide a tuple of values as the @@ -101,7 +101,7 @@ The pysqlite web page -- sqlite3 is developed externally under the name "pysqlite". - http://www.sqlite.org + https://www.sqlite.org The SQLite web page; the documentation describes the syntax and the available data types for the supported SQL dialect. diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -206,7 +206,7 @@ The *ciphers* parameter sets the available ciphers for this SSL object. It should be a string in the `OpenSSL cipher list format - `_. + `_. The parameter ``do_handshake_on_connect`` specifies whether to do the SSL handshake automatically after doing a :meth:`socket.connect`, or whether the @@ -761,7 +761,7 @@ ALERT_DESCRIPTION_* Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry - `_ + `_ contains this list and references to the RFCs where their meaning is defined. Used as the return value of the callback function in @@ -1062,7 +1062,7 @@ The *capath* string, if present, is the path to a directory containing several CA certificates in PEM format, following an `OpenSSL specific layout - `_. + `_. The *cadata* object, if present, is either an ASCII string of one or more PEM-encoded certificates or a bytes-like object of DER-encoded @@ -1091,7 +1091,7 @@ Set the available ciphers for sockets created with this context. It should be a string in the `OpenSSL cipher list format - `_. + `_. If no cipher can be selected (because compile-time options or other configuration forbids use of all the specified ciphers), an :class:`SSLError` will be raised. @@ -1230,7 +1230,7 @@ Get statistics about the SSL sessions created or managed by this context. A dictionary is returned which maps the names of each `piece of information - `_ to their + `_ to their numeric values. For example, here is the total number of hits and misses in the session cache since the context was created:: @@ -1722,7 +1722,7 @@ :meth:`SSLContext.set_ciphers` method. Starting from Python 2.7.9, the ssl module disables certain weak ciphers by default, but you may want to further restrict the cipher choice. Be sure to read OpenSSL's documentation -about the `cipher list format `_. +about the `cipher list format `_. If you want to check which ciphers are enabled by a given cipher list, use the ``openssl ciphers`` command on your system. @@ -1764,5 +1764,5 @@ `RFC 6066: Transport Layer Security (TLS) Extensions `_ D. Eastlake - `IANA TLS: Transport Layer Security (TLS) Parameters `_ + `IANA TLS: Transport Layer Security (TLS) Parameters `_ IANA diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -229,7 +229,7 @@ Documentation of the higher-level archiving facilities provided by the standard :mod:`shutil` module. - `GNU tar manual, Basic Tar Format `_ + `GNU tar manual, Basic Tar Format `_ Documentation for tar archive files, including GNU tar extensions. diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -26,13 +26,13 @@ `TKDocs `_ Extensive tutorial plus friendlier widget pages for some of the widgets. - `Tkinter reference: a GUI for Python `_ + `Tkinter reference: a GUI for Python `_ On-line reference material. `Tkinter docs from effbot `_ Online reference for tkinter supported by effbot.org. - `Tcl/Tk manual `_ + `Tcl/Tk manual `_ Official manual for the latest tcl/tk version. `Programming Python `_ diff --git a/Doc/library/ttk.rst b/Doc/library/ttk.rst --- a/Doc/library/ttk.rst +++ b/Doc/library/ttk.rst @@ -21,7 +21,7 @@ .. seealso:: - `Tk Widget Styling Support `_ + `Tk Widget Styling Support `_ The document which brought up theming support for Tk diff --git a/Doc/library/urllib2.rst b/Doc/library/urllib2.rst --- a/Doc/library/urllib2.rst +++ b/Doc/library/urllib2.rst @@ -64,7 +64,7 @@ * :meth:`info` --- return the meta-information of the page, such as headers, in the form of an :class:`mimetools.Message` instance - (see `Quick Reference to HTTP Headers `_) + (see `Quick Reference to HTTP Headers `_) * :meth:`getcode` --- return the HTTP status code of the response. diff --git a/Doc/library/urlparse.rst b/Doc/library/urlparse.rst --- a/Doc/library/urlparse.rst +++ b/Doc/library/urlparse.rst @@ -258,7 +258,7 @@ .. doctest:: - >>> urljoin('http://www.cwi.nl/%7Eguido/Python.html', + >>> urljoin('https://www.cwi.nl/%7Eguido/Python.html', ... '//www.python.org/%7Eguido') 'http://www.python.org/%7Eguido' diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst --- a/Doc/library/xml.dom.minidom.rst +++ b/Doc/library/xml.dom.minidom.rst @@ -107,7 +107,7 @@ .. seealso:: - `Document Object Model (DOM) Level 1 Specification `_ + `Document Object Model (DOM) Level 1 Specification `_ The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`. @@ -275,5 +275,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is - not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/xml.dom.rst b/Doc/library/xml.dom.rst --- a/Doc/library/xml.dom.rst +++ b/Doc/library/xml.dom.rst @@ -73,10 +73,10 @@ .. seealso:: - `Document Object Model (DOM) Level 2 Specification `_ + `Document Object Model (DOM) Level 2 Specification `_ The W3C recommendation upon which the Python DOM API is based. - `Document Object Model (DOM) Level 1 Specification `_ + `Document Object Model (DOM) Level 1 Specification `_ The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`. `Python Language Mapping Specification `_ @@ -127,7 +127,7 @@ .. data:: XML_NAMESPACE The namespace URI associated with the reserved prefix ``xml``, as defined by - `Namespaces in XML `_ (section 4). + `Namespaces in XML `_ (section 4). .. versionadded:: 2.2 @@ -136,7 +136,7 @@ The namespace URI for namespace declarations, as defined by `Document Object Model (DOM) Level 2 Core Specification - `_ (section 1.1.8). + `_ (section 1.1.8). .. versionadded:: 2.2 @@ -144,7 +144,7 @@ .. data:: XHTML_NAMESPACE The URI of the XHTML namespace as defined by `XHTML 1.0: The Extensible - HyperText Markup Language `_ (section 3.1.1). + HyperText Markup Language `_ (section 3.1.1). .. versionadded:: 2.2 @@ -895,7 +895,7 @@ .. exception:: NamespaceErr If an attempt is made to change any object in a way that is not permitted with - regard to the `Namespaces in XML `_ + regard to the `Namespaces in XML `_ recommendation, this exception is raised. diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -274,7 +274,7 @@ with prefixes in the form ``prefix:sometag`` get expanded to ``{uri}sometag`` where the *prefix* is replaced by the full *URI*. Also, if there is a `default namespace -`__, +`__, that full URI gets prepended to all of the non-prefixed tags. Here is an XML example that incorporates two namespaces, one with the @@ -345,7 +345,7 @@ ------------- This module provides limited support for -`XPath expressions `_ for locating elements in a +`XPath expressions `_ for locating elements in a tree. The goal is to support a small subset of the abbreviated syntax; a full XPath engine is outside the scope of the module. @@ -1032,5 +1032,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is - not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/xmlrpclib.rst b/Doc/library/xmlrpclib.rst --- a/Doc/library/xmlrpclib.rst +++ b/Doc/library/xmlrpclib.rst @@ -334,7 +334,7 @@ Write the XML-RPC base 64 encoding of this binary item to the *out* stream object. The encoded data will have newlines every 76 characters as per - `RFC 2045 section 6.8 `_, + `RFC 2045 section 6.8 `_, which was the de facto standard base64 specification when the XML-RPC spec was written. @@ -614,7 +614,7 @@ .. rubric:: Footnotes .. [#] This approach has been first presented in `a discussion on xmlrpc.com - `_. + `_. .. the link now points to webarchive since the one at .. http://www.xmlrpc.com/discuss/msgReader%241208 is broken (and webadmin .. doesn't reply) diff --git a/Doc/license.rst b/Doc/license.rst --- a/Doc/license.rst +++ b/Doc/license.rst @@ -11,12 +11,12 @@ ======================= Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl/) in the Netherlands as a +Mathematisch Centrum (CWI, see https://www.cwi.nl/) in the Netherlands as a successor of a language called ABC. Guido remains Python's principal author, although it includes many contributions from others. In 1995, Guido continued his work on Python at the Corporation for National -Research Initiatives (CNRI, see http://www.cnri.reston.va.us/) in Reston, +Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston, Virginia where he released several versions of the software. In May 2000, Guido and the Python core development team moved to BeOpen.com to @@ -27,7 +27,7 @@ specifically to own Python-related Intellectual Property. Zope Corporation is a sponsoring member of the PSF. -All Python releases are Open Source (see http://opensource.org/ for the Open +All Python releases are Open Source (see https://opensource.org/ for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. diff --git a/Doc/tutorial/interactive.rst b/Doc/tutorial/interactive.rst --- a/Doc/tutorial/interactive.rst +++ b/Doc/tutorial/interactive.rst @@ -170,6 +170,6 @@ :ref:`tut-customize`. -.. _GNU Readline: http://tiswww.case.edu/php/chet/readline/rltop.html +.. _GNU Readline: https://tiswww.case.edu/php/chet/readline/rltop.html .. _IPython: http://ipython.scipy.org/ .. _bpython: http://www.bpython-interpreter.org/ diff --git a/Doc/tutorial/whatnow.rst b/Doc/tutorial/whatnow.rst --- a/Doc/tutorial/whatnow.rst +++ b/Doc/tutorial/whatnow.rst @@ -43,7 +43,7 @@ for download. Once you begin releasing code, you can register it here so that others can find it. -* http://code.activestate.com/recipes/langs/python/: The Python Cookbook is a +* https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a sizable collection of code examples, larger modules, and useful scripts. Particularly notable contributions are collected in a book also titled Python Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.) diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -72,7 +72,7 @@ :program:`emacs` among them. If you want a more Mac-like editor, :program:`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see http://www.barebones.com/products/bbedit/index.html) are good choices, as is -:program:`TextMate` (see http://macromates.com/). Other editors include +:program:`TextMate` (see https://macromates.com/). Other editors include :program:`Gvim` (http://macvim.org) and :program:`Aquamacs` (http://aquamacs.org/). @@ -151,9 +151,9 @@ available from https://pythonhosted.org/pyobjc/. The standard Python GUI toolkit is :mod:`Tkinter`, based on the cross-platform -Tk toolkit (http://www.tcl.tk). An Aqua-native version of Tk is bundled with OS +Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is bundled with OS X by Apple, and the latest version can be downloaded and installed from -http://www.activestate.com; it can also be built from source. +https://www.activestate.com; it can also be built from source. *wxPython* is another popular cross-platform GUI toolkit that runs natively on Mac OS X. Packages and documentation are available from http://www.wxpython.org. diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst --- a/Doc/using/unix.rst +++ b/Doc/using/unix.rst @@ -55,7 +55,7 @@ On OpenSolaris -------------- -You can get Python from `OpenCSW `_. Various versions +You can get Python from `OpenCSW `_. Various versions of Python are available and can be installed with e.g. ``pkgutil -i python27``. @@ -143,10 +143,10 @@ information on how to code in Python in these editors, look at: * http://www.vim.org/scripts/script.php?script_id=790 -* http://sourceforge.net/projects/python-mode +* https://sourceforge.net/projects/python-mode Geany is an excellent IDE with support for a lot of languages. For more -information, read: http://www.geany.org/ +information, read: https://www.geany.org/ Komodo edit is another extremely good IDE. It also has support for a lot of -languages. For more information, read http://komodoide.com/. +languages. For more information, read https://komodoide.com/. diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -31,7 +31,7 @@ following releases), this support was dropped and new releases are just expected to work on the Windows NT family. * `Windows CE `_ is still supported. -* The `Cygwin `_ installer offers to install the Python +* The `Cygwin `_ installer offers to install the Python interpreter as well (cf. `Cygwin package source `_, `Maintainer releases @@ -129,7 +129,7 @@ https://support.microsoft.com/kb/310519 How To Manage Environment Variables in Windows XP - http://www.chem.gla.ac.uk/~louis/software/faq/q1.html + https://www.chem.gla.ac.uk/~louis/software/faq/q1.html Setting Environment variables, Louis J. Farrugia diff --git a/Doc/whatsnew/2.0.rst b/Doc/whatsnew/2.0.rst --- a/Doc/whatsnew/2.0.rst +++ b/Doc/whatsnew/2.0.rst @@ -61,7 +61,7 @@ made available by SourceForge for storing source code, tracking bug reports, and managing the queue of patch submissions. To report bugs or submit patches for Python 2.0, use the bug tracking and patch manager tools available from -Python's project page, located at http://sourceforge.net/projects/python/. +Python's project page, located at https://sourceforge.net/projects/python/. The most important of the services now hosted at SourceForge is the Python CVS tree, the version-controlled repository containing the source code for Python. diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst --- a/Doc/whatsnew/2.2.rst +++ b/Doc/whatsnew/2.2.rst @@ -632,10 +632,10 @@ every square of an $NxN$ chessboard without visiting any square twice). The idea of generators comes from other programming languages, especially Icon -(http://www.cs.arizona.edu/icon/), where the idea of generators is central. In +(https://www.cs.arizona.edu/icon/), where the idea of generators is central. In Icon, every expression and function call behaves like a generator. One example from "An Overview of the Icon Programming Language" at -http://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks +https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks like:: sentence := "Store it in the neighboring harbor" diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst --- a/Doc/whatsnew/2.3.rst +++ b/Doc/whatsnew/2.3.rst @@ -218,10 +218,10 @@ every square of an $NxN$ chessboard without visiting any square twice). The idea of generators comes from other programming languages, especially Icon -(http://www.cs.arizona.edu/icon/), where the idea of generators is central. In +(https://www.cs.arizona.edu/icon/), where the idea of generators is central. In Icon, every expression and function call behaves like a generator. One example from "An Overview of the Icon Programming Language" at -http://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks +https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks like:: sentence := "Store it in the neighboring harbor" diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst --- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -1528,7 +1528,7 @@ * The :mod:`socket` module now supports :const:`AF_NETLINK` sockets on Linux, thanks to a patch from Philippe Biondi. Netlink sockets are a Linux-specific mechanism for communications between a user-space process and kernel code; an - introductory article about them is at http://www.linuxjournal.com/article/7356. + introductory article about them is at https://www.linuxjournal.com/article/7356. In Python code, netlink addresses are represented as a tuple of 2 integers, ``(pid, group_mask)``. @@ -2013,7 +2013,7 @@ >>> For more information about the SQL dialect supported by SQLite, see -http://www.sqlite.org. +https://www.sqlite.org. .. seealso:: @@ -2021,7 +2021,7 @@ http://www.pysqlite.org The pysqlite web page. - http://www.sqlite.org + https://www.sqlite.org The SQLite web page; the documentation describes the syntax and the available data types for the supported SQL dialect. diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -152,9 +152,9 @@ up different products and import some of the bugs and patches from SourceForge. Four different trackers were examined: `Jira `__, -`Launchpad `__, +`Launchpad `__, `Roundup `__, and -`Trac `__. +`Trac `__. The committee eventually settled on Jira and Roundup as the two candidates. Jira is a commercial product that offers no-cost hosted instances to free-software projects; Roundup @@ -1427,7 +1427,7 @@ :pep:`3141` - A Type Hierarchy for Numbers PEP written by Jeffrey Yasskin. - `Scheme's numerical tower `__, from the Guile manual. + `Scheme's numerical tower `__, from the Guile manual. `Scheme's number datatypes `__ from the R5RS Scheme specification. @@ -2885,7 +2885,7 @@ Bill Janssen made extensive improvements to Python 2.6's support for the Secure Sockets Layer by adding a new module, :mod:`ssl`, that's -built atop the `OpenSSL `__ library. +built atop the `OpenSSL `__ library. This new module provides more control over the protocol negotiated, the X.509 certificates used, and has better support for writing SSL servers (as opposed to clients) in Python. The existing SSL support diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -1157,7 +1157,7 @@ * The :mod:`ctypes` module now always converts ``None`` to a C NULL pointer for arguments declared as pointers. (Changed by Thomas Heller; :issue:`4606`.) The underlying `libffi library - `__ has been updated to version + `__ has been updated to version 3.0.9, containing various fixes for different platforms. (Updated by Matthias Klose; :issue:`8142`.) @@ -1530,7 +1530,7 @@ *ciphers* argument that's a string listing the encryption algorithms to be allowed; the format of the string is described `in the OpenSSL documentation - `__. + `__. (Added by Antoine Pitrou; :issue:`8322`.) Another change makes the extension load all of OpenSSL's ciphers and @@ -1783,7 +1783,7 @@ To learn more, read the :mod:`ttk` module documentation. You may also wish to read the Tcl/Tk manual page describing the Ttk theme engine, available at -http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some +https://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some screenshots of the Python/Ttk code in use are at http://code.google.com/p/python-ttk/wiki/Screenshots. @@ -2079,7 +2079,7 @@ * The latest release of the GNU Debugger, GDB 7, can be `scripted using Python - `__. + `__. When you begin debugging an executable program P, GDB will look for a file named ``P-gdb.py`` and automatically read it. Dave Malcolm contributed a :file:`python-gdb.py` that adds a number of @@ -2149,7 +2149,7 @@ with *updatepath* set to false. Security issue reported as `CVE-2008-5983 - `_; + `_; discussed in :issue:`5753`, and fixed by Antoine Pitrou. * New macros: the Python header files now define the following macros: diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -231,6 +231,8 @@ Documentation ------------- +- Issue #26736: Used HTTPS for external links in the documentation if possible. + - Issue #6953: Rework the Readline module documentation to group related functions together, and add more details such as what underlying Readline functions and variables are accessed. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 03:50:41 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 07:50:41 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2NzM2?= =?utf-8?q?=3A_Used_HTTPS_for_external_links_in_the_documentation_if_possi?= =?utf-8?q?ble=2E?= Message-ID: <20160507075040.89249.3943.2C60CF71@psf.io> https://hg.python.org/cpython/rev/211a9f32dfb9 changeset: 101248:211a9f32dfb9 branch: 3.5 parent: 101245:52924d962027 user: Serhiy Storchaka date: Sat May 07 10:49:07 2016 +0300 summary: Issue #26736: Used HTTPS for external links in the documentation if possible. files: Doc/c-api/init.rst | 2 +- Doc/faq/design.rst | 2 +- Doc/faq/extending.rst | 2 +- Doc/faq/general.rst | 2 +- Doc/faq/gui.rst | 6 ++-- Doc/faq/programming.rst | 16 +++++++------- Doc/faq/windows.rst | 2 +- Doc/howto/functional.rst | 6 ++-- Doc/howto/logging-cookbook.rst | 4 +- Doc/howto/pyporting.rst | 4 +- Doc/howto/unicode.rst | 2 +- Doc/howto/urllib2.rst | 6 ++-- Doc/install/index.rst | 6 ++-- Doc/library/array.rst | 2 +- Doc/library/bisect.rst | 2 +- Doc/library/codecs.rst | 2 +- Doc/library/collections.abc.rst | 2 +- Doc/library/collections.rst | 6 ++-- Doc/library/colorsys.rst | 2 +- Doc/library/datetime.rst | 4 +- Doc/library/difflib.rst | 2 +- Doc/library/hashlib.rst | 2 +- Doc/library/html.entities.rst | 2 +- Doc/library/html.parser.rst | 4 +- Doc/library/http.cookiejar.rst | 2 +- Doc/library/http.rst | 2 +- Doc/library/imaplib.rst | 2 +- Doc/library/ipaddress.rst | 4 +- Doc/library/json.rst | 2 +- Doc/library/mailbox.rst | 6 ++-- Doc/library/mimetypes.rst | 2 +- Doc/library/othergui.rst | 4 +- Doc/library/pyexpat.rst | 4 +- Doc/library/select.rst | 2 +- Doc/library/sqlite3.rst | 6 ++-- Doc/library/ssl.rst | 14 ++++++------ Doc/library/statistics.rst | 2 +- Doc/library/sys.rst | 2 +- Doc/library/tarfile.rst | 2 +- Doc/library/tkinter.rst | 6 ++-- Doc/library/tkinter.ttk.rst | 2 +- Doc/library/unittest.mock-examples.rst | 4 +- Doc/library/unittest.rst | 2 +- Doc/library/urllib.request.rst | 4 +- Doc/library/xml.dom.minidom.rst | 6 ++-- Doc/library/xml.dom.rst | 12 +++++----- Doc/library/xml.etree.elementtree.rst | 8 +++--- Doc/library/xmlrpc.client.rst | 4 +- Doc/license.rst | 6 ++-- Doc/reference/lexical_analysis.rst | 2 +- Doc/tutorial/floatingpoint.rst | 2 +- Doc/tutorial/interactive.rst | 2 +- Doc/tutorial/stdlib.rst | 2 +- Doc/tutorial/whatnow.rst | 4 +- Doc/using/mac.rst | 6 ++-- Doc/using/unix.rst | 8 +++--- Doc/using/windows.rst | 4 +- Doc/whatsnew/2.0.rst | 2 +- Doc/whatsnew/2.2.rst | 4 +- Doc/whatsnew/2.3.rst | 4 +- Doc/whatsnew/2.5.rst | 6 ++-- Doc/whatsnew/2.6.rst | 8 +++--- Doc/whatsnew/2.7.rst | 10 ++++---- Doc/whatsnew/3.2.rst | 10 ++++---- Doc/whatsnew/3.4.rst | 2 +- Misc/NEWS | 2 + 66 files changed, 140 insertions(+), 138 deletions(-) diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -357,7 +357,7 @@ It is recommended that applications embedding the Python interpreter for purposes other than executing a single script pass 0 as *updatepath*, and update :data:`sys.path` themselves if desired. - See `CVE-2008-5983 `_. + See `CVE-2008-5983 `_. On versions before 3.1.3, you can achieve the same effect by manually popping the first :data:`sys.path` element after having called diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -368,7 +368,7 @@ Practical answer: -`Cython `_ and `Pyrex `_ +`Cython `_ and `Pyrex `_ compile a modified version of Python with optional annotations into C extensions. `Weave `_ makes it easy to intermingle Python and C code in various ways to increase performance. diff --git a/Doc/faq/extending.rst b/Doc/faq/extending.rst --- a/Doc/faq/extending.rst +++ b/Doc/faq/extending.rst @@ -42,7 +42,7 @@ .. XXX make sure these all work `Cython `_ and its relative `Pyrex -`_ are compilers +`_ are compilers that accept a slightly modified form of Python and generate the corresponding C code. Cython and Pyrex make it possible to write an extension without having to learn Python's C API. diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -271,7 +271,7 @@ The Python project's infrastructure is located all over the world. `www.python.org `_ is graciously hosted by `Rackspace -`_, with CDN caching provided by `Fastly +`_, with CDN caching provided by `Fastly `_. `Upfront Systems `_ hosts `bugs.python.org `_. Many other Python services like `the Wiki diff --git a/Doc/faq/gui.rst b/Doc/faq/gui.rst --- a/Doc/faq/gui.rst +++ b/Doc/faq/gui.rst @@ -31,13 +31,13 @@ install (since it comes included with most `binary distributions `_ of Python) and use. For more info about Tk, including pointers to the source, see the -`Tcl/Tk home page `_. Tcl/Tk is fully portable to the +`Tcl/Tk home page `_. Tcl/Tk is fully portable to the Mac OS X, Windows, and Unix platforms. wxWidgets --------- -wxWidgets (http://www.wxwidgets.org) is a free, portable GUI class +wxWidgets (https://www.wxwidgets.org) is a free, portable GUI class library written in C++ that provides a native look and feel on a number of platforms, with Windows, Mac OS X, GTK, X11, all listed as current stable targets. Language bindings are available for a number @@ -72,7 +72,7 @@ The `GObject introspection bindings `_ for Python allow you to write GTK+ 3 applications. There is also a -`Python GTK+ 3 Tutorial `_. +`Python GTK+ 3 Tutorial `_. The older PyGtk bindings for the `Gtk+ 2 toolkit `_ have been implemented by James Henstridge; see . diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -28,9 +28,9 @@ PythonWin is a Python IDE that includes a GUI debugger based on pdb. The Pythonwin debugger colors breakpoints and has quite a few cool features such as debugging non-Pythonwin programs. Pythonwin is available as part of the `Python -for Windows Extensions `__ project and +for Windows Extensions `__ project and as a part of the ActivePython distribution (see -http://www.activestate.com/activepython\ ). +https://www.activestate.com/activepython\ ). `Boa Constructor `_ is an IDE and GUI builder that uses wxWidgets. It offers visual frame creation and manipulation, @@ -44,13 +44,13 @@ Pydb is a version of the standard Python debugger pdb, modified for use with DDD (Data Display Debugger), a popular graphical debugger front end. Pydb can be found at http://bashdb.sourceforge.net/pydb/ and DDD can be found at -http://www.gnu.org/software/ddd. +https://www.gnu.org/software/ddd. There are a number of commercial Python IDEs that include graphical debuggers. They include: -* Wing IDE (http://wingware.com/) -* Komodo IDE (http://komodoide.com/) +* Wing IDE (https://wingware.com/) +* Komodo IDE (https://komodoide.com/) * PyCharm (https://www.jetbrains.com/pycharm/) @@ -63,13 +63,13 @@ warns about code complexity and style. You can get PyChecker from http://pychecker.sourceforge.net/. -`Pylint `_ is another tool that checks +`Pylint `_ is another tool that checks if a module satisfies a coding standard, and also makes it possible to write plug-ins to add a custom feature. In addition to the bug checking that PyChecker performs, Pylint offers some additional features such as checking line length, whether variable names are well-formed according to your coding standard, whether declared interfaces are fully implemented, and more. -http://docs.pylint.org/ provides a full list of Pylint's features. +https://docs.pylint.org/ provides a full list of Pylint's features. How can I create a stand-alone binary from a Python script? @@ -1115,7 +1115,7 @@ See the Python Cookbook for a long discussion of many ways to do this: - http://code.activestate.com/recipes/52560/ + https://code.activestate.com/recipes/52560/ If you don't mind reordering the list, sort it and then scan from the end of the list, deleting duplicates as you go:: diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -340,5 +340,5 @@ Simply rename the downloaded file to have the .TGZ extension, and WinZip will be able to handle it. (If your copy of WinZip doesn't, get a newer one from -http://www.winzip.com.) +https://www.winzip.com.) diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst --- a/Doc/howto/functional.rst +++ b/Doc/howto/functional.rst @@ -1225,9 +1225,9 @@ Mertz also wrote a 3-part series of articles on functional programming for IBM's DeveloperWorks site; see -`part 1 `__, -`part 2 `__, and -`part 3 `__, +`part 1 `__, +`part 2 `__, and +`part 3 `__, Python documentation diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -1634,11 +1634,11 @@ Inserting a BOM into messages sent to a SysLogHandler ----------------------------------------------------- -`RFC 5424 `_ requires that a +`RFC 5424 `_ requires that a Unicode message be sent to a syslog daemon as a set of bytes which have the following structure: an optional pure-ASCII component, followed by a UTF-8 Byte Order Mark (BOM), followed by Unicode encoded using UTF-8. (See the `relevant -section of the specification `_.) +section of the specification `_.) In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to insert a BOM into the message, but diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst --- a/Doc/howto/pyporting.rst +++ b/Doc/howto/pyporting.rst @@ -427,10 +427,10 @@ .. _Futurize: http://python-future.org/automatic_conversion.html .. _importlib: https://docs.python.org/3/library/importlib.html#module-importlib .. _importlib2: https://pypi.python.org/pypi/importlib2 -.. _Modernize: http://python-modernize.readthedocs.org/en/latest/ +.. _Modernize: https://python-modernize.readthedocs.org/en/latest/ .. _Porting to Python 3: http://python3porting.com/ .. _Pylint: https://pypi.python.org/pypi/pylint -.. _Python 3 Q & A: http://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html +.. _Python 3 Q & A: https://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html .. _python-future: http://python-future.org/ .. _python-porting: https://mail.python.org/mailman/listinfo/python-porting diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst --- a/Doc/howto/unicode.rst +++ b/Doc/howto/unicode.rst @@ -214,7 +214,7 @@ origin and development of Unicode is also available on the site. To help understand the standard, Jukka Korpela has written `an introductory -guide `_ to reading the +guide `_ to reading the Unicode character tables. Another `good introductory article `_ diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -122,7 +122,7 @@ Note that other encodings are sometimes required (e.g. for file upload from HTML forms - see `HTML Specification, Form Submission -`_ for more +`_ for more details). If you do not pass the ``data`` argument, urllib uses a **GET** request. One @@ -403,7 +403,7 @@ :class:`http.client.HTTPMessage` instance. Typical headers include 'Content-length', 'Content-type', and so on. See the -`Quick Reference to HTTP Headers `_ +`Quick Reference to HTTP Headers `_ for a useful listing of HTTP headers with brief explanations of their meaning and use. @@ -586,5 +586,5 @@ scripts with a localhost server, I have to prevent urllib from using the proxy. .. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe - `_. + `_. diff --git a/Doc/install/index.rst b/Doc/install/index.rst --- a/Doc/install/index.rst +++ b/Doc/install/index.rst @@ -1012,7 +1012,7 @@ .. seealso:: - `C++Builder Compiler `_ + `C++Builder Compiler `_ Information about the free C++ compiler from Borland, including links to the download pages. @@ -1055,7 +1055,7 @@ for Borland's C++, because there is no program to convert the library. First you have to create a list of symbols which the Python DLL exports. (You can find a good program for this task at -http://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/). +https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/). .. I don't understand what the next line means. --amk .. (inclusive the references on data structures.) @@ -1093,7 +1093,7 @@ .. [#] This also means you could replace all existing COFF-libraries with OMF-libraries of the same name. -.. [#] Check http://www.sourceware.org/cygwin/ and http://www.mingw.org/ for more +.. [#] Check https://www.sourceware.org/cygwin/ and http://www.mingw.org/ for more information .. [#] Then you have no POSIX emulation available, but you also don't need diff --git a/Doc/library/array.rst b/Doc/library/array.rst --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -271,7 +271,7 @@ Packing and unpacking of External Data Representation (XDR) data as used in some remote procedure call systems. - `The Numerical Python Documentation `_ + `The Numerical Python Documentation `_ The Numeric Python extension (NumPy) defines another array type; see http://www.numpy.org/ for further information about Numerical Python. diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst --- a/Doc/library/bisect.rst +++ b/Doc/library/bisect.rst @@ -60,7 +60,7 @@ .. seealso:: `SortedCollection recipe - `_ that uses + `_ that uses bisect to build a full-featured collection class with straight-forward search methods and support for a key-function. The keys are precomputed to save unnecessary calls to the key function during searches. diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1414,7 +1414,7 @@ names (:mod:`http.client` then also transparently sends an IDNA hostname in the :mailheader:`Host` field if it sends that field at all). -.. _section 3.1: http://tools.ietf.org/html/rfc3490#section-3.1 +.. _section 3.1: https://tools.ietf.org/html/rfc3490#section-3.1 When receiving host names from the wire (such as in reverse name lookup), no automatic conversion to Unicode is performed: Applications wishing to present diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst --- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -263,7 +263,7 @@ .. seealso:: - * `OrderedSet recipe `_ for an + * `OrderedSet recipe `_ for an example built on :class:`MutableSet`. * For more about ABCs, see the :mod:`abc` module and :pep:`3119`. diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -116,12 +116,12 @@ :meth:`~collections.ChainMap.parents` property. * The `Nested Contexts recipe - `_ has options to control + `_ has options to control whether writes and other mutations apply only to the first mapping or to any mapping in the chain. * A `greatly simplified read-only version of Chainmap - `_. + `_. :class:`ChainMap` Examples and Recipes @@ -957,7 +957,7 @@ .. seealso:: * `Recipe for named tuple abstract base class with a metaclass mix-in - `_ + `_ by Jan Kaliszewski. Besides providing an :term:`abstract base class` for named tuples, it also supports an alternate :term:`metaclass`-based constructor that is convenient for use cases where named tuples are being diff --git a/Doc/library/colorsys.rst b/Doc/library/colorsys.rst --- a/Doc/library/colorsys.rst +++ b/Doc/library/colorsys.rst @@ -21,7 +21,7 @@ More information about color spaces can be found at http://www.poynton.com/ColorFAQ.html and - http://www.cambridgeincolour.com/tutorials/color-spaces.htm. + https://www.cambridgeincolour.com/tutorials/color-spaces.htm. The :mod:`colorsys` module defines the following functions: diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -562,7 +562,7 @@ Return a 3-tuple, (ISO year, ISO week number, ISO weekday). The ISO calendar is a widely used variant of the Gregorian calendar. See - http://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm for a good + https://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm for a good explanation. The ISO year consists of 52 or 53 full weeks, and where a week starts on a @@ -1708,7 +1708,7 @@ *pytz* library brings the *IANA timezone database* (also known as the Olson database) to Python and its usage is recommended. - `IANA timezone database `_ + `IANA timezone database `_ The Time Zone Database (often called tz or zoneinfo) contains code and data that represent the history of local time for many representative locations around the globe. It is updated periodically to reflect changes diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -613,7 +613,7 @@ work. * `Simple version control recipe - `_ for a small application + `_ for a small application built with :class:`SequenceMatcher`. diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -232,5 +232,5 @@ Wikipedia article with information on which algorithms have known issues and what that means regarding their use. - http://www.ietf.org/rfc/rfc2898.txt + https://www.ietf.org/rfc/rfc2898.txt PKCS #5: Password-Based Cryptography Specification Version 2.0 diff --git a/Doc/library/html.entities.rst b/Doc/library/html.entities.rst --- a/Doc/library/html.entities.rst +++ b/Doc/library/html.entities.rst @@ -43,4 +43,4 @@ .. rubric:: Footnotes -.. [#] See http://www.w3.org/TR/html5/syntax.html#named-character-references +.. [#] See https://www.w3.org/TR/html5/syntax.html#named-character-references diff --git a/Doc/library/html.parser.rst b/Doc/library/html.parser.rst --- a/Doc/library/html.parser.rst +++ b/Doc/library/html.parser.rst @@ -131,8 +131,8 @@ and quotes in the *value* have been removed, and character and entity references have been replaced. - For instance, for the tag ````, this method - would be called as ``handle_starttag('a', [('href', 'http://www.cwi.nl/')])``. + For instance, for the tag ````, this method + would be called as ``handle_starttag('a', [('href', 'https://www.cwi.nl/')])``. All entity references from :mod:`html.entities` are replaced in the attribute values. diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst --- a/Doc/library/http.cookiejar.rst +++ b/Doc/library/http.cookiejar.rst @@ -115,7 +115,7 @@ :mod:`http.cookiejar` and :mod:`http.cookies` modules do not depend on each other. - http://curl.haxx.se/rfc/cookie_spec.html + https://curl.haxx.se/rfc/cookie_spec.html The specification of the original Netscape cookie protocol. Though this is still the dominant protocol, the 'Netscape cookie protocol' implemented by all the major browsers (and :mod:`http.cookiejar`) only bears a passing resemblance to diff --git a/Doc/library/http.rst b/Doc/library/http.rst --- a/Doc/library/http.rst +++ b/Doc/library/http.rst @@ -51,7 +51,7 @@ ----------------- Supported, -`IANA-registered `_ +`IANA-registered `_ status codes available in :class:`http.HTTPStatus` are: ======= =================================== ================================================================== diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -157,7 +157,7 @@ Documents describing the protocol, and sources and binaries for servers implementing it, can all be found at the University of Washington's *IMAP - Information Center* (http://www.washington.edu/imap/). + Information Center* (https://www.washington.edu/imap/). .. _imap4-objects: diff --git a/Doc/library/ipaddress.rst b/Doc/library/ipaddress.rst --- a/Doc/library/ipaddress.rst +++ b/Doc/library/ipaddress.rst @@ -198,8 +198,8 @@ ``True`` if the address is reserved for link-local usage. See :RFC:`3927`. -.. _iana-ipv4-special-registry: http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml -.. _iana-ipv6-special-registry: http://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml +.. _iana-ipv4-special-registry: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml +.. _iana-ipv6-special-registry: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml .. class:: IPv6Address(address) diff --git a/Doc/library/json.rst b/Doc/library/json.rst --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -689,7 +689,7 @@ .. rubric:: Footnotes .. [#rfc-errata] As noted in `the errata for RFC 7159 - `_, + `_, JSON permits literal U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH SEPARATOR) characters in strings, whereas JavaScript (as of ECMAScript Edition 5.1) does not. diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst --- a/Doc/library/mailbox.rst +++ b/Doc/library/mailbox.rst @@ -422,7 +422,7 @@ `maildir man page from qmail `_ The original specification of the format. - `Using maildir format `_ + `Using maildir format `_ Notes on Maildir by its inventor. Includes an updated name-creation scheme and details on "info" semantics. @@ -690,10 +690,10 @@ .. seealso:: - `Format of Version 5 Babyl Files `_ + `Format of Version 5 Babyl Files `_ A specification of the Babyl format. - `Reading Mail with Rmail `_ + `Reading Mail with Rmail `_ The Rmail manual, with some information on Babyl semantics. diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -44,7 +44,7 @@ The optional *strict* argument is a flag specifying whether the list of known MIME types is limited to only the official types `registered with IANA - `_. + `_. When *strict* is ``True`` (the default), only the IANA types are supported; when *strict* is ``False``, some additional non-standard but commonly used MIME types are also recognized. diff --git a/Doc/library/othergui.rst b/Doc/library/othergui.rst --- a/Doc/library/othergui.rst +++ b/Doc/library/othergui.rst @@ -31,7 +31,7 @@ book, `GUI Programming with Python: QT Edition `_ by Boudewijn Rempt. The *PyQt4* bindings also have a book, `Rapid GUI Programming - with Python and Qt `_, by Mark + with Python and Qt `_, by Mark Summerfield. `PySide `_ @@ -41,7 +41,7 @@ `wxPython `_ wxPython is a cross-platform GUI toolkit for Python that is built around - the popular `wxWidgets `_ (formerly wxWindows) + the popular `wxWidgets `_ (formerly wxWindows) C++ toolkit. It provides a native look and feel for applications on Windows, Mac OS X, and Unix systems by using each platform's native widgets where ever possible, (GTK+ on Unix-like systems). In addition to diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst --- a/Doc/library/pyexpat.rst +++ b/Doc/library/pyexpat.rst @@ -867,6 +867,6 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is - not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/select.rst b/Doc/library/select.rst --- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -472,7 +472,7 @@ Kevent Objects -------------- -http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 +https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 .. attribute:: kevent.ident diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -53,7 +53,7 @@ Usually your SQL operations will need to use values from Python variables. You shouldn't assemble your query using Python's string operations because doing so is insecure; it makes your program vulnerable to an SQL injection attack -(see http://xkcd.com/327/ for humorous example of what can go wrong). +(see https://xkcd.com/327/ for humorous example of what can go wrong). Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder wherever you want to use a value, and then provide a tuple of values as the @@ -99,7 +99,7 @@ The pysqlite web page -- sqlite3 is developed externally under the name "pysqlite". - http://www.sqlite.org + https://www.sqlite.org The SQLite web page; the documentation describes the syntax and the available data types for the supported SQL dialect. @@ -209,7 +209,7 @@ db = sqlite3.connect('file:path/to/database?mode=ro', uri=True) More information about this feature, including a list of recognized options, can - be found in the `SQLite URI documentation `_. + be found in the `SQLite URI documentation `_. .. versionchanged:: 3.4 Added the *uri* parameter. diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -206,7 +206,7 @@ The *ciphers* parameter sets the available ciphers for this SSL object. It should be a string in the `OpenSSL cipher list format - `_. + `_. The parameter ``do_handshake_on_connect`` specifies whether to do the SSL handshake automatically after doing a :meth:`socket.connect`, or whether the @@ -769,7 +769,7 @@ ALERT_DESCRIPTION_* Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry - `_ + `_ contains this list and references to the RFCs where their meaning is defined. Used as the return value of the callback function in @@ -1174,7 +1174,7 @@ The *capath* string, if present, is the path to a directory containing several CA certificates in PEM format, following an `OpenSSL specific layout - `_. + `_. The *cadata* object, if present, is either an ASCII string of one or more PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded @@ -1212,7 +1212,7 @@ Set the available ciphers for sockets created with this context. It should be a string in the `OpenSSL cipher list format - `_. + `_. If no cipher can be selected (because compile-time options or other configuration forbids use of all the specified ciphers), an :class:`SSLError` will be raised. @@ -1369,7 +1369,7 @@ Get statistics about the SSL sessions created or managed by this context. A dictionary is returned which maps the names of each `piece of information - `_ to their + `_ to their numeric values. For example, here is the total number of hits and misses in the session cache since the context was created:: @@ -2019,7 +2019,7 @@ :meth:`SSLContext.set_ciphers` method. Starting from Python 3.2.3, the ssl module disables certain weak ciphers by default, but you may want to further restrict the cipher choice. Be sure to read OpenSSL's documentation -about the `cipher list format `_. +about the `cipher list format `_. If you want to check which ciphers are enabled by a given cipher list, use the ``openssl ciphers`` command on your system. @@ -2061,5 +2061,5 @@ `RFC 6066: Transport Layer Security (TLS) Extensions `_ D. Eastlake - `IANA TLS: Transport Layer Security (TLS) Parameters `_ + `IANA TLS: Transport Layer Security (TLS) Parameters `_ IANA diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst --- a/Doc/library/statistics.rst +++ b/Doc/library/statistics.rst @@ -223,7 +223,7 @@ * "Statistics for the Behavioral Sciences", Frederick J Gravetter and Larry B Wallnau (8th Edition). - * Calculating the `median `_. + * Calculating the `median `_. * The `SSMEDIAN `_ diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -474,7 +474,7 @@ additional garbage collector overhead if the object is managed by the garbage collector. - See `recursive sizeof recipe `_ + See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size of containers and all their contents. diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -238,7 +238,7 @@ Documentation of the higher-level archiving facilities provided by the standard :mod:`shutil` module. - `GNU tar manual, Basic Tar Format `_ + `GNU tar manual, Basic Tar Format `_ Documentation for tar archive files, including GNU tar extensions. diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -22,13 +22,13 @@ `TKDocs `_ Extensive tutorial plus friendlier widget pages for some of the widgets. - `Tkinter reference: a GUI for Python `_ + `Tkinter reference: a GUI for Python `_ On-line reference material. `Tkinter docs from effbot `_ Online reference for tkinter supported by effbot.org. - `Tcl/Tk manual `_ + `Tcl/Tk manual `_ Official manual for the latest tcl/tk version. `Programming Python `_ @@ -173,7 +173,7 @@ .. seealso:: - `Tcl/Tk 8.6 man pages `_ + `Tcl/Tk 8.6 man pages `_ The Tcl/Tk manual on www.tcl.tk. `ActiveState Tcl Home Page `_ diff --git a/Doc/library/tkinter.ttk.rst b/Doc/library/tkinter.ttk.rst --- a/Doc/library/tkinter.ttk.rst +++ b/Doc/library/tkinter.ttk.rst @@ -22,7 +22,7 @@ .. seealso:: - `Tk Widget Styling Support `_ + `Tk Widget Styling Support `_ A document introducing theming support for Tk diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -549,7 +549,7 @@ An alternative way of dealing with mocking dates, or other builtin classes, is discussed in `this blog entry -`_. +`_. Mocking a Generator Method @@ -1010,7 +1010,7 @@ Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted adaptor -`_. +`_. Having this applied to attributes too actually causes errors. ``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to create diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -67,7 +67,7 @@ a GUI tool for test discovery and execution. This is intended largely for ease of use for those new to unit testing. For production environments it is recommended that tests be driven by a continuous integration system such as - `Buildbot `_, `Jenkins `_ + `Buildbot `_, `Jenkins `_ or `Hudson `_. diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -67,7 +67,7 @@ * :meth:`~urllib.response.addinfourl.info` --- return the meta-information of the page, such as headers, in the form of an :func:`email.message_from_string` instance (see - `Quick Reference to HTTP Headers `_) + `Quick Reference to HTTP Headers `_) * :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response. @@ -1130,7 +1130,7 @@ the returned bytes object to string once it determines or guesses the appropriate encoding. -The following W3C document, http://www.w3.org/International/O-charset\ , lists +The following W3C document, https://www.w3.org/International/O-charset\ , lists the various ways in which a (X)HTML or a XML document could have specified its encoding information. diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst --- a/Doc/library/xml.dom.minidom.rst +++ b/Doc/library/xml.dom.minidom.rst @@ -100,7 +100,7 @@ .. seealso:: - `Document Object Model (DOM) Level 1 Specification `_ + `Document Object Model (DOM) Level 1 Specification `_ The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`. @@ -251,5 +251,5 @@ the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is not valid in an XML document's declaration, even though Python accepts it as an encoding name. - See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/xml.dom.rst b/Doc/library/xml.dom.rst --- a/Doc/library/xml.dom.rst +++ b/Doc/library/xml.dom.rst @@ -63,10 +63,10 @@ .. seealso:: - `Document Object Model (DOM) Level 2 Specification `_ + `Document Object Model (DOM) Level 2 Specification `_ The W3C recommendation upon which the Python DOM API is based. - `Document Object Model (DOM) Level 1 Specification `_ + `Document Object Model (DOM) Level 1 Specification `_ The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`. `Python Language Mapping Specification `_ @@ -115,20 +115,20 @@ .. data:: XML_NAMESPACE The namespace URI associated with the reserved prefix ``xml``, as defined by - `Namespaces in XML `_ (section 4). + `Namespaces in XML `_ (section 4). .. data:: XMLNS_NAMESPACE The namespace URI for namespace declarations, as defined by `Document Object Model (DOM) Level 2 Core Specification - `_ (section 1.1.8). + `_ (section 1.1.8). .. data:: XHTML_NAMESPACE The URI of the XHTML namespace as defined by `XHTML 1.0: The Extensible - HyperText Markup Language `_ (section 3.1.1). + HyperText Markup Language `_ (section 3.1.1). In addition, :mod:`xml.dom` contains a base :class:`Node` class and the DOM @@ -874,7 +874,7 @@ .. exception:: NamespaceErr If an attempt is made to change any object in a way that is not permitted with - regard to the `Namespaces in XML `_ + regard to the `Namespaces in XML `_ recommendation, this exception is raised. diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -292,7 +292,7 @@ with prefixes in the form ``prefix:sometag`` get expanded to ``{uri}sometag`` where the *prefix* is replaced by the full *URI*. Also, if there is a `default namespace -`__, +`__, that full URI gets prepended to all of the non-prefixed tags. Here is an XML example that incorporates two namespaces, one with the @@ -363,7 +363,7 @@ ------------- This module provides limited support for -`XPath expressions `_ for locating elements in a +`XPath expressions `_ for locating elements in a tree. The goal is to support a small subset of the abbreviated syntax; a full XPath engine is outside the scope of the module. @@ -1189,5 +1189,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is - not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -315,7 +315,7 @@ Write the XML-RPC base 64 encoding of this binary item to the *out* stream object. The encoded data will have newlines every 76 characters as per - `RFC 2045 section 6.8 `_, + `RFC 2045 section 6.8 `_, which was the de facto standard base64 specification when the XML-RPC spec was written. @@ -590,7 +590,7 @@ .. rubric:: Footnotes .. [#] This approach has been first presented in `a discussion on xmlrpc.com - `_. + `_. .. the link now points to webarchive since the one at .. http://www.xmlrpc.com/discuss/msgReader%241208 is broken (and webadmin .. doesn't reply) diff --git a/Doc/license.rst b/Doc/license.rst --- a/Doc/license.rst +++ b/Doc/license.rst @@ -11,12 +11,12 @@ ======================= Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl/) in the Netherlands as a +Mathematisch Centrum (CWI, see https://www.cwi.nl/) in the Netherlands as a successor of a language called ABC. Guido remains Python's principal author, although it includes many contributions from others. In 1995, Guido continued his work on Python at the Corporation for National -Research Initiatives (CNRI, see http://www.cnri.reston.va.us/) in Reston, +Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston, Virginia where he released several versions of the software. In May 2000, Guido and the Python core development team moved to BeOpen.com to @@ -27,7 +27,7 @@ specifically to own Python-related Intellectual Property. Zope Corporation is a sponsoring member of the PSF. -All Python releases are Open Source (see http://opensource.org/ for the Open +All Python releases are Open Source (see https://opensource.org/ for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -322,7 +322,7 @@ A non-normative HTML file listing all valid identifier characters for Unicode 4.1 can be found at -http://www.dcl.hpi.uni-potsdam.de/home/loewis/table-3131.html. +https://www.dcl.hpi.uni-potsdam.de/home/loewis/table-3131.html. .. _keywords: diff --git a/Doc/tutorial/floatingpoint.rst b/Doc/tutorial/floatingpoint.rst --- a/Doc/tutorial/floatingpoint.rst +++ b/Doc/tutorial/floatingpoint.rst @@ -155,7 +155,7 @@ If you are a heavy user of floating point operations you should take a look at the Numerical Python package and many other packages for mathematical and -statistical operations supplied by the SciPy project. See . +statistical operations supplied by the SciPy project. See . Python provides tools that may help on those rare occasions when you really *do* want to know the exact value of a float. The diff --git a/Doc/tutorial/interactive.rst b/Doc/tutorial/interactive.rst --- a/Doc/tutorial/interactive.rst +++ b/Doc/tutorial/interactive.rst @@ -49,6 +49,6 @@ bpython_. -.. _GNU Readline: http://tiswww.case.edu/php/chet/readline/rltop.html +.. _GNU Readline: https://tiswww.case.edu/php/chet/readline/rltop.html .. _IPython: http://ipython.scipy.org/ .. _bpython: http://www.bpython-interpreter.org/ diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst --- a/Doc/tutorial/stdlib.rst +++ b/Doc/tutorial/stdlib.rst @@ -152,7 +152,7 @@ >>> statistics.variance(data) 1.3720238095238095 -The SciPy project has many other modules for numerical +The SciPy project has many other modules for numerical computations. .. _tut-internet-access: diff --git a/Doc/tutorial/whatnow.rst b/Doc/tutorial/whatnow.rst --- a/Doc/tutorial/whatnow.rst +++ b/Doc/tutorial/whatnow.rst @@ -43,7 +43,7 @@ for download. Once you begin releasing code, you can register it here so that others can find it. -* http://code.activestate.com/recipes/langs/python/: The Python Cookbook is a +* https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a sizable collection of code examples, larger modules, and useful scripts. Particularly notable contributions are collected in a book also titled Python Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.) @@ -51,7 +51,7 @@ * http://www.pyvideo.org collects links to Python-related videos from conferences and user-group meetings. -* http://scipy.org: The Scientific Python project includes modules for fast +* https://scipy.org: The Scientific Python project includes modules for fast array computations and manipulations plus a host of packages for such things as linear algebra, Fourier transforms, non-linear solvers, random number distributions, statistical analysis and the like. diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -65,7 +65,7 @@ :program:`emacs` among them. If you want a more Mac-like editor, :program:`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see http://www.barebones.com/products/bbedit/index.html) are good choices, as is -:program:`TextMate` (see http://macromates.com/). Other editors include +:program:`TextMate` (see https://macromates.com/). Other editors include :program:`Gvim` (http://macvim.org) and :program:`Aquamacs` (http://aquamacs.org/). @@ -144,9 +144,9 @@ available from https://pythonhosted.org/pyobjc/. The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-platform -Tk toolkit (http://www.tcl.tk). An Aqua-native version of Tk is bundled with OS +Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is bundled with OS X by Apple, and the latest version can be downloaded and installed from -http://www.activestate.com; it can also be built from source. +https://www.activestate.com; it can also be built from source. *wxPython* is another popular cross-platform GUI toolkit that runs natively on Mac OS X. Packages and documentation are available from http://www.wxpython.org. diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst --- a/Doc/using/unix.rst +++ b/Doc/using/unix.rst @@ -55,7 +55,7 @@ On OpenSolaris -------------- -You can get Python from `OpenCSW `_. Various versions +You can get Python from `OpenCSW `_. Various versions of Python are available and can be installed with e.g. ``pkgutil -i python27``. @@ -139,10 +139,10 @@ information on how to code in Python in these editors, look at: * http://www.vim.org/scripts/script.php?script_id=790 -* http://sourceforge.net/projects/python-mode +* https://sourceforge.net/projects/python-mode Geany is an excellent IDE with support for a lot of languages. For more -information, read: http://www.geany.org/ +information, read: https://www.geany.org/ Komodo edit is another extremely good IDE. It also has support for a lot of -languages. For more information, read http://komodoide.com/. +languages. For more information, read https://komodoide.com/. diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -245,7 +245,7 @@ Check :pep:`11` for details on all unsupported platforms. * `Windows CE `_ is still supported. -* The `Cygwin `_ installer offers to install the Python +* The `Cygwin `_ installer offers to install the Python interpreter as well (cf. `Cygwin package source `_, `Maintainer releases @@ -364,7 +364,7 @@ https://support.microsoft.com/kb/310519 How To Manage Environment Variables in Windows XP - http://www.chem.gla.ac.uk/~louis/software/faq/q1.html + https://www.chem.gla.ac.uk/~louis/software/faq/q1.html Setting Environment variables, Louis J. Farrugia .. _windows-path-mod: diff --git a/Doc/whatsnew/2.0.rst b/Doc/whatsnew/2.0.rst --- a/Doc/whatsnew/2.0.rst +++ b/Doc/whatsnew/2.0.rst @@ -61,7 +61,7 @@ made available by SourceForge for storing source code, tracking bug reports, and managing the queue of patch submissions. To report bugs or submit patches for Python 2.0, use the bug tracking and patch manager tools available from -Python's project page, located at http://sourceforge.net/projects/python/. +Python's project page, located at https://sourceforge.net/projects/python/. The most important of the services now hosted at SourceForge is the Python CVS tree, the version-controlled repository containing the source code for Python. diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst --- a/Doc/whatsnew/2.2.rst +++ b/Doc/whatsnew/2.2.rst @@ -632,10 +632,10 @@ every square of an $NxN$ chessboard without visiting any square twice). The idea of generators comes from other programming languages, especially Icon -(http://www.cs.arizona.edu/icon/), where the idea of generators is central. In +(https://www.cs.arizona.edu/icon/), where the idea of generators is central. In Icon, every expression and function call behaves like a generator. One example from "An Overview of the Icon Programming Language" at -http://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks +https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks like:: sentence := "Store it in the neighboring harbor" diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst --- a/Doc/whatsnew/2.3.rst +++ b/Doc/whatsnew/2.3.rst @@ -218,10 +218,10 @@ every square of an $NxN$ chessboard without visiting any square twice). The idea of generators comes from other programming languages, especially Icon -(http://www.cs.arizona.edu/icon/), where the idea of generators is central. In +(https://www.cs.arizona.edu/icon/), where the idea of generators is central. In Icon, every expression and function call behaves like a generator. One example from "An Overview of the Icon Programming Language" at -http://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks +https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks like:: sentence := "Store it in the neighboring harbor" diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst --- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -1528,7 +1528,7 @@ * The :mod:`socket` module now supports :const:`AF_NETLINK` sockets on Linux, thanks to a patch from Philippe Biondi. Netlink sockets are a Linux-specific mechanism for communications between a user-space process and kernel code; an - introductory article about them is at http://www.linuxjournal.com/article/7356. + introductory article about them is at https://www.linuxjournal.com/article/7356. In Python code, netlink addresses are represented as a tuple of 2 integers, ``(pid, group_mask)``. @@ -2013,7 +2013,7 @@ >>> For more information about the SQL dialect supported by SQLite, see -http://www.sqlite.org. +https://www.sqlite.org. .. seealso:: @@ -2021,7 +2021,7 @@ http://www.pysqlite.org The pysqlite web page. - http://www.sqlite.org + https://www.sqlite.org The SQLite web page; the documentation describes the syntax and the available data types for the supported SQL dialect. diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -154,9 +154,9 @@ up different products and import some of the bugs and patches from SourceForge. Four different trackers were examined: `Jira `__, -`Launchpad `__, +`Launchpad `__, `Roundup `__, and -`Trac `__. +`Trac `__. The committee eventually settled on Jira and Roundup as the two candidates. Jira is a commercial product that offers no-cost hosted instances to free-software projects; Roundup @@ -1431,7 +1431,7 @@ :pep:`3141` - A Type Hierarchy for Numbers PEP written by Jeffrey Yasskin. - `Scheme's numerical tower `__, from the Guile manual. + `Scheme's numerical tower `__, from the Guile manual. `Scheme's number datatypes `__ from the R5RS Scheme specification. @@ -2889,7 +2889,7 @@ Bill Janssen made extensive improvements to Python 2.6's support for the Secure Sockets Layer by adding a new module, :mod:`ssl`, that's -built atop the `OpenSSL `__ library. +built atop the `OpenSSL `__ library. This new module provides more control over the protocol negotiated, the X.509 certificates used, and has better support for writing SSL servers (as opposed to clients) in Python. The existing SSL support diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -1157,7 +1157,7 @@ * The :mod:`ctypes` module now always converts ``None`` to a C NULL pointer for arguments declared as pointers. (Changed by Thomas Heller; :issue:`4606`.) The underlying `libffi library - `__ has been updated to version + `__ has been updated to version 3.0.9, containing various fixes for different platforms. (Updated by Matthias Klose; :issue:`8142`.) @@ -1530,7 +1530,7 @@ *ciphers* argument that's a string listing the encryption algorithms to be allowed; the format of the string is described `in the OpenSSL documentation - `__. + `__. (Added by Antoine Pitrou; :issue:`8322`.) Another change makes the extension load all of OpenSSL's ciphers and @@ -1783,7 +1783,7 @@ To learn more, read the :mod:`ttk` module documentation. You may also wish to read the Tcl/Tk manual page describing the Ttk theme engine, available at -http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some +https://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some screenshots of the Python/Ttk code in use are at http://code.google.com/p/python-ttk/wiki/Screenshots. @@ -2079,7 +2079,7 @@ * The latest release of the GNU Debugger, GDB 7, can be `scripted using Python - `__. + `__. When you begin debugging an executable program P, GDB will look for a file named ``P-gdb.py`` and automatically read it. Dave Malcolm contributed a :file:`python-gdb.py` that adds a number of @@ -2149,7 +2149,7 @@ with *updatepath* set to false. Security issue reported as `CVE-2008-5983 - `_; + `_; discussed in :issue:`5753`, and fixed by Antoine Pitrou. * New macros: the Python header files now define the following macros: diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -769,8 +769,8 @@ (Contributed by Raymond Hettinger and incorporating design ideas from Jim Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245 - `_\, `recipe 577479 - `_\, :issue:`10586`, and + `_\, `recipe 577479 + `_\, :issue:`10586`, and :issue:`10593`.) * The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` attribute @@ -955,7 +955,7 @@ sealed and deposited in a queue for later handling. See `Barrier Synchronization Patterns -`_ for +`_ for more examples of how barriers can be used in parallel computing. Also, there is a simple but thorough explanation of barriers in `The Little Book of Semaphores `_, *section 3.6*. @@ -1618,7 +1618,7 @@ * The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* argument. The *ciphers* string lists the allowed encryption algorithms using the format described in the `OpenSSL documentation - `__. + `__. * When linked against recent versions of OpenSSL, the :mod:`ssl` module now supports the Server Name Indication extension to the TLS protocol, allowing @@ -2559,7 +2559,7 @@ :source:`Mac/BuildScript/README.txt` for details. For users running a 32/64-bit build, there is a known problem with the default Tcl/Tk on Mac OS X 10.6. Accordingly, we recommend installing an updated alternative such as -`ActiveState Tcl/Tk 8.5.9 `_\. +`ActiveState Tcl/Tk 8.5.9 `_\. See https://www.python.org/download/mac/tcltk/ for additional details. Porting to Python 3.2 diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -1410,7 +1410,7 @@ A new boolean parameter to the :func:`~sqlite3.connect` function, *uri*, can be used to indicate that the *database* parameter is a ``uri`` (see the `SQLite -URI documentation `_). (Contributed by poq in +URI documentation `_). (Contributed by poq in :issue:`13773`.) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -418,6 +418,8 @@ Documentation ------------- +- Issue #26736: Used HTTPS for external links in the documentation if possible. + - Issue #6953: Rework the Readline module documentation to group related functions together, and add more details such as what underlying Readline functions and variables are accessed. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 03:50:41 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 07:50:41 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326736=3A_Used_HTTPS_for_external_links_in_the_d?= =?utf-8?q?ocumentation_if_possible=2E?= Message-ID: <20160507075041.88908.29314.AA469DB3@psf.io> https://hg.python.org/cpython/rev/3ceb54a49387 changeset: 101249:3ceb54a49387 parent: 101246:ea9d69a4d0fe parent: 101248:211a9f32dfb9 user: Serhiy Storchaka date: Sat May 07 10:49:58 2016 +0300 summary: Issue #26736: Used HTTPS for external links in the documentation if possible. files: Doc/c-api/init.rst | 2 +- Doc/faq/design.rst | 2 +- Doc/faq/extending.rst | 2 +- Doc/faq/general.rst | 2 +- Doc/faq/gui.rst | 6 ++-- Doc/faq/programming.rst | 16 +++++++------- Doc/faq/windows.rst | 2 +- Doc/howto/functional.rst | 6 ++-- Doc/howto/logging-cookbook.rst | 4 +- Doc/howto/pyporting.rst | 4 +- Doc/howto/unicode.rst | 2 +- Doc/howto/urllib2.rst | 6 ++-- Doc/install/index.rst | 6 ++-- Doc/library/array.rst | 2 +- Doc/library/bisect.rst | 2 +- Doc/library/codecs.rst | 2 +- Doc/library/collections.abc.rst | 2 +- Doc/library/collections.rst | 6 ++-- Doc/library/colorsys.rst | 2 +- Doc/library/datetime.rst | 4 +- Doc/library/difflib.rst | 2 +- Doc/library/hashlib.rst | 2 +- Doc/library/html.entities.rst | 2 +- Doc/library/html.parser.rst | 4 +- Doc/library/http.cookiejar.rst | 2 +- Doc/library/http.rst | 2 +- Doc/library/imaplib.rst | 2 +- Doc/library/ipaddress.rst | 4 +- Doc/library/json.rst | 2 +- Doc/library/mailbox.rst | 6 ++-- Doc/library/mimetypes.rst | 2 +- Doc/library/othergui.rst | 4 +- Doc/library/pyexpat.rst | 4 +- Doc/library/select.rst | 2 +- Doc/library/sqlite3.rst | 6 ++-- Doc/library/ssl.rst | 14 ++++++------ Doc/library/statistics.rst | 2 +- Doc/library/sys.rst | 2 +- Doc/library/tarfile.rst | 2 +- Doc/library/tkinter.rst | 6 ++-- Doc/library/tkinter.ttk.rst | 2 +- Doc/library/unittest.mock-examples.rst | 4 +- Doc/library/unittest.rst | 2 +- Doc/library/urllib.request.rst | 4 +- Doc/library/xml.dom.minidom.rst | 6 ++-- Doc/library/xml.dom.rst | 12 +++++----- Doc/library/xml.etree.elementtree.rst | 8 +++--- Doc/library/xmlrpc.client.rst | 4 +- Doc/license.rst | 6 ++-- Doc/reference/lexical_analysis.rst | 2 +- Doc/tutorial/floatingpoint.rst | 2 +- Doc/tutorial/interactive.rst | 2 +- Doc/tutorial/stdlib.rst | 2 +- Doc/tutorial/whatnow.rst | 4 +- Doc/using/mac.rst | 6 ++-- Doc/using/unix.rst | 8 +++--- Doc/using/windows.rst | 4 +- Doc/whatsnew/2.0.rst | 2 +- Doc/whatsnew/2.2.rst | 4 +- Doc/whatsnew/2.3.rst | 4 +- Doc/whatsnew/2.5.rst | 6 ++-- Doc/whatsnew/2.6.rst | 8 +++--- Doc/whatsnew/2.7.rst | 10 ++++---- Doc/whatsnew/3.2.rst | 10 ++++---- Doc/whatsnew/3.4.rst | 2 +- Misc/NEWS | 2 + 66 files changed, 140 insertions(+), 138 deletions(-) diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -366,7 +366,7 @@ It is recommended that applications embedding the Python interpreter for purposes other than executing a single script pass 0 as *updatepath*, and update :data:`sys.path` themselves if desired. - See `CVE-2008-5983 `_. + See `CVE-2008-5983 `_. On versions before 3.1.3, you can achieve the same effect by manually popping the first :data:`sys.path` element after having called diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -368,7 +368,7 @@ Practical answer: -`Cython `_ and `Pyrex `_ +`Cython `_ and `Pyrex `_ compile a modified version of Python with optional annotations into C extensions. `Weave `_ makes it easy to intermingle Python and C code in various ways to increase performance. diff --git a/Doc/faq/extending.rst b/Doc/faq/extending.rst --- a/Doc/faq/extending.rst +++ b/Doc/faq/extending.rst @@ -42,7 +42,7 @@ .. XXX make sure these all work `Cython `_ and its relative `Pyrex -`_ are compilers +`_ are compilers that accept a slightly modified form of Python and generate the corresponding C code. Cython and Pyrex make it possible to write an extension without having to learn Python's C API. diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -271,7 +271,7 @@ The Python project's infrastructure is located all over the world. `www.python.org `_ is graciously hosted by `Rackspace -`_, with CDN caching provided by `Fastly +`_, with CDN caching provided by `Fastly `_. `Upfront Systems `_ hosts `bugs.python.org `_. Many other Python services like `the Wiki diff --git a/Doc/faq/gui.rst b/Doc/faq/gui.rst --- a/Doc/faq/gui.rst +++ b/Doc/faq/gui.rst @@ -31,13 +31,13 @@ install (since it comes included with most `binary distributions `_ of Python) and use. For more info about Tk, including pointers to the source, see the -`Tcl/Tk home page `_. Tcl/Tk is fully portable to the +`Tcl/Tk home page `_. Tcl/Tk is fully portable to the Mac OS X, Windows, and Unix platforms. wxWidgets --------- -wxWidgets (http://www.wxwidgets.org) is a free, portable GUI class +wxWidgets (https://www.wxwidgets.org) is a free, portable GUI class library written in C++ that provides a native look and feel on a number of platforms, with Windows, Mac OS X, GTK, X11, all listed as current stable targets. Language bindings are available for a number @@ -72,7 +72,7 @@ The `GObject introspection bindings `_ for Python allow you to write GTK+ 3 applications. There is also a -`Python GTK+ 3 Tutorial `_. +`Python GTK+ 3 Tutorial `_. The older PyGtk bindings for the `Gtk+ 2 toolkit `_ have been implemented by James Henstridge; see . diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -28,9 +28,9 @@ PythonWin is a Python IDE that includes a GUI debugger based on pdb. The Pythonwin debugger colors breakpoints and has quite a few cool features such as debugging non-Pythonwin programs. Pythonwin is available as part of the `Python -for Windows Extensions `__ project and +for Windows Extensions `__ project and as a part of the ActivePython distribution (see -http://www.activestate.com/activepython\ ). +https://www.activestate.com/activepython\ ). `Boa Constructor `_ is an IDE and GUI builder that uses wxWidgets. It offers visual frame creation and manipulation, @@ -44,13 +44,13 @@ Pydb is a version of the standard Python debugger pdb, modified for use with DDD (Data Display Debugger), a popular graphical debugger front end. Pydb can be found at http://bashdb.sourceforge.net/pydb/ and DDD can be found at -http://www.gnu.org/software/ddd. +https://www.gnu.org/software/ddd. There are a number of commercial Python IDEs that include graphical debuggers. They include: -* Wing IDE (http://wingware.com/) -* Komodo IDE (http://komodoide.com/) +* Wing IDE (https://wingware.com/) +* Komodo IDE (https://komodoide.com/) * PyCharm (https://www.jetbrains.com/pycharm/) @@ -63,13 +63,13 @@ warns about code complexity and style. You can get PyChecker from http://pychecker.sourceforge.net/. -`Pylint `_ is another tool that checks +`Pylint `_ is another tool that checks if a module satisfies a coding standard, and also makes it possible to write plug-ins to add a custom feature. In addition to the bug checking that PyChecker performs, Pylint offers some additional features such as checking line length, whether variable names are well-formed according to your coding standard, whether declared interfaces are fully implemented, and more. -http://docs.pylint.org/ provides a full list of Pylint's features. +https://docs.pylint.org/ provides a full list of Pylint's features. How can I create a stand-alone binary from a Python script? @@ -1116,7 +1116,7 @@ See the Python Cookbook for a long discussion of many ways to do this: - http://code.activestate.com/recipes/52560/ + https://code.activestate.com/recipes/52560/ If you don't mind reordering the list, sort it and then scan from the end of the list, deleting duplicates as you go:: diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -340,5 +340,5 @@ Simply rename the downloaded file to have the .TGZ extension, and WinZip will be able to handle it. (If your copy of WinZip doesn't, get a newer one from -http://www.winzip.com.) +https://www.winzip.com.) diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst --- a/Doc/howto/functional.rst +++ b/Doc/howto/functional.rst @@ -1225,9 +1225,9 @@ Mertz also wrote a 3-part series of articles on functional programming for IBM's DeveloperWorks site; see -`part 1 `__, -`part 2 `__, and -`part 3 `__, +`part 1 `__, +`part 2 `__, and +`part 3 `__, Python documentation diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -1634,11 +1634,11 @@ Inserting a BOM into messages sent to a SysLogHandler ----------------------------------------------------- -`RFC 5424 `_ requires that a +`RFC 5424 `_ requires that a Unicode message be sent to a syslog daemon as a set of bytes which have the following structure: an optional pure-ASCII component, followed by a UTF-8 Byte Order Mark (BOM), followed by Unicode encoded using UTF-8. (See the `relevant -section of the specification `_.) +section of the specification `_.) In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to insert a BOM into the message, but diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst --- a/Doc/howto/pyporting.rst +++ b/Doc/howto/pyporting.rst @@ -427,10 +427,10 @@ .. _Futurize: http://python-future.org/automatic_conversion.html .. _importlib: https://docs.python.org/3/library/importlib.html#module-importlib .. _importlib2: https://pypi.python.org/pypi/importlib2 -.. _Modernize: http://python-modernize.readthedocs.org/en/latest/ +.. _Modernize: https://python-modernize.readthedocs.org/en/latest/ .. _Porting to Python 3: http://python3porting.com/ .. _Pylint: https://pypi.python.org/pypi/pylint -.. _Python 3 Q & A: http://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html +.. _Python 3 Q & A: https://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html .. _python-future: http://python-future.org/ .. _python-porting: https://mail.python.org/mailman/listinfo/python-porting diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst --- a/Doc/howto/unicode.rst +++ b/Doc/howto/unicode.rst @@ -214,7 +214,7 @@ origin and development of Unicode is also available on the site. To help understand the standard, Jukka Korpela has written `an introductory -guide `_ to reading the +guide `_ to reading the Unicode character tables. Another `good introductory article `_ diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -122,7 +122,7 @@ Note that other encodings are sometimes required (e.g. for file upload from HTML forms - see `HTML Specification, Form Submission -`_ for more +`_ for more details). If you do not pass the ``data`` argument, urllib uses a **GET** request. One @@ -403,7 +403,7 @@ :class:`http.client.HTTPMessage` instance. Typical headers include 'Content-length', 'Content-type', and so on. See the -`Quick Reference to HTTP Headers `_ +`Quick Reference to HTTP Headers `_ for a useful listing of HTTP headers with brief explanations of their meaning and use. @@ -586,5 +586,5 @@ scripts with a localhost server, I have to prevent urllib from using the proxy. .. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe - `_. + `_. diff --git a/Doc/install/index.rst b/Doc/install/index.rst --- a/Doc/install/index.rst +++ b/Doc/install/index.rst @@ -1012,7 +1012,7 @@ .. seealso:: - `C++Builder Compiler `_ + `C++Builder Compiler `_ Information about the free C++ compiler from Borland, including links to the download pages. @@ -1055,7 +1055,7 @@ for Borland's C++, because there is no program to convert the library. First you have to create a list of symbols which the Python DLL exports. (You can find a good program for this task at -http://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/). +https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/). .. I don't understand what the next line means. --amk .. (inclusive the references on data structures.) @@ -1093,7 +1093,7 @@ .. [#] This also means you could replace all existing COFF-libraries with OMF-libraries of the same name. -.. [#] Check http://www.sourceware.org/cygwin/ and http://www.mingw.org/ for more +.. [#] Check https://www.sourceware.org/cygwin/ and http://www.mingw.org/ for more information .. [#] Then you have no POSIX emulation available, but you also don't need diff --git a/Doc/library/array.rst b/Doc/library/array.rst --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -271,7 +271,7 @@ Packing and unpacking of External Data Representation (XDR) data as used in some remote procedure call systems. - `The Numerical Python Documentation `_ + `The Numerical Python Documentation `_ The Numeric Python extension (NumPy) defines another array type; see http://www.numpy.org/ for further information about Numerical Python. diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst --- a/Doc/library/bisect.rst +++ b/Doc/library/bisect.rst @@ -60,7 +60,7 @@ .. seealso:: `SortedCollection recipe - `_ that uses + `_ that uses bisect to build a full-featured collection class with straight-forward search methods and support for a key-function. The keys are precomputed to save unnecessary calls to the key function during searches. diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1414,7 +1414,7 @@ names (:mod:`http.client` then also transparently sends an IDNA hostname in the :mailheader:`Host` field if it sends that field at all). -.. _section 3.1: http://tools.ietf.org/html/rfc3490#section-3.1 +.. _section 3.1: https://tools.ietf.org/html/rfc3490#section-3.1 When receiving host names from the wire (such as in reverse name lookup), no automatic conversion to Unicode is performed: Applications wishing to present diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst --- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -270,7 +270,7 @@ .. seealso:: - * `OrderedSet recipe `_ for an + * `OrderedSet recipe `_ for an example built on :class:`MutableSet`. * For more about ABCs, see the :mod:`abc` module and :pep:`3119`. diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -116,12 +116,12 @@ :meth:`~collections.ChainMap.parents` property. * The `Nested Contexts recipe - `_ has options to control + `_ has options to control whether writes and other mutations apply only to the first mapping or to any mapping in the chain. * A `greatly simplified read-only version of Chainmap - `_. + `_. :class:`ChainMap` Examples and Recipes @@ -957,7 +957,7 @@ .. seealso:: * `Recipe for named tuple abstract base class with a metaclass mix-in - `_ + `_ by Jan Kaliszewski. Besides providing an :term:`abstract base class` for named tuples, it also supports an alternate :term:`metaclass`-based constructor that is convenient for use cases where named tuples are being diff --git a/Doc/library/colorsys.rst b/Doc/library/colorsys.rst --- a/Doc/library/colorsys.rst +++ b/Doc/library/colorsys.rst @@ -21,7 +21,7 @@ More information about color spaces can be found at http://www.poynton.com/ColorFAQ.html and - http://www.cambridgeincolour.com/tutorials/color-spaces.htm. + https://www.cambridgeincolour.com/tutorials/color-spaces.htm. The :mod:`colorsys` module defines the following functions: diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -562,7 +562,7 @@ Return a 3-tuple, (ISO year, ISO week number, ISO weekday). The ISO calendar is a widely used variant of the Gregorian calendar. See - http://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm for a good + https://www.staff.science.uu.nl/~gent0113/calendar/isocalendar.htm for a good explanation. The ISO year consists of 52 or 53 full weeks, and where a week starts on a @@ -1775,7 +1775,7 @@ *pytz* library brings the *IANA timezone database* (also known as the Olson database) to Python and its usage is recommended. - `IANA timezone database `_ + `IANA timezone database `_ The Time Zone Database (often called tz or zoneinfo) contains code and data that represent the history of local time for many representative locations around the globe. It is updated periodically to reflect changes diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -613,7 +613,7 @@ work. * `Simple version control recipe - `_ for a small application + `_ for a small application built with :class:`SequenceMatcher`. diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -232,5 +232,5 @@ Wikipedia article with information on which algorithms have known issues and what that means regarding their use. - http://www.ietf.org/rfc/rfc2898.txt + https://www.ietf.org/rfc/rfc2898.txt PKCS #5: Password-Based Cryptography Specification Version 2.0 diff --git a/Doc/library/html.entities.rst b/Doc/library/html.entities.rst --- a/Doc/library/html.entities.rst +++ b/Doc/library/html.entities.rst @@ -43,4 +43,4 @@ .. rubric:: Footnotes -.. [#] See http://www.w3.org/TR/html5/syntax.html#named-character-references +.. [#] See https://www.w3.org/TR/html5/syntax.html#named-character-references diff --git a/Doc/library/html.parser.rst b/Doc/library/html.parser.rst --- a/Doc/library/html.parser.rst +++ b/Doc/library/html.parser.rst @@ -131,8 +131,8 @@ and quotes in the *value* have been removed, and character and entity references have been replaced. - For instance, for the tag ````, this method - would be called as ``handle_starttag('a', [('href', 'http://www.cwi.nl/')])``. + For instance, for the tag ````, this method + would be called as ``handle_starttag('a', [('href', 'https://www.cwi.nl/')])``. All entity references from :mod:`html.entities` are replaced in the attribute values. diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst --- a/Doc/library/http.cookiejar.rst +++ b/Doc/library/http.cookiejar.rst @@ -115,7 +115,7 @@ :mod:`http.cookiejar` and :mod:`http.cookies` modules do not depend on each other. - http://curl.haxx.se/rfc/cookie_spec.html + https://curl.haxx.se/rfc/cookie_spec.html The specification of the original Netscape cookie protocol. Though this is still the dominant protocol, the 'Netscape cookie protocol' implemented by all the major browsers (and :mod:`http.cookiejar`) only bears a passing resemblance to diff --git a/Doc/library/http.rst b/Doc/library/http.rst --- a/Doc/library/http.rst +++ b/Doc/library/http.rst @@ -51,7 +51,7 @@ ----------------- Supported, -`IANA-registered `_ +`IANA-registered `_ status codes available in :class:`http.HTTPStatus` are: ======= =================================== ================================================================== diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -157,7 +157,7 @@ Documents describing the protocol, and sources and binaries for servers implementing it, can all be found at the University of Washington's *IMAP - Information Center* (http://www.washington.edu/imap/). + Information Center* (https://www.washington.edu/imap/). .. _imap4-objects: diff --git a/Doc/library/ipaddress.rst b/Doc/library/ipaddress.rst --- a/Doc/library/ipaddress.rst +++ b/Doc/library/ipaddress.rst @@ -198,8 +198,8 @@ ``True`` if the address is reserved for link-local usage. See :RFC:`3927`. -.. _iana-ipv4-special-registry: http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml -.. _iana-ipv6-special-registry: http://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml +.. _iana-ipv4-special-registry: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml +.. _iana-ipv6-special-registry: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml .. class:: IPv6Address(address) diff --git a/Doc/library/json.rst b/Doc/library/json.rst --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -689,7 +689,7 @@ .. rubric:: Footnotes .. [#rfc-errata] As noted in `the errata for RFC 7159 - `_, + `_, JSON permits literal U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH SEPARATOR) characters in strings, whereas JavaScript (as of ECMAScript Edition 5.1) does not. diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst --- a/Doc/library/mailbox.rst +++ b/Doc/library/mailbox.rst @@ -422,7 +422,7 @@ `maildir man page from qmail `_ The original specification of the format. - `Using maildir format `_ + `Using maildir format `_ Notes on Maildir by its inventor. Includes an updated name-creation scheme and details on "info" semantics. @@ -690,10 +690,10 @@ .. seealso:: - `Format of Version 5 Babyl Files `_ + `Format of Version 5 Babyl Files `_ A specification of the Babyl format. - `Reading Mail with Rmail `_ + `Reading Mail with Rmail `_ The Rmail manual, with some information on Babyl semantics. diff --git a/Doc/library/mimetypes.rst b/Doc/library/mimetypes.rst --- a/Doc/library/mimetypes.rst +++ b/Doc/library/mimetypes.rst @@ -44,7 +44,7 @@ The optional *strict* argument is a flag specifying whether the list of known MIME types is limited to only the official types `registered with IANA - `_. + `_. When *strict* is ``True`` (the default), only the IANA types are supported; when *strict* is ``False``, some additional non-standard but commonly used MIME types are also recognized. diff --git a/Doc/library/othergui.rst b/Doc/library/othergui.rst --- a/Doc/library/othergui.rst +++ b/Doc/library/othergui.rst @@ -31,7 +31,7 @@ book, `GUI Programming with Python: QT Edition `_ by Boudewijn Rempt. The *PyQt4* bindings also have a book, `Rapid GUI Programming - with Python and Qt `_, by Mark + with Python and Qt `_, by Mark Summerfield. `PySide `_ @@ -41,7 +41,7 @@ `wxPython `_ wxPython is a cross-platform GUI toolkit for Python that is built around - the popular `wxWidgets `_ (formerly wxWindows) + the popular `wxWidgets `_ (formerly wxWindows) C++ toolkit. It provides a native look and feel for applications on Windows, Mac OS X, and Unix systems by using each platform's native widgets where ever possible, (GTK+ on Unix-like systems). In addition to diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst --- a/Doc/library/pyexpat.rst +++ b/Doc/library/pyexpat.rst @@ -867,6 +867,6 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is - not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/select.rst b/Doc/library/select.rst --- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -472,7 +472,7 @@ Kevent Objects -------------- -http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 +https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 .. attribute:: kevent.ident diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -53,7 +53,7 @@ Usually your SQL operations will need to use values from Python variables. You shouldn't assemble your query using Python's string operations because doing so is insecure; it makes your program vulnerable to an SQL injection attack -(see http://xkcd.com/327/ for humorous example of what can go wrong). +(see https://xkcd.com/327/ for humorous example of what can go wrong). Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder wherever you want to use a value, and then provide a tuple of values as the @@ -99,7 +99,7 @@ The pysqlite web page -- sqlite3 is developed externally under the name "pysqlite". - http://www.sqlite.org + https://www.sqlite.org The SQLite web page; the documentation describes the syntax and the available data types for the supported SQL dialect. @@ -209,7 +209,7 @@ db = sqlite3.connect('file:path/to/database?mode=ro', uri=True) More information about this feature, including a list of recognized options, can - be found in the `SQLite URI documentation `_. + be found in the `SQLite URI documentation `_. .. versionchanged:: 3.4 Added the *uri* parameter. diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -206,7 +206,7 @@ The *ciphers* parameter sets the available ciphers for this SSL object. It should be a string in the `OpenSSL cipher list format - `_. + `_. The parameter ``do_handshake_on_connect`` specifies whether to do the SSL handshake automatically after doing a :meth:`socket.connect`, or whether the @@ -769,7 +769,7 @@ ALERT_DESCRIPTION_* Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry - `_ + `_ contains this list and references to the RFCs where their meaning is defined. Used as the return value of the callback function in @@ -1174,7 +1174,7 @@ The *capath* string, if present, is the path to a directory containing several CA certificates in PEM format, following an `OpenSSL specific layout - `_. + `_. The *cadata* object, if present, is either an ASCII string of one or more PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded @@ -1212,7 +1212,7 @@ Set the available ciphers for sockets created with this context. It should be a string in the `OpenSSL cipher list format - `_. + `_. If no cipher can be selected (because compile-time options or other configuration forbids use of all the specified ciphers), an :class:`SSLError` will be raised. @@ -1369,7 +1369,7 @@ Get statistics about the SSL sessions created or managed by this context. A dictionary is returned which maps the names of each `piece of information - `_ to their + `_ to their numeric values. For example, here is the total number of hits and misses in the session cache since the context was created:: @@ -2019,7 +2019,7 @@ :meth:`SSLContext.set_ciphers` method. Starting from Python 3.2.3, the ssl module disables certain weak ciphers by default, but you may want to further restrict the cipher choice. Be sure to read OpenSSL's documentation -about the `cipher list format `_. +about the `cipher list format `_. If you want to check which ciphers are enabled by a given cipher list, use the ``openssl ciphers`` command on your system. @@ -2061,5 +2061,5 @@ `RFC 6066: Transport Layer Security (TLS) Extensions `_ D. Eastlake - `IANA TLS: Transport Layer Security (TLS) Parameters `_ + `IANA TLS: Transport Layer Security (TLS) Parameters `_ IANA diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst --- a/Doc/library/statistics.rst +++ b/Doc/library/statistics.rst @@ -223,7 +223,7 @@ * "Statistics for the Behavioral Sciences", Frederick J Gravetter and Larry B Wallnau (8th Edition). - * Calculating the `median `_. + * Calculating the `median `_. * The `SSMEDIAN `_ diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -479,7 +479,7 @@ additional garbage collector overhead if the object is managed by the garbage collector. - See `recursive sizeof recipe `_ + See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size of containers and all their contents. diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -238,7 +238,7 @@ Documentation of the higher-level archiving facilities provided by the standard :mod:`shutil` module. - `GNU tar manual, Basic Tar Format `_ + `GNU tar manual, Basic Tar Format `_ Documentation for tar archive files, including GNU tar extensions. diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -22,13 +22,13 @@ `TKDocs `_ Extensive tutorial plus friendlier widget pages for some of the widgets. - `Tkinter reference: a GUI for Python `_ + `Tkinter reference: a GUI for Python `_ On-line reference material. `Tkinter docs from effbot `_ Online reference for tkinter supported by effbot.org. - `Tcl/Tk manual `_ + `Tcl/Tk manual `_ Official manual for the latest tcl/tk version. `Programming Python `_ @@ -173,7 +173,7 @@ .. seealso:: - `Tcl/Tk 8.6 man pages `_ + `Tcl/Tk 8.6 man pages `_ The Tcl/Tk manual on www.tcl.tk. `ActiveState Tcl Home Page `_ diff --git a/Doc/library/tkinter.ttk.rst b/Doc/library/tkinter.ttk.rst --- a/Doc/library/tkinter.ttk.rst +++ b/Doc/library/tkinter.ttk.rst @@ -22,7 +22,7 @@ .. seealso:: - `Tk Widget Styling Support `_ + `Tk Widget Styling Support `_ A document introducing theming support for Tk diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -549,7 +549,7 @@ An alternative way of dealing with mocking dates, or other builtin classes, is discussed in `this blog entry -`_. +`_. Mocking a Generator Method @@ -1010,7 +1010,7 @@ Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted adaptor -`_. +`_. Having this applied to attributes too actually causes errors. ``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to create diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -67,7 +67,7 @@ a GUI tool for test discovery and execution. This is intended largely for ease of use for those new to unit testing. For production environments it is recommended that tests be driven by a continuous integration system such as - `Buildbot `_, `Jenkins `_ + `Buildbot `_, `Jenkins `_ or `Hudson `_. diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -67,7 +67,7 @@ * :meth:`~urllib.response.addinfourl.info` --- return the meta-information of the page, such as headers, in the form of an :func:`email.message_from_string` instance (see - `Quick Reference to HTTP Headers `_) + `Quick Reference to HTTP Headers `_) * :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response. @@ -1130,7 +1130,7 @@ the returned bytes object to string once it determines or guesses the appropriate encoding. -The following W3C document, http://www.w3.org/International/O-charset\ , lists +The following W3C document, https://www.w3.org/International/O-charset\ , lists the various ways in which a (X)HTML or a XML document could have specified its encoding information. diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst --- a/Doc/library/xml.dom.minidom.rst +++ b/Doc/library/xml.dom.minidom.rst @@ -100,7 +100,7 @@ .. seealso:: - `Document Object Model (DOM) Level 1 Specification `_ + `Document Object Model (DOM) Level 1 Specification `_ The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`. @@ -251,5 +251,5 @@ the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is not valid in an XML document's declaration, even though Python accepts it as an encoding name. - See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/xml.dom.rst b/Doc/library/xml.dom.rst --- a/Doc/library/xml.dom.rst +++ b/Doc/library/xml.dom.rst @@ -63,10 +63,10 @@ .. seealso:: - `Document Object Model (DOM) Level 2 Specification `_ + `Document Object Model (DOM) Level 2 Specification `_ The W3C recommendation upon which the Python DOM API is based. - `Document Object Model (DOM) Level 1 Specification `_ + `Document Object Model (DOM) Level 1 Specification `_ The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`. `Python Language Mapping Specification `_ @@ -115,20 +115,20 @@ .. data:: XML_NAMESPACE The namespace URI associated with the reserved prefix ``xml``, as defined by - `Namespaces in XML `_ (section 4). + `Namespaces in XML `_ (section 4). .. data:: XMLNS_NAMESPACE The namespace URI for namespace declarations, as defined by `Document Object Model (DOM) Level 2 Core Specification - `_ (section 1.1.8). + `_ (section 1.1.8). .. data:: XHTML_NAMESPACE The URI of the XHTML namespace as defined by `XHTML 1.0: The Extensible - HyperText Markup Language `_ (section 3.1.1). + HyperText Markup Language `_ (section 3.1.1). In addition, :mod:`xml.dom` contains a base :class:`Node` class and the DOM @@ -874,7 +874,7 @@ .. exception:: NamespaceErr If an attempt is made to change any object in a way that is not permitted with - regard to the `Namespaces in XML `_ + regard to the `Namespaces in XML `_ recommendation, this exception is raised. diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -292,7 +292,7 @@ with prefixes in the form ``prefix:sometag`` get expanded to ``{uri}sometag`` where the *prefix* is replaced by the full *URI*. Also, if there is a `default namespace -`__, +`__, that full URI gets prepended to all of the non-prefixed tags. Here is an XML example that incorporates two namespaces, one with the @@ -363,7 +363,7 @@ ------------- This module provides limited support for -`XPath expressions `_ for locating elements in a +`XPath expressions `_ for locating elements in a tree. The goal is to support a small subset of the abbreviated syntax; a full XPath engine is outside the scope of the module. @@ -1189,5 +1189,5 @@ .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is - not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets/character-sets.xhtml. + not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl + and https://www.iana.org/assignments/character-sets/character-sets.xhtml. diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -315,7 +315,7 @@ Write the XML-RPC base 64 encoding of this binary item to the *out* stream object. The encoded data will have newlines every 76 characters as per - `RFC 2045 section 6.8 `_, + `RFC 2045 section 6.8 `_, which was the de facto standard base64 specification when the XML-RPC spec was written. @@ -590,7 +590,7 @@ .. rubric:: Footnotes .. [#] This approach has been first presented in `a discussion on xmlrpc.com - `_. + `_. .. the link now points to webarchive since the one at .. http://www.xmlrpc.com/discuss/msgReader%241208 is broken (and webadmin .. doesn't reply) diff --git a/Doc/license.rst b/Doc/license.rst --- a/Doc/license.rst +++ b/Doc/license.rst @@ -11,12 +11,12 @@ ======================= Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl/) in the Netherlands as a +Mathematisch Centrum (CWI, see https://www.cwi.nl/) in the Netherlands as a successor of a language called ABC. Guido remains Python's principal author, although it includes many contributions from others. In 1995, Guido continued his work on Python at the Corporation for National -Research Initiatives (CNRI, see http://www.cnri.reston.va.us/) in Reston, +Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston, Virginia where he released several versions of the software. In May 2000, Guido and the Python core development team moved to BeOpen.com to @@ -27,7 +27,7 @@ specifically to own Python-related Intellectual Property. Zope Corporation is a sponsoring member of the PSF. -All Python releases are Open Source (see http://opensource.org/ for the Open +All Python releases are Open Source (see https://opensource.org/ for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -322,7 +322,7 @@ A non-normative HTML file listing all valid identifier characters for Unicode 4.1 can be found at -http://www.dcl.hpi.uni-potsdam.de/home/loewis/table-3131.html. +https://www.dcl.hpi.uni-potsdam.de/home/loewis/table-3131.html. .. _keywords: diff --git a/Doc/tutorial/floatingpoint.rst b/Doc/tutorial/floatingpoint.rst --- a/Doc/tutorial/floatingpoint.rst +++ b/Doc/tutorial/floatingpoint.rst @@ -155,7 +155,7 @@ If you are a heavy user of floating point operations you should take a look at the Numerical Python package and many other packages for mathematical and -statistical operations supplied by the SciPy project. See . +statistical operations supplied by the SciPy project. See . Python provides tools that may help on those rare occasions when you really *do* want to know the exact value of a float. The diff --git a/Doc/tutorial/interactive.rst b/Doc/tutorial/interactive.rst --- a/Doc/tutorial/interactive.rst +++ b/Doc/tutorial/interactive.rst @@ -49,6 +49,6 @@ bpython_. -.. _GNU Readline: http://tiswww.case.edu/php/chet/readline/rltop.html +.. _GNU Readline: https://tiswww.case.edu/php/chet/readline/rltop.html .. _IPython: http://ipython.scipy.org/ .. _bpython: http://www.bpython-interpreter.org/ diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst --- a/Doc/tutorial/stdlib.rst +++ b/Doc/tutorial/stdlib.rst @@ -152,7 +152,7 @@ >>> statistics.variance(data) 1.3720238095238095 -The SciPy project has many other modules for numerical +The SciPy project has many other modules for numerical computations. .. _tut-internet-access: diff --git a/Doc/tutorial/whatnow.rst b/Doc/tutorial/whatnow.rst --- a/Doc/tutorial/whatnow.rst +++ b/Doc/tutorial/whatnow.rst @@ -43,7 +43,7 @@ for download. Once you begin releasing code, you can register it here so that others can find it. -* http://code.activestate.com/recipes/langs/python/: The Python Cookbook is a +* https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a sizable collection of code examples, larger modules, and useful scripts. Particularly notable contributions are collected in a book also titled Python Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.) @@ -51,7 +51,7 @@ * http://www.pyvideo.org collects links to Python-related videos from conferences and user-group meetings. -* http://scipy.org: The Scientific Python project includes modules for fast +* https://scipy.org: The Scientific Python project includes modules for fast array computations and manipulations plus a host of packages for such things as linear algebra, Fourier transforms, non-linear solvers, random number distributions, statistical analysis and the like. diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst --- a/Doc/using/mac.rst +++ b/Doc/using/mac.rst @@ -65,7 +65,7 @@ :program:`emacs` among them. If you want a more Mac-like editor, :program:`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see http://www.barebones.com/products/bbedit/index.html) are good choices, as is -:program:`TextMate` (see http://macromates.com/). Other editors include +:program:`TextMate` (see https://macromates.com/). Other editors include :program:`Gvim` (http://macvim.org) and :program:`Aquamacs` (http://aquamacs.org/). @@ -144,9 +144,9 @@ available from https://pythonhosted.org/pyobjc/. The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-platform -Tk toolkit (http://www.tcl.tk). An Aqua-native version of Tk is bundled with OS +Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is bundled with OS X by Apple, and the latest version can be downloaded and installed from -http://www.activestate.com; it can also be built from source. +https://www.activestate.com; it can also be built from source. *wxPython* is another popular cross-platform GUI toolkit that runs natively on Mac OS X. Packages and documentation are available from http://www.wxpython.org. diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst --- a/Doc/using/unix.rst +++ b/Doc/using/unix.rst @@ -55,7 +55,7 @@ On OpenSolaris -------------- -You can get Python from `OpenCSW `_. Various versions +You can get Python from `OpenCSW `_. Various versions of Python are available and can be installed with e.g. ``pkgutil -i python27``. @@ -139,10 +139,10 @@ information on how to code in Python in these editors, look at: * http://www.vim.org/scripts/script.php?script_id=790 -* http://sourceforge.net/projects/python-mode +* https://sourceforge.net/projects/python-mode Geany is an excellent IDE with support for a lot of languages. For more -information, read: http://www.geany.org/ +information, read: https://www.geany.org/ Komodo edit is another extremely good IDE. It also has support for a lot of -languages. For more information, read http://komodoide.com/. +languages. For more information, read https://komodoide.com/. diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -245,7 +245,7 @@ Check :pep:`11` for details on all unsupported platforms. * `Windows CE `_ is still supported. -* The `Cygwin `_ installer offers to install the Python +* The `Cygwin `_ installer offers to install the Python interpreter as well (cf. `Cygwin package source `_, `Maintainer releases @@ -364,7 +364,7 @@ https://support.microsoft.com/kb/310519 How To Manage Environment Variables in Windows XP - http://www.chem.gla.ac.uk/~louis/software/faq/q1.html + https://www.chem.gla.ac.uk/~louis/software/faq/q1.html Setting Environment variables, Louis J. Farrugia .. _windows-path-mod: diff --git a/Doc/whatsnew/2.0.rst b/Doc/whatsnew/2.0.rst --- a/Doc/whatsnew/2.0.rst +++ b/Doc/whatsnew/2.0.rst @@ -61,7 +61,7 @@ made available by SourceForge for storing source code, tracking bug reports, and managing the queue of patch submissions. To report bugs or submit patches for Python 2.0, use the bug tracking and patch manager tools available from -Python's project page, located at http://sourceforge.net/projects/python/. +Python's project page, located at https://sourceforge.net/projects/python/. The most important of the services now hosted at SourceForge is the Python CVS tree, the version-controlled repository containing the source code for Python. diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst --- a/Doc/whatsnew/2.2.rst +++ b/Doc/whatsnew/2.2.rst @@ -632,10 +632,10 @@ every square of an $NxN$ chessboard without visiting any square twice). The idea of generators comes from other programming languages, especially Icon -(http://www.cs.arizona.edu/icon/), where the idea of generators is central. In +(https://www.cs.arizona.edu/icon/), where the idea of generators is central. In Icon, every expression and function call behaves like a generator. One example from "An Overview of the Icon Programming Language" at -http://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks +https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks like:: sentence := "Store it in the neighboring harbor" diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst --- a/Doc/whatsnew/2.3.rst +++ b/Doc/whatsnew/2.3.rst @@ -218,10 +218,10 @@ every square of an $NxN$ chessboard without visiting any square twice). The idea of generators comes from other programming languages, especially Icon -(http://www.cs.arizona.edu/icon/), where the idea of generators is central. In +(https://www.cs.arizona.edu/icon/), where the idea of generators is central. In Icon, every expression and function call behaves like a generator. One example from "An Overview of the Icon Programming Language" at -http://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks +https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what this looks like:: sentence := "Store it in the neighboring harbor" diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst --- a/Doc/whatsnew/2.5.rst +++ b/Doc/whatsnew/2.5.rst @@ -1528,7 +1528,7 @@ * The :mod:`socket` module now supports :const:`AF_NETLINK` sockets on Linux, thanks to a patch from Philippe Biondi. Netlink sockets are a Linux-specific mechanism for communications between a user-space process and kernel code; an - introductory article about them is at http://www.linuxjournal.com/article/7356. + introductory article about them is at https://www.linuxjournal.com/article/7356. In Python code, netlink addresses are represented as a tuple of 2 integers, ``(pid, group_mask)``. @@ -2013,7 +2013,7 @@ >>> For more information about the SQL dialect supported by SQLite, see -http://www.sqlite.org. +https://www.sqlite.org. .. seealso:: @@ -2021,7 +2021,7 @@ http://www.pysqlite.org The pysqlite web page. - http://www.sqlite.org + https://www.sqlite.org The SQLite web page; the documentation describes the syntax and the available data types for the supported SQL dialect. diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -154,9 +154,9 @@ up different products and import some of the bugs and patches from SourceForge. Four different trackers were examined: `Jira `__, -`Launchpad `__, +`Launchpad `__, `Roundup `__, and -`Trac `__. +`Trac `__. The committee eventually settled on Jira and Roundup as the two candidates. Jira is a commercial product that offers no-cost hosted instances to free-software projects; Roundup @@ -1431,7 +1431,7 @@ :pep:`3141` - A Type Hierarchy for Numbers PEP written by Jeffrey Yasskin. - `Scheme's numerical tower `__, from the Guile manual. + `Scheme's numerical tower `__, from the Guile manual. `Scheme's number datatypes `__ from the R5RS Scheme specification. @@ -2889,7 +2889,7 @@ Bill Janssen made extensive improvements to Python 2.6's support for the Secure Sockets Layer by adding a new module, :mod:`ssl`, that's -built atop the `OpenSSL `__ library. +built atop the `OpenSSL `__ library. This new module provides more control over the protocol negotiated, the X.509 certificates used, and has better support for writing SSL servers (as opposed to clients) in Python. The existing SSL support diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -1157,7 +1157,7 @@ * The :mod:`ctypes` module now always converts ``None`` to a C NULL pointer for arguments declared as pointers. (Changed by Thomas Heller; :issue:`4606`.) The underlying `libffi library - `__ has been updated to version + `__ has been updated to version 3.0.9, containing various fixes for different platforms. (Updated by Matthias Klose; :issue:`8142`.) @@ -1530,7 +1530,7 @@ *ciphers* argument that's a string listing the encryption algorithms to be allowed; the format of the string is described `in the OpenSSL documentation - `__. + `__. (Added by Antoine Pitrou; :issue:`8322`.) Another change makes the extension load all of OpenSSL's ciphers and @@ -1783,7 +1783,7 @@ To learn more, read the :mod:`ttk` module documentation. You may also wish to read the Tcl/Tk manual page describing the Ttk theme engine, available at -http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some +https://www.tcl.tk/man/tcl8.5/TkCmd/ttk_intro.htm. Some screenshots of the Python/Ttk code in use are at http://code.google.com/p/python-ttk/wiki/Screenshots. @@ -2079,7 +2079,7 @@ * The latest release of the GNU Debugger, GDB 7, can be `scripted using Python - `__. + `__. When you begin debugging an executable program P, GDB will look for a file named ``P-gdb.py`` and automatically read it. Dave Malcolm contributed a :file:`python-gdb.py` that adds a number of @@ -2149,7 +2149,7 @@ with *updatepath* set to false. Security issue reported as `CVE-2008-5983 - `_; + `_; discussed in :issue:`5753`, and fixed by Antoine Pitrou. * New macros: the Python header files now define the following macros: diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -769,8 +769,8 @@ (Contributed by Raymond Hettinger and incorporating design ideas from Jim Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245 - `_\, `recipe 577479 - `_\, :issue:`10586`, and + `_\, `recipe 577479 + `_\, :issue:`10586`, and :issue:`10593`.) * The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` attribute @@ -955,7 +955,7 @@ sealed and deposited in a queue for later handling. See `Barrier Synchronization Patterns -`_ for +`_ for more examples of how barriers can be used in parallel computing. Also, there is a simple but thorough explanation of barriers in `The Little Book of Semaphores `_, *section 3.6*. @@ -1618,7 +1618,7 @@ * The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* argument. The *ciphers* string lists the allowed encryption algorithms using the format described in the `OpenSSL documentation - `__. + `__. * When linked against recent versions of OpenSSL, the :mod:`ssl` module now supports the Server Name Indication extension to the TLS protocol, allowing @@ -2559,7 +2559,7 @@ :source:`Mac/BuildScript/README.txt` for details. For users running a 32/64-bit build, there is a known problem with the default Tcl/Tk on Mac OS X 10.6. Accordingly, we recommend installing an updated alternative such as -`ActiveState Tcl/Tk 8.5.9 `_\. +`ActiveState Tcl/Tk 8.5.9 `_\. See https://www.python.org/download/mac/tcltk/ for additional details. Porting to Python 3.2 diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -1410,7 +1410,7 @@ A new boolean parameter to the :func:`~sqlite3.connect` function, *uri*, can be used to indicate that the *database* parameter is a ``uri`` (see the `SQLite -URI documentation `_). (Contributed by poq in +URI documentation `_). (Contributed by poq in :issue:`13773`.) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1010,6 +1010,8 @@ Documentation ------------- +- Issue #26736: Used HTTPS for external links in the documentation if possible. + - Issue #6953: Rework the Readline module documentation to group related functions together, and add more details such as what underlying Readline functions and variables are accessed. -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Sat May 7 04:53:11 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 07 May 2016 08:53:11 +0000 Subject: [Python-checkins] Daily reference leaks (786de3f37ca7): sum=10 Message-ID: <20160507085311.69961.85105.790AA77E@psf.io> results for 786de3f37ca7 on branch "default" -------------------------------------------- test_collections leaked [0, 0, 4] memory blocks, sum=4 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_typing leaked [2, 0, 0] references, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogVvuKKj', '--timeout', '7200'] From python-checkins at python.org Sat May 7 08:44:31 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 12:44:31 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzE3NzY1?= =?utf-8?q?=3A_weakref=2Eref=28=29_no_longer_silently_ignores_keyword_argu?= =?utf-8?q?ments=2E?= Message-ID: <20160507124430.130801.23310.6F485AF6@psf.io> https://hg.python.org/cpython/rev/ee17a83feabc changeset: 101251:ee17a83feabc branch: 3.5 parent: 101248:211a9f32dfb9 user: Serhiy Storchaka date: Sat May 07 15:41:09 2016 +0300 summary: Issue #17765: weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl. files: Lib/test/test_weakref.py | 4 ++++ Misc/NEWS | 3 +++ Objects/weakrefobject.c | 4 +++- 3 files changed, 10 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -133,6 +133,10 @@ ref1 = weakref.ref(c, callback) del c + def test_constructor_kwargs(self): + c = C() + self.assertRaises(TypeError, weakref.ref, c, callback=None) + def test_proxy_ref(self): o = C() o.bar = 1 diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -116,6 +116,9 @@ Library ------- +- Issue #17765: weakref.ref() no longer silently ignores keyword arguments. + Patch by Georg Brandl. + - Issue #26873: xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result. diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -268,7 +268,6 @@ parse_weakref_init_args(char *funcname, PyObject *args, PyObject *kwargs, PyObject **obp, PyObject **callbackp) { - /* XXX Should check that kwargs == NULL or is empty. */ return PyArg_UnpackTuple(args, funcname, 1, 2, obp, callbackp); } @@ -331,6 +330,9 @@ { PyObject *tmp; + if (!_PyArg_NoKeywords("ref()", kwargs)) + return -1; + if (parse_weakref_init_args("__init__", args, kwargs, &tmp, &tmp)) return 0; else -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 08:44:38 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 12:44:38 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzE3NzY1?= =?utf-8?q?=3A_weakref=2Eref=28=29_no_longer_silently_ignores_keyword_argu?= =?utf-8?q?ments=2E?= Message-ID: <20160507124430.22573.16333.67652900@psf.io> https://hg.python.org/cpython/rev/60de9c6188cc changeset: 101252:60de9c6188cc branch: 2.7 parent: 101250:e3af25d70976 user: Serhiy Storchaka date: Sat May 07 15:41:09 2016 +0300 summary: Issue #17765: weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl. files: Lib/test/test_weakref.py | 4 ++++ Misc/NEWS | 3 +++ Objects/weakrefobject.c | 4 +++- 3 files changed, 10 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -116,6 +116,10 @@ ref1 = weakref.ref(c, callback) del c + def test_constructor_kwargs(self): + c = C() + self.assertRaises(TypeError, weakref.ref, c, callback=None) + def test_proxy_ref(self): o = C() o.bar = 1 diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -77,6 +77,9 @@ Library ------- +- Issue #17765: weakref.ref() no longer silently ignores keyword arguments. + Patch by Georg Brandl. + - Issue #26873: xmlrpclib now raises ResponseError on unsupported type tags instead of silently return incorrect result. diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -271,7 +271,6 @@ parse_weakref_init_args(char *funcname, PyObject *args, PyObject *kwargs, PyObject **obp, PyObject **callbackp) { - /* XXX Should check that kwargs == NULL or is empty. */ return PyArg_UnpackTuple(args, funcname, 1, 2, obp, callbackp); } @@ -334,6 +333,9 @@ { PyObject *tmp; + if (!_PyArg_NoKeywords("ref()", kwargs)) + return -1; + if (parse_weakref_init_args("__init__", args, kwargs, &tmp, &tmp)) return 0; else -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 08:44:38 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 12:44:38 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2317765=3A_weakref=2Eref=28=29_no_longer_silently?= =?utf-8?q?_ignores_keyword_arguments=2E?= Message-ID: <20160507124430.21015.45282.E7136FA5@psf.io> https://hg.python.org/cpython/rev/ef55fa8c4b82 changeset: 101253:ef55fa8c4b82 parent: 101249:3ceb54a49387 parent: 101251:ee17a83feabc user: Serhiy Storchaka date: Sat May 07 15:43:59 2016 +0300 summary: Issue #17765: weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl. files: Lib/test/test_weakref.py | 4 ++++ Misc/NEWS | 3 +++ Objects/weakrefobject.c | 4 +++- 3 files changed, 10 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -133,6 +133,10 @@ ref1 = weakref.ref(c, callback) del c + def test_constructor_kwargs(self): + c = C() + self.assertRaises(TypeError, weakref.ref, c, callback=None) + def test_proxy_ref(self): o = C() o.bar = 1 diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -265,6 +265,9 @@ Library ------- +- Issue #17765: weakref.ref() no longer silently ignores keyword arguments. + Patch by Georg Brandl. + - Issue #26873: xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result. diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -268,7 +268,6 @@ parse_weakref_init_args(const char *funcname, PyObject *args, PyObject *kwargs, PyObject **obp, PyObject **callbackp) { - /* XXX Should check that kwargs == NULL or is empty. */ return PyArg_UnpackTuple(args, funcname, 1, 2, obp, callbackp); } @@ -331,6 +330,9 @@ { PyObject *tmp; + if (!_PyArg_NoKeywords("ref()", kwargs)) + return -1; + if (parse_weakref_init_args("__init__", args, kwargs, &tmp, &tmp)) return 0; else -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 09:37:10 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 07 May 2016 13:37:10 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Replace_exampl?= =?utf-8?q?e=2Ecom_with_pythontest=2Enet_in_test=5Furllibnet?= Message-ID: <20160507133710.31189.80782.D5ACD22B@psf.io> https://hg.python.org/cpython/rev/d1a33c93fa1b changeset: 101254:d1a33c93fa1b branch: 3.5 parent: 101251:ee17a83feabc user: Berker Peksag date: Sat May 07 16:37:09 2016 +0300 summary: Replace example.com with pythontest.net in test_urllibnet example.com/404 returns 500 instead of 404 now. files: Lib/test/test_urllibnet.py | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -38,12 +38,14 @@ for transparent redirection have been written. setUp is not used for always constructing a connection to - http://www.example.com/ since there a few tests that don't use that address + http://www.pythontest.net/ since there a few tests that don't use that address and making a connection is expensive enough to warrant minimizing unneeded connections. """ + url = 'http://www.pythontest.net/' + @contextlib.contextmanager def urlopen(self, *args, **kwargs): resource = args[0] @@ -56,7 +58,7 @@ def test_basic(self): # Simple test expected to pass. - with self.urlopen("http://www.example.com/") as open_url: + with self.urlopen(self.url) as open_url: for attr in ("read", "readline", "readlines", "fileno", "close", "info", "geturl"): self.assertTrue(hasattr(open_url, attr), "object returned from " @@ -65,7 +67,7 @@ def test_readlines(self): # Test both readline and readlines. - with self.urlopen("http://www.example.com/") as open_url: + with self.urlopen(self.url) as open_url: self.assertIsInstance(open_url.readline(), bytes, "readline did not return a string") self.assertIsInstance(open_url.readlines(), list, @@ -73,7 +75,7 @@ def test_info(self): # Test 'info'. - with self.urlopen("http://www.example.com/") as open_url: + with self.urlopen(self.url) as open_url: info_obj = open_url.info() self.assertIsInstance(info_obj, email.message.Message, "object returned by 'info' is not an " @@ -82,14 +84,13 @@ def test_geturl(self): # Make sure same URL as opened is returned by geturl. - URL = "http://www.example.com/" - with self.urlopen(URL) as open_url: + with self.urlopen(self.url) as open_url: gotten_url = open_url.geturl() - self.assertEqual(gotten_url, URL) + self.assertEqual(gotten_url, self.url) def test_getcode(self): # test getcode() with the fancy opener to get 404 error codes - URL = "http://www.example.com/XXXinvalidXXX" + URL = self.url + "XXXinvalidXXX" with support.transient_internet(URL): with self.assertWarns(DeprecationWarning): open_url = urllib.request.FancyURLopener().open(URL) @@ -153,7 +154,7 @@ def test_basic(self): # Test basic functionality. - with self.urlretrieve("http://www.example.com/") as (file_location, info): + with self.urlretrieve(self.logo) as (file_location, info): self.assertTrue(os.path.exists(file_location), "file location returned by" " urlretrieve is not a valid path") with open(file_location, 'rb') as f: @@ -162,7 +163,7 @@ def test_specified_path(self): # Make sure that specifying the location of the file to write to works. - with self.urlretrieve("http://www.example.com/", + with self.urlretrieve(self.logo, support.TESTFN) as (file_location, info): self.assertEqual(file_location, support.TESTFN) self.assertTrue(os.path.exists(file_location)) @@ -171,11 +172,11 @@ def test_header(self): # Make sure header returned as 2nd value from urlretrieve is good. - with self.urlretrieve("http://www.example.com/") as (file_location, info): + with self.urlretrieve(self.logo) as (file_location, info): self.assertIsInstance(info, email.message.Message, "info is not an instance of email.message.Message") - logo = "http://www.example.com/" + logo = "http://www.pythontest.net/" def test_data_header(self): with self.urlretrieve(self.logo) as (file_location, fileheaders): -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 09:37:10 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 07 May 2016 13:37:10 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Replace_example=2Ecom_with_pythontest=2Enet_in_test=5Fur?= =?utf-8?q?llibnet?= Message-ID: <20160507133710.42375.86912.35F8EC39@psf.io> https://hg.python.org/cpython/rev/07b118f9527a changeset: 101255:07b118f9527a parent: 101253:ef55fa8c4b82 parent: 101254:d1a33c93fa1b user: Berker Peksag date: Sat May 07 16:37:35 2016 +0300 summary: Replace example.com with pythontest.net in test_urllibnet example.com/404 returns 500 instead of 404 now. files: Lib/test/test_urllibnet.py | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -37,12 +37,14 @@ for transparent redirection have been written. setUp is not used for always constructing a connection to - http://www.example.com/ since there a few tests that don't use that address + http://www.pythontest.net/ since there a few tests that don't use that address and making a connection is expensive enough to warrant minimizing unneeded connections. """ + url = 'http://www.pythontest.net/' + @contextlib.contextmanager def urlopen(self, *args, **kwargs): resource = args[0] @@ -55,7 +57,7 @@ def test_basic(self): # Simple test expected to pass. - with self.urlopen("http://www.example.com/") as open_url: + with self.urlopen(self.url) as open_url: for attr in ("read", "readline", "readlines", "fileno", "close", "info", "geturl"): self.assertTrue(hasattr(open_url, attr), "object returned from " @@ -64,7 +66,7 @@ def test_readlines(self): # Test both readline and readlines. - with self.urlopen("http://www.example.com/") as open_url: + with self.urlopen(self.url) as open_url: self.assertIsInstance(open_url.readline(), bytes, "readline did not return a string") self.assertIsInstance(open_url.readlines(), list, @@ -72,7 +74,7 @@ def test_info(self): # Test 'info'. - with self.urlopen("http://www.example.com/") as open_url: + with self.urlopen(self.url) as open_url: info_obj = open_url.info() self.assertIsInstance(info_obj, email.message.Message, "object returned by 'info' is not an " @@ -81,14 +83,13 @@ def test_geturl(self): # Make sure same URL as opened is returned by geturl. - URL = "http://www.example.com/" - with self.urlopen(URL) as open_url: + with self.urlopen(self.url) as open_url: gotten_url = open_url.geturl() - self.assertEqual(gotten_url, URL) + self.assertEqual(gotten_url, self.url) def test_getcode(self): # test getcode() with the fancy opener to get 404 error codes - URL = "http://www.example.com/XXXinvalidXXX" + URL = self.url + "XXXinvalidXXX" with support.transient_internet(URL): with self.assertWarns(DeprecationWarning): open_url = urllib.request.FancyURLopener().open(URL) @@ -152,7 +153,7 @@ def test_basic(self): # Test basic functionality. - with self.urlretrieve("http://www.example.com/") as (file_location, info): + with self.urlretrieve(self.logo) as (file_location, info): self.assertTrue(os.path.exists(file_location), "file location returned by" " urlretrieve is not a valid path") with open(file_location, 'rb') as f: @@ -161,7 +162,7 @@ def test_specified_path(self): # Make sure that specifying the location of the file to write to works. - with self.urlretrieve("http://www.example.com/", + with self.urlretrieve(self.logo, support.TESTFN) as (file_location, info): self.assertEqual(file_location, support.TESTFN) self.assertTrue(os.path.exists(file_location)) @@ -170,11 +171,11 @@ def test_header(self): # Make sure header returned as 2nd value from urlretrieve is good. - with self.urlretrieve("http://www.example.com/") as (file_location, info): + with self.urlretrieve(self.logo) as (file_location, info): self.assertIsInstance(info, email.message.Message, "info is not an instance of email.message.Message") - logo = "http://www.example.com/" + logo = "http://www.pythontest.net/" def test_data_header(self): with self.urlretrieve(self.logo) as (file_location, fileheaders): -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 09:41:11 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 07 May 2016 13:41:11 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Replace_exampl?= =?utf-8?q?e=2Ecom_with_pythontest=2Enet_in_test=5Fgetcode_of_test=5Furlli?= =?utf-8?q?bnet?= Message-ID: <20160507134111.88888.53025.EFCA0215@psf.io> https://hg.python.org/cpython/rev/806dfe65ddcf changeset: 101256:806dfe65ddcf branch: 2.7 parent: 101252:60de9c6188cc user: Berker Peksag date: Sat May 07 16:41:39 2016 +0300 summary: Replace example.com with pythontest.net in test_getcode of test_urllibnet files: Lib/test/test_urllibnet.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -111,7 +111,7 @@ def test_getcode(self): # test getcode() with the fancy opener to get 404 error codes - URL = "http://www.example.com/XXXinvalidXXX" + URL = "http://www.pythontest.net/XXXinvalidXXX" open_url = urllib.FancyURLopener().open(URL) try: code = open_url.getcode() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 09:45:39 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 07 May 2016 13:45:39 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326708=3A_Use_the_?= =?utf-8?q?=22const=22_qualifier_for_immutable_strings=2E?= Message-ID: <20160507134537.9353.79550.B894F261@psf.io> https://hg.python.org/cpython/rev/7edf74098c76 changeset: 101257:7edf74098c76 parent: 101255:07b118f9527a user: Serhiy Storchaka date: Sat May 07 16:45:18 2016 +0300 summary: Issue #26708: Use the "const" qualifier for immutable strings. This can help to avoid unintentional modification. files: Modules/posixmodule.c | 76 +++++++++++++++--------------- 1 files changed, 39 insertions(+), 37 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -810,8 +810,8 @@ const char *argument_name; int nullable; int allow_fd; - wchar_t *wide; - char *narrow; + const wchar_t *wide; + const char *narrow; int fd; Py_ssize_t length; PyObject *object; @@ -834,7 +834,7 @@ path_t *path = (path_t *)p; PyObject *bytes; Py_ssize_t length; - char *narrow; + const char *narrow; #define FORMAT_EXCEPTION(exc, fmt) \ PyErr_Format(exc, "%s%s" fmt, \ @@ -862,7 +862,7 @@ if (PyUnicode_Check(o)) { #ifdef MS_WINDOWS - wchar_t *wide; + const wchar_t *wide; wide = PyUnicode_AsUnicodeAndSize(o, &length); if (!wide) { @@ -1164,7 +1164,7 @@ for (e = _wenviron; *e != NULL; e++) { PyObject *k; PyObject *v; - wchar_t *p = wcschr(*e, L'='); + const wchar_t *p = wcschr(*e, L'='); if (p == NULL) continue; k = PyUnicode_FromWideChar(*e, (Py_ssize_t)(p-*e)); @@ -1192,7 +1192,7 @@ for (e = environ; *e != NULL; e++) { PyObject *k; PyObject *v; - char *p = strchr(*e, '='); + const char *p = strchr(*e, '='); if (p == NULL) continue; k = PyBytes_FromStringAndSize(*e, (int)(p-*e)); @@ -3483,7 +3483,7 @@ if (!path->narrow) { WIN32_FIND_DATAW wFileData; - wchar_t *po_wchars; + const wchar_t *po_wchars; if (!path->wide) { /* Default arg: "." */ po_wchars = L"."; @@ -3649,7 +3649,7 @@ else #endif { - char *name; + const char *name; if (path->narrow) { name = path->narrow; /* only return bytes if they specified a bytes object */ @@ -3831,7 +3831,7 @@ wchar_t *target_path; int result_length; PyObject *result; - wchar_t *path_wchar; + const wchar_t *path_wchar; path_wchar = PyUnicode_AsUnicode(path); if (path_wchar == NULL) @@ -3920,7 +3920,8 @@ /*[clinic end generated code: output=79a0ba729f956dbe input=7eacadc40acbda6b]*/ { PyObject *result; - wchar_t *path_wchar, *mountpath=NULL; + const wchar_t *path_wchar; + wchar_t *mountpath=NULL; size_t buflen; BOOL ret; @@ -4118,7 +4119,7 @@ static PyObject * internal_rename(path_t *src, path_t *dst, int src_dir_fd, int dst_dir_fd, int is_replace) { - char *function_name = is_replace ? "replace" : "rename"; + const char *function_name = is_replace ? "replace" : "rename"; int dir_fd_specified; #ifdef MS_WINDOWS @@ -4298,7 +4299,7 @@ /*[clinic end generated code: output=800f775e10b7be55 input=86a58554ba6094af]*/ { long result; - char *bytes = PyBytes_AsString(command); + const char *bytes = PyBytes_AsString(command); Py_BEGIN_ALLOW_THREADS result = system(bytes); Py_END_ALLOW_THREADS @@ -4937,7 +4938,8 @@ Py_ssize_t i, pos, envc; PyObject *keys=NULL, *vals=NULL; PyObject *key, *val, *key2, *val2; - char *p, *k, *v; + char *p; + const char *k, *v; size_t len; i = PyMapping_Size(env); @@ -5052,7 +5054,7 @@ os_execv_impl(PyModuleDef *module, PyObject *path, PyObject *argv) /*[clinic end generated code: output=9221f08143146fff input=96041559925e5229]*/ { - char *path_char; + const char *path_char; char **argvlist; Py_ssize_t argc; @@ -5173,7 +5175,7 @@ os_spawnv_impl(PyModuleDef *module, int mode, PyObject *path, PyObject *argv) /*[clinic end generated code: output=140a7945484c8cc5 input=042c91dfc1e6debc]*/ { - char *path_char; + const char *path_char; char **argvlist; int i; Py_ssize_t argc; @@ -5251,7 +5253,7 @@ PyObject *argv, PyObject *env) /*[clinic end generated code: output=e7f5f0703610531f input=02362fd937963f8f]*/ { - char *path_char; + const char *path_char; char **argvlist; char **envlist; PyObject *res = NULL; @@ -6264,7 +6266,7 @@ posix_initgroups(PyObject *self, PyObject *args) { PyObject *oname; - char *username; + const char *username; int res; #ifdef __APPLE__ int gid; @@ -7138,16 +7140,16 @@ static PyObject * win_readlink(PyObject *self, PyObject *args, PyObject *kwargs) { - wchar_t *path; + const wchar_t *path; DWORD n_bytes_returned; DWORD io_result; PyObject *po, *result; - int dir_fd; + int dir_fd; HANDLE reparse_point_handle; char target_buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE]; REPARSE_DATA_BUFFER *rdb = (REPARSE_DATA_BUFFER *)target_buffer; - wchar_t *print_name; + const wchar_t *print_name; static char *keywords[] = {"path", "dir_fd", NULL}; @@ -7215,8 +7217,8 @@ #if defined(MS_WINDOWS) /* Grab CreateSymbolicLinkW dynamically from kernel32 */ -static DWORD (CALLBACK *Py_CreateSymbolicLinkW)(LPWSTR, LPWSTR, DWORD) = NULL; -static DWORD (CALLBACK *Py_CreateSymbolicLinkA)(LPSTR, LPSTR, DWORD) = NULL; +static DWORD (CALLBACK *Py_CreateSymbolicLinkW)(LPCWSTR, LPCWSTR, DWORD) = NULL; +static DWORD (CALLBACK *Py_CreateSymbolicLinkA)(LPCSTR, LPCSTR, DWORD) = NULL; static int check_CreateSymbolicLink(void) @@ -7321,7 +7323,7 @@ /* Return True if the path at src relative to dest is a directory */ static int -_check_dirW(WCHAR *src, WCHAR *dest) +_check_dirW(LPCWSTR src, LPCWSTR dest) { WIN32_FILE_ATTRIBUTE_DATA src_info; WCHAR dest_parent[MAX_PATH]; @@ -7340,7 +7342,7 @@ /* Return True if the path at src relative to dest is a directory */ static int -_check_dirA(const char *src, char *dest) +_check_dirA(LPCSTR src, LPCSTR dest) { WIN32_FILE_ATTRIBUTE_DATA src_info; char dest_parent[MAX_PATH]; @@ -9030,7 +9032,7 @@ os_putenv_impl(PyModuleDef *module, PyObject *name, PyObject *value) /*[clinic end generated code: output=a2438cf95e5a0c1c input=ba586581c2e6105f]*/ { - wchar_t *env; + const wchar_t *env; PyObject *unicode = PyUnicode_FromFormat("%U=%U", name, value); if (unicode == NULL) { @@ -9076,8 +9078,8 @@ { PyObject *bytes = NULL; char *env; - char *name_string = PyBytes_AsString(name); - char *value_string = PyBytes_AsString(value); + const char *name_string = PyBytes_AsString(name); + const char *value_string = PyBytes_AsString(value); bytes = PyBytes_FromFormat("%s=%s", name_string, value_string); if (bytes == NULL) { @@ -10469,7 +10471,7 @@ static int setup_confname_table(struct constdef *table, size_t tablesize, - char *tablename, PyObject *module) + const char *tablename, PyObject *module) { PyObject *d = NULL; size_t i; @@ -10596,9 +10598,9 @@ win32_startfile(PyObject *self, PyObject *args) { PyObject *ofilepath; - char *filepath; - char *operation = NULL; - wchar_t *wpath, *woperation; + const char *filepath; + const char *operation = NULL; + const wchar_t *wpath, *woperation; HINSTANCE rc; PyObject *unipath, *uoperation = NULL; @@ -11003,7 +11005,7 @@ name = path->narrow ? path->narrow : "."; for (i = 0; ; i++) { - char *start, *trace, *end; + const char *start, *trace, *end; ssize_t length; static const Py_ssize_t buffer_sizes[] = { 256, XATTR_LIST_MAX, 0 }; Py_ssize_t buffer_size = buffer_sizes[i]; @@ -11482,7 +11484,7 @@ struct _Py_stat_struct st; #ifdef MS_WINDOWS - wchar_t *path; + const wchar_t *path; path = PyUnicode_AsUnicode(self->path); if (!path) @@ -11499,7 +11501,7 @@ } #else /* POSIX */ PyObject *bytes; - char *path; + const char *path; if (!PyUnicode_FSConverter(self->path, &bytes)) return NULL; @@ -11683,7 +11685,7 @@ { #ifdef MS_WINDOWS if (!self->got_file_index) { - wchar_t *path; + const wchar_t *path; struct _Py_stat_struct stat; path = PyUnicode_AsUnicode(self->path); @@ -11777,7 +11779,7 @@ #ifdef MS_WINDOWS static wchar_t * -join_path_filenameW(wchar_t *path_wide, wchar_t* filename) +join_path_filenameW(const wchar_t *path_wide, const wchar_t *filename) { Py_ssize_t path_len; Py_ssize_t size; @@ -12208,7 +12210,7 @@ #ifdef MS_WINDOWS wchar_t *path_strW; #else - char *path; + const char *path; #endif iterator = PyObject_New(ScandirIterator, &ScandirIteratorType); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 09:58:34 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 07 May 2016 13:58:34 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogRml4IHNlbGYuZmFp?= =?utf-8?q?l=28=29_call_in_test=5Fdata=5Fheader?= Message-ID: <20160507135834.89111.18945.6D56F141@psf.io> https://hg.python.org/cpython/rev/52a23bdb7177 changeset: 101258:52a23bdb7177 branch: 3.5 parent: 101254:d1a33c93fa1b user: Berker Peksag date: Sat May 07 16:58:41 2016 +0300 summary: Fix self.fail() call in test_data_header files: Lib/test/test_urllibnet.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -185,7 +185,7 @@ try: time.strptime(datevalue, dateformat) except ValueError: - self.fail('Date value not in %r format', dateformat) + self.fail('Date value not in %r format' % dateformat) def test_reporthook(self): records = [] -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 09:58:34 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 07 May 2016 13:58:34 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Fix_self=2Efail=28=29_call_in_test=5Fdata=5Fheader?= Message-ID: <20160507135834.89117.11174.E14A6F81@psf.io> https://hg.python.org/cpython/rev/8d9f6c1f65f9 changeset: 101259:8d9f6c1f65f9 parent: 101257:7edf74098c76 parent: 101258:52a23bdb7177 user: Berker Peksag date: Sat May 07 16:59:01 2016 +0300 summary: Fix self.fail() call in test_data_header files: Lib/test/test_urllibnet.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -184,7 +184,7 @@ try: time.strptime(datevalue, dateformat) except ValueError: - self.fail('Date value not in %r format', dateformat) + self.fail('Date value not in %r format' % dateformat) def test_reporthook(self): records = [] -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 13:38:51 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 07 May 2016 17:38:51 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326924=3A_Do_not_d?= =?utf-8?q?efine_=5Fmultiprocessing=2Esem=5Funlink_under_Android?= Message-ID: <20160507173851.31189.87074.7267DB8F@psf.io> https://hg.python.org/cpython/rev/1030aa8357a7 changeset: 101260:1030aa8357a7 user: Berker Peksag date: Sat May 07 20:39:20 2016 +0300 summary: Issue #26924: Do not define _multiprocessing.sem_unlink under Android Android declares sem_unlink but doesn't implement it. files: Modules/_multiprocessing/multiprocessing.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -128,7 +128,7 @@ {"recv", multiprocessing_recv, METH_VARARGS, ""}, {"send", multiprocessing_send, METH_VARARGS, ""}, #endif -#ifndef POSIX_SEMAPHORES_NOT_ENABLED +#if defined(HAVE_SEM_UNLINK) && !defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__) {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""}, #endif {NULL} -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 7 14:13:22 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 07 May 2016 18:13:22 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326924=3A_Fix_Wind?= =?utf-8?q?ows_buildbots?= Message-ID: <20160507181322.42367.34039.F466E662@psf.io> https://hg.python.org/cpython/rev/eee959fee5f5 changeset: 101261:eee959fee5f5 user: Berker Peksag date: Sat May 07 21:13:50 2016 +0300 summary: Issue #26924: Fix Windows buildbots sem_unlink is defined as #define SEM_UNLINK(name) 0 under Windows. files: Modules/_multiprocessing/multiprocessing.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -128,7 +128,7 @@ {"recv", multiprocessing_recv, METH_VARARGS, ""}, {"send", multiprocessing_send, METH_VARARGS, ""}, #endif -#if defined(HAVE_SEM_UNLINK) && !defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__) +#if !defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__) {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""}, #endif {NULL} -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Sun May 8 05:04:22 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 08 May 2016 09:04:22 +0000 Subject: [Python-checkins] Daily reference leaks (eee959fee5f5): sum=-19 Message-ID: <20160508090422.130972.76983.B7D259D6@psf.io> results for eee959fee5f5 on branch "default" -------------------------------------------- test_asyncio leaked [0, 0, -17] references, sum=-17 test_asyncio leaked [0, 0, -6] memory blocks, sum=-6 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog60L1bw', '--timeout', '7200'] From python-checkins at python.org Sun May 8 07:59:29 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 08 May 2016 11:59:29 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2NTEy?= =?utf-8?q?=3A_Clarify_Integral=3B_tidy_up_table_of_rounding_functions?= Message-ID: <20160508115929.88888.36574.939B7230@psf.io> https://hg.python.org/cpython/rev/a69805edfadd changeset: 101264:a69805edfadd branch: 2.7 parent: 101256:806dfe65ddcf user: Martin Panter date: Sun May 08 12:47:37 2016 +0000 summary: Issue #26512: Clarify Integral; tidy up table of rounding functions Based on patch by Julien. files: Doc/library/stdtypes.rst | 29 +++++++++++++++------------ 1 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -393,19 +393,22 @@ All :class:`numbers.Real` types (:class:`int`, :class:`long`, and :class:`float`) also include the following operations: -+--------------------+------------------------------------+--------+ -| Operation | Result | Notes | -+====================+====================================+========+ -| ``math.trunc(x)`` | *x* truncated to Integral | | -+--------------------+------------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding ties away from zero. If n | | -| | is omitted, it defaults to 0. | | -+--------------------+------------------------------------+--------+ -| ``math.floor(x)`` | the greatest integral float <= *x* | | -+--------------------+------------------------------------+--------+ -| ``math.ceil(x)`` | the least integral float >= *x* | | -+--------------------+------------------------------------+--------+ ++--------------------+---------------------------------------------+ +| Operation | Result | ++====================+=============================================+ +| :func:`math.trunc(\| *x* truncated to :class:`~numbers.Integral` | +| x) ` | | ++--------------------+---------------------------------------------+ +| :func:`round(x[, | *x* rounded to *n* digits, | +| n]) ` | rounding ties away from zero. If *n* | +| | is omitted, it defaults to 0. | ++--------------------+---------------------------------------------+ +| :func:`math.floor(\| the greatest integer as a float <= *x* | +| x) ` | | ++--------------------+---------------------------------------------+ +| :func:`math.ceil(x)| the least integer as a float >= *x* | +| ` | | ++--------------------+---------------------------------------------+ .. XXXJH exceptions: overflow (when? what operations?) zerodivision -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 07:59:29 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 08 May 2016 11:59:29 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2NTEy?= =?utf-8?q?=3A_Clarify_Integral=3B_tidy_up_table_of_rounding_functions?= Message-ID: <20160508115928.9353.52667.BC65F148@psf.io> https://hg.python.org/cpython/rev/9e29034a41fa changeset: 101262:9e29034a41fa branch: 3.5 parent: 101258:52a23bdb7177 user: Martin Panter date: Sun May 08 12:22:37 2016 +0000 summary: Issue #26512: Clarify Integral; tidy up table of rounding functions Based on patch by Julien. files: Doc/library/stdtypes.rst | 29 +++++++++++++++------------ Modules/mathmodule.c | 8 +++--- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -361,19 +361,22 @@ All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: -+--------------------+------------------------------------+--------+ -| Operation | Result | Notes | -+====================+====================================+========+ -| ``math.trunc(x)`` | *x* truncated to Integral | | -+--------------------+------------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding half to even. If n is | | -| | omitted, it defaults to 0. | | -+--------------------+------------------------------------+--------+ -| ``math.floor(x)`` | the greatest integral float <= *x* | | -+--------------------+------------------------------------+--------+ -| ``math.ceil(x)`` | the least integral float >= *x* | | -+--------------------+------------------------------------+--------+ ++--------------------+---------------------------------------------+ +| Operation | Result | ++====================+=============================================+ +| :func:`math.trunc(\| *x* truncated to :class:`~numbers.Integral` | +| x) ` | | ++--------------------+---------------------------------------------+ +| :func:`round(x[, | *x* rounded to *n* digits, | +| n]) ` | rounding half to even. If *n* is | +| | omitted, it defaults to 0. | ++--------------------+---------------------------------------------+ +| :func:`math.floor(\| the greatest :class:`~numbers.Integral` | +| x) ` | <= *x* | ++--------------------+---------------------------------------------+ +| :func:`math.ceil(x)| the least :class:`~numbers.Integral` >= *x* | +| ` | | ++--------------------+---------------------------------------------+ For additional numeric operations see the :mod:`math` and :mod:`cmath` modules. diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -957,8 +957,8 @@ } PyDoc_STRVAR(math_ceil_doc, - "ceil(x)\n\nReturn the ceiling of x as an int.\n" - "This is the smallest integral value >= x."); + "ceil(x)\n\nReturn the ceiling of x as an Integral.\n" + "This is the smallest integer >= x."); FUNC2(copysign, copysign, "copysign(x, y)\n\nReturn a float with the magnitude (absolute value) " @@ -997,8 +997,8 @@ } PyDoc_STRVAR(math_floor_doc, - "floor(x)\n\nReturn the floor of x as an int.\n" - "This is the largest integral value <= x."); + "floor(x)\n\nReturn the floor of x as an Integral.\n" + "This is the largest integer <= x."); FUNC1A(gamma, m_tgamma, "gamma(x)\n\nGamma function at x.") -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 07:59:29 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 08 May 2016 11:59:29 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326512=3A_Merge_rounding_doc_from_3=2E5?= Message-ID: <20160508115928.15110.89825.C3C23B7B@psf.io> https://hg.python.org/cpython/rev/a8883951b2ff changeset: 101263:a8883951b2ff parent: 101261:eee959fee5f5 parent: 101262:9e29034a41fa user: Martin Panter date: Sun May 08 12:34:58 2016 +0000 summary: Issue #26512: Merge rounding doc from 3.5 files: Doc/library/stdtypes.rst | 29 +++++++++++++++------------ Modules/mathmodule.c | 8 +++--- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -361,19 +361,22 @@ All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: -+--------------------+------------------------------------+--------+ -| Operation | Result | Notes | -+====================+====================================+========+ -| ``math.trunc(x)`` | *x* truncated to Integral | | -+--------------------+------------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding half to even. If n is | | -| | omitted, it defaults to 0. | | -+--------------------+------------------------------------+--------+ -| ``math.floor(x)`` | the greatest integral float <= *x* | | -+--------------------+------------------------------------+--------+ -| ``math.ceil(x)`` | the least integral float >= *x* | | -+--------------------+------------------------------------+--------+ ++--------------------+---------------------------------------------+ +| Operation | Result | ++====================+=============================================+ +| :func:`math.trunc(\| *x* truncated to :class:`~numbers.Integral` | +| x) ` | | ++--------------------+---------------------------------------------+ +| :func:`round(x[, | *x* rounded to *n* digits, | +| n]) ` | rounding half to even. If *n* is | +| | omitted, it defaults to 0. | ++--------------------+---------------------------------------------+ +| :func:`math.floor(\| the greatest :class:`~numbers.Integral` | +| x) ` | <= *x* | ++--------------------+---------------------------------------------+ +| :func:`math.ceil(x)| the least :class:`~numbers.Integral` >= *x* | +| ` | | ++--------------------+---------------------------------------------+ For additional numeric operations see the :mod:`math` and :mod:`cmath` modules. diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -957,8 +957,8 @@ } PyDoc_STRVAR(math_ceil_doc, - "ceil(x)\n\nReturn the ceiling of x as an int.\n" - "This is the smallest integral value >= x."); + "ceil(x)\n\nReturn the ceiling of x as an Integral.\n" + "This is the smallest integer >= x."); FUNC2(copysign, copysign, "copysign(x, y)\n\nReturn a float with the magnitude (absolute value) " @@ -997,8 +997,8 @@ } PyDoc_STRVAR(math_floor_doc, - "floor(x)\n\nReturn the floor of x as an int.\n" - "This is the largest integral value <= x."); + "floor(x)\n\nReturn the floor of x as an Integral.\n" + "This is the largest integer <= x."); FUNC1A(gamma, m_tgamma, "gamma(x)\n\nGamma function at x.") -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 08:14:54 2016 From: python-checkins at python.org (steven.daprano) Date: Sun, 08 May 2016 12:14:54 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_26977=2C_remove_unne?= =?utf-8?q?eded_line_in_pvariance_=28duplicate_call_to_=5Fss=29=2E?= Message-ID: <20160508121454.15110.90273.B0D177A2@psf.io> https://hg.python.org/cpython/rev/2bf4a02f3570 changeset: 101265:2bf4a02f3570 parent: 101263:a8883951b2ff user: Steven D'Aprano date: Sun May 08 22:14:38 2016 +1000 summary: Issue 26977, remove unneeded line in pvariance (duplicate call to _ss). files: Lib/statistics.py | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/Lib/statistics.py b/Lib/statistics.py --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -593,7 +593,6 @@ n = len(data) if n < 1: raise StatisticsError('pvariance requires at least one data point') - ss = _ss(data, mu) T, ss = _ss(data, mu) return _convert(ss/n, T) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 09:18:26 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 08 May 2016 13:18:26 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Fix_typos_in_c?= =?utf-8?q?omments=2C_documentation_and_test_method_names?= Message-ID: <20160508131826.31201.19080.AABD15CB@psf.io> https://hg.python.org/cpython/rev/f6e8b2bbad31 changeset: 101268:f6e8b2bbad31 branch: 3.5 parent: 101262:9e29034a41fa user: Martin Panter date: Sun May 08 13:48:10 2016 +0000 summary: Fix typos in comments, documentation and test method names files: Doc/howto/logging-cookbook.rst | 2 +- Doc/reference/simple_stmts.rst | 2 +- Lib/http/cookiejar.py | 2 +- Lib/idlelib/ChangeLog | 2 +- Lib/test/test_descr.py | 2 +- Lib/test/test_module.py | 2 +- Lib/tkinter/__init__.py | 4 ++-- Lib/urllib/robotparser.py | 2 +- Mac/BuildScript/scripts/postflight.patch-profile | 4 ++-- Misc/NEWS | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -2231,7 +2231,7 @@ The example script has a simple function, ``foo``, which just cycles through all the logging levels, writing to ``sys.stderr`` to say what level it's about -to log at, and then actually logging a message that that level. You can pass a +to log at, and then actually logging a message at that level. You can pass a parameter to ``foo`` which, if true, will log at ERROR and CRITICAL levels - otherwise, it only logs at DEBUG, INFO and WARNING levels. diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -237,7 +237,7 @@ phase, causing less detailed error messages. Although the definition of assignment implies that overlaps between the -left-hand side and the right-hand side are 'simultanenous' (for example ``a, b = +left-hand side and the right-hand side are 'simultaneous' (for example ``a, b = b, a`` swaps two variables), overlaps *within* the collection of assigned-to variables occur left-to-right, sometimes resulting in confusion. For instance, the following program prints ``[0, 2]``:: diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -1841,7 +1841,7 @@ class LWPCookieJar(FileCookieJar): """ The LWPCookieJar saves a sequence of "Set-Cookie3" lines. - "Set-Cookie3" is the format used by the libwww-perl libary, not known + "Set-Cookie3" is the format used by the libwww-perl library, not known to be compatible with any browser, but which is easy to read and doesn't lose information about RFC 2965 cookies. diff --git a/Lib/idlelib/ChangeLog b/Lib/idlelib/ChangeLog --- a/Lib/idlelib/ChangeLog +++ b/Lib/idlelib/ChangeLog @@ -1574,7 +1574,7 @@ * Attic/PopupMenu.py: Pass a root to the help window. * SearchBinding.py: - Add parent argument to 'to to line number' dialog box. + Add parent argument to 'go to line number' dialog box. Sat Oct 10 19:15:32 1998 Guido van Rossum diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3489,7 +3489,7 @@ b.a = a z = deepcopy(a) # This blew up before - def test_unintialized_modules(self): + def test_uninitialized_modules(self): # Testing uninitialized module objects... from types import ModuleType as M m = M.__new__(M) diff --git a/Lib/test/test_module.py b/Lib/test/test_module.py --- a/Lib/test/test_module.py +++ b/Lib/test/test_module.py @@ -30,7 +30,7 @@ pass self.assertEqual(foo.__doc__, ModuleType.__doc__) - def test_unintialized_missing_getattr(self): + def test_uninitialized_missing_getattr(self): # Issue 8297 # test the text in the AttributeError of an uninitialized module foo = ModuleType.__new__(ModuleType) diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -1249,7 +1249,7 @@ nsign, b, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args # Missing: (a, c, d, m, o, v, B, R) e = Event() - # serial field: valid vor all events + # serial field: valid for all events # number of button: ButtonPress and ButtonRelease events only # height field: Configure, ConfigureRequest, Create, # ResizeRequest, and Expose events only @@ -1261,7 +1261,7 @@ # y field: "valid for events that contain a y field" # keysym as decimal: KeyPress and KeyRelease events only # x_root, y_root fields: ButtonPress, ButtonRelease, KeyPress, - # KeyRelease,and Motion events + # KeyRelease, and Motion events e.serial = getint(nsign) e.num = getint_event(b) try: e.focus = getboolean(f) diff --git a/Lib/urllib/robotparser.py b/Lib/urllib/robotparser.py --- a/Lib/urllib/robotparser.py +++ b/Lib/urllib/robotparser.py @@ -132,7 +132,7 @@ return True # Until the robots.txt file has been read or found not # to exist, we must assume that no url is allowable. - # This prevents false positives when a user erronenously + # This prevents false positives when a user erroneously # calls can_fetch() before calling read(). if not self.last_checked: return False diff --git a/Mac/BuildScript/scripts/postflight.patch-profile b/Mac/BuildScript/scripts/postflight.patch-profile --- a/Mac/BuildScript/scripts/postflight.patch-profile +++ b/Mac/BuildScript/scripts/postflight.patch-profile @@ -58,7 +58,7 @@ fi echo "" >> "${RC}" echo "# Setting PATH for Python ${PYVER}" >> "${RC}" - echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}" + echo "# The original version is saved in .cshrc.pysave" >> "${RC}" echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}" if [ `id -ur` = 0 ]; then chown "${USER}" "${RC}" @@ -90,7 +90,7 @@ fi echo "" >> "${PR}" echo "# Setting PATH for Python ${PYVER}" >> "${PR}" -echo "# The orginal version is saved in `basename ${PR}`.pysave" >> "${PR}" +echo "# The original version is saved in `basename ${PR}`.pysave" >> "${PR}" echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}" echo 'export PATH' >> "${PR}" if [ `id -ur` = 0 ]; then diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -2674,7 +2674,7 @@ is run with pythonw.exe. - Issue #21775: shutil.copytree(): fix crash when copying to VFAT. An exception - handler assumed that that OSError objects always have a 'winerror' attribute. + handler assumed that OSError objects always have a 'winerror' attribute. That is not the case, so the exception handler itself raised AttributeError when run on Linux (and, presumably, any other non-Windows OS). Patch by Greg Ward. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 09:18:26 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 08 May 2016 13:18:26 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Corrections_fo?= =?utf-8?q?r_a/an_in_code_comments_and_documentation?= Message-ID: <20160508131826.22577.62002.6B67603F@psf.io> https://hg.python.org/cpython/rev/1b4320232e61 changeset: 101267:1b4320232e61 branch: 2.7 user: Martin Panter date: Sun May 08 13:45:55 2016 +0000 summary: Corrections for a/an in code comments and documentation files: Demo/metaclasses/index.html | 2 +- Doc/c-api/string.rst | 2 +- Doc/library/codecs.rst | 2 +- Doc/library/ctypes.rst | 2 +- Doc/library/imageop.rst | 2 +- Doc/library/stdtypes.rst | 2 +- Include/memoryobject.h | 2 +- Include/pythonrun.h | 2 +- Lib/lib-tk/Tkinter.py | 2 +- Lib/test/test_imageop.py | 2 +- Mac/README | 2 +- Misc/cheatsheet | 2 +- Modules/audioop.c | 6 +++--- Objects/floatobject.c | 2 +- Objects/stringlib/formatter.h | 4 ++-- PC/pyconfig.h | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Demo/metaclasses/index.html b/Demo/metaclasses/index.html --- a/Demo/metaclasses/index.html +++ b/Demo/metaclasses/index.html @@ -222,7 +222,7 @@ means calling the metainstance, and this will return a real instance. And what class is that an instance of? Conceptually, it is of course an instance of our metainstance; but in most cases the Python runtime -system will see it as an instance of a a helper class used by the +system will see it as an instance of a helper class used by the metaclass to implement its (non-meta) instances...

Hopefully an example will make things clearer. Let's presume we diff --git a/Doc/c-api/string.rst b/Doc/c-api/string.rst --- a/Doc/c-api/string.rst +++ b/Doc/c-api/string.rst @@ -88,7 +88,7 @@ | :attr:`%%` | *n/a* | The literal % character. | +-------------------+---------------+--------------------------------+ | :attr:`%c` | int | A single character, | - | | | represented as an C int. | + | | | represented as a C int. | +-------------------+---------------+--------------------------------+ | :attr:`%d` | int | Exactly equivalent to | | | | ``printf("%d")``. | diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -909,7 +909,7 @@ * an ISO 8859 codeset -* a Microsoft Windows code page, which is typically derived from a 8859 codeset, +* a Microsoft Windows code page, which is typically derived from an 8859 codeset, but replaces control characters with additional graphic characters * an IBM EBCDIC code page diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1873,7 +1873,7 @@ allows specifying the size of the array if the length of the string should not be used. - If the first parameter is a 8-bit string, it is converted into a unicode string + If the first parameter is an 8-bit string, it is converted into a unicode string according to ctypes conversion rules. diff --git a/Doc/library/imageop.rst b/Doc/library/imageop.rst --- a/Doc/library/imageop.rst +++ b/Doc/library/imageop.rst @@ -49,7 +49,7 @@ .. function:: grey2mono(image, width, height, threshold) - Convert a 8-bit deep greyscale image to a 1-bit deep image by thresholding all + Convert an 8-bit deep greyscale image to a 1-bit deep image by thresholding all the pixels. The resulting image is tightly packed and is probably only useful as an argument to :func:`mono2grey`. diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2749,7 +2749,7 @@ .. attribute:: shape A tuple of integers the length of :attr:`ndim` giving the shape of the - memory as a N-dimensional array. + memory as an N-dimensional array. .. attribute:: ndim diff --git a/Include/memoryobject.h b/Include/memoryobject.h --- a/Include/memoryobject.h +++ b/Include/memoryobject.h @@ -33,7 +33,7 @@ original buffer if a copy must be made. If buffertype is PyBUF_WRITE and the buffer is not contiguous an error will be raised. In this circumstance, the user can use - PyBUF_SHADOW to ensure that a a writable temporary + PyBUF_SHADOW to ensure that a writable temporary contiguous buffer is returned. The contents of this contiguous buffer will be copied back into the original object after the memoryview object is deleted as long as diff --git a/Include/pythonrun.h b/Include/pythonrun.h --- a/Include/pythonrun.h +++ b/Include/pythonrun.h @@ -155,7 +155,7 @@ /* Stack size, in "pointers" (so we get extra safety margins on 64-bit platforms). On a 32-bit platform, this translates - to a 8k margin. */ + to an 8k margin. */ #define PYOS_STACK_MARGIN 2048 #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300 diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -1252,7 +1252,7 @@ # time field: "valid for events that contain a time field" # width field: Configure, ConfigureRequest, Create, ResizeRequest, # and Expose events only - # x field: "valid for events that contain a x field" + # x field: "valid for events that contain an x field" # y field: "valid for events that contain a y field" # keysym as decimal: KeyPress and KeyRelease events only # x_root, y_root fields: ButtonPress, ButtonRelease, KeyPress, diff --git a/Lib/test/test_imageop.py b/Lib/test/test_imageop.py --- a/Lib/test/test_imageop.py +++ b/Lib/test/test_imageop.py @@ -121,7 +121,7 @@ print 'grey2rgb' image = imageop.grey2rgb(greyimage, width, height) - # Convert a 8-bit deep greyscale image to a 1-bit deep image by + # Convert an 8-bit deep greyscale image to a 1-bit deep image by # thresholding all the pixels. The resulting image is tightly packed # and is probably only useful as an argument to mono2grey. if verbose: diff --git a/Mac/README b/Mac/README --- a/Mac/README +++ b/Mac/README @@ -125,7 +125,7 @@ To build a universal binary that includes a 64-bit architecture, you must build on a system running OS X 10.5 or later. The ``all`` and ``64-bit`` flavors can -only be built with an 10.5 SDK because ``ppc64`` support was only included with +only be built with a 10.5 SDK because ``ppc64`` support was only included with OS X 10.5. Although legacy ``ppc`` support was included with Xcode 3 on OS X 10.6, it was removed in Xcode 4, versions of which were released on OS X 10.6 and which is the standard for OS X 10.7. To summarize, the diff --git a/Misc/cheatsheet b/Misc/cheatsheet --- a/Misc/cheatsheet +++ b/Misc/cheatsheet @@ -1053,7 +1053,7 @@ recommanded to use the following form:if isinstance(x, types.StringType): etc... unichr(code) code. -unicode(string[, Creates a Unicode string from a 8-bit string, using +unicode(string[, Creates a Unicode string from an 8-bit string, using encoding[, error thegiven encoding name and error treatment ('strict', ]]]) 'ignore',or 'replace'}. Without arguments, returns a dictionary correspondingto the diff --git a/Modules/audioop.c b/Modules/audioop.c --- a/Modules/audioop.c +++ b/Modules/audioop.c @@ -55,7 +55,7 @@ */ #define BIAS 0x84 /* define the add-in bias for 16 bit samples */ #define CLIP 32635 -#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ +#define SIGN_BIT (0x80) /* Sign bit for an A-law byte. */ #define QUANT_MASK (0xf) /* Quantization field mask. */ #define SEG_SHIFT (4) /* Left shift for segment number. */ #define SEG_MASK (0x70) /* Segment field mask. */ @@ -229,8 +229,8 @@ }; /* - * linear2alaw() accepts an 13-bit signed integer and encodes it as A-law data - * stored in a unsigned char. This function should only be called with + * linear2alaw() accepts a 13-bit signed integer and encodes it as A-law data + * stored in an unsigned char. This function should only be called with * the data shifted such that it only contains information in the lower * 13-bits. * diff --git a/Objects/floatobject.c b/Objects/floatobject.c --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -407,7 +407,7 @@ * may lose info from fractional bits. Converting the integer to a double * also has two failure modes: (1) a long int may trigger overflow (too * large to fit in the dynamic range of a C double); (2) even a C long may have - * more bits than fit in a C double (e.g., on a a 64-bit box long may have + * more bits than fit in a C double (e.g., on a 64-bit box long may have * 63 bits of precision, but a C double probably has only 53), and then * we can falsely claim equality when low-order integer bits are lost by * coercion to double. So this part is painful too. diff --git a/Objects/stringlib/formatter.h b/Objects/stringlib/formatter.h --- a/Objects/stringlib/formatter.h +++ b/Objects/stringlib/formatter.h @@ -995,7 +995,7 @@ if (precision < 0) precision = default_precision; - /* Cast "type", because if we're in unicode we need to pass a + /* Cast "type", because if we're in unicode we need to pass an 8-bit char. This is safe, because we've restricted what "type" can be. */ buf = PyOS_double_to_string(val, (char)type, precision, flags, @@ -1175,7 +1175,7 @@ if (precision < 0) precision = default_precision; - /* Cast "type", because if we're in unicode we need to pass a + /* Cast "type", because if we're in unicode we need to pass an 8-bit char. This is safe, because we've restricted what "type" can be. */ re_buf = PyOS_double_to_string(re, (char)type, precision, flags, diff --git a/PC/pyconfig.h b/PC/pyconfig.h --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -368,7 +368,7 @@ # define SIZEOF_FPOS_T 8 # define SIZEOF_HKEY 4 # define SIZEOF_SIZE_T 4 - /* MS VS2005 changes time_t to an 64-bit type on all platforms */ + /* MS VS2005 changes time_t to a 64-bit type on all platforms */ # if defined(_MSC_VER) && _MSC_VER >= 1400 # define SIZEOF_TIME_T 8 # else -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 09:18:27 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 08 May 2016 13:18:27 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Fix_typos_in_c?= =?utf-8?q?omments=2C_documentation_and_test_method_names?= Message-ID: <20160508131826.130972.80695.25A174C6@psf.io> https://hg.python.org/cpython/rev/5efcd5e9470f changeset: 101266:5efcd5e9470f branch: 2.7 parent: 101264:a69805edfadd user: Martin Panter date: Sun May 08 13:18:25 2016 +0000 summary: Fix typos in comments, documentation and test method names files: Doc/howto/logging-cookbook.rst | 2 +- Doc/library/logging.handlers.rst | 2 +- Lib/_LWPCookieJar.py | 2 +- Lib/idlelib/ChangeLog | 2 +- Lib/lib-tk/Tkinter.py | 4 ++-- Lib/robotparser.py | 2 +- Lib/test/test_descr.py | 2 +- Mac/BuildScript/scripts/postflight.patch-profile | 4 ++-- Misc/HISTORY | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -1247,7 +1247,7 @@ The example script has a simple function, ``foo``, which just cycles through all the logging levels, writing to ``sys.stderr`` to say what level it's about -to log at, and then actually logging a message that that level. You can pass a +to log at, and then actually logging a message at that level. You can pass a parameter to ``foo`` which, if true, will log at ERROR and CRITICAL levels - otherwise, it only logs at DEBUG, INFO and WARNING levels. diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst --- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -349,7 +349,7 @@ .. method:: createSocket() Tries to create a socket; on failure, uses an exponential back-off - algorithm. On intial failure, the handler will drop the message it was + algorithm. On initial failure, the handler will drop the message it was trying to send. When subsequent messages are handled by the same instance, it will not try connecting until some time has passed. The default parameters are such that the initial delay is one second, and if diff --git a/Lib/_LWPCookieJar.py b/Lib/_LWPCookieJar.py --- a/Lib/_LWPCookieJar.py +++ b/Lib/_LWPCookieJar.py @@ -49,7 +49,7 @@ class LWPCookieJar(FileCookieJar): """ The LWPCookieJar saves a sequence of "Set-Cookie3" lines. - "Set-Cookie3" is the format used by the libwww-perl libary, not known + "Set-Cookie3" is the format used by the libwww-perl library, not known to be compatible with any browser, but which is easy to read and doesn't lose information about RFC 2965 cookies. diff --git a/Lib/idlelib/ChangeLog b/Lib/idlelib/ChangeLog --- a/Lib/idlelib/ChangeLog +++ b/Lib/idlelib/ChangeLog @@ -1574,7 +1574,7 @@ * Attic/PopupMenu.py: Pass a root to the help window. * SearchBinding.py: - Add parent argument to 'to to line number' dialog box. + Add parent argument to 'go to line number' dialog box. Sat Oct 10 19:15:32 1998 Guido van Rossum diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -1244,7 +1244,7 @@ nsign, b, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args # Missing: (a, c, d, m, o, v, B, R) e = Event() - # serial field: valid vor all events + # serial field: valid for all events # number of button: ButtonPress and ButtonRelease events only # height field: Configure, ConfigureRequest, Create, # ResizeRequest, and Expose events only @@ -1256,7 +1256,7 @@ # y field: "valid for events that contain a y field" # keysym as decimal: KeyPress and KeyRelease events only # x_root, y_root fields: ButtonPress, ButtonRelease, KeyPress, - # KeyRelease,and Motion events + # KeyRelease, and Motion events e.serial = getint(nsign) e.num = getint_event(b) try: e.focus = getboolean(f) diff --git a/Lib/robotparser.py b/Lib/robotparser.py --- a/Lib/robotparser.py +++ b/Lib/robotparser.py @@ -136,7 +136,7 @@ # Until the robots.txt file has been read or found not # to exist, we must assume that no url is allowable. - # This prevents false positives when a user erronenously + # This prevents false positives when a user erroneously # calls can_fetch() before calling read(). if not self.last_checked: return False diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3723,7 +3723,7 @@ b.a = a z = deepcopy(a) # This blew up before - def test_unintialized_modules(self): + def test_uninitialized_modules(self): # Testing uninitialized module objects... from types import ModuleType as M m = M.__new__(M) diff --git a/Mac/BuildScript/scripts/postflight.patch-profile b/Mac/BuildScript/scripts/postflight.patch-profile --- a/Mac/BuildScript/scripts/postflight.patch-profile +++ b/Mac/BuildScript/scripts/postflight.patch-profile @@ -58,7 +58,7 @@ fi echo "" >> "${RC}" echo "# Setting PATH for Python ${PYVER}" >> "${RC}" - echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}" + echo "# The original version is saved in .cshrc.pysave" >> "${RC}" echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}" if [ `id -ur` = 0 ]; then chown "${USER}" "${RC}" @@ -90,7 +90,7 @@ fi echo "" >> "${PR}" echo "# Setting PATH for Python ${PYVER}" >> "${PR}" -echo "# The orginal version is saved in `basename ${PR}`.pysave" >> "${PR}" +echo "# The original version is saved in `basename ${PR}`.pysave" >> "${PR}" echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}" echo 'export PATH' >> "${PR}" if [ `id -ur` = 0 ]; then diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -3134,7 +3134,7 @@ - When method objects have an attribute that can be satisfied either by the function object or by the method object, the function object's attribute usually wins. Christian Tismer pointed out that - that this is really a mistake, because this only happens for special + this is really a mistake, because this only happens for special methods (like __reduce__) where the method object's version is really more appropriate than the function's attribute. So from now on, all method attributes will have precedence over function -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 09:18:27 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 08 May 2016 13:18:27 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Corrections_fo?= =?utf-8?q?r_a/an_in_code_comments_and_documentation?= Message-ID: <20160508131826.9140.29560.88BC59A6@psf.io> https://hg.python.org/cpython/rev/d783cbef73fb changeset: 101269:d783cbef73fb branch: 3.5 user: Martin Panter date: Sun May 08 13:53:41 2016 +0000 summary: Corrections for a/an in code comments and documentation files: Doc/library/codecs.rst | 2 +- Include/pythonrun.h | 2 +- Lib/pickletools.py | 8 ++++---- Lib/tkinter/__init__.py | 2 +- Mac/README | 2 +- Modules/arraymodule.c | 2 +- Modules/audioop.c | 4 ++-- PC/pyconfig.h | 2 +- Python/formatter_unicode.c | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -977,7 +977,7 @@ * an ISO 8859 codeset -* a Microsoft Windows code page, which is typically derived from a 8859 codeset, +* a Microsoft Windows code page, which is typically derived from an 8859 codeset, but replaces control characters with additional graphic characters * an IBM EBCDIC code page diff --git a/Include/pythonrun.h b/Include/pythonrun.h --- a/Include/pythonrun.h +++ b/Include/pythonrun.h @@ -176,7 +176,7 @@ /* Stack size, in "pointers" (so we get extra safety margins on 64-bit platforms). On a 32-bit platform, this translates - to a 8k margin. */ + to an 8k margin. */ #define PYOS_STACK_MARGIN 2048 #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300 diff --git a/Lib/pickletools.py b/Lib/pickletools.py --- a/Lib/pickletools.py +++ b/Lib/pickletools.py @@ -590,7 +590,7 @@ reader=read_bytes8, doc="""A counted bytes string. - The first argument is a 8-byte little-endian unsigned int giving + The first argument is an 8-byte little-endian unsigned int giving the number of bytes, and the second argument is that many bytes. """) @@ -734,7 +734,7 @@ reader=read_unicodestring8, doc="""A counted Unicode string. - The first argument is a 8-byte little-endian signed int + The first argument is an 8-byte little-endian signed int giving the number of bytes in the string, and the second argument-- the UTF-8 encoding of the Unicode string -- contains that many bytes. @@ -1330,7 +1330,7 @@ proto=4, doc="""Push a Python bytes object. - There are two arguments: the first is a 8-byte unsigned int giving + There are two arguments: the first is an 8-byte unsigned int giving the number of bytes in the string, and the second is that many bytes, which are taken literally as the string content. """), @@ -1417,7 +1417,7 @@ proto=4, doc="""Push a Python Unicode string object. - There are two arguments: the first is a 8-byte little-endian signed int + There are two arguments: the first is an 8-byte little-endian signed int giving the number of bytes in the string. The second is that many bytes, and is the UTF-8 encoding of the Unicode string. """), diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -1257,7 +1257,7 @@ # time field: "valid for events that contain a time field" # width field: Configure, ConfigureRequest, Create, ResizeRequest, # and Expose events only - # x field: "valid for events that contain a x field" + # x field: "valid for events that contain an x field" # y field: "valid for events that contain a y field" # keysym as decimal: KeyPress and KeyRelease events only # x_root, y_root fields: ButtonPress, ButtonRelease, KeyPress, diff --git a/Mac/README b/Mac/README --- a/Mac/README +++ b/Mac/README @@ -126,7 +126,7 @@ To build a universal binary that includes a 64-bit architecture, you must build on a system running OS X 10.5 or later. The ``all`` and ``64-bit`` flavors can -only be built with an 10.5 SDK because ``ppc64`` support was only included with +only be built with a 10.5 SDK because ``ppc64`` support was only included with OS X 10.5. Although legacy ``ppc`` support was included with Xcode 3 on OS X 10.6, it was removed in Xcode 4, versions of which were released on OS X 10.6 and which is the standard for OS X 10.7. To summarize, the diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -2090,7 +2090,7 @@ * that fits better. This may result in an array with narrower * or wider elements. * - * For example, if a 32-bit machine pickles a L-code array of + * For example, if a 32-bit machine pickles an L-code array of * unsigned longs, then the array will be unpickled by 64-bit * machine as an I-code array of unsigned ints. * diff --git a/Modules/audioop.c b/Modules/audioop.c --- a/Modules/audioop.c +++ b/Modules/audioop.c @@ -46,7 +46,7 @@ */ #define BIAS 0x84 /* define the add-in bias for 16 bit samples */ #define CLIP 32635 -#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ +#define SIGN_BIT (0x80) /* Sign bit for an A-law byte. */ #define QUANT_MASK (0xf) /* Quantization field mask. */ #define SEG_SHIFT (4) /* Left shift for segment number. */ #define SEG_MASK (0x70) /* Segment field mask. */ @@ -217,7 +217,7 @@ }; /* - * linear2alaw() accepts an 13-bit signed integer and encodes it as A-law data + * linear2alaw() accepts a 13-bit signed integer and encodes it as A-law data * stored in an unsigned char. This function should only be called with * the data shifted such that it only contains information in the lower * 13-bits. diff --git a/PC/pyconfig.h b/PC/pyconfig.h --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -347,7 +347,7 @@ # define SIZEOF_FPOS_T 8 # define SIZEOF_HKEY 4 # define SIZEOF_SIZE_T 4 - /* MS VS2005 changes time_t to an 64-bit type on all platforms */ + /* MS VS2005 changes time_t to a 64-bit type on all platforms */ # if defined(_MSC_VER) && _MSC_VER >= 1400 # define SIZEOF_TIME_T 8 # else diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -1042,7 +1042,7 @@ else if (type == 'r') type = 'g'; - /* Cast "type", because if we're in unicode we need to pass a + /* Cast "type", because if we're in unicode we need to pass an 8-bit char. This is safe, because we've restricted what "type" can be. */ buf = PyOS_double_to_string(val, (char)type, precision, flags, @@ -1221,7 +1221,7 @@ else if (type == 'r') type = 'g'; - /* Cast "type", because if we're in unicode we need to pass a + /* Cast "type", because if we're in unicode we need to pass an 8-bit char. This is safe, because we've restricted what "type" can be. */ re_buf = PyOS_double_to_string(re, (char)type, precision, flags, -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 09:18:27 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 08 May 2016 13:18:27 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_typo_fixes_from_3=2E5?= Message-ID: <20160508131826.123432.90696.B465744D@psf.io> https://hg.python.org/cpython/rev/c61d2c43d22e changeset: 101270:c61d2c43d22e parent: 101265:2bf4a02f3570 parent: 101269:d783cbef73fb user: Martin Panter date: Sun May 08 14:02:35 2016 +0000 summary: Merge typo fixes from 3.5 files: Doc/howto/logging-cookbook.rst | 2 +- Doc/library/codecs.rst | 2 +- Doc/reference/simple_stmts.rst | 2 +- Include/pythonrun.h | 2 +- Lib/http/cookiejar.py | 2 +- Lib/idlelib/ChangeLog | 2 +- Lib/pickletools.py | 8 ++++---- Lib/test/test_descr.py | 2 +- Lib/test/test_module.py | 2 +- Lib/tkinter/__init__.py | 6 +++--- Lib/urllib/robotparser.py | 2 +- Mac/BuildScript/scripts/postflight.patch-profile | 4 ++-- Mac/README | 2 +- Misc/NEWS | 2 +- Modules/arraymodule.c | 2 +- Modules/audioop.c | 4 ++-- PC/pyconfig.h | 2 +- Python/formatter_unicode.c | 4 ++-- 18 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -2231,7 +2231,7 @@ The example script has a simple function, ``foo``, which just cycles through all the logging levels, writing to ``sys.stderr`` to say what level it's about -to log at, and then actually logging a message that that level. You can pass a +to log at, and then actually logging a message at that level. You can pass a parameter to ``foo`` which, if true, will log at ERROR and CRITICAL levels - otherwise, it only logs at DEBUG, INFO and WARNING levels. diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -977,7 +977,7 @@ * an ISO 8859 codeset -* a Microsoft Windows code page, which is typically derived from a 8859 codeset, +* a Microsoft Windows code page, which is typically derived from an 8859 codeset, but replaces control characters with additional graphic characters * an IBM EBCDIC code page diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -237,7 +237,7 @@ phase, causing less detailed error messages. Although the definition of assignment implies that overlaps between the -left-hand side and the right-hand side are 'simultanenous' (for example ``a, b = +left-hand side and the right-hand side are 'simultaneous' (for example ``a, b = b, a`` swaps two variables), overlaps *within* the collection of assigned-to variables occur left-to-right, sometimes resulting in confusion. For instance, the following program prints ``[0, 2]``:: diff --git a/Include/pythonrun.h b/Include/pythonrun.h --- a/Include/pythonrun.h +++ b/Include/pythonrun.h @@ -176,7 +176,7 @@ /* Stack size, in "pointers" (so we get extra safety margins on 64-bit platforms). On a 32-bit platform, this translates - to a 8k margin. */ + to an 8k margin. */ #define PYOS_STACK_MARGIN 2048 #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300 diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -1841,7 +1841,7 @@ class LWPCookieJar(FileCookieJar): """ The LWPCookieJar saves a sequence of "Set-Cookie3" lines. - "Set-Cookie3" is the format used by the libwww-perl libary, not known + "Set-Cookie3" is the format used by the libwww-perl library, not known to be compatible with any browser, but which is easy to read and doesn't lose information about RFC 2965 cookies. diff --git a/Lib/idlelib/ChangeLog b/Lib/idlelib/ChangeLog --- a/Lib/idlelib/ChangeLog +++ b/Lib/idlelib/ChangeLog @@ -1574,7 +1574,7 @@ * Attic/PopupMenu.py: Pass a root to the help window. * SearchBinding.py: - Add parent argument to 'to to line number' dialog box. + Add parent argument to 'go to line number' dialog box. Sat Oct 10 19:15:32 1998 Guido van Rossum diff --git a/Lib/pickletools.py b/Lib/pickletools.py --- a/Lib/pickletools.py +++ b/Lib/pickletools.py @@ -590,7 +590,7 @@ reader=read_bytes8, doc="""A counted bytes string. - The first argument is a 8-byte little-endian unsigned int giving + The first argument is an 8-byte little-endian unsigned int giving the number of bytes, and the second argument is that many bytes. """) @@ -734,7 +734,7 @@ reader=read_unicodestring8, doc="""A counted Unicode string. - The first argument is a 8-byte little-endian signed int + The first argument is an 8-byte little-endian signed int giving the number of bytes in the string, and the second argument-- the UTF-8 encoding of the Unicode string -- contains that many bytes. @@ -1330,7 +1330,7 @@ proto=4, doc="""Push a Python bytes object. - There are two arguments: the first is a 8-byte unsigned int giving + There are two arguments: the first is an 8-byte unsigned int giving the number of bytes in the string, and the second is that many bytes, which are taken literally as the string content. """), @@ -1417,7 +1417,7 @@ proto=4, doc="""Push a Python Unicode string object. - There are two arguments: the first is a 8-byte little-endian signed int + There are two arguments: the first is an 8-byte little-endian signed int giving the number of bytes in the string. The second is that many bytes, and is the UTF-8 encoding of the Unicode string. """), diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3489,7 +3489,7 @@ b.a = a z = deepcopy(a) # This blew up before - def test_unintialized_modules(self): + def test_uninitialized_modules(self): # Testing uninitialized module objects... from types import ModuleType as M m = M.__new__(M) diff --git a/Lib/test/test_module.py b/Lib/test/test_module.py --- a/Lib/test/test_module.py +++ b/Lib/test/test_module.py @@ -30,7 +30,7 @@ pass self.assertEqual(foo.__doc__, ModuleType.__doc__) - def test_unintialized_missing_getattr(self): + def test_uninitialized_missing_getattr(self): # Issue 8297 # test the text in the AttributeError of an uninitialized module foo = ModuleType.__new__(ModuleType) diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -1248,7 +1248,7 @@ nsign, b, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args # Missing: (a, c, d, m, o, v, B, R) e = Event() - # serial field: valid vor all events + # serial field: valid for all events # number of button: ButtonPress and ButtonRelease events only # height field: Configure, ConfigureRequest, Create, # ResizeRequest, and Expose events only @@ -1256,11 +1256,11 @@ # time field: "valid for events that contain a time field" # width field: Configure, ConfigureRequest, Create, ResizeRequest, # and Expose events only - # x field: "valid for events that contain a x field" + # x field: "valid for events that contain an x field" # y field: "valid for events that contain a y field" # keysym as decimal: KeyPress and KeyRelease events only # x_root, y_root fields: ButtonPress, ButtonRelease, KeyPress, - # KeyRelease,and Motion events + # KeyRelease, and Motion events e.serial = getint(nsign) e.num = getint_event(b) try: e.focus = getboolean(f) diff --git a/Lib/urllib/robotparser.py b/Lib/urllib/robotparser.py --- a/Lib/urllib/robotparser.py +++ b/Lib/urllib/robotparser.py @@ -153,7 +153,7 @@ return True # Until the robots.txt file has been read or found not # to exist, we must assume that no url is allowable. - # This prevents false positives when a user erronenously + # This prevents false positives when a user erroneously # calls can_fetch() before calling read(). if not self.last_checked: return False diff --git a/Mac/BuildScript/scripts/postflight.patch-profile b/Mac/BuildScript/scripts/postflight.patch-profile --- a/Mac/BuildScript/scripts/postflight.patch-profile +++ b/Mac/BuildScript/scripts/postflight.patch-profile @@ -58,7 +58,7 @@ fi echo "" >> "${RC}" echo "# Setting PATH for Python ${PYVER}" >> "${RC}" - echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}" + echo "# The original version is saved in .cshrc.pysave" >> "${RC}" echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}" if [ `id -ur` = 0 ]; then chown "${USER}" "${RC}" @@ -90,7 +90,7 @@ fi echo "" >> "${PR}" echo "# Setting PATH for Python ${PYVER}" >> "${PR}" -echo "# The orginal version is saved in `basename ${PR}`.pysave" >> "${PR}" +echo "# The original version is saved in `basename ${PR}`.pysave" >> "${PR}" echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}" echo 'export PATH' >> "${PR}" if [ `id -ur` = 0 ]; then diff --git a/Mac/README b/Mac/README --- a/Mac/README +++ b/Mac/README @@ -126,7 +126,7 @@ To build a universal binary that includes a 64-bit architecture, you must build on a system running OS X 10.5 or later. The ``all`` and ``64-bit`` flavors can -only be built with an 10.5 SDK because ``ppc64`` support was only included with +only be built with a 10.5 SDK because ``ppc64`` support was only included with OS X 10.5. Although legacy ``ppc`` support was included with Xcode 3 on OS X 10.6, it was removed in Xcode 4, versions of which were released on OS X 10.6 and which is the standard for OS X 10.7. To summarize, the diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -3308,7 +3308,7 @@ is run with pythonw.exe. - Issue #21775: shutil.copytree(): fix crash when copying to VFAT. An exception - handler assumed that that OSError objects always have a 'winerror' attribute. + handler assumed that OSError objects always have a 'winerror' attribute. That is not the case, so the exception handler itself raised AttributeError when run on Linux (and, presumably, any other non-Windows OS). Patch by Greg Ward. diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -2090,7 +2090,7 @@ * that fits better. This may result in an array with narrower * or wider elements. * - * For example, if a 32-bit machine pickles a L-code array of + * For example, if a 32-bit machine pickles an L-code array of * unsigned longs, then the array will be unpickled by 64-bit * machine as an I-code array of unsigned ints. * diff --git a/Modules/audioop.c b/Modules/audioop.c --- a/Modules/audioop.c +++ b/Modules/audioop.c @@ -46,7 +46,7 @@ */ #define BIAS 0x84 /* define the add-in bias for 16 bit samples */ #define CLIP 32635 -#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ +#define SIGN_BIT (0x80) /* Sign bit for an A-law byte. */ #define QUANT_MASK (0xf) /* Quantization field mask. */ #define SEG_SHIFT (4) /* Left shift for segment number. */ #define SEG_MASK (0x70) /* Segment field mask. */ @@ -219,7 +219,7 @@ }; /* - * linear2alaw() accepts an 13-bit signed integer and encodes it as A-law data + * linear2alaw() accepts a 13-bit signed integer and encodes it as A-law data * stored in an unsigned char. This function should only be called with * the data shifted such that it only contains information in the lower * 13-bits. diff --git a/PC/pyconfig.h b/PC/pyconfig.h --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -347,7 +347,7 @@ # define SIZEOF_FPOS_T 8 # define SIZEOF_HKEY 4 # define SIZEOF_SIZE_T 4 - /* MS VS2005 changes time_t to an 64-bit type on all platforms */ + /* MS VS2005 changes time_t to a 64-bit type on all platforms */ # if defined(_MSC_VER) && _MSC_VER >= 1400 # define SIZEOF_TIME_T 8 # else diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -1042,7 +1042,7 @@ else if (type == 'r') type = 'g'; - /* Cast "type", because if we're in unicode we need to pass a + /* Cast "type", because if we're in unicode we need to pass an 8-bit char. This is safe, because we've restricted what "type" can be. */ buf = PyOS_double_to_string(val, (char)type, precision, flags, @@ -1221,7 +1221,7 @@ else if (type == 'r') type = 'g'; - /* Cast "type", because if we're in unicode we need to pass a + /* Cast "type", because if we're in unicode we need to pass an 8-bit char. This is safe, because we've restricted what "type" can be. */ re_buf = PyOS_double_to_string(re, (char)type, precision, flags, -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 13:47:16 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 17:47:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2323815=3A_Fixed_crashes_related_to_directly_crea?= =?utf-8?q?ted_instances_of_types_in?= Message-ID: <20160508174716.42347.65620.E90813F2@psf.io> https://hg.python.org/cpython/rev/1c6326e81c33 changeset: 101272:1c6326e81c33 parent: 101270:c61d2c43d22e parent: 101271:cd25508c62fc user: Serhiy Storchaka date: Sun May 08 20:46:55 2016 +0300 summary: Issue #23815: Fixed crashes related to directly created instances of types in _tkinter and curses.panel modules. files: Lib/test/test_curses.py | 4 ++++ Lib/test/test_tcl.py | 2 ++ Misc/NEWS | 3 +++ Modules/_curses_panel.c | 7 ++++--- Modules/_tkinter.c | 3 +++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -285,6 +285,10 @@ panel.set_userptr(A()) panel.set_userptr(None) + def test_new_curses_panel(self): + panel = curses.panel.new_panel(self.stdscr) + self.assertRaises(TypeError, type(panel)) + @unittest.skipUnless(hasattr(curses, 'resizeterm'), 'resizeterm not available') def test_resize_term(self): diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -649,6 +649,8 @@ expected = {'a': (1, 2, 3), 'something': 'foo', 'status': ''} self.assertEqual(splitdict(tcl, arg), expected) + def test_new_tcl_obj(self): + self.assertRaises(TypeError, _tkinter.Tcl_Obj) class BigmemTclTest(unittest.TestCase): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -265,6 +265,9 @@ Library ------- +- Issue #23815: Fixed crashes related to directly created instances of types in + _tkinter and curses.panel modules. + - Issue #17765: weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl. diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -506,10 +506,11 @@ d = PyModule_GetDict(m); /* Initialize object type */ - _curses_panelstate(m)->PyCursesPanel_Type = \ - PyType_FromSpec(&PyCursesPanel_Type_spec); - if (_curses_panelstate(m)->PyCursesPanel_Type == NULL) + v = PyType_FromSpec(&PyCursesPanel_Type_spec); + if (v == NULL) goto fail; + ((PyTypeObject *)v)->tp_new = NULL; + _curses_panelstate(m)->PyCursesPanel_Type = v; import_curses(); if (PyErr_Occurred()) diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -3544,6 +3544,7 @@ Py_DECREF(m); return NULL; } + ((PyTypeObject *)o)->tp_new = NULL; if (PyModule_AddObject(m, "TkappType", o)) { Py_DECREF(o); Py_DECREF(m); @@ -3556,6 +3557,7 @@ Py_DECREF(m); return NULL; } + ((PyTypeObject *)o)->tp_new = NULL; if (PyModule_AddObject(m, "TkttType", o)) { Py_DECREF(o); Py_DECREF(m); @@ -3568,6 +3570,7 @@ Py_DECREF(m); return NULL; } + ((PyTypeObject *)o)->tp_new = NULL; if (PyModule_AddObject(m, "Tcl_Obj", o)) { Py_DECREF(o); Py_DECREF(m); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 13:47:16 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 17:47:16 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzIzODE1?= =?utf-8?q?=3A_Fixed_crashes_related_to_directly_created_instances_of_type?= =?utf-8?q?s_in?= Message-ID: <20160508174716.42377.82705.92F4727C@psf.io> https://hg.python.org/cpython/rev/cd25508c62fc changeset: 101271:cd25508c62fc branch: 3.5 parent: 101269:d783cbef73fb user: Serhiy Storchaka date: Sun May 08 20:46:22 2016 +0300 summary: Issue #23815: Fixed crashes related to directly created instances of types in _tkinter and curses.panel modules. files: Lib/test/test_curses.py | 4 ++++ Lib/test/test_tcl.py | 2 ++ Misc/NEWS | 3 +++ Modules/_curses_panel.c | 7 ++++--- Modules/_tkinter.c | 3 +++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -285,6 +285,10 @@ panel.set_userptr(A()) panel.set_userptr(None) + def test_new_curses_panel(self): + panel = curses.panel.new_panel(self.stdscr) + self.assertRaises(TypeError, type(panel)) + @unittest.skipUnless(hasattr(curses, 'resizeterm'), 'resizeterm not available') def test_resize_term(self): diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -649,6 +649,8 @@ expected = {'a': (1, 2, 3), 'something': 'foo', 'status': ''} self.assertEqual(splitdict(tcl, arg), expected) + def test_new_tcl_obj(self): + self.assertRaises(TypeError, _tkinter.Tcl_Obj) class BigmemTclTest(unittest.TestCase): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -116,6 +116,9 @@ Library ------- +- Issue #23815: Fixed crashes related to directly created instances of types in + _tkinter and curses.panel modules. + - Issue #17765: weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl. diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -506,10 +506,11 @@ d = PyModule_GetDict(m); /* Initialize object type */ - _curses_panelstate(m)->PyCursesPanel_Type = \ - PyType_FromSpec(&PyCursesPanel_Type_spec); - if (_curses_panelstate(m)->PyCursesPanel_Type == NULL) + v = PyType_FromSpec(&PyCursesPanel_Type_spec); + if (v == NULL) goto fail; + ((PyTypeObject *)v)->tp_new = NULL; + _curses_panelstate(m)->PyCursesPanel_Type = v; import_curses(); if (PyErr_Occurred()) diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -3551,6 +3551,7 @@ Py_DECREF(m); return NULL; } + ((PyTypeObject *)o)->tp_new = NULL; if (PyModule_AddObject(m, "TkappType", o)) { Py_DECREF(o); Py_DECREF(m); @@ -3563,6 +3564,7 @@ Py_DECREF(m); return NULL; } + ((PyTypeObject *)o)->tp_new = NULL; if (PyModule_AddObject(m, "TkttType", o)) { Py_DECREF(o); Py_DECREF(m); @@ -3575,6 +3577,7 @@ Py_DECREF(m); return NULL; } + ((PyTypeObject *)o)->tp_new = NULL; if (PyModule_AddObject(m, "Tcl_Obj", o)) { Py_DECREF(o); Py_DECREF(m); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 15:00:26 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 19:00:26 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326156=3A_Make_expressions_grammar_description_m?= =?utf-8?q?ore_semantically_correct=2E?= Message-ID: <20160508190026.21011.70748.D8059AEA@psf.io> https://hg.python.org/cpython/rev/61e3160310ae changeset: 101274:61e3160310ae parent: 101272:1c6326e81c33 parent: 101273:e876ff4e9e95 user: Serhiy Storchaka date: Sun May 08 22:00:09 2016 +0300 summary: Issue #26156: Make expressions grammar description more semantically correct. files: Doc/reference/expressions.rst | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -821,7 +821,7 @@ Can only be used inside a :term:`coroutine function`. .. productionlist:: - await: ["await"] `primary` + await_expr: "await" `primary` .. versionadded:: 3.5 @@ -835,7 +835,7 @@ less tightly than unary operators on its right. The syntax is: .. productionlist:: - power: `await` ["**" `u_expr`] + power: ( `await_expr` | `primary` ) ["**" `u_expr`] Thus, in an unparenthesized sequence of power and unary operators, the operators are evaluated from right to left (this does not constrain the evaluation order -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 15:00:26 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 19:00:26 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2MTU2?= =?utf-8?q?=3A_Make_expressions_grammar_description_more_semantically_corr?= =?utf-8?q?ect=2E?= Message-ID: <20160508190026.31201.63880.07BFDBA2@psf.io> https://hg.python.org/cpython/rev/e876ff4e9e95 changeset: 101273:e876ff4e9e95 branch: 3.5 parent: 101271:cd25508c62fc user: Serhiy Storchaka date: Sun May 08 21:59:46 2016 +0300 summary: Issue #26156: Make expressions grammar description more semantically correct. files: Doc/reference/expressions.rst | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -821,7 +821,7 @@ Can only be used inside a :term:`coroutine function`. .. productionlist:: - await: ["await"] `primary` + await_expr: "await" `primary` .. versionadded:: 3.5 @@ -835,7 +835,7 @@ less tightly than unary operators on its right. The syntax is: .. productionlist:: - power: `await` ["**" `u_expr`] + power: ( `await_expr` | `primary` ) ["**" `u_expr`] Thus, in an unparenthesized sequence of power and unary operators, the operators are evaluated from right to left (this does not constrain the evaluation order -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 16:37:05 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 20:37:05 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2318531=3A_Single_v?= =?utf-8?q?ar-keyword_argument_of_dict_subtype_was_passed?= Message-ID: <20160508203704.31189.45642.B5339F02@psf.io> https://hg.python.org/cpython/rev/e4835b1ed7b1 changeset: 101275:e4835b1ed7b1 user: Serhiy Storchaka date: Sun May 08 23:36:44 2016 +0300 summary: Issue #18531: Single var-keyword argument of dict subtype was passed unscathed to the C-defined function. Now it is converted to exact dict. files: Lib/test/test_getargs2.py | 56 +++++++++++++++++++++++++++ Misc/NEWS | 3 + Modules/_testcapimodule.c | 22 ++++++++++ Python/ceval.c | 2 +- 4 files changed, 82 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -70,6 +70,12 @@ def __int__(self): return True +class TupleSubclass(tuple): + pass + +class DictSubclass(dict): + pass + class Unsigned_TestCase(unittest.TestCase): def test_b(self): @@ -321,6 +327,33 @@ class Tuple_TestCase(unittest.TestCase): + def test_args(self): + from _testcapi import get_args + + ret = get_args(1, 2) + self.assertEqual(ret, (1, 2)) + self.assertIs(type(ret), tuple) + + ret = get_args(1, *(2, 3)) + self.assertEqual(ret, (1, 2, 3)) + self.assertIs(type(ret), tuple) + + ret = get_args(*[1, 2]) + self.assertEqual(ret, (1, 2)) + self.assertIs(type(ret), tuple) + + ret = get_args(*TupleSubclass([1, 2])) + self.assertEqual(ret, (1, 2)) + self.assertIs(type(ret), tuple) + + ret = get_args() + self.assertIn(ret, ((), None)) + self.assertIn(type(ret), (tuple, type(None))) + + ret = get_args(*()) + self.assertIn(ret, ((), None)) + self.assertIn(type(ret), (tuple, type(None))) + def test_tuple(self): from _testcapi import getargs_tuple @@ -336,6 +369,29 @@ self.assertRaises(TypeError, getargs_tuple, 1, seq()) class Keywords_TestCase(unittest.TestCase): + def test_kwargs(self): + from _testcapi import get_kwargs + + ret = get_kwargs(a=1, b=2) + self.assertEqual(ret, {'a': 1, 'b': 2}) + self.assertIs(type(ret), dict) + + ret = get_kwargs(a=1, **{'b': 2, 'c': 3}) + self.assertEqual(ret, {'a': 1, 'b': 2, 'c': 3}) + self.assertIs(type(ret), dict) + + ret = get_kwargs(**DictSubclass({'a': 1, 'b': 2})) + self.assertEqual(ret, {'a': 1, 'b': 2}) + self.assertIs(type(ret), dict) + + ret = get_kwargs() + self.assertIn(ret, ({}, None)) + self.assertIn(type(ret), (dict, type(None))) + + ret = get_kwargs(**{}) + self.assertIn(ret, ({}, None)) + self.assertIn(type(ret), (dict, type(None))) + def test_positional_args(self): # using all positional args self.assertEqual( diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #18531: Single var-keyword argument of dict subtype was passed + unscathed to the C-defined function. Now it is converted to exact dict. + - Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL pointer. diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -872,6 +872,26 @@ #endif /* ifdef HAVE_LONG_LONG */ +static PyObject * +get_args(PyObject *self, PyObject *args) +{ + if (args == NULL) { + args = Py_None; + } + Py_INCREF(args); + return args; +} + +static PyObject * +get_kwargs(PyObject *self, PyObject *args, PyObject *kwargs) +{ + if (kwargs == NULL) { + kwargs = Py_None; + } + Py_INCREF(kwargs); + return kwargs; +} + /* Test tuple argument processing */ static PyObject * getargs_tuple(PyObject *self, PyObject *args) @@ -3784,6 +3804,8 @@ {"test_pep3118_obsolete_write_locks", (PyCFunction)test_pep3118_obsolete_write_locks, METH_NOARGS}, #endif {"getbuffer_with_null_view", getbuffer_with_null_view, METH_O}, + {"get_args", get_args, METH_VARARGS}, + {"get_kwargs", (PyCFunction)get_kwargs, METH_VARARGS|METH_KEYWORDS}, {"getargs_tuple", getargs_tuple, METH_VARARGS}, {"getargs_keywords", (PyCFunction)getargs_keywords, METH_VARARGS|METH_KEYWORDS}, diff --git a/Python/ceval.c b/Python/ceval.c --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4993,7 +4993,7 @@ if (flags & CALL_FLAG_KW) { kwdict = EXT_POP(*pp_stack); - if (!PyDict_Check(kwdict)) { + if (!PyDict_CheckExact(kwdict)) { PyObject *d; d = PyDict_New(); if (d == NULL) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 16:46:20 2016 From: python-checkins at python.org (brett.cannon) Date: Sun, 08 May 2016 20:46:20 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Update_status_of_GH_migration?= Message-ID: <20160508204620.42351.7225.3BDB0BB0@psf.io> https://hg.python.org/peps/rev/5b67d0028fc7 changeset: 6314:5b67d0028fc7 user: Brett Cannon date: Sun May 08 13:46:14 2016 -0700 summary: Update status of GH migration files: pep-0512.txt | 98 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 93 insertions(+), 5 deletions(-) diff --git a/pep-0512.txt b/pep-0512.txt --- a/pep-0512.txt +++ b/pep-0512.txt @@ -12,6 +12,7 @@ Abstract ======== + This PEP outlines the steps required to migrate Python's development process from Mercurial [#hg]_ as hosted at hg.python.org [#h.p.o]_ to Git [#git]_ on GitHub [#GitHub]_. Meeting @@ -19,8 +20,10 @@ process of Python to be as productive as it currently is, and meeting its extended goals should improve it. + Rationale ========= + In 2014, it became obvious that Python's custom development process was becoming a hindrance. As an example, for an external contributor to submit a fix for a bug that eventually was committed, @@ -104,8 +107,10 @@ that if an external contributor chooses not to use GitHub then they will continue to have that option. + Repositories to Migrate ======================= + While hg.python.org [#h.p.o]_ hosts many repositories, there are only five key repositories that should move: @@ -122,6 +127,7 @@ Migration Plan ============== + The migration plan is separated into sections based on what is required to migrate the repositories listed in the `Repositories to Migrate`_ section. Completion of requirements @@ -129,16 +135,20 @@ repositories. The sections are expected to be completed in order, but not necessarily the requirements within a section. + Requirements for Code-Only Repositories --------------------------------------- + Completion of the requirements in this section will allow the devinabox and benchmarks repositories to move to GitHub. While devinabox has a sufficiently descriptive name, the benchmarks repository does not; therefore, it will be named "python-benchmarks". + Create a 'Python core' team ''''''''''''''''''''''''''' + To manage permissions, a 'Python core' team will be created as part of the python organization [#github-python-org]_. Any repository that is moved will have the 'Python core' team added to it with write @@ -146,15 +156,19 @@ manage SSH keys on hg.python.org will become a team maintainer for the 'Python core' team. + Define commands to move a Mercurial repository to Git ''''''''''''''''''''''''''''''''''''''''''''''''''''' + Since moving to GitHub also entails moving to Git [#git]_, we must decide what tools and commands we will run to translate a Mercurial repository to Git. The exact tools and steps to use are an open issue; see `Tools and commands to move from Mercurial to Git`_. + CLA enforcement ''''''''''''''' + A key part of any open source project is making sure that its source code can be properly licensed. This requires making sure all people making contributions have signed a contributor license agreement @@ -165,8 +179,10 @@ off with automated checking and enforcement of contributors signing the CLA. + Adding GitHub username support to bugs.python.org +++++++++++++++++++++++++++++++++++++++++++++++++ + To keep tracking of CLA signing under the direct control of the PSF, tracking who has signed the PSF CLA will be continued by marking that fact as part of someone's bugs.python.org user profile. What this @@ -185,8 +201,10 @@ and a ``true`` value if they have sigend the CLA, ``false`` if they have not, and ``null`` if no corresponding GitHub username was found. + A bot to enforce CLA signing ++++++++++++++++++++++++++++ + With an association between someone's GitHub account and their bugs.python.org [#b.p.o]_ account, which has the data as to whether someone has signed the CLA, a bot can monitor pull requests on @@ -211,8 +229,10 @@ showcase for asynchronous programming. The code for the bot is hosted in the Knights Who Say Ni project [#ni]_. + Requirements for Web-Related Repositories ----------------------------------------- + Due to their use for generating webpages, the devguide [#devguide-repo]_ and peps [#peps-repo]_ repositories need their respective processes updated to pull from their new Git @@ -223,16 +243,20 @@ when viewed in isolation from the python organization [#github-python-org]_. + Requirements for the cpython Repository --------------------------------------- + Obviously the most active and important repository currently hosted at hg.python.org [#h.p.o]_ is the cpython repository [#cpython-repo]_. Because of its importance and high- frequency use, it requires more tooling before being moved to GitHub compared to the other repositories mentioned in this PEP. + Document steps to commit a pull request ''''''''''''''''''''''''''''''''''''''' + During the process of choosing a new development workflow, it was decided that a linear history is desired. People preferred having a single commit representing a single change instead of having a set of @@ -262,8 +286,10 @@ core developers is an open issue: `Git CLI commands for committing a pull request to cpython`_. + Handling Misc/NEWS '''''''''''''''''' + Traditionally the ``Misc/NEWS`` file [#news-file]_ has been problematic for changes which spanned Python releases. Often times there will be merge conflicts when committing a change between e.g., 3.5 and 3.6 @@ -278,8 +304,10 @@ ``Misc/NEWS`` problem which are discussed in an open issue: `How to handle the Misc/NEWS file`_. + Handling Misc/ACKS '''''''''''''''''' + Traditionally the ``Misc/ACKS`` file [#acks-file]_ has been managed by hand. But thanks to Git supporting an ``author`` value as well as a ``committer`` value per commit, authorship of a commit can be part @@ -305,8 +333,10 @@ start of the message led to a comment being posted to the issue linking to the commit. + Linking a pull request to an issue ++++++++++++++++++++++++++++++++++ + An association between a pull request and an issue is needed to track when a fix has been proposed. The association needs to be many-to-one as there can take multiple pull requests to solve a single issue @@ -324,13 +354,17 @@ could lead to incorrect associations if the wrong issue or referencing another issue was done, but these are rare occasions. + Notify the issue if the pull request is committed +++++++++++++++++++++++++++++++++++++++++++++++++ + Once a pull request is closed (merged or not), the issue should be updated to reflect this fact. + Update linking service for mapping commit IDs to URLs ''''''''''''''''''''''''''''''''''''''''''''''''''''' + Currently you can use https://hg.python.org/lookup/ with a revision ID from either the Subversion or Mercurial copies of the cpython repo [#cpython-repo]_ to get redirected to the URL for that @@ -338,14 +372,18 @@ be updated to redirect to the Git repository and to support the new revision IDs created for the Git repository. + Create https://git.python.org ''''''''''''''''''''''''''''' + Just as hg.python.org [#h.p.o]_ currently points to the Mercurial repository for Python, git.python.org should do the equivalent for the Git repository. + Backup of pull request data ''''''''''''''''''''''''''' + Since GitHub [#github]_ is going to be used for code hosting and code review, those two things need to be backed up. In the case of code hosting, the backup is implicit as all non-shallow Git [#git]_ clones @@ -359,25 +397,33 @@ GitHub to some other code review system is feasible were GitHub to disappear overnight. + Deprecate sys._mercurial '''''''''''''''''''''''' + Once Python is no longer kept in Mercurial, the ``sys._mercurial`` attribute will need to be changed to return ``('CPython', '', '')``. An equivalent ``sys._git`` attribute will be added which fulfills the same use-cases. + Update the devguide ''''''''''''''''''' + The devguide will need to be updated with details of the new workflow. Mostly likely work will take place in a separate branch until the migration actually occurs. + Update PEP 101 '''''''''''''' + The release process will need to be updated as necessary. + Optional, Planned Features -------------------------- + Once the cpython repository [#cpython-repo]_ is migrated, all repositories will have been moved to GitHub [#github]_ and the development process should be on equal footing as before. But a key @@ -389,8 +435,10 @@ bugs.python.org [#b.p.o]_ -- which includes plans independent of this migration -- are tracked on their own wiki page [#tracker-plans]_. + Bot to handle pull request merging '''''''''''''''''''''''''''''''''' + As stated in the section entitled "`Document steps to commit a pull request`_", the desire is to maintain a linear history for cpython. Unfortunately, @@ -419,8 +467,10 @@ The name given to this bot in order to give it commands is an open issue: `Naming the bots`_. + Continuous integration per pull request ''''''''''''''''''''''''''''''''''''''' + To help speed up pull request approvals, continuous integration testing should be used. This helps mitigate the need for a core developer to download a patch simply to run the test suite against @@ -429,8 +479,10 @@ Which free CI service to use is an open issue: `Choosing a CI service`_. + Test coverage report '''''''''''''''''''' + Getting an up-to-date test coverage report for Python's standard library would be extremely beneficial as generating such a report can take quite a while to produce. @@ -439,8 +491,10 @@ coverage for open source projects. Which option is best is an open issue: `Choosing a test coverage service`_. + Notifying issues of pull request comments ''''''''''''''''''''''''''''''''''''''''' + The current development process does not include notifying an issue on bugs.python.org [#b.p.o]_ when a review comment is left on Rietveld [#rietveld]_. It would be nice to fix this so that people @@ -454,14 +508,18 @@ notifications while still making sure that those only following bugs.python.org know when there might be a review comment to address. + Allow bugs.python.org to use GitHub as a login provider ''''''''''''''''''''''''''''''''''''''''''''''''''''''' + As of right now, bugs.python.org [#b.p.o]_ allows people to log in using Google, Launchpad, or OpenID credentials. It would be good to expand this to GitHub credentials. + Web hooks for re-generating web content ''''''''''''''''''''''''''''''''''''''' + The content at https://docs.python.org/, https://docs.python.org/devguide, and https://www.python.org/dev/peps/ are all derived from files kept in @@ -470,16 +528,20 @@ rebuilding the appropriate web content when the files they are based on change instead of having to wait for, e.g., a cronjob to trigger. + Link web content back to files that it is generated from '''''''''''''''''''''''''''''''''''''''''''''''''''''''' + It would be helpful for people who find issues with any of the documentation that is generated from a file to have a link on each page which points back to the file on GitHub [#github]_ that stores the content of the page. That would allow for quick pull requests to fix simple things such as spelling mistakes. + Splitting out parts of the documentation into their own repositories '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + While certain parts of the documentation at https://docs.python.org change with the code, other parts are fairly static and are not tightly bound to the CPython code itself. The following sections of @@ -505,15 +567,19 @@ What's New (potentially through a label added to PRs, like "What's New needed"). + Backup of Git repositories '''''''''''''''''''''''''' + While not necessary, it would be good to have official backups of the various Git repositories for disaster protection. It will be up to the PSF infrastructure committee to decide if this is worthwhile or unnecessary. + Identify potential new core developers '''''''''''''''''''''''''''''''''''''' + The Python development team has long-standing guidelines for selecting new core developers. The key part of the guidelines is that a person needs to have contributed multiple patches which have been @@ -528,14 +594,10 @@ Status ====== + Requirements for migrating the devinabox [#devinabox-repo]_ and benchmarks [#benchmarks-repo]_ repositories: -* In progress - - - `Define commands to move a Mercurial repository to Git`_: - https://github.com/orsenthil/cpython-hg-to-git (Senthil Kumaran) - * Completed - `Adding GitHub username support to bugs.python.org`_ @@ -543,6 +605,8 @@ - `A bot to enforce CLA signing`_: https://github.com/python/the-knights-who-say-ni (Brett Cannon) - `Create a 'Python core' team`_ + - `Define commands to move a Mercurial repository to Git`_: + https://github.com/orsenthil/cpython-hg-to-git (Senthil Kumaran) Repositories whose build steps need updating: @@ -606,15 +670,19 @@ - None + Open Issues =========== + For this PEP, open issues are ones where a decision needs to be made to how to approach or solve a problem. Open issues do not entail coordination issues such as who is going to write a certain bit of code. + The fate of hg.python.org ------------------------- + With the code repositories moving over to Git [#git]_, there is no technical need to keep hg.python.org [#h.p.o]_ running. Having said that, some in the community would like to have it stay functioning as @@ -630,8 +698,10 @@ either be forced to migration or they can choose to simply stay on hg.python.org. + Tools and commands to move from Mercurial to Git ------------------------------------------------ + A decision needs to be made on exactly what tooling and what commands involving those tools will be used to convert a Mercurial repository to Git. Currently a suggestion has been made to use @@ -639,8 +709,10 @@ https://github.com/felipec/git-remote-hg. Finally, http://hg-git.github.io/ has been suggested. + Git CLI commands for committing a pull request to cpython --------------------------------------------------------- + Because Git [#git]_ may be a new version control system for core developers, the commands people are expected to run will need to be written down. These commands also need to keep a linear history while @@ -651,8 +723,10 @@ history will be kept implicitly, but it will need to make sure to keep/add attribution. + How to handle the Misc/NEWS file -------------------------------- + There are three competing approaches to handling ``Misc/NEWS`` [#news-file]_. One is to add a news entry for issues on bugs.python.org [#b.p.o]_. This would mean an issue that is marked @@ -701,8 +775,10 @@ run the risk, though, of failure and thus blocking a commit until it can be manually resolved. + Naming the bots --------------- + As naming things can lead to bikeshedding of epic proportions, Brett Cannon will choose the final name of the various bots (the name of the project for the bots themselves can be anything, this is purely @@ -713,6 +789,7 @@ Choosing a CI service --------------------- + There are various CI services that provide free support for open source projects hosted on GitHub [#github]_. Two such examples are Travis [#travis]_ and Codeship [#codeship]_. Whatever solution is @@ -726,8 +803,10 @@ bugs.python.org [#b.p.o]_. The results can be viewed at https://ci.centos.org/job/cPython-build-patch/ . + Choosing a test coverage service -------------------------------- + Getting basic test coverage of Python's standard library can be created simply by using coverage.py [#coverage]_. Getting thorough test coverage is actually quite tricky, with the details @@ -738,10 +817,13 @@ Free test coverage services include Coveralls [#coveralls]_ and Codecov [#codecov]_. + Rejected Ideas ============== + Separate Python 2 and Python 3 repositories ------------------------------------------- + It was discussed whether separate repositories for Python 2 and Python 3 were desired. The thinking was that this would shrink the overall repository size which benefits people with slow Internet @@ -750,8 +832,10 @@ In the end it was decided that it was easier logistically to simply keep all of CPython's history in a single repository. + Commit multi-release changes in bugfix branch first --------------------------------------------------- + As the current development process has changes committed in the oldest branch first and then merged up to the default branch, the question came up as to whether this workflow should be perpetuated. @@ -776,8 +860,10 @@ Cherry-picking should decouple this so that you don't have to rush your multi-branch changes as the cherry-pick can be done separately. + Deriving ``Misc/NEWS`` from the commit logs ------------------------------------------- + As part of the discussion surrounding `Handling Misc/NEWS`_, the suggestion has come up of deriving the file from the commit logs itself. In this scenario, the first line of a commit message would be @@ -793,6 +879,7 @@ References ========== + .. [#h.p.o] https://hg.python.org .. [#GitHub] GitHub (https://github.com) @@ -889,6 +976,7 @@ .. [#ni] The Knights Who Say Ni project (https://github.com/python/the-knights-who-say-ni) + Copyright ========= -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Sun May 8 17:02:31 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 21:02:31 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2ODgx?= =?utf-8?q?=3A_modulefinder_now_works_with_bytecode_with_extended_args=2E?= Message-ID: <20160508210231.130799.30873.5DF177A4@psf.io> https://hg.python.org/cpython/rev/f06baed1bb0c changeset: 101278:f06baed1bb0c branch: 2.7 parent: 101267:1b4320232e61 user: Serhiy Storchaka date: Mon May 09 00:02:06 2016 +0300 summary: Issue #26881: modulefinder now works with bytecode with extended args. files: Lib/modulefinder.py | 83 ++++++++++++---------- Lib/test/test_modulefinder.py | 13 +++ Misc/NEWS | 2 + 3 files changed, 60 insertions(+), 38 deletions(-) diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -16,12 +16,32 @@ # remain compatible with Python < 2.3 READ_MODE = "r" -LOAD_CONST = chr(dis.opname.index('LOAD_CONST')) -IMPORT_NAME = chr(dis.opname.index('IMPORT_NAME')) -STORE_NAME = chr(dis.opname.index('STORE_NAME')) -STORE_GLOBAL = chr(dis.opname.index('STORE_GLOBAL')) -STORE_OPS = [STORE_NAME, STORE_GLOBAL] -HAVE_ARGUMENT = chr(dis.HAVE_ARGUMENT) +LOAD_CONST = dis.opmap['LOAD_CONST'] +IMPORT_NAME = dis.opmap['IMPORT_NAME'] +STORE_NAME = dis.opmap['STORE_NAME'] +STORE_GLOBAL = dis.opmap['STORE_GLOBAL'] +STORE_OPS = STORE_NAME, STORE_GLOBAL +HAVE_ARGUMENT = dis.HAVE_ARGUMENT +EXTENDED_ARG = dis.EXTENDED_ARG + +def _unpack_opargs(code): + # enumerate() is not an option, since we sometimes process + # multiple elements on a single pass through the loop + extended_arg = 0 + n = len(code) + i = 0 + while i < n: + op = ord(code[i]) + offset = i + i = i+1 + arg = None + if op >= HAVE_ARGUMENT: + arg = ord(code[i]) + ord(code[i+1])*256 + extended_arg + extended_arg = 0 + i = i+2 + if op == EXTENDED_ARG: + extended_arg = arg*65536 + yield (offset, op, arg) # Modulefinder does a good job at simulating Python's, but it can not # handle __path__ modifications packages make at runtime. Therefore there @@ -344,53 +364,40 @@ code = co.co_code names = co.co_names consts = co.co_consts - while code: - c = code[0] + opargs = [(op, arg) for _, op, arg in _unpack_opargs(code) + if op != EXTENDED_ARG] + for i, (op, oparg) in enumerate(opargs): if c in STORE_OPS: - oparg, = unpack('= 1 + and opargs[i-1][0] == LOAD_CONST): + fromlist = consts[opargs[i-1][1]] + yield "import", (fromlist, names[oparg]) continue - if c >= HAVE_ARGUMENT: - code = code[3:] - else: - code = code[1:] - def scan_opcodes_25(self, co, - unpack = struct.unpack): + def scan_opcodes_25(self, co): # Scan the code, and yield 'interesting' opcode combinations - # Python 2.5 version (has absolute and relative imports) code = co.co_code names = co.co_names consts = co.co_consts - LOAD_LOAD_AND_IMPORT = LOAD_CONST + LOAD_CONST + IMPORT_NAME - while code: - c = code[0] - if c in STORE_OPS: - oparg, = unpack('= 2 + and opargs[i-1][0] == opargs[i-2][0] == LOAD_CONST): + level = consts[opargs[i-2][1]] + fromlist = consts[opargs[i-1][1]] if level == -1: # normal import - yield "import", (consts[oparg_2], names[oparg_3]) + yield "import", (fromlist, names[oparg]) elif level == 0: # absolute import - yield "absolute_import", (consts[oparg_2], names[oparg_3]) + yield "absolute_import", (fromlist, names[oparg]) else: # relative import - yield "relative_import", (level, consts[oparg_2], names[oparg_3]) - code = code[9:] + yield "relative_import", (level, fromlist, names[oparg]) continue - if c >= HAVE_ARGUMENT: - code = code[3:] - else: - code = code[1:] def scan_code(self, co, m): code = co.co_code diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -278,6 +278,19 @@ def test_relative_imports_3(self): self._do_test(relative_import_test_3) + def test_extended_opargs(self): + extended_opargs_test = [ + "a", + ["a", "b"], + [], [], + """\ +a.py + %r + import b +b.py +""" % range(2**16)] # 2**16 constants + self._do_test(extended_opargs_test) + def test_main(): distutils.log.set_threshold(distutils.log.WARN) test_support.run_unittest(ModuleFinderTest) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -77,6 +77,8 @@ Library ------- +- Issue #26881: modulefinder now works with bytecode with extended args. + - Issue #17765: weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 17:02:30 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 21:02:30 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2ODgx?= =?utf-8?q?=3A_The_modulefinder_module_now_supports_extended_opcode_argume?= =?utf-8?q?nts=2E?= Message-ID: <20160508210230.13775.7624.48E076DE@psf.io> https://hg.python.org/cpython/rev/3579cdaf56d9 changeset: 101276:3579cdaf56d9 branch: 3.5 parent: 101273:e876ff4e9e95 user: Serhiy Storchaka date: Sun May 08 23:43:50 2016 +0300 summary: Issue #26881: The modulefinder module now supports extended opcode arguments. files: Lib/dis.py | 59 ++++++++++------------ Lib/modulefinder.py | 45 +++++++---------- Lib/test/test_modulefinder.py | 13 +++++ Misc/NEWS | 4 + 4 files changed, 63 insertions(+), 58 deletions(-) diff --git a/Lib/dis.py b/Lib/dis.py --- a/Lib/dis.py +++ b/Lib/dis.py @@ -275,31 +275,17 @@ """ labels = findlabels(code) - extended_arg = 0 starts_line = None free = None - # enumerate() is not an option, since we sometimes process - # multiple elements on a single pass through the loop - n = len(code) - i = 0 - while i < n: - op = code[i] - offset = i + for offset, op, arg in _unpack_opargs(code): if linestarts is not None: - starts_line = linestarts.get(i, None) + starts_line = linestarts.get(offset, None) if starts_line is not None: starts_line += line_offset - is_jump_target = i in labels - i = i+1 - arg = None + is_jump_target = offset in labels argval = None argrepr = '' - if op >= HAVE_ARGUMENT: - arg = code[i] + code[i+1]*256 + extended_arg - extended_arg = 0 - i = i+2 - if op == EXTENDED_ARG: - extended_arg = arg*65536 + if arg is not None: # Set argval to the dereferenced value of the argument when # availabe, and argrepr to the string representation of argval. # _disassemble_bytes needs the string repr of the @@ -310,7 +296,7 @@ elif op in hasname: argval, argrepr = _get_name_info(arg, names) elif op in hasjrel: - argval = i + arg + argval = offset + 3 + arg argrepr = "to " + repr(argval) elif op in haslocal: argval, argrepr = _get_name_info(arg, varnames) @@ -320,7 +306,7 @@ elif op in hasfree: argval, argrepr = _get_name_info(arg, cells) elif op in hasnargs: - argrepr = "%d positional, %d keyword pair" % (code[i-2], code[i-1]) + argrepr = "%d positional, %d keyword pair" % (arg%256, arg//256) yield Instruction(opname[op], op, arg, argval, argrepr, offset, starts_line, is_jump_target) @@ -356,6 +342,25 @@ disco = disassemble # XXX For backwards compatibility +def _unpack_opargs(code): + # enumerate() is not an option, since we sometimes process + # multiple elements on a single pass through the loop + extended_arg = 0 + n = len(code) + i = 0 + while i < n: + op = code[i] + offset = i + i = i+1 + arg = None + if op >= HAVE_ARGUMENT: + arg = code[i] + code[i+1]*256 + extended_arg + extended_arg = 0 + i = i+2 + if op == EXTENDED_ARG: + extended_arg = arg*65536 + yield (offset, op, arg) + def findlabels(code): """Detect all offsets in a byte code which are jump targets. @@ -363,19 +368,11 @@ """ labels = [] - # enumerate() is not an option, since we sometimes process - # multiple elements on a single pass through the loop - n = len(code) - i = 0 - while i < n: - op = code[i] - i = i+1 - if op >= HAVE_ARGUMENT: - arg = code[i] + code[i+1]*256 - i = i+2 + for offset, op, arg in _unpack_opargs(code): + if arg is not None: label = -1 if op in hasjrel: - label = i+arg + label = offset + 3 + arg elif op in hasjabs: label = arg if label >= 0: diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -13,13 +13,12 @@ warnings.simplefilter('ignore', PendingDeprecationWarning) import imp -# XXX Clean up once str8's cstor matches bytes. -LOAD_CONST = bytes([dis.opname.index('LOAD_CONST')]) -IMPORT_NAME = bytes([dis.opname.index('IMPORT_NAME')]) -STORE_NAME = bytes([dis.opname.index('STORE_NAME')]) -STORE_GLOBAL = bytes([dis.opname.index('STORE_GLOBAL')]) -STORE_OPS = [STORE_NAME, STORE_GLOBAL] -HAVE_ARGUMENT = bytes([dis.HAVE_ARGUMENT]) +LOAD_CONST = dis.opmap['LOAD_CONST'] +IMPORT_NAME = dis.opmap['IMPORT_NAME'] +STORE_NAME = dis.opmap['STORE_NAME'] +STORE_GLOBAL = dis.opmap['STORE_GLOBAL'] +STORE_OPS = STORE_NAME, STORE_GLOBAL +EXTENDED_ARG = dis.EXTENDED_ARG # Modulefinder does a good job at simulating Python's, but it can not # handle __path__ modifications packages make at runtime. Therefore there @@ -337,38 +336,30 @@ fullname = name + "." + sub self._add_badmodule(fullname, caller) - def scan_opcodes_25(self, co, - unpack = struct.unpack): + def scan_opcodes(self, co): # Scan the code, and yield 'interesting' opcode combinations - # Python 2.5 version (has absolute and relative imports) code = co.co_code names = co.co_names consts = co.co_consts - LOAD_LOAD_AND_IMPORT = LOAD_CONST + LOAD_CONST + IMPORT_NAME - while code: - c = bytes([code[0]]) - if c in STORE_OPS: - oparg, = unpack('= 2 + and opargs[i-1][0] == opargs[i-2][0] == LOAD_CONST): + level = consts[opargs[i-2][1]] + fromlist = consts[opargs[i-1][1]] if level == 0: # absolute import - yield "absolute_import", (consts[oparg_2], names[oparg_3]) + yield "absolute_import", (fromlist, names[oparg]) else: # relative import - yield "relative_import", (level, consts[oparg_2], names[oparg_3]) - code = code[9:] + yield "relative_import", (level, fromlist, names[oparg]) continue - if c >= HAVE_ARGUMENT: - code = code[3:] - else: - code = code[1:] def scan_code(self, co, m): code = co.co_code - scanner = self.scan_opcodes_25 + scanner = self.scan_opcodes for what, args in scanner(co): if what == "store": name, = args diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -319,6 +319,19 @@ expected = "co_filename %r changed to %r" % (old_path, new_path) self.assertIn(expected, output) + def test_extended_opargs(self): + extended_opargs_test = [ + "a", + ["a", "b"], + [], [], + """\ +a.py + %r + import b +b.py +""" % list(range(2**16))] # 2**16 constants + self._do_test(extended_opargs_test) + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -116,6 +116,8 @@ Library ------- +- Issue #26881: The modulefinder module now supports extended opcode arguments. + - Issue #23815: Fixed crashes related to directly created instances of types in _tkinter and curses.panel modules. @@ -125,6 +127,8 @@ - Issue #26873: xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result. +- Issue #26881: modulefinder now works with bytecode with extended args. + - Issue #26711: Fixed the comparison of plistlib.Data with other types. - Issue #24114: Fix an uninitialized variable in `ctypes.util`. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 17:02:31 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 21:02:31 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326881=3A_The_modulefinder_module_now_supports_e?= =?utf-8?q?xtended_opcode_arguments=2E?= Message-ID: <20160508210230.67143.42535.A22B1878@psf.io> https://hg.python.org/cpython/rev/c27e3773d0f9 changeset: 101277:c27e3773d0f9 parent: 101275:e4835b1ed7b1 parent: 101276:3579cdaf56d9 user: Serhiy Storchaka date: Sun May 08 23:44:54 2016 +0300 summary: Issue #26881: The modulefinder module now supports extended opcode arguments. files: Lib/dis.py | 59 ++++++++++------------ Lib/modulefinder.py | 43 ++++++---------- Lib/test/test_modulefinder.py | 13 +++++ Misc/NEWS | 4 + 4 files changed, 62 insertions(+), 57 deletions(-) diff --git a/Lib/dis.py b/Lib/dis.py --- a/Lib/dis.py +++ b/Lib/dis.py @@ -284,31 +284,17 @@ """ labels = findlabels(code) - extended_arg = 0 starts_line = None free = None - # enumerate() is not an option, since we sometimes process - # multiple elements on a single pass through the loop - n = len(code) - i = 0 - while i < n: - op = code[i] - offset = i + for offset, op, arg in _unpack_opargs(code): if linestarts is not None: - starts_line = linestarts.get(i, None) + starts_line = linestarts.get(offset, None) if starts_line is not None: starts_line += line_offset - is_jump_target = i in labels - i = i+1 - arg = None + is_jump_target = offset in labels argval = None argrepr = '' - if op >= HAVE_ARGUMENT: - arg = code[i] + code[i+1]*256 + extended_arg - extended_arg = 0 - i = i+2 - if op == EXTENDED_ARG: - extended_arg = arg*65536 + if arg is not None: # Set argval to the dereferenced value of the argument when # availabe, and argrepr to the string representation of argval. # _disassemble_bytes needs the string repr of the @@ -319,7 +305,7 @@ elif op in hasname: argval, argrepr = _get_name_info(arg, names) elif op in hasjrel: - argval = i + arg + argval = offset + 3 + arg argrepr = "to " + repr(argval) elif op in haslocal: argval, argrepr = _get_name_info(arg, varnames) @@ -329,7 +315,7 @@ elif op in hasfree: argval, argrepr = _get_name_info(arg, cells) elif op in hasnargs: - argrepr = "%d positional, %d keyword pair" % (code[i-2], code[i-1]) + argrepr = "%d positional, %d keyword pair" % (arg%256, arg//256) yield Instruction(opname[op], op, arg, argval, argrepr, offset, starts_line, is_jump_target) @@ -365,6 +351,25 @@ disco = disassemble # XXX For backwards compatibility +def _unpack_opargs(code): + # enumerate() is not an option, since we sometimes process + # multiple elements on a single pass through the loop + extended_arg = 0 + n = len(code) + i = 0 + while i < n: + op = code[i] + offset = i + i = i+1 + arg = None + if op >= HAVE_ARGUMENT: + arg = code[i] + code[i+1]*256 + extended_arg + extended_arg = 0 + i = i+2 + if op == EXTENDED_ARG: + extended_arg = arg*65536 + yield (offset, op, arg) + def findlabels(code): """Detect all offsets in a byte code which are jump targets. @@ -372,19 +377,11 @@ """ labels = [] - # enumerate() is not an option, since we sometimes process - # multiple elements on a single pass through the loop - n = len(code) - i = 0 - while i < n: - op = code[i] - i = i+1 - if op >= HAVE_ARGUMENT: - arg = code[i] + code[i+1]*256 - i = i+2 + for offset, op, arg in _unpack_opargs(code): + if arg is not None: label = -1 if op in hasjrel: - label = i+arg + label = offset + 3 + arg elif op in hasjabs: label = arg if label >= 0: diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -13,13 +13,12 @@ warnings.simplefilter('ignore', DeprecationWarning) import imp -# XXX Clean up once str8's cstor matches bytes. -LOAD_CONST = bytes([dis.opmap['LOAD_CONST']]) -IMPORT_NAME = bytes([dis.opmap['IMPORT_NAME']]) -STORE_NAME = bytes([dis.opmap['STORE_NAME']]) -STORE_GLOBAL = bytes([dis.opmap['STORE_GLOBAL']]) +LOAD_CONST = dis.opmap['LOAD_CONST'] +IMPORT_NAME = dis.opmap['IMPORT_NAME'] +STORE_NAME = dis.opmap['STORE_NAME'] +STORE_GLOBAL = dis.opmap['STORE_GLOBAL'] STORE_OPS = STORE_NAME, STORE_GLOBAL -HAVE_ARGUMENT = bytes([dis.HAVE_ARGUMENT]) +EXTENDED_ARG = dis.EXTENDED_ARG # Modulefinder does a good job at simulating Python's, but it can not # handle __path__ modifications packages make at runtime. Therefore there @@ -337,38 +336,30 @@ fullname = name + "." + sub self._add_badmodule(fullname, caller) - def scan_opcodes_25(self, co, - unpack = struct.unpack): + def scan_opcodes(self, co): # Scan the code, and yield 'interesting' opcode combinations - # Python 2.5 version (has absolute and relative imports) code = co.co_code names = co.co_names consts = co.co_consts - LOAD_LOAD_AND_IMPORT = LOAD_CONST + LOAD_CONST + IMPORT_NAME - while code: - c = bytes([code[0]]) - if c in STORE_OPS: - oparg, = unpack('= 2 + and opargs[i-1][0] == opargs[i-2][0] == LOAD_CONST): + level = consts[opargs[i-2][1]] + fromlist = consts[opargs[i-1][1]] if level == 0: # absolute import - yield "absolute_import", (consts[oparg_2], names[oparg_3]) + yield "absolute_import", (fromlist, names[oparg]) else: # relative import - yield "relative_import", (level, consts[oparg_2], names[oparg_3]) - code = code[9:] + yield "relative_import", (level, fromlist, names[oparg]) continue - if c >= HAVE_ARGUMENT: - code = code[3:] - else: - code = code[1:] def scan_code(self, co, m): code = co.co_code - scanner = self.scan_opcodes_25 + scanner = self.scan_opcodes for what, args in scanner(co): if what == "store": name, = args diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -319,6 +319,19 @@ expected = "co_filename %r changed to %r" % (old_path, new_path) self.assertIn(expected, output) + def test_extended_opargs(self): + extended_opargs_test = [ + "a", + ["a", "b"], + [], [], + """\ +a.py + %r + import b +b.py +""" % list(range(2**16))] # 2**16 constants + self._do_test(extended_opargs_test) + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -268,6 +268,8 @@ Library ------- +- Issue #26881: The modulefinder module now supports extended opcode arguments. + - Issue #23815: Fixed crashes related to directly created instances of types in _tkinter and curses.panel modules. @@ -277,6 +279,8 @@ - Issue #26873: xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result. +- Issue #26881: modulefinder now works with bytecode with extended args. + - Issue #26915: The __contains__ methods in the collections ABCs now check for identity before checking equality. This better matches the behavior of the concrete classes, allows sensible handling of NaNs, and makes it -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 17:14:46 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 21:14:46 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2325745=3A_Fixed_leaking_a_userptr_in_curses_pane?= =?utf-8?q?l_destructor=2E?= Message-ID: <20160508211446.15122.93605.49D34A23@psf.io> https://hg.python.org/cpython/rev/50a94e1cabe0 changeset: 101281:50a94e1cabe0 parent: 101277:c27e3773d0f9 parent: 101279:afed12943ddd user: Serhiy Storchaka date: Mon May 09 00:14:22 2016 +0300 summary: Issue #25745: Fixed leaking a userptr in curses panel destructor. files: Misc/NEWS | 2 ++ Modules/_curses_panel.c | 5 +++++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -268,6 +268,8 @@ Library ------- +- Issue #25745: Fixed leaking a userptr in curses panel destructor. + - Issue #26881: The modulefinder module now supports extended opcode arguments. - Issue #23815: Fixed crashes related to directly created instances of types in diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -220,6 +220,11 @@ static void PyCursesPanel_Dealloc(PyCursesPanelObject *po) { + PyObject *obj = (PyObject *) panel_userptr(po->pan); + if (obj) { + (void)set_panel_userptr(po->pan, NULL); + Py_DECREF(obj); + } (void)del_panel(po->pan); if (po->wo != NULL) { Py_DECREF(po->wo); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 17:14:46 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 21:14:46 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI1NzQ1?= =?utf-8?q?=3A_Fixed_leaking_a_userptr_in_curses_panel_destructor=2E?= Message-ID: <20160508211446.22565.71096.954D0147@psf.io> https://hg.python.org/cpython/rev/1662b41e1663 changeset: 101280:1662b41e1663 branch: 2.7 parent: 101278:f06baed1bb0c user: Serhiy Storchaka date: Mon May 09 00:11:59 2016 +0300 summary: Issue #25745: Fixed leaking a userptr in curses panel destructor. files: Misc/NEWS | 2 +- Modules/_curses_panel.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -77,7 +77,7 @@ Library ------- -- Issue #26881: modulefinder now works with bytecode with extended args. +- Issue #25745: Fixed leaking a userptr in curses panel destructor. - Issue #17765: weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl. diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -191,6 +191,11 @@ static void PyCursesPanel_Dealloc(PyCursesPanelObject *po) { + PyObject *obj = (PyObject *) panel_userptr(po->pan); + if (obj) { + (void)set_panel_userptr(po->pan, NULL); + Py_DECREF(obj); + } (void)del_panel(po->pan); if (po->wo != NULL) { Py_DECREF(po->wo); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 17:14:47 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 08 May 2016 21:14:47 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI1NzQ1?= =?utf-8?q?=3A_Fixed_leaking_a_userptr_in_curses_panel_destructor=2E?= Message-ID: <20160508211446.130791.91256.A5D48D0F@psf.io> https://hg.python.org/cpython/rev/afed12943ddd changeset: 101279:afed12943ddd branch: 3.5 parent: 101276:3579cdaf56d9 user: Serhiy Storchaka date: Mon May 09 00:11:59 2016 +0300 summary: Issue #25745: Fixed leaking a userptr in curses panel destructor. files: Misc/NEWS | 2 ++ Modules/_curses_panel.c | 5 +++++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -116,6 +116,8 @@ Library ------- +- Issue #25745: Fixed leaking a userptr in curses panel destructor. + - Issue #26881: The modulefinder module now supports extended opcode arguments. - Issue #23815: Fixed crashes related to directly created instances of types in diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -220,6 +220,11 @@ static void PyCursesPanel_Dealloc(PyCursesPanelObject *po) { + PyObject *obj = (PyObject *) panel_userptr(po->pan); + if (obj) { + (void)set_panel_userptr(po->pan, NULL); + Py_DECREF(obj); + } (void)del_panel(po->pan); if (po->wo != NULL) { Py_DECREF(po->wo); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 8 21:56:54 2016 From: python-checkins at python.org (brett.cannon) Date: Mon, 09 May 2016 01:56:54 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Mention_reno_as_a_possible_so?= =?utf-8?q?lution_to_the_NEWS_problem?= Message-ID: <20160509015654.21029.14652.2E5AD78D@psf.io> https://hg.python.org/peps/rev/f852badca865 changeset: 6315:f852badca865 user: Brett Cannon date: Sun May 08 18:56:47 2016 -0700 summary: Mention reno as a possible solution to the NEWS problem files: pep-0512.txt | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pep-0512.txt b/pep-0512.txt --- a/pep-0512.txt +++ b/pep-0512.txt @@ -767,8 +767,9 @@ line of the commit message if no specific news entry was specified). Code for this approach has been written previously for the Mercurial workflow at http://bugs.python.org/issue18967. There is also tools -from the community like https://pypi.python.org/pypi/towncrier and -https://github.com/twisted/newsbuilder . +from the community like https://pypi.python.org/pypi/towncrier, +https://github.com/twisted/newsbuilder, and +http://docs.openstack.org/developer/reno/. A yet third option is a merge script to handle the conflicts. This approach allows for keeping the NEWS file as a single file. It does -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Mon May 9 02:20:34 2016 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 09 May 2016 06:20:34 +0000 Subject: [Python-checkins] =?utf-8?b?cGVwczogMi43LjEy?= Message-ID: <20160509061951.22581.39559.C5EEEF47@psf.io> https://hg.python.org/peps/rev/06e939c5adae changeset: 6316:06e939c5adae user: Benjamin Peterson date: Sun May 08 23:19:46 2016 -0700 summary: 2.7.12 files: pep-0373.txt | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/pep-0373.txt b/pep-0373.txt --- a/pep-0373.txt +++ b/pep-0373.txt @@ -56,7 +56,8 @@ Planned future release dates: -- 2.7.12 May 2016ish +- 2.7.12rc1 2016-06-12 +- 2.7.12 2016-06-25 - beyond this date, releases as needed Dates of previous maintenance releases: -- Repository URL: https://hg.python.org/peps From solipsis at pitrou.net Mon May 9 04:50:03 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 09 May 2016 08:50:03 +0000 Subject: [Python-checkins] Daily reference leaks (50a94e1cabe0): sum=4 Message-ID: <20160509085002.42555.60654.800F0003@psf.io> results for 50a94e1cabe0 on branch "default" -------------------------------------------- test_collections leaked [0, 4, -4] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [0, -2, 2] memory blocks, sum=0 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogcdMp3l', '--timeout', '7200'] From lp_benchmark_robot at intel.com Mon May 9 10:03:39 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Mon, 9 May 2016 15:03:39 +0100 Subject: [Python-checkins] GOOD Benchmark Results for Python Default 2016-05-09 Message-ID: Results for project Python default, build date 2016-05-09 02:02:23 +0000 commit: 50a94e1cabe0 previous commit: 66a1fbdbe4bb revision date: 2016-05-08 21:14:22 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.27% 1.60% 10.87% 14.33% :-| pybench 0.08% 1.06% 1.65% 5.99% :-( regex_v8 2.84% -0.45% -2.29% 4.84% :-) nbody 0.12% 2.63% 0.25% 8.42% :-| json_dump_v2 0.38% -0.03% -1.40% 10.63% :-| normal_startup 0.77% -0.06% 0.94% 5.81% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/good-benchmark-results-for-python-default-2016-05-09/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Mon May 9 10:05:09 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Mon, 9 May 2016 15:05:09 +0100 Subject: [Python-checkins] GOOD Benchmark Results for Python 2.7 2016-05-09 Message-ID: <8e5ce8d2-90da-4e89-b5d0-7ee355df0778@irsmsx102.ger.corp.intel.com> Results for project Python 2.7, build date 2016-05-09 02:46:45 +0000 commit: 1662b41e1663 previous commit: 4462e193f089 revision date: 2016-05-08 21:11:59 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.10% -0.51% 6.08% 5.09% :-) pybench 0.11% 0.54% 6.19% 4.18% :-( regex_v8 0.69% 0.01% -2.17% 10.55% :-) nbody 0.14% 2.93% 9.58% 0.27% :-) json_dump_v2 0.52% -0.46% 2.01% 11.97% :-( normal_startup 1.81% 0.71% -4.91% 2.24% :-) ssbench 0.19% 0.46% 2.67% 1.65% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/good-benchmark-results-for-python-2-7-2016-05-09/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Mon May 9 15:50:49 2016 From: python-checkins at python.org (zach.ware) Date: Mon, 09 May 2016 19:50:49 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2OTg3?= =?utf-8?q?=3A_Correct_implementation_to_match_comment?= Message-ID: <20160509195046.57780.69015.5300C756@psf.io> https://hg.python.org/cpython/rev/8842c02c02a2 changeset: 101282:8842c02c02a2 branch: 3.5 parent: 101279:afed12943ddd user: Zachary Ware date: Mon May 09 14:49:31 2016 -0500 summary: Issue #26987: Correct implementation to match comment This was inadvertently changed in 644b677c2ae5 to use self._stderr instead of _sys.stderr. files: Lib/threading.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/threading.py b/Lib/threading.py --- a/Lib/threading.py +++ b/Lib/threading.py @@ -921,7 +921,7 @@ # self. if _sys and _sys.stderr is not None: print("Exception in thread %s:\n%s" % - (self.name, _format_exc()), file=self._stderr) + (self.name, _format_exc()), file=_sys.stderr) elif self._stderr is not None: # Do the best job possible w/o a huge amt. of code to # approximate a traceback (code ideas from -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 9 15:50:55 2016 From: python-checkins at python.org (zach.ware) Date: Mon, 09 May 2016 19:50:55 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Closes_=2326987=3A_Merge_with_3=2E5?= Message-ID: <20160509195046.5594.23335.F2C793D4@psf.io> https://hg.python.org/cpython/rev/694dadd9f7bd changeset: 101283:694dadd9f7bd parent: 101281:50a94e1cabe0 parent: 101282:8842c02c02a2 user: Zachary Ware date: Mon May 09 14:50:36 2016 -0500 summary: Closes #26987: Merge with 3.5 files: Lib/threading.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/threading.py b/Lib/threading.py --- a/Lib/threading.py +++ b/Lib/threading.py @@ -923,7 +923,7 @@ # self. if _sys and _sys.stderr is not None: print("Exception in thread %s:\n%s" % - (self.name, _format_exc()), file=self._stderr) + (self.name, _format_exc()), file=_sys.stderr) elif self._stderr is not None: # Do the best job possible w/o a huge amt. of code to # approximate a traceback (code ideas from -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 9 23:14:21 2016 From: python-checkins at python.org (nick.coghlan) Date: Tue, 10 May 2016 03:14:21 +0000 Subject: [Python-checkins] =?utf-8?q?devguide=3A_Clarify_a_point_on_the_mo?= =?utf-8?q?tivations_page?= Message-ID: <20160510031421.17976.15504.3130CF93@psf.io> https://hg.python.org/devguide/rev/969de4441485 changeset: 803:969de4441485 user: Nick Coghlan date: Tue May 10 13:14:12 2016 +1000 summary: Clarify a point on the motivations page files: motivations.rst | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/motivations.rst b/motivations.rst --- a/motivations.rst +++ b/motivations.rst @@ -150,10 +150,11 @@ Include an "Available for " (or activities) bullet point with a link if you'd like to be contacted for professional training, consulting or - contract work. A link to a page with additional details is preferred to a - direct email address or contact phone number, as this is a global site, and - folks may not be familiar with the relevant practical details that apply to - this kind of work in a contributor's country of residence. + contract work, or other employment opportunities. A link to a page with + additional details is preferred to a direct email address or contact phone + number, as this is a global site, and folks may not be familiar with the + relevant practical details that apply to this kind of work in a contributor's + country of residence. Include a "Crowdfunding" bullet point with a link if you'd like to highlight crowdfunding services (e.g. Patreon) that folks can use to support your core -- Repository URL: https://hg.python.org/devguide From python-checkins at python.org Mon May 9 23:42:52 2016 From: python-checkins at python.org (guido.van.rossum) Date: Tue, 10 May 2016 03:42:52 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Fix_some_cursive_markup=2E?= Message-ID: <20160510034252.57780.58031.28A7CD76@psf.io> https://hg.python.org/peps/rev/538ca691a576 changeset: 6317:538ca691a576 user: Guido van Rossum date: Mon May 09 20:42:47 2016 -0700 summary: Fix some cursive markup. files: pep-0484.txt | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pep-0484.txt b/pep-0484.txt --- a/pep-0484.txt +++ b/pep-0484.txt @@ -634,14 +634,14 @@ reject such a call: the function might append an ``Employee`` instance to the list, which would violate the variable's type in the caller. -It turns out such an argument acts _contravariantly_, whereas the +It turns out such an argument acts *contravariantly*, whereas the intuitive answer (which is correct in case the function doesn't mutate -its argument!) requires the argument to act _covariantly_. A longer +its argument!) requires the argument to act *covariantly*. A longer introduction to these concepts can be found on Wikipedia [wiki-variance]_; here we just show how to control a type checker's behavior. -By default type variables are considered _invariant_, which means that +By default type variables are considered *invariant*, which means that arguments for arguments annotated with types like ``List[Employee]`` must exactly match the type annotation -- no subclasses or superclasses of the type parameter (in this example ``Employee``) are -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 10 02:44:35 2016 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 10 May 2016 06:44:35 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_improve_PyFunc?= =?utf-8?q?tion=5FNew_docs_=28closes_=2326986=29?= Message-ID: <20160510064435.13775.42527.7A150D72@psf.io> https://hg.python.org/cpython/rev/bfc4c57a0986 changeset: 101284:bfc4c57a0986 branch: 3.5 parent: 101282:8842c02c02a2 user: Benjamin Peterson date: Mon May 09 23:43:53 2016 -0700 summary: improve PyFunction_New docs (closes #26986) Patch from Xiang Zhang. files: Doc/c-api/function.rst | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/function.rst b/Doc/c-api/function.rst --- a/Doc/c-api/function.rst +++ b/Doc/c-api/function.rst @@ -34,8 +34,9 @@ Return a new function object associated with the code object *code*. *globals* must be a dictionary with the global variables accessible to the function. - The function's docstring, name and *__module__* are retrieved from the code - object, the argument defaults and closure are set to *NULL*. + The function's docstring and name are retrieved from the code object. *__module__* + is retrieved from *globals*. The argument defaults, annotations and closure are + set to *NULL*. *__qualname__* is set to the same value as the function's name. .. c:function:: PyObject* PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 10 02:44:36 2016 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 10 May 2016 06:44:36 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogbWVyZ2UgMy41ICgjMjY5ODYp?= Message-ID: <20160510064435.121389.5880.6E471211@psf.io> https://hg.python.org/cpython/rev/71afeb15f617 changeset: 101285:71afeb15f617 parent: 101283:694dadd9f7bd parent: 101284:bfc4c57a0986 user: Benjamin Peterson date: Mon May 09 23:44:30 2016 -0700 summary: merge 3.5 (#26986) files: Doc/c-api/function.rst | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/function.rst b/Doc/c-api/function.rst --- a/Doc/c-api/function.rst +++ b/Doc/c-api/function.rst @@ -34,8 +34,9 @@ Return a new function object associated with the code object *code*. *globals* must be a dictionary with the global variables accessible to the function. - The function's docstring, name and *__module__* are retrieved from the code - object, the argument defaults and closure are set to *NULL*. + The function's docstring and name are retrieved from the code object. *__module__* + is retrieved from *globals*. The argument defaults, annotations and closure are + set to *NULL*. *__qualname__* is set to the same value as the function's name. .. c:function:: PyObject* PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 10 04:13:03 2016 From: python-checkins at python.org (senthil.kumaran) Date: Tue, 10 May 2016 08:13:03 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Closes_issue26?= =?utf-8?q?960=2E?= Message-ID: <20160510081301.89249.28076.D7C2E32D@psf.io> https://hg.python.org/cpython/rev/44d02a5d59fb changeset: 101286:44d02a5d59fb branch: 2.7 parent: 101280:1662b41e1663 user: Senthil Kumaran date: Tue May 10 01:12:55 2016 -0700 summary: Closes issue26960. Backport issue16270: Fix for urllib hanging with ftp urls. files: Lib/urllib.py | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/Lib/urllib.py b/Lib/urllib.py --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -932,13 +932,7 @@ return (ftpobj, retrlen) def endtransfer(self): - if not self.busy: - return self.busy = 0 - try: - self.ftp.voidresp() - except ftperrors(): - pass def close(self): self.keepalive = False -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 10 04:29:39 2016 From: python-checkins at python.org (senthil.kumaran) Date: Tue, 10 May 2016 08:29:39 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Add_NEWS_entry?= =?utf-8?q?_for_issue26960=2E?= Message-ID: <20160510082939.88912.5995.B91F2AAE@psf.io> https://hg.python.org/cpython/rev/3388e249389d changeset: 101287:3388e249389d branch: 2.7 user: Senthil Kumaran date: Tue May 10 01:29:34 2016 -0700 summary: Add NEWS entry for issue26960. files: Misc/NEWS | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -77,6 +77,9 @@ Library ------- +- Issue #26960: Backported #16270 from Python 3 to Python 2, to prevent urllib + from hanging when retrieving certain FTP files. + - Issue #25745: Fixed leaking a userptr in curses panel destructor. - Issue #17765: weakref.ref() no longer silently ignores keyword arguments. -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Tue May 10 04:54:47 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 10 May 2016 08:54:47 +0000 Subject: [Python-checkins] Daily reference leaks (694dadd9f7bd): sum=7 Message-ID: <20160510085447.6907.66588.764CCF5F@psf.io> results for 694dadd9f7bd on branch "default" -------------------------------------------- test_asyncio leaked [0, 0, 3] memory blocks, sum=3 test_collections leaked [4, -4, 0] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogXa21mt', '--timeout', '7200'] From python-checkins at python.org Tue May 10 05:02:52 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 10 May 2016 09:02:52 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2323921=3A_Standardized_documentation_whitespace_?= =?utf-8?q?formatting=2E?= Message-ID: <20160510090249.22575.93316.46212454@psf.io> https://hg.python.org/cpython/rev/909099686e6e changeset: 101289:909099686e6e parent: 101285:71afeb15f617 parent: 101288:2b492ea961c1 user: Serhiy Storchaka date: Tue May 10 12:01:56 2016 +0300 summary: Issue #23921: Standardized documentation whitespace formatting. Original patch by James Edwards. files: Doc/distutils/apiref.rst | 4 +- Doc/faq/design.rst | 18 +- Doc/faq/library.rst | 17 +- Doc/faq/programming.rst | 39 +- Doc/howto/descriptor.rst | 64 ++-- Doc/howto/functional.rst | 10 +- Doc/howto/logging-cookbook.rst | 56 ++-- Doc/howto/logging.rst | 4 +- Doc/howto/regex.rst | 12 +- Doc/howto/unicode.rst | 2 +- Doc/howto/urllib2.rst | 12 +- Doc/library/argparse.rst | 18 +- Doc/library/asynchat.rst | 2 +- Doc/library/asyncio-sync.rst | 6 +- Doc/library/asyncore.rst | 4 +- Doc/library/audioop.rst | 2 +- Doc/library/collections.abc.rst | 29 +- Doc/library/collections.rst | 2 +- Doc/library/concurrent.futures.rst | 4 +- Doc/library/configparser.rst | 10 +- Doc/library/contextlib.rst | 2 +- Doc/library/crypt.rst | 2 +- Doc/library/ctypes.rst | 64 ++-- Doc/library/email.headerregistry.rst | 2 +- Doc/library/getopt.rst | 2 +- Doc/library/html.parser.rst | 10 +- Doc/library/http.client.rst | 2 +- Doc/library/inspect.rst | 2 +- Doc/library/ipaddress.rst | 2 +- Doc/library/locale.rst | 10 +- Doc/library/mailcap.rst | 2 +- Doc/library/mmap.rst | 2 +- Doc/library/multiprocessing.rst | 8 +- Doc/library/optparse.rst | 32 +- Doc/library/re.rst | 30 +- Doc/library/shelve.rst | 33 +- Doc/library/ssl.rst | 2 +- Doc/library/string.rst | 12 +- Doc/library/threading.rst | 2 +- Doc/library/tkinter.rst | 2 +- Doc/library/tokenize.rst | 6 +- Doc/library/types.rst | 2 + Doc/library/unittest.rst | 26 +- Doc/library/urllib.request.rst | 2 +- Doc/library/wsgiref.rst | 8 +- Doc/library/xml.dom.minidom.rst | 4 +- Doc/library/xml.etree.elementtree.rst | 26 +- Doc/library/xmlrpc.client.rst | 7 +- Doc/reference/datamodel.rst | 6 +- Doc/reference/expressions.rst | 2 +- Doc/reference/simple_stmts.rst | 4 +- Doc/tutorial/appendix.rst | 2 +- Doc/tutorial/classes.rst | 12 +- Doc/tutorial/controlflow.rst | 4 +- Doc/tutorial/errors.rst | 16 +- Doc/tutorial/inputoutput.rst | 4 +- Doc/tutorial/introduction.rst | 8 +- Doc/tutorial/modules.rst | 2 +- Doc/tutorial/stdlib.rst | 2 +- Doc/tutorial/stdlib2.rst | 1 + Doc/whatsnew/3.2.rst | 170 +++++++------ Doc/whatsnew/3.3.rst | 6 +- Doc/whatsnew/3.4.rst | 2 +- 63 files changed, 448 insertions(+), 412 deletions(-) diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -1907,9 +1907,9 @@ that is designed to run with both Python 2.x and 3.x, add:: try: - from distutils.command.build_py import build_py_2to3 as build_py + from distutils.command.build_py import build_py_2to3 as build_py except ImportError: - from distutils.command.build_py import build_py + from distutils.command.build_py import build_py to your setup.py, and later:: diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -158,7 +158,7 @@ line = f.readline() if not line: break - ... # do something with line + ... # do something with line The reason for not allowing assignment in Python expressions is a common, hard-to-find bug in those other languages, caused by this construct: @@ -190,7 +190,7 @@ line = f.readline() while line: - ... # do something with line... + ... # do something with line... line = f.readline() The problem with this is that if you change your mind about exactly how you get @@ -203,7 +203,7 @@ ` support the iterator protocol, so you can write simply:: for line in f: - ... # do something with line... + ... # do something with line... @@ -577,8 +577,10 @@ class ListWrapper: def __init__(self, the_list): self.the_list = the_list + def __eq__(self, other): return self.the_list == other.the_list + def __hash__(self): l = self.the_list result = 98767 - len(l)*555 @@ -619,7 +621,7 @@ dictionary in sorted order:: for key in sorted(mydict): - ... # do whatever with mydict[key]... + ... # do whatever with mydict[key]... How do you specify and enforce an interface spec in Python? @@ -675,11 +677,11 @@ class label(Exception): pass # declare a label try: - ... - if condition: raise label() # goto label - ... + ... + if condition: raise label() # goto label + ... except label: # where to goto - pass + pass ... This doesn't allow you to jump into the middle of a loop, but that's usually diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst --- a/Doc/faq/library.rst +++ b/Doc/faq/library.rst @@ -257,7 +257,8 @@ import threading, time def thread_task(name, n): - for i in range(n): print(name, i) + for i in range(n): + print(name, i) for i in range(10): T = threading.Thread(target=thread_task, args=(str(i), i)) @@ -273,7 +274,8 @@ def thread_task(name, n): time.sleep(0.001) # <--------------------! - for i in range(n): print(name, i) + for i in range(n): + print(name, i) for i in range(10): T = threading.Thread(target=thread_task, args=(str(i), i)) @@ -502,8 +504,8 @@ import struct with open(filename, "rb") as f: - s = f.read(8) - x, y, z = struct.unpack(">hhl", s) + s = f.read(8) + x, y, z = struct.unpack(">hhl", s) The '>' in the format string forces big-endian data; the letter 'h' reads one "short integer" (2 bytes), and 'l' reads one "long integer" (4 bytes) from the @@ -681,10 +683,10 @@ import urllib.request - ### build the query string + # build the query string qs = "First=Josephine&MI=Q&Last=Public" - ### connect and send the server a path + # connect and send the server a path req = urllib.request.urlopen('http://www.some-server.out-there' '/cgi-bin/some-cgi-script', data=qs) with req: @@ -740,8 +742,9 @@ ``/usr/sbin/sendmail``. The sendmail manual page will help you out. Here's some sample code:: + import os + SENDMAIL = "/usr/sbin/sendmail" # sendmail location - import os p = os.popen("%s -t -i" % SENDMAIL, "w") p.write("To: receiver at example.com\n") p.write("Subject: test\n") diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -207,7 +207,7 @@ >>> squares = [] >>> for x in range(5): - ... squares.append(lambda: x**2) + ... squares.append(lambda: x**2) This gives you a list that contains 5 lambdas that calculate ``x**2``. You might expect that, when called, they would return, respectively, ``0``, ``1``, @@ -234,7 +234,7 @@ >>> squares = [] >>> for x in range(5): - ... squares.append(lambda n=x: n**2) + ... squares.append(lambda n=x: n**2) Here, ``n=x`` creates a new variable ``n`` local to the lambda and computed when the lambda is defined so that it has the same value that ``x`` had at @@ -539,7 +539,7 @@ args['a'] = 'new-value' # args is a mutable dictionary args['b'] = args['b'] + 1 # change it in-place - args = {'a':' old-value', 'b': 99} + args = {'a': 'old-value', 'b': 99} func3(args) print(args['a'], args['b']) @@ -655,16 +655,15 @@ ``def`` and ``class`` statements, but in that case the value is a callable. Consider the following code:: - class A: - pass - - B = A - - a = B() - b = a - print(b) + >>> class A: + ... pass + ... + >>> B = A + >>> a = B() + >>> b = a + >>> print(b) <__main__.A object at 0x16D07CC> - print(a) + >>> print(a) <__main__.A object at 0x16D07CC> Arguably the class has a name: even though it is bound to two names and invoked @@ -1100,7 +1099,7 @@ Use the :func:`reversed` built-in function, which is new in Python 2.4:: for x in reversed(sequence): - ... # do something with x... + ... # do something with x ... This won't touch your original sequence, but build a new copy with reversed order to iterate over. @@ -1108,7 +1107,7 @@ With Python 2.3, you can use an extended slice syntax:: for x in sequence[::-1]: - ... # do something with x... + ... # do something with x ... How do you remove duplicates from a list? @@ -1406,7 +1405,7 @@ definition:: class C: - def meth (self, arg): + def meth(self, arg): return arg * 2 + self.attribute @@ -1439,9 +1438,9 @@ def search(obj): if isinstance(obj, Mailbox): - # ... code to search a mailbox + ... # code to search a mailbox elif isinstance(obj, Document): - # ... code to search a document + ... # code to search a document elif ... A better approach is to define a ``search()`` method on all the classes and just @@ -1449,11 +1448,11 @@ class Mailbox: def search(self): - # ... code to search a mailbox + ... # code to search a mailbox class Document: def search(self): - # ... code to search a document + ... # code to search a document obj.search() @@ -1510,7 +1509,7 @@ Use the built-in :func:`super` function:: class Derived(Base): - def meth (self): + def meth(self): super(Derived, self).meth() For version prior to 3.0, you may be using classic classes: For a class diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst --- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -104,7 +104,7 @@ "Emulate type_getattro() in Objects/typeobject.c" v = object.__getattribute__(self, key) if hasattr(v, '__get__'): - return v.__get__(None, self) + return v.__get__(None, self) return v The important points to remember are: @@ -163,9 +163,9 @@ self.val = val >>> class MyClass(object): - x = RevealAccess(10, 'var "x"') - y = 5 - + ... x = RevealAccess(10, 'var "x"') + ... y = 5 + ... >>> m = MyClass() >>> m.x Retrieving var "x" @@ -287,15 +287,15 @@ Running the interpreter shows how the function descriptor works in practice:: >>> class D(object): - def f(self, x): - return x - + ... def f(self, x): + ... return x + ... >>> d = D() - >>> D.__dict__['f'] # Stored internally as a function + >>> D.__dict__['f'] # Stored internally as a function - >>> D.f # Get from a class becomes an unbound method + >>> D.f # Get from a class becomes an unbound method - >>> d.f # Get from an instance becomes a bound method + >>> d.f # Get from an instance becomes a bound method > The output suggests that bound and unbound methods are two different types. @@ -358,10 +358,10 @@ calls are unexciting:: >>> class E(object): - def f(x): - print(x) - f = staticmethod(f) - + ... def f(x): + ... print(x) + ... f = staticmethod(f) + ... >>> print(E.f(3)) 3 >>> print(E().f(3)) @@ -371,23 +371,23 @@ :func:`staticmethod` would look like this:: class StaticMethod(object): - "Emulate PyStaticMethod_Type() in Objects/funcobject.c" + "Emulate PyStaticMethod_Type() in Objects/funcobject.c" - def __init__(self, f): - self.f = f + def __init__(self, f): + self.f = f - def __get__(self, obj, objtype=None): - return self.f + def __get__(self, obj, objtype=None): + return self.f Unlike static methods, class methods prepend the class reference to the argument list before calling the function. This format is the same for whether the caller is an object or a class:: >>> class E(object): - def f(klass, x): - return klass.__name__, x - f = classmethod(f) - + ... def f(klass, x): + ... return klass.__name__, x + ... f = classmethod(f) + ... >>> print(E.f(3)) ('E', 3) >>> print(E().f(3)) @@ -419,15 +419,15 @@ :func:`classmethod` would look like this:: class ClassMethod(object): - "Emulate PyClassMethod_Type() in Objects/funcobject.c" + "Emulate PyClassMethod_Type() in Objects/funcobject.c" - def __init__(self, f): - self.f = f + def __init__(self, f): + self.f = f - def __get__(self, obj, klass=None): - if klass is None: - klass = type(obj) - def newfunc(*args): - return self.f(klass, *args) - return newfunc + def __get__(self, obj, klass=None): + if klass is None: + klass = type(obj) + def newfunc(*args): + return self.f(klass, *args) + return newfunc diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst --- a/Doc/howto/functional.rst +++ b/Doc/howto/functional.rst @@ -395,14 +395,14 @@ continue # Skip this element for expr2 in sequence2: if not (condition2): - continue # Skip this element + continue # Skip this element ... for exprN in sequenceN: - if not (conditionN): - continue # Skip this element + if not (conditionN): + continue # Skip this element - # Output the value of - # the expression. + # Output the value of + # the expression. This means that when there are multiple ``for...in`` clauses but no ``if`` clauses, the length of the resulting output will be equal to the product of the diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -63,6 +63,7 @@ def __init__(self): self.logger = logging.getLogger('spam_application.auxiliary.Auxiliary') self.logger.info('creating an instance of Auxiliary') + def do_something(self): self.logger.info('doing something') a = 1 + 1 @@ -360,7 +361,7 @@ An example of using these two classes follows (imports omitted):: - que = queue.Queue(-1) # no limit on size + que = queue.Queue(-1) # no limit on size queue_handler = QueueHandler(que) handler = logging.StreamHandler() listener = QueueListener(que, handler) @@ -656,21 +657,21 @@ return True if __name__ == '__main__': - levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL) - logging.basicConfig(level=logging.DEBUG, - format='%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s') - a1 = logging.getLogger('a.b.c') - a2 = logging.getLogger('d.e.f') - - f = ContextFilter() - a1.addFilter(f) - a2.addFilter(f) - a1.debug('A debug message') - a1.info('An info message with %s', 'some parameters') - for x in range(10): - lvl = choice(levels) - lvlname = logging.getLevelName(lvl) - a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, 'parameters') + levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL) + logging.basicConfig(level=logging.DEBUG, + format='%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s') + a1 = logging.getLogger('a.b.c') + a2 = logging.getLogger('d.e.f') + + f = ContextFilter() + a1.addFilter(f) + a2.addFilter(f) + a1.debug('A debug message') + a1.info('An info message with %s', 'some parameters') + for x in range(10): + lvl = choice(levels) + lvlname = logging.getLevelName(lvl) + a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, 'parameters') which, when run, produces something like:: @@ -764,10 +765,10 @@ while True: try: record = queue.get() - if record is None: # We send this as a sentinel to tell the listener to quit. + if record is None: # We send this as a sentinel to tell the listener to quit. break logger = logging.getLogger(record.name) - logger.handle(record) # No level or filter logic applied - just do it! + logger.handle(record) # No level or filter logic applied - just do it! except Exception: import sys, traceback print('Whoops! Problem:', file=sys.stderr) @@ -790,10 +791,11 @@ # Note that on Windows you can't rely on fork semantics, so each process # will run the logging configuration code when it starts. def worker_configurer(queue): - h = logging.handlers.QueueHandler(queue) # Just the one handler needed + h = logging.handlers.QueueHandler(queue) # Just the one handler needed root = logging.getLogger() root.addHandler(h) - root.setLevel(logging.DEBUG) # send all messages, for demo; no other level or filter logic applied. + # send all messages, for demo; no other level or filter logic applied. + root.setLevel(logging.DEBUG) # This is the worker process top-level loop, which just logs ten events with # random intervening delays before terminating. @@ -821,7 +823,7 @@ workers = [] for i in range(10): worker = multiprocessing.Process(target=worker_process, - args=(queue, worker_configurer)) + args=(queue, worker_configurer)) workers.append(worker) worker.start() for w in workers: @@ -1245,12 +1247,12 @@ of queues, for example a ZeroMQ 'publish' socket. In the example below,the socket is created separately and passed to the handler (as its 'queue'):: - import zmq # using pyzmq, the Python binding for ZeroMQ - import json # for serializing records portably + import zmq # using pyzmq, the Python binding for ZeroMQ + import json # for serializing records portably ctx = zmq.Context() - sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value - sock.bind('tcp://*:5556') # or wherever + sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value + sock.bind('tcp://*:5556') # or wherever class ZeroMQSocketHandler(QueueHandler): def enqueue(self, record): @@ -1288,7 +1290,7 @@ def __init__(self, uri, *handlers, **kwargs): self.ctx = kwargs.get('ctx') or zmq.Context() socket = zmq.Socket(self.ctx, zmq.SUB) - socket.setsockopt(zmq.SUBSCRIBE, '') # subscribe to everything + socket.setsockopt(zmq.SUBSCRIBE, '') # subscribe to everything socket.connect(uri) def dequeue(self): @@ -2116,7 +2118,7 @@ Format an exception so that it prints on a single line. """ result = super(OneLineExceptionFormatter, self).formatException(exc_info) - return repr(result) # or format into one line however you want to + return repr(result) # or format into one line however you want to def format(self, record): s = super(OneLineExceptionFormatter, self).format(record) diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst --- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -103,8 +103,8 @@ A very simple example is:: import logging - logging.warning('Watch out!') # will print a message to the console - logging.info('I told you so') # will not print anything + logging.warning('Watch out!') # will print a message to the console + logging.info('I told you so') # will not print anything If you type these lines into a script and run it, you'll see:: diff --git a/Doc/howto/regex.rst b/Doc/howto/regex.rst --- a/Doc/howto/regex.rst +++ b/Doc/howto/regex.rst @@ -1115,19 +1115,19 @@ Here's a simple example of using the :meth:`sub` method. It replaces colour names with the word ``colour``:: - >>> p = re.compile( '(blue|white|red)') - >>> p.sub( 'colour', 'blue socks and red shoes') + >>> p = re.compile('(blue|white|red)') + >>> p.sub('colour', 'blue socks and red shoes') 'colour socks and colour shoes' - >>> p.sub( 'colour', 'blue socks and red shoes', count=1) + >>> p.sub('colour', 'blue socks and red shoes', count=1) 'colour socks and red shoes' The :meth:`subn` method does the same work, but returns a 2-tuple containing the new string value and the number of replacements that were performed:: - >>> p = re.compile( '(blue|white|red)') - >>> p.subn( 'colour', 'blue socks and red shoes') + >>> p = re.compile('(blue|white|red)') + >>> p.subn('colour', 'blue socks and red shoes') ('colour socks and colour shoes', 2) - >>> p.subn( 'colour', 'no colours at all') + >>> p.subn('colour', 'no colours at all') ('no colours at all', 0) Empty matches are replaced only when they're not adjacent to a previous match. diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst --- a/Doc/howto/unicode.rst +++ b/Doc/howto/unicode.rst @@ -687,7 +687,7 @@ # make changes to the string 'data' with open(fname + '.new', 'w', - encoding="ascii", errors="surrogateescape") as f: + encoding="ascii", errors="surrogateescape") as f: f.write(data) The ``surrogateescape`` error handler will decode any non-ASCII bytes diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -175,10 +175,10 @@ url = 'http://www.someserver.com/cgi-bin/register.cgi' user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)' - values = {'name' : 'Michael Foord', - 'location' : 'Northampton', - 'language' : 'Python' } - headers = { 'User-Agent' : user_agent } + values = {'name': 'Michael Foord', + 'location': 'Northampton', + 'language': 'Python' } + headers = {'User-Agent': user_agent} data = urllib.parse.urlencode(values) data = data.encode('ascii') @@ -215,7 +215,7 @@ >>> req = urllib.request.Request('http://www.pretend_server.org') >>> try: urllib.request.urlopen(req) ... except urllib.error.URLError as e: - ... print(e.reason) #doctest: +SKIP + ... print(e.reason) #doctest: +SKIP ... (4, 'getaddrinfo failed') @@ -372,7 +372,7 @@ :: from urllib.request import Request, urlopen - from urllib.error import URLError + from urllib.error import URLError req = Request(someurl) try: response = urlopen(req) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -35,10 +35,10 @@ parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', - help='an integer for the accumulator') + help='an integer for the accumulator') parser.add_argument('--sum', dest='accumulate', action='store_const', - const=sum, default=max, - help='sum the integers (default: find the max)') + const=sum, default=max, + help='sum the integers (default: find the max)') args = parser.parse_args() print(args.accumulate(args.integers)) @@ -488,7 +488,7 @@ arguments they contain. For example:: >>> with open('args.txt', 'w') as fp: - ... fp.write('-f\nbar') + ... fp.write('-f\nbar') >>> parser = argparse.ArgumentParser(fromfile_prefix_chars='@') >>> parser.add_argument('-f') >>> parser.parse_args(['-f', 'foo', '@args.txt']) @@ -1109,9 +1109,9 @@ >>> parser = argparse.ArgumentParser(prog='frobble') >>> parser.add_argument('--foo', action='store_true', - ... help='foo the bars before frobbling') + ... help='foo the bars before frobbling') >>> parser.add_argument('bar', nargs='+', - ... help='one of the bars to be frobbled') + ... help='one of the bars to be frobbled') >>> parser.parse_args(['-h']) usage: frobble [-h] [--foo] bar [bar ...] @@ -1129,7 +1129,7 @@ >>> parser = argparse.ArgumentParser(prog='frobble') >>> parser.add_argument('bar', nargs='?', type=int, default=42, - ... help='the bar to %(prog)s (default: %(default)s)') + ... help='the bar to %(prog)s (default: %(default)s)') >>> parser.print_help() usage: frobble [-h] [bar] @@ -1468,10 +1468,10 @@ >>> parser = argparse.ArgumentParser() >>> parser.add_argument( ... 'integers', metavar='int', type=int, choices=range(10), - ... nargs='+', help='an integer in the range 0..9') + ... nargs='+', help='an integer in the range 0..9') >>> parser.add_argument( ... '--sum', dest='accumulate', action='store_const', const=sum, - ... default=max, help='sum the integers (default: find the max)') + ... default=max, help='sum the integers (default: find the max)') >>> parser.parse_args(['1', '2', '3', '4']) Namespace(accumulate=, integers=[1, 2, 3, 4]) >>> parser.parse_args(['1', '2', '3', '4', '--sum']) diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst --- a/Doc/library/asynchat.rst +++ b/Doc/library/asynchat.rst @@ -202,7 +202,7 @@ self.set_terminator(None) self.handle_request() elif not self.handling: - self.set_terminator(None) # browsers sometimes over-send + self.set_terminator(None) # browsers sometimes over-send self.cgi_data = parse(self.headers, b"".join(self.ibuffer)) self.handling = True self.ibuffer = [] diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst --- a/Doc/library/asyncio-sync.rst +++ b/Doc/library/asyncio-sync.rst @@ -71,14 +71,14 @@ lock = Lock() ... with (yield from lock): - ... + ... Lock objects can be tested for locking state:: if not lock.locked(): - yield from lock + yield from lock else: - # lock is acquired + # lock is acquired ... .. method:: locked() diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -315,8 +315,8 @@ self.buffer = self.buffer[sent:] - client = HTTPClient('www.python.org', '/') - asyncore.loop() + client = HTTPClient('www.python.org', '/') + asyncore.loop() .. _asyncore-example-2: diff --git a/Doc/library/audioop.rst b/Doc/library/audioop.rst --- a/Doc/library/audioop.rst +++ b/Doc/library/audioop.rst @@ -276,6 +276,6 @@ # out_test) prefill = '\0'*(pos+ipos)*2 postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata)) - outputdata = prefill + audioop.mul(outputdata,2,-factor) + postfill + outputdata = prefill + audioop.mul(outputdata, 2, -factor) + postfill return audioop.add(inputdata, outputdata, 2) diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst --- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -225,19 +225,22 @@ :meth:`isdisjoint`:: class ListBasedSet(collections.abc.Set): - ''' Alternate set implementation favoring space over speed - and not requiring the set elements to be hashable. ''' - def __init__(self, iterable): - self.elements = lst = [] - for value in iterable: - if value not in lst: - lst.append(value) - def __iter__(self): - return iter(self.elements) - def __contains__(self, value): - return value in self.elements - def __len__(self): - return len(self.elements) + ''' Alternate set implementation favoring space over speed + and not requiring the set elements to be hashable. ''' + def __init__(self, iterable): + self.elements = lst = [] + for value in iterable: + if value not in lst: + lst.append(value) + + def __iter__(self): + return iter(self.elements) + + def __contains__(self, value): + return value in self.elements + + def __len__(self): + return len(self.elements) s1 = ListBasedSet('abcdef') s2 = ListBasedSet('defghi') diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -1032,7 +1032,7 @@ in conjunction with sorting to make a sorted dictionary:: >>> # regular unsorted dictionary - >>> d = {'banana': 3, 'apple':4, 'pear': 1, 'orange': 2} + >>> d = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2} >>> # dictionary sorted by key >>> OrderedDict(sorted(d.items(), key=lambda t: t[0])) diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst --- a/Doc/library/concurrent.futures.rst +++ b/Doc/library/concurrent.futures.rst @@ -99,12 +99,12 @@ import time def wait_on_b(): time.sleep(5) - print(b.result()) # b will never complete because it is waiting on a. + print(b.result()) # b will never complete because it is waiting on a. return 5 def wait_on_a(): time.sleep(5) - print(a.result()) # a will never complete because it is waiting on b. + print(a.result()) # a will never complete because it is waiting on b. return 6 diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -833,13 +833,13 @@ # Set the optional *raw* argument of get() to True if you wish to disable # interpolation in a single get operation. - print(cfg.get('Section1', 'foo', raw=False)) # -> "Python is fun!" - print(cfg.get('Section1', 'foo', raw=True)) # -> "%(bar)s is %(baz)s!" + print(cfg.get('Section1', 'foo', raw=False)) # -> "Python is fun!" + print(cfg.get('Section1', 'foo', raw=True)) # -> "%(bar)s is %(baz)s!" # The optional *vars* argument is a dict with members that will take # precedence in interpolation. print(cfg.get('Section1', 'foo', vars={'bar': 'Documentation', - 'baz': 'evil'})) + 'baz': 'evil'})) # The optional *fallback* argument can be used to provide a fallback value print(cfg.get('Section1', 'foo')) @@ -866,10 +866,10 @@ config = configparser.ConfigParser({'bar': 'Life', 'baz': 'hard'}) config.read('example.cfg') - print(config.get('Section1', 'foo')) # -> "Python is fun!" + print(config.get('Section1', 'foo')) # -> "Python is fun!" config.remove_option('Section1', 'bar') config.remove_option('Section1', 'baz') - print(config.get('Section1', 'foo')) # -> "Life is hard!" + print(config.get('Section1', 'foo')) # -> "Life is hard!" .. _configparser-objects: diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst --- a/Doc/library/contextlib.rst +++ b/Doc/library/contextlib.rst @@ -656,7 +656,7 @@ Before After >>> with cm: - ... pass + ... pass ... Traceback (most recent call last): ... diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst --- a/Doc/library/crypt.rst +++ b/Doc/library/crypt.rst @@ -149,4 +149,4 @@ hashed = crypt.crypt(plaintext) if not compare_hash(hashed, crypt.crypt(plaintext, hashed)): - raise ValueError("hashed version doesn't validate against original") + raise ValueError("hashed version doesn't validate against original") diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -52,11 +52,11 @@ convention:: >>> from ctypes import * - >>> print(windll.kernel32) # doctest: +WINDOWS + >>> print(windll.kernel32) # doctest: +WINDOWS - >>> print(cdll.msvcrt) # doctest: +WINDOWS + >>> print(cdll.msvcrt) # doctest: +WINDOWS - >>> libc = cdll.msvcrt # doctest: +WINDOWS + >>> libc = cdll.msvcrt # doctest: +WINDOWS >>> Windows appends the usual ``.dll`` file suffix automatically. @@ -72,10 +72,10 @@ :meth:`LoadLibrary` method of the dll loaders should be used, or you should load the library by creating an instance of CDLL by calling the constructor:: - >>> cdll.LoadLibrary("libc.so.6") # doctest: +LINUX + >>> cdll.LoadLibrary("libc.so.6") # doctest: +LINUX - >>> libc = CDLL("libc.so.6") # doctest: +LINUX - >>> libc # doctest: +LINUX + >>> libc = CDLL("libc.so.6") # doctest: +LINUX + >>> libc # doctest: +LINUX >>> @@ -92,9 +92,9 @@ >>> from ctypes import * >>> libc.printf <_FuncPtr object at 0x...> - >>> print(windll.kernel32.GetModuleHandleA) # doctest: +WINDOWS + >>> print(windll.kernel32.GetModuleHandleA) # doctest: +WINDOWS <_FuncPtr object at 0x...> - >>> print(windll.kernel32.MyOwnFunction) # doctest: +WINDOWS + >>> print(windll.kernel32.MyOwnFunction) # doctest: +WINDOWS Traceback (most recent call last): File "", line 1, in ? File "ctypes.py", line 239, in __getattr__ @@ -123,16 +123,16 @@ identifiers, like ``"??2 at YAPAXI@Z"``. In this case you have to use :func:`getattr` to retrieve the function:: - >>> getattr(cdll.msvcrt, "??2 at YAPAXI@Z") # doctest: +WINDOWS + >>> getattr(cdll.msvcrt, "??2 at YAPAXI@Z") # doctest: +WINDOWS <_FuncPtr object at 0x...> >>> On Windows, some dlls export functions not by name but by ordinal. These functions can be accessed by indexing the dll object with the ordinal number:: - >>> cdll.kernel32[1] # doctest: +WINDOWS + >>> cdll.kernel32[1] # doctest: +WINDOWS <_FuncPtr object at 0x...> - >>> cdll.kernel32[0] # doctest: +WINDOWS + >>> cdll.kernel32[0] # doctest: +WINDOWS Traceback (most recent call last): File "", line 1, in ? File "ctypes.py", line 310, in __getitem__ @@ -154,9 +154,9 @@ This example calls both functions with a NULL pointer (``None`` should be used as the NULL pointer):: - >>> print(libc.time(None)) # doctest: +SKIP + >>> print(libc.time(None)) # doctest: +SKIP 1150640792 - >>> print(hex(windll.kernel32.GetModuleHandleA(None))) # doctest: +WINDOWS + >>> print(hex(windll.kernel32.GetModuleHandleA(None))) # doctest: +WINDOWS 0x1d000000 >>> @@ -165,11 +165,11 @@ Windows. It does this by examining the stack after the function returns, so although an error is raised the function *has* been called:: - >>> windll.kernel32.GetModuleHandleA() # doctest: +WINDOWS + >>> windll.kernel32.GetModuleHandleA() # doctest: +WINDOWS Traceback (most recent call last): File "", line 1, in ? ValueError: Procedure probably called with not enough arguments (4 bytes missing) - >>> windll.kernel32.GetModuleHandleA(0, 0) # doctest: +WINDOWS + >>> windll.kernel32.GetModuleHandleA(0, 0) # doctest: +WINDOWS Traceback (most recent call last): File "", line 1, in ? ValueError: Procedure probably called with too many arguments (4 bytes in excess) @@ -178,13 +178,13 @@ The same exception is raised when you call an ``stdcall`` function with the ``cdecl`` calling convention, or vice versa:: - >>> cdll.kernel32.GetModuleHandleA(None) # doctest: +WINDOWS + >>> cdll.kernel32.GetModuleHandleA(None) # doctest: +WINDOWS Traceback (most recent call last): File "", line 1, in ? ValueError: Procedure probably called with not enough arguments (4 bytes missing) >>> - >>> windll.msvcrt.printf(b"spam") # doctest: +WINDOWS + >>> windll.msvcrt.printf(b"spam") # doctest: +WINDOWS Traceback (most recent call last): File "", line 1, in ? ValueError: Procedure probably called with too many arguments (4 bytes in excess) @@ -197,7 +197,7 @@ crashes from general protection faults when functions are called with invalid argument values:: - >>> windll.kernel32.GetModuleHandleA(32) # doctest: +WINDOWS + >>> windll.kernel32.GetModuleHandleA(32) # doctest: +WINDOWS Traceback (most recent call last): File "", line 1, in ? OSError: exception: access violation reading 0x00000020 @@ -462,9 +462,9 @@ a string pointer and a char, and returns a pointer to a string:: >>> strchr = libc.strchr - >>> strchr(b"abcdef", ord("d")) # doctest: +SKIP + >>> strchr(b"abcdef", ord("d")) # doctest: +SKIP 8059983 - >>> strchr.restype = c_char_p # c_char_p is a pointer to a string + >>> strchr.restype = c_char_p # c_char_p is a pointer to a string >>> strchr(b"abcdef", ord("d")) b'def' >>> print(strchr(b"abcdef", ord("x"))) @@ -495,17 +495,17 @@ result of this call will be used as the result of your function call. This is useful to check for error return values and automatically raise an exception:: - >>> GetModuleHandle = windll.kernel32.GetModuleHandleA # doctest: +WINDOWS + >>> GetModuleHandle = windll.kernel32.GetModuleHandleA # doctest: +WINDOWS >>> def ValidHandle(value): ... if value == 0: ... raise WinError() ... return value ... >>> - >>> GetModuleHandle.restype = ValidHandle # doctest: +WINDOWS - >>> GetModuleHandle(None) # doctest: +WINDOWS + >>> GetModuleHandle.restype = ValidHandle # doctest: +WINDOWS + >>> GetModuleHandle(None) # doctest: +WINDOWS 486539264 - >>> GetModuleHandle("something silly") # doctest: +WINDOWS + >>> GetModuleHandle("something silly") # doctest: +WINDOWS Traceback (most recent call last): File "", line 1, in ? File "", line 3, in ValidHandle @@ -676,12 +676,12 @@ >>> from ctypes import * >>> class POINT(Structure): - ... _fields_ = ("x", c_int), ("y", c_int) + ... _fields_ = ("x", c_int), ("y", c_int) ... >>> class MyStruct(Structure): - ... _fields_ = [("a", c_int), - ... ("b", c_float), - ... ("point_array", POINT * 4)] + ... _fields_ = [("a", c_int), + ... ("b", c_float), + ... ("point_array", POINT * 4)] >>> >>> print(len(MyStruct().point_array)) 4 @@ -998,7 +998,7 @@ The result:: - >>> qsort(ia, len(ia), sizeof(c_int), cmp_func) # doctest: +LINUX + >>> qsort(ia, len(ia), sizeof(c_int), cmp_func) # doctest: +LINUX py_cmp_func 5 1 py_cmp_func 33 99 py_cmp_func 7 33 @@ -1100,9 +1100,9 @@ hit the NULL entry:: >>> for item in table: - ... print(item.name, item.size) - ... if item.name is None: - ... break + ... print(item.name, item.size) + ... if item.name is None: + ... break ... __hello__ 104 __phello__ -104 diff --git a/Doc/library/email.headerregistry.rst b/Doc/library/email.headerregistry.rst --- a/Doc/library/email.headerregistry.rst +++ b/Doc/library/email.headerregistry.rst @@ -171,7 +171,7 @@ :class:`~datetime.datetime` instance. This means, for example, that the following code is valid and does what one would expect:: - msg['Date'] = datetime(2011, 7, 15, 21) + msg['Date'] = datetime(2011, 7, 15, 21) Because this is a naive ``datetime`` it will be interpreted as a UTC timestamp, and the resulting value will have a timezone of ``-0000``. Much diff --git a/Doc/library/getopt.rst b/Doc/library/getopt.rst --- a/Doc/library/getopt.rst +++ b/Doc/library/getopt.rst @@ -124,7 +124,7 @@ opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="]) except getopt.GetoptError as err: # print help information and exit: - print(err) # will print something like "option -a not recognized" + print(err) # will print something like "option -a not recognized" usage() sys.exit(2) output = None diff --git a/Doc/library/html.parser.rst b/Doc/library/html.parser.rst --- a/Doc/library/html.parser.rst +++ b/Doc/library/html.parser.rst @@ -51,8 +51,10 @@ class MyHTMLParser(HTMLParser): def handle_starttag(self, tag, attrs): print("Encountered a start tag:", tag) + def handle_endtag(self, tag): print("Encountered an end tag :", tag) + def handle_data(self, data): print("Encountered some data :", data) @@ -237,21 +239,27 @@ print("Start tag:", tag) for attr in attrs: print(" attr:", attr) + def handle_endtag(self, tag): print("End tag :", tag) + def handle_data(self, data): print("Data :", data) + def handle_comment(self, data): print("Comment :", data) + def handle_entityref(self, name): c = chr(name2codepoint[name]) print("Named ent:", c) + def handle_charref(self, name): if name.startswith('x'): c = chr(int(name[1:], 16)) else: c = chr(int(name)) print("Num ent :", c) + def handle_decl(self, data): print("Decl :", data) @@ -283,7 +291,7 @@ attr: ('type', 'text/css') Data : #python { color: green } End tag : style - >>> + >>> parser.feed('') Start tag: script diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst --- a/Doc/library/http.client.rst +++ b/Doc/library/http.client.rst @@ -441,7 +441,7 @@ >>> conn.request("GET", "/") >>> r1 = conn.getresponse() >>> while not r1.closed: - ... print(r1.read(200)) # 200 bytes + ... print(r1.read(200)) # 200 bytes b'\n diff --git a/Tools/msi/launcher/launcher.wixproj b/Tools/msi/launcher/launcher.wixproj --- a/Tools/msi/launcher/launcher.wixproj +++ b/Tools/msi/launcher/launcher.wixproj @@ -5,7 +5,8 @@ 2.0 launcher Package - SkipMissingCore=1;$(DefineConstants) + UpgradeCode=1B68A0EC-4DD3-5134-840E-73854B0863F1;$(DefineConstants) + true diff --git a/Tools/msi/launcher/launcher.wxs b/Tools/msi/launcher/launcher.wxs --- a/Tools/msi/launcher/launcher.wxs +++ b/Tools/msi/launcher/launcher.wxs @@ -5,7 +5,6 @@ - @@ -27,12 +26,18 @@ NOT Installed AND NOT ALLUSERS=1 NOT Installed AND ALLUSERS=1 - UPGRADE or REMOVE_OLD_LAUNCHER + UPGRADE or REMOVE_350_LAUNCHER - + - + + + + + + + Installed OR NOT BLOCK_360A1_LAUNCHER diff --git a/Tools/msi/launcher/launcher_en-US.wxl b/Tools/msi/launcher/launcher_en-US.wxl --- a/Tools/msi/launcher/launcher_en-US.wxl +++ b/Tools/msi/launcher/launcher_en-US.wxl @@ -1,7 +1,13 @@ ? - Launcher - launcher + 1033 + en-us + Python Launcher + Python Launcher + Python Launcher + Python Software Foundation + A newer version of the Python launcher is already installed. + The TARGETDIR variable must be provided when invoking this installer. Python File Python File (no console) Compiled Python File diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props --- a/Tools/msi/msi.props +++ b/Tools/msi/msi.props @@ -39,7 +39,7 @@ - + WixUtilExtension WixUtilExtension @@ -150,7 +150,7 @@ lib2to3/pickles - + <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',') <_GenerateCommand>import uuid; print('\n'.join('{}={}'.format(i, uuid.uuid5(uuid.UUID('c8d9733e-a70c-43ff-ab0c-e26456f11083'), '$(ReleaseUri.Replace(`{arch}`, `$(ArchName)`))' + j)) for i,j in [$(_Uuids.Replace(`"`,`'`))])) diff --git a/Tools/msi/msi.targets b/Tools/msi/msi.targets --- a/Tools/msi/msi.targets +++ b/Tools/msi/msi.targets @@ -25,7 +25,7 @@ - + <_Content>$([System.IO.File]::ReadAllText(%(WxlTemplate.FullPath)).Replace(`{{ShortVersion}}`, `$(MajorVersionNumber).$(MinorVersionNumber)$(PyTestExt)`).Replace(`{{LongVersion}}`, `$(PythonVersion)$(PyTestExt)`).Replace(`{{Bitness}}`, `$(Bitness)`)) <_ExistingContent Condition="Exists('$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl')">$([System.IO.File]::ReadAllText($(IntermediateOutputPath)%(WxlTemplate.Filename).wxl)) @@ -35,7 +35,7 @@ Overwrite="true" Condition="$(_Content) != $(_ExistingContent)" /> - + -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 18 18:54:42 2016 From: python-checkins at python.org (steve.dower) Date: Wed, 18 May 2016 22:54:42 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Removes_versio?= =?utf-8?q?ning_from_py=2Eexe_launcher_installer_and_ensures_that_old?= Message-ID: <20160518225438.8815.84411.008ACF27@psf.io> https://hg.python.org/cpython/rev/60129a556672 changeset: 101433:60129a556672 branch: 3.5 parent: 101431:79197e60e441 user: Steve Dower date: Wed May 18 15:54:05 2016 -0700 summary: Removes versioning from py.exe launcher installer and ensures that old launchers are replaced by newer ones. files: Tools/msi/common.wxs | 4 +++- Tools/msi/launcher/launcher.wixproj | 3 ++- Tools/msi/launcher/launcher.wxs | 13 +++++++++---- Tools/msi/launcher/launcher_en-US.wxl | 10 ++++++++-- Tools/msi/msi.props | 4 ++-- Tools/msi/msi.targets | 4 ++-- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Tools/msi/common.wxs b/Tools/msi/common.wxs --- a/Tools/msi/common.wxs +++ b/Tools/msi/common.wxs @@ -21,8 +21,8 @@ + - @@ -47,9 +47,11 @@ + + diff --git a/Tools/msi/launcher/launcher.wixproj b/Tools/msi/launcher/launcher.wixproj --- a/Tools/msi/launcher/launcher.wixproj +++ b/Tools/msi/launcher/launcher.wixproj @@ -5,7 +5,8 @@ 2.0 launcher Package - SkipMissingCore=1;$(DefineConstants) + UpgradeCode=1B68A0EC-4DD3-5134-840E-73854B0863F1;$(DefineConstants) + true diff --git a/Tools/msi/launcher/launcher.wxs b/Tools/msi/launcher/launcher.wxs --- a/Tools/msi/launcher/launcher.wxs +++ b/Tools/msi/launcher/launcher.wxs @@ -5,7 +5,6 @@ - @@ -27,12 +26,18 @@ NOT Installed AND NOT ALLUSERS=1 NOT Installed AND ALLUSERS=1 - UPGRADE or REMOVE_OLD_LAUNCHER + UPGRADE or REMOVE_350_LAUNCHER - + - + + + + + + + Installed OR NOT BLOCK_360A1_LAUNCHER diff --git a/Tools/msi/launcher/launcher_en-US.wxl b/Tools/msi/launcher/launcher_en-US.wxl --- a/Tools/msi/launcher/launcher_en-US.wxl +++ b/Tools/msi/launcher/launcher_en-US.wxl @@ -1,7 +1,13 @@ ? - Launcher - launcher + 1033 + en-us + Python Launcher + Python Launcher + Python Launcher + Python Software Foundation + A newer version of the Python launcher is already installed. + The TARGETDIR variable must be provided when invoking this installer. Python File Python File (no console) Compiled Python File diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props --- a/Tools/msi/msi.props +++ b/Tools/msi/msi.props @@ -39,7 +39,7 @@ - + WixUtilExtension WixUtilExtension @@ -150,7 +150,7 @@ lib2to3/pickles - + <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',') <_GenerateCommand>import uuid; print('\n'.join('{}={}'.format(i, uuid.uuid5(uuid.UUID('c8d9733e-a70c-43ff-ab0c-e26456f11083'), '$(ReleaseUri.Replace(`{arch}`, `$(ArchName)`))' + j)) for i,j in [$(_Uuids.Replace(`"`,`'`))])) diff --git a/Tools/msi/msi.targets b/Tools/msi/msi.targets --- a/Tools/msi/msi.targets +++ b/Tools/msi/msi.targets @@ -25,7 +25,7 @@ - + <_Content>$([System.IO.File]::ReadAllText(%(WxlTemplate.FullPath)).Replace(`{{ShortVersion}}`, `$(MajorVersionNumber).$(MinorVersionNumber)$(PyTestExt)`).Replace(`{{LongVersion}}`, `$(PythonVersion)$(PyTestExt)`).Replace(`{{Bitness}}`, `$(Bitness)`)) <_ExistingContent Condition="Exists('$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl')">$([System.IO.File]::ReadAllText($(IntermediateOutputPath)%(WxlTemplate.Filename).wxl)) @@ -35,7 +35,7 @@ Overwrite="true" Condition="$(_Content) != $(_ExistingContent)" /> - + -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Thu May 19 04:46:44 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Thu, 19 May 2016 08:46:44 +0000 Subject: [Python-checkins] Daily reference leaks (3811995aad73): sum=0 Message-ID: <20160519084642.8802.67257.E8DC5038@psf.io> results for 3811995aad73 on branch "default" -------------------------------------------- test_collections leaked [-4, 0, 0] memory blocks, sum=-4 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogNwr9ML', '--timeout', '7200'] From lp_benchmark_robot at intel.com Thu May 19 10:30:35 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Thu, 19 May 2016 15:30:35 +0100 Subject: [Python-checkins] BAD Benchmark Results for Python 2.7 2016-05-19 Message-ID: Results for project Python 2.7, build date 2016-05-19 02:45:59 +0000 commit: 18c5e4d82d83 previous commit: 9e1c859562bb revision date: 2016-05-18 10:00:48 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.10% -0.59% 5.94% 4.76% :-) pybench 0.13% 0.05% 5.92% 4.72% :-( regex_v8 0.86% 0.14% -2.45% 10.63% :-) nbody 0.13% -0.10% 9.70% 1.45% :-| json_dump_v2 0.47% -0.12% 1.58% 8.65% :-( normal_startup 2.01% -1.11% -6.18% 2.38% :-) ssbench 0.14% 0.66% 2.76% 1.36% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/bad-benchmark-results-for-python-2-7-2016-05-19/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Thu May 19 10:29:53 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Thu, 19 May 2016 15:29:53 +0100 Subject: [Python-checkins] BAD Benchmark Results for Python Default 2016-05-19 Message-ID: <03d27f82-321a-4ec1-83b7-578f4e5142a2@irsmsx103.ger.corp.intel.com> Results for project Python default, build date 2016-05-19 02:01:54 +0000 commit: 3811995aad73 previous commit: ba71905dd010 revision date: 2016-05-18 22:54:24 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.19% -1.40% 7.87% 18.17% :-| pybench 0.12% 0.20% 0.89% 6.26% :-( regex_v8 2.86% -0.27% -2.27% 2.50% :-| nbody 0.19% -0.12% 0.34% 5.19% :-| json_dump_v2 0.31% 0.32% -1.39% 11.25% :-| normal_startup 0.85% 0.02% -0.78% 6.05% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/bad-benchmark-results-for-python-default-2016-05-19/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Thu May 19 10:50:07 2016 From: python-checkins at python.org (victor.stinner) Date: Thu, 19 May 2016 14:50:07 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogTWVyZ2UgMy41IChpc3N1ZSAjMjcwNTcp?= Message-ID: <20160519144958.8825.6135.0C913925@psf.io> https://hg.python.org/cpython/rev/783c1b8cdddb changeset: 101436:783c1b8cdddb parent: 101434:3811995aad73 parent: 101435:13c5135d8467 user: Victor Stinner date: Thu May 19 16:48:06 2016 +0200 summary: Merge 3.5 (issue #27057) files: Misc/ACKS | 1 + Misc/NEWS | 4 ++++ Python/fileutils.c | 9 +++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Misc/ACKS b/Misc/ACKS --- a/Misc/ACKS +++ b/Misc/ACKS @@ -110,6 +110,7 @@ Robin Becker Torsten Becker Bill Bedford +Micha? Bednarski Ian Beer Stefan Behnel Reimer Behrends diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -297,6 +297,10 @@ Library ------- +- Issue #27057: Fix os.set_inheritable() on Android, ioctl() is blocked by + SELinux and fails with EACCESS. The function now falls back to fcntl(). + Patch written by Micha? Bednarski. + - Issue #27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure! - Issue #27031: Removed dummy methods in Tkinter widget classes: tk_menuBar() diff --git a/Python/fileutils.c b/Python/fileutils.c --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -860,7 +860,7 @@ return 0; } - if (errno != ENOTTY) { + if (errno != ENOTTY && errno != EACCES) { if (raise) PyErr_SetFromErrno(PyExc_OSError); return -1; @@ -869,7 +869,12 @@ /* Issue #22258: Here, ENOTTY means "Inappropriate ioctl for device". The ioctl is declared but not supported by the kernel. Remember that ioctl() doesn't work. It is the case on - Illumos-based OS for example. */ + Illumos-based OS for example. + + Issue #27057: When SELinux policy disallows ioctl it will fail + with EACCES. While FIOCLEX is safe operation it may be + unavailable because ioctl was denied altogether. + This can be the case on Android. */ ioctl_works = 0; } /* fallback to fcntl() if ioctl() does not work */ -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 19 10:51:35 2016 From: python-checkins at python.org (victor.stinner) Date: Thu, 19 May 2016 14:51:35 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogRml4IG9zLnNldF9p?= =?utf-8?q?nheritable=28=29_on_Android?= Message-ID: <20160519144952.36191.35396.D75936F5@psf.io> https://hg.python.org/cpython/rev/13c5135d8467 changeset: 101435:13c5135d8467 branch: 3.5 parent: 101433:60129a556672 user: Victor Stinner date: Thu May 19 16:46:18 2016 +0200 summary: Fix os.set_inheritable() on Android Issue #27057: Fix os.set_inheritable() on Android, ioctl() is blocked by SELinux and fails with EACCESS. The function now falls back to fcntl(). Patch written by Micha? Bednarski. files: Misc/ACKS | 1 + Misc/NEWS | 4 ++++ Python/fileutils.c | 9 +++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Misc/ACKS b/Misc/ACKS --- a/Misc/ACKS +++ b/Misc/ACKS @@ -110,6 +110,7 @@ Robin Becker Torsten Becker Bill Bedford +Micha? Bednarski Ian Beer Stefan Behnel Reimer Behrends diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -123,6 +123,10 @@ Library ------- +- Issue #27057: Fix os.set_inheritable() on Android, ioctl() is blocked by + SELinux and fails with EACCESS. The function now falls back to fcntl(). + Patch written by Micha? Bednarski. + - Issue #27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure! - Issue #14132: Fix urllib.request redirect handling when the target only has diff --git a/Python/fileutils.c b/Python/fileutils.c --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -856,7 +856,7 @@ return 0; } - if (errno != ENOTTY) { + if (errno != ENOTTY && errno != EACCES) { if (raise) PyErr_SetFromErrno(PyExc_OSError); return -1; @@ -865,7 +865,12 @@ /* Issue #22258: Here, ENOTTY means "Inappropriate ioctl for device". The ioctl is declared but not supported by the kernel. Remember that ioctl() doesn't work. It is the case on - Illumos-based OS for example. */ + Illumos-based OS for example. + + Issue #27057: When SELinux policy disallows ioctl it will fail + with EACCES. While FIOCLEX is safe operation it may be + unavailable because ioctl was denied altogether. + This can be the case on Android. */ ioctl_works = 0; } /* fallback to fcntl() if ioctl() does not work */ -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 19 13:15:58 2016 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 19 May 2016 17:15:58 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Clarify_a_sentence_that_menti?= =?utf-8?q?oned_LoggedVar=5Bt=5D=2E?= Message-ID: <20160519171556.10528.18129.EE60D493@psf.io> https://hg.python.org/peps/rev/0d3d68373e6b changeset: 6338:0d3d68373e6b user: Guido van Rossum date: Thu May 19 10:15:48 2016 -0700 summary: Clarify a sentence that mentioned LoggedVar[t]. files: pep-0484.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/pep-0484.txt b/pep-0484.txt --- a/pep-0484.txt +++ b/pep-0484.txt @@ -372,7 +372,7 @@ a type within the class body. The ``Generic`` base class uses a metaclass that defines ``__getitem__`` -so that ``LoggedVar[t]`` is valid as a type:: +so that e.g. ``LoggedVar[int]`` is valid as a type:: from typing import Iterable -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Thu May 19 15:10:43 2016 From: python-checkins at python.org (steve.dower) Date: Thu, 19 May 2016 19:10:43 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MDUz?= =?utf-8?q?=3A_Updates_make=5Fzip=2Epy_to_correctly_generate_library_ZIP_f?= =?utf-8?q?ile=2E?= Message-ID: <20160519191041.7032.56809.C7AB4CF6@psf.io> https://hg.python.org/cpython/rev/12cb81e90479 changeset: 101437:12cb81e90479 branch: 3.5 parent: 101435:13c5135d8467 user: Steve Dower date: Thu May 19 10:47:47 2016 -0700 summary: Issue #27053: Updates make_zip.py to correctly generate library ZIP file. files: Misc/NEWS | 2 ++ Tools/msi/make_zip.py | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -556,6 +556,8 @@ Windows ------- +- Issue #27053: Updates make_zip.py to correctly generate library ZIP file. + - Issue #26268: Update the prepare_ssl.py script to handle OpenSSL releases that don't include the contents of the include directory (that is, 1.0.2e and later). diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -89,7 +89,7 @@ ('/', 'PCBuild/$arch', 'python*.exe', is_not_debug), ('/', 'PCBuild/$arch', '*.pyd', is_not_debug), ('/', 'PCBuild/$arch', '*.dll', is_not_debug), - ('python35.zip', 'Lib', '**/*', include_in_lib), + ('python{0.major}{0.minor}.zip'.format(sys.version_info), 'Lib', '**/*', include_in_lib), ] if os.getenv('DOC_FILENAME'): -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 19 15:11:35 2016 From: python-checkins at python.org (steve.dower) Date: Thu, 19 May 2016 19:11:35 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327053=3A_Updates_make=5Fzip=2Epy_to_correctly_g?= =?utf-8?q?enerate_library_ZIP_file=2E?= Message-ID: <20160519191042.19946.43502.DEBC7753@psf.io> https://hg.python.org/cpython/rev/a6473f7a8c55 changeset: 101438:a6473f7a8c55 parent: 101436:783c1b8cdddb parent: 101437:12cb81e90479 user: Steve Dower date: Thu May 19 10:47:55 2016 -0700 summary: Issue #27053: Updates make_zip.py to correctly generate library ZIP file. files: Misc/NEWS | 2 ++ Tools/msi/make_zip.py | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1221,6 +1221,8 @@ Windows ------- +- Issue #27053: Updates make_zip.py to correctly generate library ZIP file. + - Issue #26268: Update the prepare_ssl.py script to handle OpenSSL releases that don't include the contents of the include directory (that is, 1.0.2e and later). diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -89,7 +89,7 @@ ('/', 'PCBuild/$arch', 'python*.exe', is_not_debug), ('/', 'PCBuild/$arch', '*.pyd', is_not_debug), ('/', 'PCBuild/$arch', '*.dll', is_not_debug), - ('python35.zip', 'Lib', '**/*', include_in_lib), + ('python{0.major}{0.minor}.zip'.format(sys.version_info), 'Lib', '**/*', include_in_lib), ] if os.getenv('DOC_FILENAME'): -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 19 16:13:58 2016 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 19 May 2016 20:13:58 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E4=29=3A_Back_out_7e960?= =?utf-8?q?5697dfc=2C_2e3c31ab586a=2C_759b2cecc289=2E?= Message-ID: <20160519201356.53991.71676.D5DCFDB8@psf.io> https://hg.python.org/cpython/rev/90e58a77d386 changeset: 101439:90e58a77d386 branch: 3.4 parent: 101211:5cf064bf81fd user: Guido van Rossum date: Thu May 19 13:00:21 2016 -0700 summary: Back out 7e9605697dfc, 2e3c31ab586a, 759b2cecc289. These added a path attribute to pathlib.Path objects, and docs. Instead, we're going to use PEP 519. (Starting in the 3.4 branch and merging forward from there since that's what I did originally.) files: Doc/library/pathlib.rst | 18 ------------------ Lib/pathlib.py | 7 ------- Lib/test/test_pathlib.py | 27 --------------------------- Misc/NEWS | 6 ------ 4 files changed, 0 insertions(+), 58 deletions(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -365,24 +365,6 @@ '' -.. data:: PurePath.path - - A string representing the full path:: - - >>> PurePosixPath('my/library/setup.py').path - 'my/library/setup.py' - - This always returns the same value as ``str(p)``; it is included to - serve as a one-off protocol. Code that wants to support both - strings and ``pathlib.Path`` objects as filenames can write - ``arg = getattr(arg, 'path', arg)`` to get the path as a string. - This can then be passed to various system calls or library - functions that expect a string. Unlike the alternative - ``arg = str(arg)``, this will still raise an exception if an object - of some other type is given by accident. - - .. versionadded:: 3.4.5 - .. data:: PurePath.suffix The file extension of the final component, if any:: diff --git a/Lib/pathlib.py b/Lib/pathlib.py --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -648,13 +648,6 @@ self._parts) or '.' return self._str - @property - def path(self): - try: - return self._str - except AttributeError: - return str(self) - def as_posix(self): """Return the string representation of the path with forward (/) slashes.""" diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -480,22 +480,6 @@ self.assertEqual(P('a/b.py').name, 'b.py') self.assertEqual(P('/a/b.py').name, 'b.py') - def test_path_common(self): - P = self.cls - def check(arg, expected=None): - if expected is None: - expected = arg - self.assertEqual(P(arg).path, expected.replace('/', self.sep)) - check('', '.') - check('.') - check('/') - check('a/b') - check('/a/b') - check('/a/b/', '/a/b') - check('/a/b/.', '/a/b') - check('a/b.py') - check('/a/b.py') - def test_suffix_common(self): P = self.cls self.assertEqual(P('').suffix, '') @@ -919,17 +903,6 @@ self.assertEqual(P('//My.py/Share.php').name, '') self.assertEqual(P('//My.py/Share.php/a/b').name, 'b') - def test_path(self): - P = self.cls - self.assertEqual(P('c:').path, 'c:') - self.assertEqual(P('c:/').path, 'c:\\') - self.assertEqual(P('c:a/b').path, 'c:a\\b') - self.assertEqual(P('c:/a/b').path, 'c:\\a\\b') - self.assertEqual(P('c:a/b.py').path, 'c:a\\b.py') - self.assertEqual(P('c:/a/b.py').path, 'c:\\a\\b.py') - self.assertEqual(P('//My.py/Share.php').path, '\\\\My.py\\Share.php\\') - self.assertEqual(P('//My.py/Share.php/a/b').path, '\\\\My.py\\Share.php\\a\\b') - def test_suffix(self): P = self.cls self.assertEqual(P('c:').suffix, '') diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -21,12 +21,6 @@ - Issue #25939: On Windows open the cert store readonly in ssl.enum_certificates. -- Issue #22570: Add 'path' attribute to pathlib.Path objects, - returning the same as str(), to make it more similar to DirEntry. - Library code can now write getattr(p, 'path', p) to get the path as - a string from a Path, a DirEntry, or a plain string. This is - essentially a small one-off protocol. - - Issue #26012: Don't traverse into symlinks for ** pattern in pathlib.Path.[r]glob(). -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 19 16:13:58 2016 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 19 May 2016 20:13:58 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAobWVyZ2UgMy40IC0+IDMuNSk6?= =?utf-8?q?_Back_out_pathlib=2EPath=2Epath_attr=2E_=28Merge_3=2E4-=3E3=2E5?= =?utf-8?q?=29?= Message-ID: <20160519201356.62697.10774.78405FAD@psf.io> https://hg.python.org/cpython/rev/97198545e6c3 changeset: 101440:97198545e6c3 branch: 3.5 parent: 101437:12cb81e90479 parent: 101439:90e58a77d386 user: Guido van Rossum date: Thu May 19 13:10:20 2016 -0700 summary: Back out pathlib.Path.path attr. (Merge 3.4->3.5) files: Doc/library/pathlib.rst | 22 ---------------------- Lib/pathlib.py | 7 ------- Lib/test/test_pathlib.py | 27 --------------------------- Misc/NEWS | 6 ------ 4 files changed, 0 insertions(+), 62 deletions(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -365,28 +365,6 @@ '' -.. data:: PurePath.path - - A string representing the full path:: - - >>> PurePosixPath('my/library/setup.py').path - 'my/library/setup.py' - - This always returns the same value as ``str(p)``; it is included to - serve as a one-off protocol. Code that wants to support both - strings and ``pathlib.Path`` objects as filenames can write - ``arg = getattr(arg, 'path', arg)`` to get the path as a string. - This can then be passed to various system calls or library - functions that expect a string. Unlike the alternative - ``arg = str(arg)``, this will still raise an exception if an object - of some other type is given by accident. - - A nice advantage is that this protocol is also supported by - :class:`os.DirEntry` objects returned by :func:`os.scandir`. - - .. versionadded:: 3.4.5 - .. versionadded:: 3.5.2 - .. data:: PurePath.suffix The file extension of the final component, if any:: diff --git a/Lib/pathlib.py b/Lib/pathlib.py --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -693,13 +693,6 @@ self._parts) or '.' return self._str - @property - def path(self): - try: - return self._str - except AttributeError: - return str(self) - def as_posix(self): """Return the string representation of the path with forward (/) slashes.""" diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -477,22 +477,6 @@ self.assertEqual(P('a/b.py').name, 'b.py') self.assertEqual(P('/a/b.py').name, 'b.py') - def test_path_common(self): - P = self.cls - def check(arg, expected=None): - if expected is None: - expected = arg - self.assertEqual(P(arg).path, expected.replace('/', self.sep)) - check('', '.') - check('.') - check('/') - check('a/b') - check('/a/b') - check('/a/b/', '/a/b') - check('/a/b/.', '/a/b') - check('a/b.py') - check('/a/b.py') - def test_suffix_common(self): P = self.cls self.assertEqual(P('').suffix, '') @@ -915,17 +899,6 @@ self.assertEqual(P('//My.py/Share.php').name, '') self.assertEqual(P('//My.py/Share.php/a/b').name, 'b') - def test_path(self): - P = self.cls - self.assertEqual(P('c:').path, 'c:') - self.assertEqual(P('c:/').path, 'c:\\') - self.assertEqual(P('c:a/b').path, 'c:a\\b') - self.assertEqual(P('c:/a/b').path, 'c:\\a\\b') - self.assertEqual(P('c:a/b.py').path, 'c:a\\b.py') - self.assertEqual(P('c:/a/b.py').path, 'c:\\a\\b.py') - self.assertEqual(P('//My.py/Share.php').path, '\\\\My.py\\Share.php\\') - self.assertEqual(P('//My.py/Share.php/a/b').path, '\\\\My.py\\Share.php\\a\\b') - def test_suffix(self): P = self.cls self.assertEqual(P('c:').suffix, '') diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -370,12 +370,6 @@ - Issue #25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode option if it is safe to do so. -- Issue #22570: Add 'path' attribute to pathlib.Path objects, - returning the same as str(), to make it more similar to DirEntry. - Library code can now write getattr(p, 'path', p) to get the path as - a string from a Path, a DirEntry, or a plain string. This is - essentially a small one-off protocol. - - Issue #26012: Don't traverse into symlinks for ** pattern in pathlib.Path.[r]glob(). -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 19 16:13:58 2016 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 19 May 2016 20:13:58 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Back_out_pathlib=2EPath=2Epath_attr=2E_=28Merge_3=2E5-?= =?utf-8?b?PjMuNik=?= Message-ID: <20160519201356.123929.22461.A82EB27F@psf.io> https://hg.python.org/cpython/rev/ade839421b8f changeset: 101441:ade839421b8f parent: 101438:a6473f7a8c55 parent: 101440:97198545e6c3 user: Guido van Rossum date: Thu May 19 13:11:17 2016 -0700 summary: Back out pathlib.Path.path attr. (Merge 3.5->3.6) files: Doc/library/pathlib.rst | 22 ---------------------- Lib/pathlib.py | 7 ------- Lib/test/test_pathlib.py | 27 --------------------------- Misc/NEWS | 6 ------ 4 files changed, 0 insertions(+), 62 deletions(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -365,28 +365,6 @@ '' -.. data:: PurePath.path - - A string representing the full path:: - - >>> PurePosixPath('my/library/setup.py').path - 'my/library/setup.py' - - This always returns the same value as ``str(p)``; it is included to - serve as a one-off protocol. Code that wants to support both - strings and ``pathlib.Path`` objects as filenames can write - ``arg = getattr(arg, 'path', arg)`` to get the path as a string. - This can then be passed to various system calls or library - functions that expect a string. Unlike the alternative - ``arg = str(arg)``, this will still raise an exception if an object - of some other type is given by accident. - - A nice advantage is that this protocol is also supported by - :class:`os.DirEntry` objects returned by :func:`os.scandir`. - - .. versionadded:: 3.4.5 - .. versionadded:: 3.5.2 - .. data:: PurePath.suffix The file extension of the final component, if any:: diff --git a/Lib/pathlib.py b/Lib/pathlib.py --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -693,13 +693,6 @@ self._parts) or '.' return self._str - @property - def path(self): - try: - return self._str - except AttributeError: - return str(self) - def as_posix(self): """Return the string representation of the path with forward (/) slashes.""" diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -477,22 +477,6 @@ self.assertEqual(P('a/b.py').name, 'b.py') self.assertEqual(P('/a/b.py').name, 'b.py') - def test_path_common(self): - P = self.cls - def check(arg, expected=None): - if expected is None: - expected = arg - self.assertEqual(P(arg).path, expected.replace('/', self.sep)) - check('', '.') - check('.') - check('/') - check('a/b') - check('/a/b') - check('/a/b/', '/a/b') - check('/a/b/.', '/a/b') - check('a/b.py') - check('/a/b.py') - def test_suffix_common(self): P = self.cls self.assertEqual(P('').suffix, '') @@ -915,17 +899,6 @@ self.assertEqual(P('//My.py/Share.php').name, '') self.assertEqual(P('//My.py/Share.php/a/b').name, 'b') - def test_path(self): - P = self.cls - self.assertEqual(P('c:').path, 'c:') - self.assertEqual(P('c:/').path, 'c:\\') - self.assertEqual(P('c:a/b').path, 'c:a\\b') - self.assertEqual(P('c:/a/b').path, 'c:\\a\\b') - self.assertEqual(P('c:a/b.py').path, 'c:a\\b.py') - self.assertEqual(P('c:/a/b.py').path, 'c:\\a\\b.py') - self.assertEqual(P('//My.py/Share.php').path, '\\\\My.py\\Share.php\\') - self.assertEqual(P('//My.py/Share.php/a/b').path, '\\\\My.py\\Share.php\\a\\b') - def test_suffix(self): P = self.cls self.assertEqual(P('c:').suffix, '') diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -682,12 +682,6 @@ - Issue #25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode option if it is safe to do so. -- Issue #22570: Add 'path' attribute to pathlib.Path objects, - returning the same as str(), to make it more similar to DirEntry. - Library code can now write getattr(p, 'path', p) to get the path as - a string from a Path, a DirEntry, or a plain string. This is - essentially a small one-off protocol. - - Issue #26012: Don't traverse into symlinks for ** pattern in pathlib.Path.[r]glob(). -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Fri May 20 04:55:58 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 20 May 2016 08:55:58 +0000 Subject: [Python-checkins] Daily reference leaks (ade839421b8f): sum=6 Message-ID: <20160520085558.10780.19344.D8575E39@psf.io> results for ade839421b8f on branch "default" -------------------------------------------- test_asyncio leaked [0, -17, 17] references, sum=0 test_asyncio leaked [0, -6, 8] memory blocks, sum=2 test_collections leaked [-4, 0, 4] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogcbiCxA', '--timeout', '7200'] From python-checkins at python.org Fri May 20 05:36:56 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 09:36:56 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Cleanup_import=2Ec?= Message-ID: <20160520093654.107792.65862.193A5BB6@psf.io> https://hg.python.org/cpython/rev/779563dd701c changeset: 101442:779563dd701c user: Victor Stinner date: Fri May 20 11:36:13 2016 +0200 summary: Cleanup import.c * Replace PyUnicode_RPartition() with PyUnicode_FindChar() and PyUnicode_Substring() to avoid the creation of a temporary tuple. * Use PyUnicode_FromFormat() to build a string and avoid the single_dot ('.') singleton Thanks Serhiy Storchaka for your review. files: Python/import.c | 67 +++++++++++++++--------------------- 1 files changed, 28 insertions(+), 39 deletions(-) diff --git a/Python/import.c b/Python/import.c --- a/Python/import.c +++ b/Python/import.c @@ -1349,7 +1349,6 @@ _Py_IDENTIFIER(_find_and_load); _Py_IDENTIFIER(_handle_fromlist); _Py_IDENTIFIER(_lock_unlock_module); - _Py_static_string(single_dot, "."); PyObject *abs_name = NULL; PyObject *builtins_import = NULL; PyObject *final_mod = NULL; @@ -1471,19 +1470,25 @@ } if (_PyDict_GetItemId(globals, &PyId___path__) == NULL) { - PyObject *partition = NULL; - PyObject *borrowed_dot = _PyUnicode_FromId(&single_dot); - if (borrowed_dot == NULL) { + Py_ssize_t dot; + + if (PyUnicode_READY(package) < 0) { goto error; } - partition = PyUnicode_RPartition(package, borrowed_dot); - Py_DECREF(package); - if (partition == NULL) { + + dot = PyUnicode_FindChar(package, '.', + 0, PyUnicode_GET_LENGTH(package), -1); + if (dot == -2) { goto error; } - package = PyTuple_GET_ITEM(partition, 0); - Py_INCREF(package); - Py_DECREF(partition); + + if (dot >= 0) { + PyObject *substr = PyUnicode_Substring(package, 0, dot); + if (substr == NULL) { + goto error; + } + Py_SETREF(package, substr); + } } } @@ -1531,17 +1536,8 @@ goto error; if (PyUnicode_GET_LENGTH(name) > 0) { - PyObject *borrowed_dot, *seq = NULL; - - borrowed_dot = _PyUnicode_FromId(&single_dot); - seq = PyTuple_Pack(2, base, name); + abs_name = PyUnicode_FromFormat("%U.%U", base, name); Py_DECREF(base); - if (borrowed_dot == NULL || seq == NULL) { - goto error; - } - - abs_name = PyUnicode_Join(borrowed_dot, seq); - Py_DECREF(seq); if (abs_name == NULL) { goto error; } @@ -1639,43 +1635,36 @@ if (has_from < 0) goto error; if (!has_from) { - if (level == 0 || PyUnicode_GET_LENGTH(name) > 0) { - PyObject *front = NULL; - PyObject *partition = NULL; - PyObject *borrowed_dot = _PyUnicode_FromId(&single_dot); + Py_ssize_t len = PyUnicode_GET_LENGTH(name); + if (level == 0 || len > 0) { + Py_ssize_t dot; - if (borrowed_dot == NULL) { + dot = PyUnicode_FindChar(name, '.', 0, len, 1); + if (dot == -2) { goto error; } - partition = PyUnicode_Partition(name, borrowed_dot); - if (partition == NULL) { - goto error; - } - - if (PyUnicode_GET_LENGTH(PyTuple_GET_ITEM(partition, 1)) == 0) { + if (dot == -1) { /* No dot in module name, simple exit */ - Py_DECREF(partition); final_mod = mod; Py_INCREF(mod); goto error; } - front = PyTuple_GET_ITEM(partition, 0); - Py_INCREF(front); - Py_DECREF(partition); + if (level == 0) { + PyObject *front = PyUnicode_Substring(name, 0, dot); + if (front == NULL) { + goto error; + } - if (level == 0) { final_mod = PyObject_CallFunctionObjArgs(builtins_import, front, NULL); Py_DECREF(front); } else { - Py_ssize_t cut_off = PyUnicode_GET_LENGTH(name) - - PyUnicode_GET_LENGTH(front); + Py_ssize_t cut_off = len - dot; Py_ssize_t abs_name_len = PyUnicode_GET_LENGTH(abs_name); PyObject *to_return = PyUnicode_Substring(abs_name, 0, abs_name_len - cut_off); - Py_DECREF(front); if (to_return == NULL) { goto error; } -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 05:44:03 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 09:44:03 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Optimize_pickle=2Eload=28?= =?utf-8?q?=29_and_pickle=2Eloads=28=29?= Message-ID: <20160520094401.113679.32799.7DD50B1A@psf.io> https://hg.python.org/cpython/rev/f9b85b47f9c8 changeset: 101443:f9b85b47f9c8 user: Victor Stinner date: Fri May 20 11:42:37 2016 +0200 summary: Optimize pickle.load() and pickle.loads() Issue #27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to deserialize a lot of small objects. files: Doc/whatsnew/3.6.rst | 3 ++ Misc/NEWS | 5 ++- Modules/_pickle.c | 45 ++++++++++++++++++------------- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -467,6 +467,9 @@ with a short lifetime, and use :c:func:`malloc` for larger memory blocks. (Contributed by Victor Stinner in :issue:`26249`). +* :func:`pickle.load` and :func:`pickle.loads` are now up to 10% faster when + deserializing many small objects (Contributed by Victor Stinner in + :issue:`27056`). Build and C API Changes ======================= diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -16,6 +16,9 @@ Library ------- +- Issue #27056: Optimize pickle.load() and pickle.loads(), up to 10% faster + to deserialize a lot of small objects. + What's New in Python 3.6.0 alpha 1? =================================== @@ -341,7 +344,7 @@ - Issue #26977: Removed unnecessary, and ignored, call to sum of squares helper in statistics.pvariance. -- Issue #26002: Use bisect in statistics.median instead of a linear search. +- Issue #26002: Use bisect in statistics.median instead of a linear search. Patch by Upendra Kuma. - Issue #25974: Make use of new Decimal.as_integer_ratio() method in statistics diff --git a/Modules/_pickle.c b/Modules/_pickle.c --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -1197,21 +1197,9 @@ return read_size; } -/* Read `n` bytes from the unpickler's data source, storing the result in `*s`. - - This should be used for all data reads, rather than accessing the unpickler's - input buffer directly. This method deals correctly with reading from input - streams, which the input buffer doesn't deal with. - - Note that when reading from a file-like object, self->next_read_idx won't - be updated (it should remain at 0 for the entire unpickling process). You - should use this function's return value to know how many bytes you can - consume. - - Returns -1 (with an exception set) on failure. On success, return the - number of chars read. */ +/* Don't call it directly: use _Unpickler_Read() */ static Py_ssize_t -_Unpickler_Read(UnpicklerObject *self, char **s, Py_ssize_t n) +_Unpickler_ReadImpl(UnpicklerObject *self, char **s, Py_ssize_t n) { Py_ssize_t num_read; @@ -1222,11 +1210,10 @@ "read would overflow (invalid bytecode)"); return -1; } - if (self->next_read_idx + n <= self->input_len) { - *s = self->input_buffer + self->next_read_idx; - self->next_read_idx += n; - return n; - } + + /* This case is handled by the _Unpickler_Read() macro for efficiency */ + assert(self->next_read_idx + n > self->input_len); + if (!self->read) { PyErr_Format(PyExc_EOFError, "Ran out of input"); return -1; @@ -1243,6 +1230,26 @@ return n; } +/* Read `n` bytes from the unpickler's data source, storing the result in `*s`. + + This should be used for all data reads, rather than accessing the unpickler's + input buffer directly. This method deals correctly with reading from input + streams, which the input buffer doesn't deal with. + + Note that when reading from a file-like object, self->next_read_idx won't + be updated (it should remain at 0 for the entire unpickling process). You + should use this function's return value to know how many bytes you can + consume. + + Returns -1 (with an exception set) on failure. On success, return the + number of chars read. */ +#define _Unpickler_Read(self, s, n) \ + (((self)->next_read_idx + (n) <= (self)->input_len) \ + ? (*(s) = (self)->input_buffer + (self)->next_read_idx, \ + (self)->next_read_idx += (n), \ + (n)) \ + : _Unpickler_ReadImpl(self, (s), (n))) + static Py_ssize_t _Unpickler_CopyLine(UnpicklerObject *self, char *line, Py_ssize_t len, char **result) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 06:48:07 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 10:48:07 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326741=3A_POSIX_im?= =?utf-8?q?plementation_of_subprocess=2EPopen=2E=5Fexecute=5Fchild=28=29_n?= =?utf-8?q?ow?= Message-ID: <20160520104807.32294.31237.53F35531@psf.io> https://hg.python.org/cpython/rev/4c02b983bd5f changeset: 101445:4c02b983bd5f user: Victor Stinner date: Fri May 20 12:08:12 2016 +0200 summary: Issue #26741: POSIX implementation of subprocess.Popen._execute_child() now sets the returncode attribute using the child process exit status when exec failed. files: Lib/subprocess.py | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1524,9 +1524,14 @@ if errpipe_data: try: - os.waitpid(self.pid, 0) + pid, sts = os.waitpid(self.pid, 0) + if pid == self.pid: + self._handle_exitstatus(sts) + else: + self.returncode = sys.maxsize except ChildProcessError: pass + try: exception_name, hex_errno, err_msg = ( errpipe_data.split(b':', 2)) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 06:48:08 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 10:48:08 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Use_=22with_popen=3A=22_in?= =?utf-8?q?_test=5Fsubprocess?= Message-ID: <20160520104807.113677.49092.61E5AC67@psf.io> https://hg.python.org/cpython/rev/b122011b139e changeset: 101444:b122011b139e user: Victor Stinner date: Fri May 20 12:43:15 2016 +0200 summary: Use "with popen:" in test_subprocess Issue #26741. files: Lib/test/test_subprocess.py | 113 +++++++++++------------ 1 files changed, 55 insertions(+), 58 deletions(-) diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -443,8 +443,8 @@ p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stdout.write("orange")'], stdout=subprocess.PIPE) - self.addCleanup(p.stdout.close) - self.assertEqual(p.stdout.read(), b"orange") + with p: + self.assertEqual(p.stdout.read(), b"orange") def test_stdout_filedes(self): # stdout is set to open file descriptor @@ -474,8 +474,8 @@ p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stderr.write("strawberry")'], stderr=subprocess.PIPE) - self.addCleanup(p.stderr.close) - self.assertStderrEqual(p.stderr.read(), b"strawberry") + with p: + self.assertStderrEqual(p.stderr.read(), b"strawberry") def test_stderr_filedes(self): # stderr is set to open file descriptor @@ -530,8 +530,8 @@ 'sys.stderr.write("orange")'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - self.addCleanup(p.stdout.close) - self.assertStderrEqual(p.stdout.read(), b"appleorange") + with p: + self.assertStderrEqual(p.stdout.read(), b"appleorange") def test_stdout_stderr_file(self): # capture stdout and stderr to the same open file @@ -789,18 +789,19 @@ stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=1) - p.stdin.write("line1\n") - p.stdin.flush() - self.assertEqual(p.stdout.readline(), "line1\n") - p.stdin.write("line3\n") - p.stdin.close() - self.addCleanup(p.stdout.close) - self.assertEqual(p.stdout.readline(), - "line2\n") - self.assertEqual(p.stdout.read(6), - "line3\n") - self.assertEqual(p.stdout.read(), - "line4\nline5\nline6\nline7\nline8") + with p: + p.stdin.write("line1\n") + p.stdin.flush() + self.assertEqual(p.stdout.readline(), "line1\n") + p.stdin.write("line3\n") + p.stdin.close() + self.addCleanup(p.stdout.close) + self.assertEqual(p.stdout.readline(), + "line2\n") + self.assertEqual(p.stdout.read(6), + "line3\n") + self.assertEqual(p.stdout.read(), + "line4\nline5\nline6\nline7\nline8") def test_universal_newlines_communicate(self): # universal newlines through communicate() @@ -1434,8 +1435,8 @@ 'sys.stdout.write(os.getenv("FRUIT"))'], stdout=subprocess.PIPE, preexec_fn=lambda: os.putenv("FRUIT", "apple")) - self.addCleanup(p.stdout.close) - self.assertEqual(p.stdout.read(), b"apple") + with p: + self.assertEqual(p.stdout.read(), b"apple") def test_preexec_exception(self): def raise_it(): @@ -1583,8 +1584,8 @@ p = subprocess.Popen(["echo $FRUIT"], shell=1, stdout=subprocess.PIPE, env=newenv) - self.addCleanup(p.stdout.close) - self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple") + with p: + self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple") def test_shell_string(self): # Run command through the shell (string) @@ -1593,8 +1594,8 @@ p = subprocess.Popen("echo $FRUIT", shell=1, stdout=subprocess.PIPE, env=newenv) - self.addCleanup(p.stdout.close) - self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple") + with p: + self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple") def test_call_string(self): # call() function with string argument on UNIX @@ -1626,8 +1627,8 @@ for sh in shells: p = subprocess.Popen("echo $0", executable=sh, shell=True, stdout=subprocess.PIPE) - self.addCleanup(p.stdout.close) - self.assertEqual(p.stdout.read().strip(), bytes(sh, 'ascii')) + with p: + self.assertEqual(p.stdout.read().strip(), bytes(sh, 'ascii')) def _kill_process(self, method, *args): # Do not inherit file handles from the parent. @@ -2450,8 +2451,8 @@ p = subprocess.Popen(["set"], shell=1, stdout=subprocess.PIPE, env=newenv) - self.addCleanup(p.stdout.close) - self.assertIn(b"physalis", p.stdout.read()) + with p: + self.assertIn(b"physalis", p.stdout.read()) def test_shell_string(self): # Run command through the shell (string) @@ -2460,8 +2461,8 @@ p = subprocess.Popen("set", shell=1, stdout=subprocess.PIPE, env=newenv) - self.addCleanup(p.stdout.close) - self.assertIn(b"physalis", p.stdout.read()) + with p: + self.assertIn(b"physalis", p.stdout.read()) def test_call_string(self): # call() function with string argument on Windows @@ -2480,16 +2481,14 @@ stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - self.addCleanup(p.stdout.close) - self.addCleanup(p.stderr.close) - self.addCleanup(p.stdin.close) - # Wait for the interpreter to be completely initialized before - # sending any signal. - p.stdout.read(1) - getattr(p, method)(*args) - _, stderr = p.communicate() - self.assertStderrEqual(stderr, b'') - returncode = p.wait() + with p: + # Wait for the interpreter to be completely initialized before + # sending any signal. + p.stdout.read(1) + getattr(p, method)(*args) + _, stderr = p.communicate() + self.assertStderrEqual(stderr, b'') + returncode = p.wait() self.assertNotEqual(returncode, 0) def _kill_dead_process(self, method, *args): @@ -2502,19 +2501,17 @@ stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - self.addCleanup(p.stdout.close) - self.addCleanup(p.stderr.close) - self.addCleanup(p.stdin.close) - # Wait for the interpreter to be completely initialized before - # sending any signal. - p.stdout.read(1) - # The process should end after this - time.sleep(1) - # This shouldn't raise even though the child is now dead - getattr(p, method)(*args) - _, stderr = p.communicate() - self.assertStderrEqual(stderr, b'') - rc = p.wait() + with p: + # Wait for the interpreter to be completely initialized before + # sending any signal. + p.stdout.read(1) + # The process should end after this + time.sleep(1) + # This shouldn't raise even though the child is now dead + getattr(p, method)(*args) + _, stderr = p.communicate() + self.assertStderrEqual(stderr, b'') + rc = p.wait() self.assertEqual(rc, 42) def test_send_signal(self): @@ -2602,11 +2599,11 @@ def with_spaces(self, *args, **kwargs): kwargs['stdout'] = subprocess.PIPE p = subprocess.Popen(*args, **kwargs) - self.addCleanup(p.stdout.close) - self.assertEqual( - p.stdout.read ().decode("mbcs"), - "2 [%r, 'ab cd']" % self.fname - ) + with p: + self.assertEqual( + p.stdout.read ().decode("mbcs"), + "2 [%r, 'ab cd']" % self.fname + ) def test_shell_string_with_spaces(self): # call() function with string argument with spaces on Windows -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 06:48:09 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 10:48:09 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_subprocess_now_emits_a_Res?= =?utf-8?q?ourceWarning_warning?= Message-ID: <20160520104809.25871.32672.F8445BDF@psf.io> https://hg.python.org/cpython/rev/b7f3494deb2c changeset: 101446:b7f3494deb2c user: Victor Stinner date: Fri May 20 12:11:15 2016 +0200 summary: subprocess now emits a ResourceWarning warning Issue #26741: subprocess.Popen destructor now emits a ResourceWarning warning if the child process is still running. files: Doc/library/subprocess.rst | 4 ++++ Doc/whatsnew/3.6.rst | 10 ++++++++++ Lib/subprocess.py | 3 +++ Lib/test/test_subprocess.py | 8 ++++++-- Misc/NEWS | 3 +++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -497,6 +497,10 @@ .. versionchanged:: 3.2 Added context manager support. + .. versionchanged:: 3.6 + Popen destructor now emits a :exc:`ResourceWarning` warning if the child + process is still running. + Exceptions ^^^^^^^^^^ diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -330,6 +330,16 @@ (Contributed by Aviv Palivoda in :issue:`26404`.) +subprocess +---------- + +:class:`subprocess.Popen` destructor now emits a :exc:`ResourceWarning` warning +if the child process is still running. Use the context manager protocol (``with +proc: ...``) or call explicitly the :meth:`~subprocess.Popen.wait` method to +read the exit status of the child process (Contributed by Victor Stinner in +:issue:`26741`). + + telnetlib --------- diff --git a/Lib/subprocess.py b/Lib/subprocess.py --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1006,6 +1006,9 @@ if not self._child_created: # We didn't get to successfully create a child process. return + if self.returncode is None: + warnings.warn("running subprocess %r" % self, ResourceWarning, + source=self) # In case the child hasn't been waited on, check if it's done. self._internal_poll(_deadstate=_maxsize) if self.returncode is None and _active is not None: diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2286,7 +2286,9 @@ self.addCleanup(p.stderr.close) ident = id(p) pid = p.pid - del p + with support.check_warnings(('', ResourceWarning)): + p = None + # check that p is in the active processes list self.assertIn(ident, [id(o) for o in subprocess._active]) @@ -2305,7 +2307,9 @@ self.addCleanup(p.stderr.close) ident = id(p) pid = p.pid - del p + with support.check_warnings(('', ResourceWarning)): + p = None + os.kill(pid, signal.SIGKILL) # check that p is in the active processes list self.assertIn(ident, [id(o) for o in subprocess._active]) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -16,6 +16,9 @@ Library ------- +- Issue #26741: subprocess.Popen destructor now emits a ResourceWarning warning + if the child process is still running. + - Issue #27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to deserialize a lot of small objects. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 07:09:03 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 11:09:03 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogYXN5bmNpbzogZml4?= =?utf-8?q?_ResourceWarning_related_to_subprocesses?= Message-ID: <20160520110901.107798.33284.E325C008@psf.io> https://hg.python.org/cpython/rev/72946937536e changeset: 101447:72946937536e branch: 3.5 parent: 101440:97198545e6c3 user: Victor Stinner date: Fri May 20 13:05:48 2016 +0200 summary: asyncio: fix ResourceWarning related to subprocesses Issue #26741: asyncio: BaseSubprocessTransport._process_exited() now copies the return code from the child watched to the returncode attribute of the Popen object. On Python 3.6, it is required to avoid a ResourceWarning. files: Lib/asyncio/base_subprocess.py | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py --- a/Lib/asyncio/base_subprocess.py +++ b/Lib/asyncio/base_subprocess.py @@ -210,6 +210,10 @@ logger.info('%r exited with return code %r', self, returncode) self._returncode = returncode + if self._proc.returncode is None: + # asyncio uses a child watcher: copy the status into the Popen + # object. On Python 3.6, it is required to avoid a ResourceWarning. + self._proc.returncode = returncode self._call(self._protocol.process_exited) self._try_finish() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 07:09:03 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 11:09:03 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogTWVyZ2UgMy41IChpc3N1ZSAjMjY3NDEp?= Message-ID: <20160520110901.88248.67813.59FA515C@psf.io> https://hg.python.org/cpython/rev/911f398c6396 changeset: 101448:911f398c6396 parent: 101446:b7f3494deb2c parent: 101447:72946937536e user: Victor Stinner date: Fri May 20 13:06:55 2016 +0200 summary: Merge 3.5 (issue #26741) files: Lib/asyncio/base_subprocess.py | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py --- a/Lib/asyncio/base_subprocess.py +++ b/Lib/asyncio/base_subprocess.py @@ -211,6 +211,10 @@ logger.info('%r exited with return code %r', self, returncode) self._returncode = returncode + if self._proc.returncode is None: + # asyncio uses a child watcher: copy the status into the Popen + # object. On Python 3.6, it is required to avoid a ResourceWarning. + self._proc.returncode = returncode self._call(self._protocol.process_exited) self._try_finish() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 07:41:02 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 11:41:02 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_regrtest=3A_display_test_r?= =?utf-8?b?ZXN1bHQgKHBhc3NlZCwgZmFpbGVkLCAuLi4p?= Message-ID: <20160520114100.107798.66636.F2BFF9D5@psf.io> https://hg.python.org/cpython/rev/8e1b5bbff4c7 changeset: 101450:8e1b5bbff4c7 user: Victor Stinner date: Fri May 20 13:37:40 2016 +0200 summary: regrtest: display test result (passed, failed, ...) * in multiprocessing mode: always display the result * sequential mode: only display the result if the test did not pass files: Lib/test/libregrtest/main.py | 12 ++++++++---- Lib/test/libregrtest/runtest.py | 17 +++++++++++++++-- Lib/test/libregrtest/runtest_mp.py | 5 +++-- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -15,7 +15,7 @@ findtests, runtest, STDTESTS, NOTTESTS, PASSED, FAILED, ENV_CHANGED, SKIPPED, RESOURCE_DENIED, INTERRUPTED, CHILD_ERROR, - PROGRESS_MIN_TIME) + PROGRESS_MIN_TIME, format_test_result) from test.libregrtest.setup import setup_tests from test import support try: @@ -326,7 +326,9 @@ # if on a false return value from main. cmd = ('result = runtest(self.ns, test); ' 'self.accumulate_result(test, result)') - self.tracer.runctx(cmd, globals=globals(), locals=vars()) + ns = dict(locals()) + self.tracer.runctx(cmd, globals=globals(), locals=ns) + result = ns['result'] else: try: result = runtest(self.ns, test) @@ -337,10 +339,12 @@ else: self.accumulate_result(test, result) + previous_test = format_test_result(test, result[0]) test_time = time.monotonic() - start_time if test_time >= PROGRESS_MIN_TIME: - previous_test = '%s took %.0f sec' % (test, test_time) - else: + previous_test = "%s in %.0f sec" % (previous_test, test_time) + elif result[0] == PASSED: + # be quiet: say nothing if the test passed shortly previous_test = None if self.ns.findleaks: diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -20,12 +20,20 @@ INTERRUPTED = -4 CHILD_ERROR = -5 # error in a child process +_FORMAT_TEST_RESULT = { + PASSED: '%s passed', + FAILED: '%s failed', + ENV_CHANGED: '%s failed (env changed)', + SKIPPED: '%s skipped', + RESOURCE_DENIED: '%s skipped (resource denied)', + INTERRUPTED: '%s interrupted', + CHILD_ERROR: '%s crashed', +} + # Minimum duration of a test to display its duration or to mention that # the test is running in background PROGRESS_MIN_TIME = 30.0 # seconds - - # small set of tests to determine if we have a basically functioning interpreter # (i.e. if any of these fail, then anything else is likely to follow) STDTESTS = [ @@ -45,6 +53,11 @@ NOTTESTS = set() +def format_test_result(test_name, result): + fmt = _FORMAT_TEST_RESULT.get(result, "%s") + return fmt % test_name + + def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS): """Return a list of all applicable test modules.""" testdir = findtestdir(testdir) diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -14,7 +14,8 @@ sys.exit(2) from test.libregrtest.runtest import ( - runtest, INTERRUPTED, CHILD_ERROR, PROGRESS_MIN_TIME) + runtest, INTERRUPTED, CHILD_ERROR, PROGRESS_MIN_TIME, + format_test_result) from test.libregrtest.setup import setup_tests @@ -196,8 +197,8 @@ regrtest.accumulate_result(test, result) # Display progress - text = test ok, test_time = result + text = format_test_result(test, ok) if (ok not in (CHILD_ERROR, INTERRUPTED) and test_time >= PROGRESS_MIN_TIME and not regrtest.ns.pgo): -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 07:41:02 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 11:41:02 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_regrtest_doesn=27t_ignore_?= =?utf-8?q?-j1_anymore?= Message-ID: <20160520114100.62206.3453.2DD53AD7@psf.io> https://hg.python.org/cpython/rev/6f7e5b51c8fb changeset: 101449:6f7e5b51c8fb user: Victor Stinner date: Fri May 20 13:15:55 2016 +0200 summary: regrtest doesn't ignore -j1 anymore * regrtest now uses subprocesses when the -j1 command line option is used: each test file runs in a fresh child process. Before, the -j1 option was ignored. * Tools/buildbot/test.bat script now uses -j1 by default to run each test file in fresh child process. files: Lib/test/libregrtest/cmdline.py | 2 -- Misc/NEWS | 10 ++++++++++ Tools/buildbot/test.bat | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py --- a/Lib/test/libregrtest/cmdline.py +++ b/Lib/test/libregrtest/cmdline.py @@ -318,8 +318,6 @@ if ns.use_mp <= 0: # Use all cores + extras for tests that like to sleep ns.use_mp = 2 + (os.cpu_count() or 1) - if ns.use_mp == 1: - ns.use_mp = None if ns.use: for a in ns.use: for r in a: diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -22,6 +22,16 @@ - Issue #27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to deserialize a lot of small objects. +Tests +----- + +- Issue #25285: regrtest now uses subprocesses when the -j1 command line option + is used: each test file runs in a fresh child process. Before, the -j1 option + was ignored. + +- Issue #25285: Tools/buildbot/test.bat script now uses -j1 by default to run + each test file in fresh child process. + What's New in Python 3.6.0 alpha 1? =================================== diff --git a/Tools/buildbot/test.bat b/Tools/buildbot/test.bat --- a/Tools/buildbot/test.bat +++ b/Tools/buildbot/test.bat @@ -4,7 +4,7 @@ set here=%~dp0 set rt_opts=-q -d -set regrtest_args= +set regrtest_args=-j1 :CheckOpts if "%1"=="-x64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts -- Repository URL: https://hg.python.org/cpython From lp_benchmark_robot at intel.com Fri May 20 09:12:48 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Fri, 20 May 2016 14:12:48 +0100 Subject: [Python-checkins] GOOD Benchmark Results for Python Default 2016-05-20 Message-ID: Results for project Python default, build date 2016-05-20 02:02:21 +0000 commit: ade839421b8f previous commit: 3811995aad73 revision date: 2016-05-19 20:11:17 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.25% 1.39% 9.16% 15.60% :-| pybench 0.10% 0.85% 1.73% 4.92% :-( regex_v8 2.82% 0.14% -2.13% 3.92% :-| nbody 0.42% 0.73% 1.06% 2.13% :-| json_dump_v2 0.30% 0.39% -0.99% 11.34% :-| normal_startup 0.73% 0.16% -0.46% 6.08% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/good-benchmark-results-for-python-default-2016-05-20/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Fri May 20 09:13:24 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Fri, 20 May 2016 14:13:24 +0100 Subject: [Python-checkins] BAD Benchmark Results for Python 2.7 2016-05-20 Message-ID: <9cd14e7d-8325-41ba-9890-0da84db873ac@irsmsx151.ger.corp.intel.com> No new revisions. Here are the previous results: Results for project Python 2.7, build date 2016-05-20 02:46:51 +0000 commit: 18c5e4d82d83 previous commit: 9e1c859562bb revision date: 2016-05-18 10:00:48 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.10% -0.59% 5.94% 4.76% :-) pybench 0.13% 0.05% 5.92% 4.72% :-( regex_v8 0.86% 0.14% -2.45% 10.63% :-) nbody 0.13% -0.10% 9.70% 1.45% :-| json_dump_v2 0.47% -0.12% 1.58% 8.65% :-( normal_startup 2.01% -1.11% -6.18% 2.38% :-) ssbench 0.14% 0.66% 2.76% 1.36% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/bad-benchmark-results-for-python-2-7-2016-05-20/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Fri May 20 11:32:30 2016 From: python-checkins at python.org (yury.selivanov) Date: Fri, 20 May 2016 15:32:30 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogYXN5bmNpbzogRml4?= =?utf-8?q?_an_SSL_warning_in_StreamReaderProtocol=2Eeof=5Freceived?= Message-ID: <20160520153227.10790.89924.7653519B@psf.io> https://hg.python.org/cpython/rev/7c9666a055e4 changeset: 101451:7c9666a055e4 branch: 3.5 parent: 101447:72946937536e user: Yury Selivanov date: Fri May 20 11:31:40 2016 -0400 summary: asyncio: Fix an SSL warning in StreamReaderProtocol.eof_received files: Lib/asyncio/streams.py | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -225,9 +225,11 @@ self._stream_reader = stream_reader self._stream_writer = None self._client_connected_cb = client_connected_cb + self._over_ssl = False def connection_made(self, transport): self._stream_reader.set_transport(transport) + self._over_ssl = transport.get_extra_info('sslcontext') is not None if self._client_connected_cb is not None: self._stream_writer = StreamWriter(transport, self, self._stream_reader, @@ -252,6 +254,11 @@ def eof_received(self): self._stream_reader.feed_eof() + if self._over_ssl: + # Prevent a warning in SSLProtocol.eof_received: + # "returning true from eof_received() + # has no effect when using ssl" + return False return True -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 11:33:15 2016 From: python-checkins at python.org (yury.selivanov) Date: Fri, 20 May 2016 15:33:15 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_3=2E5_=28asyncio=29?= Message-ID: <20160520153305.10778.67582.18C6BB27@psf.io> https://hg.python.org/cpython/rev/708d847ec412 changeset: 101452:708d847ec412 parent: 101450:8e1b5bbff4c7 parent: 101451:7c9666a055e4 user: Yury Selivanov date: Fri May 20 11:31:55 2016 -0400 summary: Merge 3.5 (asyncio) files: Lib/asyncio/streams.py | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -225,9 +225,11 @@ self._stream_reader = stream_reader self._stream_writer = None self._client_connected_cb = client_connected_cb + self._over_ssl = False def connection_made(self, transport): self._stream_reader.set_transport(transport) + self._over_ssl = transport.get_extra_info('sslcontext') is not None if self._client_connected_cb is not None: self._stream_writer = StreamWriter(transport, self, self._stream_reader, @@ -252,6 +254,11 @@ def eof_received(self): self._stream_reader.feed_eof() + if self._over_ssl: + # Prevent a warning in SSLProtocol.eof_received: + # "returning true from eof_received() + # has no effect when using ssl" + return False return True -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 14:33:25 2016 From: python-checkins at python.org (guido.van.rossum) Date: Fri, 20 May 2016 18:33:25 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Improve_wording_on_covariance?= =?utf-8?b?IG9mIFR5cGVbXSAoSXZhbiBMLCAjMTA3KS4=?= Message-ID: <20160520183318.47742.31333.9D919B6E@psf.io> https://hg.python.org/peps/rev/8b079eb1ad5d changeset: 6339:8b079eb1ad5d user: Guido van Rossum date: Fri May 20 11:33:13 2016 -0700 summary: Improve wording on covariance of Type[] (Ivan L, #107). files: pep-0484.txt | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pep-0484.txt b/pep-0484.txt --- a/pep-0484.txt +++ b/pep-0484.txt @@ -372,7 +372,7 @@ a type within the class body. The ``Generic`` base class uses a metaclass that defines ``__getitem__`` -so that e.g. ``LoggedVar[int]`` is valid as a type:: +so that ``LoggedVar[t]`` is valid as a type:: from typing import Iterable @@ -914,6 +914,7 @@ ``Type[]``, as in:: def new_non_team_user(user_class: Type[Union[BasicUser, ProUser]]): + user = new_user(user_class) ... However the actual argument passed in at runtime must still be a @@ -952,8 +953,12 @@ ``__repr__()`` and ``__mro__``). Such a variable can be called with arbitrary arguments, and the return type is ``Any``. -``Type[T]`` should be considered covariant, since for a concrete class -``C``, ``Type[C]`` matches ``C`` and any of its subclasses. +``Type`` is covariant in its parameter, because ``Type[Derived]`` is a +subtype of ``Type[Base]``:: + + def new_pro_user(pro_user_class: Type[ProUser]): + user = new_user(pro_user_class) # OK + ... Version and platform checking -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Fri May 20 15:17:47 2016 From: python-checkins at python.org (victor.stinner) Date: Fri, 20 May 2016 19:17:47 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327056=3A_Fix_=5FU?= =?utf-8?q?npickler=5FRead=28=29_to_avoid_integer_overflow?= Message-ID: <20160520191746.22699.91221.0204E455@psf.io> https://hg.python.org/cpython/rev/3d7b7aa89437 changeset: 101453:3d7b7aa89437 user: Victor Stinner date: Fri May 20 21:16:59 2016 +0200 summary: Issue #27056: Fix _Unpickler_Read() to avoid integer overflow files: Modules/_pickle.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Modules/_pickle.c b/Modules/_pickle.c --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -1244,7 +1244,7 @@ Returns -1 (with an exception set) on failure. On success, return the number of chars read. */ #define _Unpickler_Read(self, s, n) \ - (((self)->next_read_idx + (n) <= (self)->input_len) \ + (((n) <= (self)->input_len - (self)->next_read_idx) \ ? (*(s) = (self)->input_buffer + (self)->next_read_idx, \ (self)->next_read_idx += (n), \ (n)) \ -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 15:32:22 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Fri, 20 May 2016 19:32:22 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2MTY4?= =?utf-8?q?=3A_Fixed_possible_refleaks_in_failing_Py=5FBuildValue=28=29_wi?= =?utf-8?q?th_the_=22N=22?= Message-ID: <20160520193221.21502.22436.F6AD92C2@psf.io> https://hg.python.org/cpython/rev/0285173d81b4 changeset: 101455:0285173d81b4 branch: 2.7 parent: 101426:18c5e4d82d83 user: Serhiy Storchaka date: Fri May 20 22:31:24 2016 +0300 summary: Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" format unit. files: Lib/test/test_capi.py | 7 +- Misc/NEWS | 3 + Modules/_testcapimodule.c | 95 +++++++++++++++++++++ Python/modsupport.c | 114 +++++++++++++++---------- 4 files changed, 174 insertions(+), 45 deletions(-) diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -16,6 +16,11 @@ # Skip this test if the _testcapi module isn't available. _testcapi = support.import_module('_testcapi') +class CAPITest(unittest.TestCase): + + def test_buildvalue_N(self): + _testcapi.test_buildvalue_N() + @unittest.skipUnless(threading, 'Threading required for this test.') class TestPendingCalls(unittest.TestCase): @@ -132,7 +137,7 @@ except _testcapi.error: raise support.TestFailed, sys.exc_info()[1] - support.run_unittest(TestPendingCalls, TestThreadState) + support.run_unittest(CAPITest, TestPendingCalls, TestThreadState) if __name__ == "__main__": test_main() diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" + format unit. + - Issue #27039: Fixed bytearray.remove() for values greater than 127. Patch by Joe Jevnik. diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -931,6 +931,100 @@ #endif /* ifdef HAVE_LONG_LONG */ static PyObject * +return_none(void *unused) +{ + Py_RETURN_NONE; +} + +static PyObject * +raise_error(void *unused) +{ + PyErr_SetNone(PyExc_ValueError); + return NULL; +} + +static int +test_buildvalue_N_error(const char *fmt) +{ + PyObject *arg, *res; + + arg = PyList_New(0); + if (arg == NULL) { + return -1; + } + + Py_INCREF(arg); + res = Py_BuildValue(fmt, return_none, NULL, arg); + if (res == NULL) { + return -1; + } + Py_DECREF(res); + if (Py_REFCNT(arg) != 1) { + PyErr_Format(TestError, "test_buildvalue_N: " + "arg was not decrefed in successful " + "Py_BuildValue(\"%s\")", fmt); + return -1; + } + + Py_INCREF(arg); + res = Py_BuildValue(fmt, raise_error, NULL, arg); + if (res != NULL || !PyErr_Occurred()) { + PyErr_Format(TestError, "test_buildvalue_N: " + "Py_BuildValue(\"%s\") didn't complain", fmt); + return -1; + } + PyErr_Clear(); + if (Py_REFCNT(arg) != 1) { + PyErr_Format(TestError, "test_buildvalue_N: " + "arg was not decrefed in failed " + "Py_BuildValue(\"%s\")", fmt); + return -1; + } + Py_DECREF(arg); + return 0; +} + +static PyObject * +test_buildvalue_N(PyObject *self, PyObject *noargs) +{ + PyObject *arg, *res; + + arg = PyList_New(0); + if (arg == NULL) { + return NULL; + } + Py_INCREF(arg); + res = Py_BuildValue("N", arg); + if (res == NULL) { + return NULL; + } + if (res != arg) { + return raiseTestError("test_buildvalue_N", + "Py_BuildValue(\"N\") returned wrong result"); + } + if (Py_REFCNT(arg) != 2) { + return raiseTestError("test_buildvalue_N", + "arg was not decrefed in Py_BuildValue(\"N\")"); + } + Py_DECREF(res); + Py_DECREF(arg); + + if (test_buildvalue_N_error("O&N") < 0) + return NULL; + if (test_buildvalue_N_error("(O&N)") < 0) + return NULL; + if (test_buildvalue_N_error("[O&N]") < 0) + return NULL; + if (test_buildvalue_N_error("{O&N}") < 0) + return NULL; + if (test_buildvalue_N_error("{()O&(())N}") < 0) + return NULL; + + Py_RETURN_NONE; +} + + +static PyObject * get_args(PyObject *self, PyObject *args) { if (args == NULL) { @@ -2414,6 +2508,7 @@ {"test_with_docstring", (PyCFunction)test_with_docstring, METH_NOARGS, PyDoc_STR("This is a pretty normal docstring.")}, + {"test_buildvalue_N", test_buildvalue_N, METH_NOARGS}, {"get_args", get_args, METH_VARARGS}, {"get_kwargs", (PyCFunction)get_kwargs, METH_VARARGS|METH_KEYWORDS}, {"getargs_tuple", getargs_tuple, METH_VARARGS}, diff --git a/Python/modsupport.c b/Python/modsupport.c --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -156,48 +156,83 @@ static PyObject *do_mkvalue(const char**, va_list *, int); +static void +do_ignore(const char **p_format, va_list *p_va, int endchar, int n, int flags) +{ + PyObject *v; + int i; + assert(PyErr_Occurred()); + v = PyTuple_New(n); + for (i = 0; i < n; i++) { + PyObject *exception, *value, *tb, *w; + PyErr_Fetch(&exception, &value, &tb); + w = do_mkvalue(p_format, p_va, flags); + PyErr_Restore(exception, value, tb); + if (w != NULL) { + if (v != NULL) { + PyTuple_SET_ITEM(v, i, w); + } + else { + Py_DECREF(w); + } + } + } + Py_XDECREF(v); + if (**p_format != endchar) { + PyErr_SetString(PyExc_SystemError, + "Unmatched paren in format"); + return; + } + if (endchar) + ++*p_format; +} + static PyObject * do_mkdict(const char **p_format, va_list *p_va, int endchar, int n, int flags) { PyObject *d; int i; - int itemfailed = 0; if (n < 0) return NULL; - if ((d = PyDict_New()) == NULL) + if (n % 2) { + PyErr_SetString(PyExc_SystemError, + "Bad dict format"); + do_ignore(p_format, p_va, endchar, n, flags); return NULL; + } /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + if ((d = PyDict_New()) == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i+= 2) { PyObject *k, *v; - int err; + k = do_mkvalue(p_format, p_va, flags); if (k == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - k = Py_None; - } - v = do_mkvalue(p_format, p_va, flags); - if (v == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - v = Py_None; - } - err = PyDict_SetItem(d, k, v); - Py_DECREF(k); - Py_DECREF(v); - if (err < 0 || itemfailed) { + do_ignore(p_format, p_va, endchar, n - i - 1, flags); Py_DECREF(d); return NULL; } + v = do_mkvalue(p_format, p_va, flags); + if (v == NULL || PyDict_SetItem(d, k, v) < 0) { + do_ignore(p_format, p_va, endchar, n - i - 2, flags); + Py_DECREF(k); + Py_XDECREF(v); + Py_DECREF(d); + return NULL; + } + Py_DECREF(k); + Py_DECREF(v); } - if (d != NULL && **p_format != endchar) { + if (**p_format != endchar) { Py_DECREF(d); - d = NULL; PyErr_SetString(PyExc_SystemError, "Unmatched paren in format"); + return NULL; } - else if (endchar) + if (endchar) ++*p_format; return d; } @@ -207,29 +242,24 @@ { PyObject *v; int i; - int itemfailed = 0; if (n < 0) return NULL; - v = PyList_New(n); - if (v == NULL) - return NULL; /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + v = PyList_New(n); + if (v == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i++) { PyObject *w = do_mkvalue(p_format, p_va, flags); if (w == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - w = Py_None; + do_ignore(p_format, p_va, endchar, n - i - 1, flags); + Py_DECREF(v); + return NULL; } PyList_SET_ITEM(v, i, w); } - - if (itemfailed) { - /* do_mkvalue() should have already set an error */ - Py_DECREF(v); - return NULL; - } if (**p_format != endchar) { Py_DECREF(v); PyErr_SetString(PyExc_SystemError, @@ -257,27 +287,23 @@ { PyObject *v; int i; - int itemfailed = 0; if (n < 0) return NULL; - if ((v = PyTuple_New(n)) == NULL) - return NULL; /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + if ((v = PyTuple_New(n)) == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i++) { PyObject *w = do_mkvalue(p_format, p_va, flags); if (w == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - w = Py_None; + do_ignore(p_format, p_va, endchar, n - i - 1, flags); + Py_DECREF(v); + return NULL; } PyTuple_SET_ITEM(v, i, w); } - if (itemfailed) { - /* do_mkvalue() should have already set an error */ - Py_DECREF(v); - return NULL; - } if (**p_format != endchar) { Py_DECREF(v); PyErr_SetString(PyExc_SystemError, -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 15:32:22 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Fri, 20 May 2016 19:32:22 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2MTY4?= =?utf-8?q?=3A_Fixed_possible_refleaks_in_failing_Py=5FBuildValue=28=29_wi?= =?utf-8?q?th_the_=22N=22?= Message-ID: <20160520193221.22703.81736.6FFD3C40@psf.io> https://hg.python.org/cpython/rev/4e605f809551 changeset: 101454:4e605f809551 branch: 3.5 parent: 101451:7c9666a055e4 user: Serhiy Storchaka date: Fri May 20 22:31:14 2016 +0300 summary: Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" format unit. files: Lib/test/test_capi.py | 3 + Misc/NEWS | 3 + Modules/_testcapimodule.c | 95 +++++++++++++++++++ Python/modsupport.c | 127 ++++++++++++++----------- 4 files changed, 173 insertions(+), 55 deletions(-) diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -236,6 +236,9 @@ 'return_result_with_error.* ' 'returned a result with an error set') + def test_buildvalue_N(self): + _testcapi.test_buildvalue_N() + @unittest.skipUnless(threading, 'Threading required for this test.') class TestPendingCalls(unittest.TestCase): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" + format unit. + - Issue #26991: Fix possible refleak when creating a function with annotations. - Issue #27039: Fixed bytearray.remove() for values greater than 127. Patch by diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -873,6 +873,100 @@ #endif /* ifdef HAVE_LONG_LONG */ static PyObject * +return_none(void *unused) +{ + Py_RETURN_NONE; +} + +static PyObject * +raise_error(void *unused) +{ + PyErr_SetNone(PyExc_ValueError); + return NULL; +} + +static int +test_buildvalue_N_error(const char *fmt) +{ + PyObject *arg, *res; + + arg = PyList_New(0); + if (arg == NULL) { + return -1; + } + + Py_INCREF(arg); + res = Py_BuildValue(fmt, return_none, NULL, arg); + if (res == NULL) { + return -1; + } + Py_DECREF(res); + if (Py_REFCNT(arg) != 1) { + PyErr_Format(TestError, "test_buildvalue_N: " + "arg was not decrefed in successful " + "Py_BuildValue(\"%s\")", fmt); + return -1; + } + + Py_INCREF(arg); + res = Py_BuildValue(fmt, raise_error, NULL, arg); + if (res != NULL || !PyErr_Occurred()) { + PyErr_Format(TestError, "test_buildvalue_N: " + "Py_BuildValue(\"%s\") didn't complain", fmt); + return -1; + } + PyErr_Clear(); + if (Py_REFCNT(arg) != 1) { + PyErr_Format(TestError, "test_buildvalue_N: " + "arg was not decrefed in failed " + "Py_BuildValue(\"%s\")", fmt); + return -1; + } + Py_DECREF(arg); + return 0; +} + +static PyObject * +test_buildvalue_N(PyObject *self, PyObject *noargs) +{ + PyObject *arg, *res; + + arg = PyList_New(0); + if (arg == NULL) { + return NULL; + } + Py_INCREF(arg); + res = Py_BuildValue("N", arg); + if (res == NULL) { + return NULL; + } + if (res != arg) { + return raiseTestError("test_buildvalue_N", + "Py_BuildValue(\"N\") returned wrong result"); + } + if (Py_REFCNT(arg) != 2) { + return raiseTestError("test_buildvalue_N", + "arg was not decrefed in Py_BuildValue(\"N\")"); + } + Py_DECREF(res); + Py_DECREF(arg); + + if (test_buildvalue_N_error("O&N") < 0) + return NULL; + if (test_buildvalue_N_error("(O&N)") < 0) + return NULL; + if (test_buildvalue_N_error("[O&N]") < 0) + return NULL; + if (test_buildvalue_N_error("{O&N}") < 0) + return NULL; + if (test_buildvalue_N_error("{()O&(())N}") < 0) + return NULL; + + Py_RETURN_NONE; +} + + +static PyObject * get_args(PyObject *self, PyObject *args) { if (args == NULL) { @@ -3728,6 +3822,7 @@ {"test_pep3118_obsolete_write_locks", (PyCFunction)test_pep3118_obsolete_write_locks, METH_NOARGS}, #endif {"getbuffer_with_null_view", getbuffer_with_null_view, METH_O}, + {"test_buildvalue_N", test_buildvalue_N, METH_NOARGS}, {"get_args", get_args, METH_VARARGS}, {"get_kwargs", (PyCFunction)get_kwargs, METH_VARARGS|METH_KEYWORDS}, {"getargs_tuple", getargs_tuple, METH_VARARGS}, diff --git a/Python/modsupport.c b/Python/modsupport.c --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -63,48 +63,84 @@ static PyObject *do_mkvalue(const char**, va_list *, int); +static void +do_ignore(const char **p_format, va_list *p_va, int endchar, int n, int flags) +{ + PyObject *v; + int i; + assert(PyErr_Occurred()); + v = PyTuple_New(n); + for (i = 0; i < n; i++) { + PyObject *exception, *value, *tb, *w; + + PyErr_Fetch(&exception, &value, &tb); + w = do_mkvalue(p_format, p_va, flags); + PyErr_Restore(exception, value, tb); + if (w != NULL) { + if (v != NULL) { + PyTuple_SET_ITEM(v, i, w); + } + else { + Py_DECREF(w); + } + } + } + Py_XDECREF(v); + if (**p_format != endchar) { + PyErr_SetString(PyExc_SystemError, + "Unmatched paren in format"); + return; + } + if (endchar) + ++*p_format; +} + static PyObject * do_mkdict(const char **p_format, va_list *p_va, int endchar, int n, int flags) { PyObject *d; int i; - int itemfailed = 0; if (n < 0) return NULL; - if ((d = PyDict_New()) == NULL) + if (n % 2) { + PyErr_SetString(PyExc_SystemError, + "Bad dict format"); + do_ignore(p_format, p_va, endchar, n, flags); return NULL; + } /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + if ((d = PyDict_New()) == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i+= 2) { PyObject *k, *v; - int err; + k = do_mkvalue(p_format, p_va, flags); if (k == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - k = Py_None; - } - v = do_mkvalue(p_format, p_va, flags); - if (v == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - v = Py_None; - } - err = PyDict_SetItem(d, k, v); - Py_DECREF(k); - Py_DECREF(v); - if (err < 0 || itemfailed) { + do_ignore(p_format, p_va, endchar, n - i - 1, flags); Py_DECREF(d); return NULL; } + v = do_mkvalue(p_format, p_va, flags); + if (v == NULL || PyDict_SetItem(d, k, v) < 0) { + do_ignore(p_format, p_va, endchar, n - i - 2, flags); + Py_DECREF(k); + Py_XDECREF(v); + Py_DECREF(d); + return NULL; + } + Py_DECREF(k); + Py_DECREF(v); } - if (d != NULL && **p_format != endchar) { + if (**p_format != endchar) { Py_DECREF(d); - d = NULL; PyErr_SetString(PyExc_SystemError, "Unmatched paren in format"); + return NULL; } - else if (endchar) + if (endchar) ++*p_format; return d; } @@ -114,29 +150,24 @@ { PyObject *v; int i; - int itemfailed = 0; if (n < 0) return NULL; - v = PyList_New(n); - if (v == NULL) - return NULL; /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + v = PyList_New(n); + if (v == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i++) { PyObject *w = do_mkvalue(p_format, p_va, flags); if (w == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - w = Py_None; + do_ignore(p_format, p_va, endchar, n - i - 1, flags); + Py_DECREF(v); + return NULL; } PyList_SET_ITEM(v, i, w); } - - if (itemfailed) { - /* do_mkvalue() should have already set an error */ - Py_DECREF(v); - return NULL; - } if (**p_format != endchar) { Py_DECREF(v); PyErr_SetString(PyExc_SystemError, @@ -153,37 +184,23 @@ { PyObject *v; int i; - int itemfailed = 0; if (n < 0) return NULL; - if ((v = PyTuple_New(n)) == NULL) - return NULL; /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + if ((v = PyTuple_New(n)) == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i++) { - PyObject *w; - - if (itemfailed) { - PyObject *exception, *value, *tb; - PyErr_Fetch(&exception, &value, &tb); - w = do_mkvalue(p_format, p_va, flags); - PyErr_Restore(exception, value, tb); - } - else { - w = do_mkvalue(p_format, p_va, flags); - } + PyObject *w = do_mkvalue(p_format, p_va, flags); if (w == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - w = Py_None; + do_ignore(p_format, p_va, endchar, n - i - 1, flags); + Py_DECREF(v); + return NULL; } PyTuple_SET_ITEM(v, i, w); } - if (itemfailed) { - /* do_mkvalue() should have already set an error */ - Py_DECREF(v); - return NULL; - } if (**p_format != endchar) { Py_DECREF(v); PyErr_SetString(PyExc_SystemError, -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 15:32:23 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Fri, 20 May 2016 19:32:23 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326168=3A_Fixed_possible_refleaks_in_failing_Py?= =?utf-8?q?=5FBuildValue=28=29_with_the_=22N=22?= Message-ID: <20160520193221.543.91832.E8159962@psf.io> https://hg.python.org/cpython/rev/03b32f854680 changeset: 101456:03b32f854680 parent: 101453:3d7b7aa89437 parent: 101454:4e605f809551 user: Serhiy Storchaka date: Fri May 20 22:31:50 2016 +0300 summary: Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" format unit. files: Lib/test/test_capi.py | 3 + Misc/NEWS | 3 + Modules/_testcapimodule.c | 95 +++++++++++++++++++ Python/modsupport.c | 127 ++++++++++++++----------- 4 files changed, 173 insertions(+), 55 deletions(-) diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -238,6 +238,9 @@ 'return_result_with_error.* ' 'returned a result with an error set') + def test_buildvalue_N(self): + _testcapi.test_buildvalue_N() + @unittest.skipUnless(threading, 'Threading required for this test.') class TestPendingCalls(unittest.TestCase): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -41,6 +41,9 @@ Core and Builtins ----------------- +- Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" + format unit. + - Issue #26991: Fix possible refleak when creating a function with annotations. - Issue #27039: Fixed bytearray.remove() for values greater than 127. Based on diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -873,6 +873,100 @@ #endif /* ifdef HAVE_LONG_LONG */ static PyObject * +return_none(void *unused) +{ + Py_RETURN_NONE; +} + +static PyObject * +raise_error(void *unused) +{ + PyErr_SetNone(PyExc_ValueError); + return NULL; +} + +static int +test_buildvalue_N_error(const char *fmt) +{ + PyObject *arg, *res; + + arg = PyList_New(0); + if (arg == NULL) { + return -1; + } + + Py_INCREF(arg); + res = Py_BuildValue(fmt, return_none, NULL, arg); + if (res == NULL) { + return -1; + } + Py_DECREF(res); + if (Py_REFCNT(arg) != 1) { + PyErr_Format(TestError, "test_buildvalue_N: " + "arg was not decrefed in successful " + "Py_BuildValue(\"%s\")", fmt); + return -1; + } + + Py_INCREF(arg); + res = Py_BuildValue(fmt, raise_error, NULL, arg); + if (res != NULL || !PyErr_Occurred()) { + PyErr_Format(TestError, "test_buildvalue_N: " + "Py_BuildValue(\"%s\") didn't complain", fmt); + return -1; + } + PyErr_Clear(); + if (Py_REFCNT(arg) != 1) { + PyErr_Format(TestError, "test_buildvalue_N: " + "arg was not decrefed in failed " + "Py_BuildValue(\"%s\")", fmt); + return -1; + } + Py_DECREF(arg); + return 0; +} + +static PyObject * +test_buildvalue_N(PyObject *self, PyObject *noargs) +{ + PyObject *arg, *res; + + arg = PyList_New(0); + if (arg == NULL) { + return NULL; + } + Py_INCREF(arg); + res = Py_BuildValue("N", arg); + if (res == NULL) { + return NULL; + } + if (res != arg) { + return raiseTestError("test_buildvalue_N", + "Py_BuildValue(\"N\") returned wrong result"); + } + if (Py_REFCNT(arg) != 2) { + return raiseTestError("test_buildvalue_N", + "arg was not decrefed in Py_BuildValue(\"N\")"); + } + Py_DECREF(res); + Py_DECREF(arg); + + if (test_buildvalue_N_error("O&N") < 0) + return NULL; + if (test_buildvalue_N_error("(O&N)") < 0) + return NULL; + if (test_buildvalue_N_error("[O&N]") < 0) + return NULL; + if (test_buildvalue_N_error("{O&N}") < 0) + return NULL; + if (test_buildvalue_N_error("{()O&(())N}") < 0) + return NULL; + + Py_RETURN_NONE; +} + + +static PyObject * get_args(PyObject *self, PyObject *args) { if (args == NULL) { @@ -3861,6 +3955,7 @@ {"test_pep3118_obsolete_write_locks", (PyCFunction)test_pep3118_obsolete_write_locks, METH_NOARGS}, #endif {"getbuffer_with_null_view", getbuffer_with_null_view, METH_O}, + {"test_buildvalue_N", test_buildvalue_N, METH_NOARGS}, {"get_args", get_args, METH_VARARGS}, {"get_kwargs", (PyCFunction)get_kwargs, METH_VARARGS|METH_KEYWORDS}, {"getargs_tuple", getargs_tuple, METH_VARARGS}, diff --git a/Python/modsupport.c b/Python/modsupport.c --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -63,48 +63,84 @@ static PyObject *do_mkvalue(const char**, va_list *, int); +static void +do_ignore(const char **p_format, va_list *p_va, int endchar, int n, int flags) +{ + PyObject *v; + int i; + assert(PyErr_Occurred()); + v = PyTuple_New(n); + for (i = 0; i < n; i++) { + PyObject *exception, *value, *tb, *w; + + PyErr_Fetch(&exception, &value, &tb); + w = do_mkvalue(p_format, p_va, flags); + PyErr_Restore(exception, value, tb); + if (w != NULL) { + if (v != NULL) { + PyTuple_SET_ITEM(v, i, w); + } + else { + Py_DECREF(w); + } + } + } + Py_XDECREF(v); + if (**p_format != endchar) { + PyErr_SetString(PyExc_SystemError, + "Unmatched paren in format"); + return; + } + if (endchar) + ++*p_format; +} + static PyObject * do_mkdict(const char **p_format, va_list *p_va, int endchar, int n, int flags) { PyObject *d; int i; - int itemfailed = 0; if (n < 0) return NULL; - if ((d = PyDict_New()) == NULL) + if (n % 2) { + PyErr_SetString(PyExc_SystemError, + "Bad dict format"); + do_ignore(p_format, p_va, endchar, n, flags); return NULL; + } /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + if ((d = PyDict_New()) == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i+= 2) { PyObject *k, *v; - int err; + k = do_mkvalue(p_format, p_va, flags); if (k == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - k = Py_None; - } - v = do_mkvalue(p_format, p_va, flags); - if (v == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - v = Py_None; - } - err = PyDict_SetItem(d, k, v); - Py_DECREF(k); - Py_DECREF(v); - if (err < 0 || itemfailed) { + do_ignore(p_format, p_va, endchar, n - i - 1, flags); Py_DECREF(d); return NULL; } + v = do_mkvalue(p_format, p_va, flags); + if (v == NULL || PyDict_SetItem(d, k, v) < 0) { + do_ignore(p_format, p_va, endchar, n - i - 2, flags); + Py_DECREF(k); + Py_XDECREF(v); + Py_DECREF(d); + return NULL; + } + Py_DECREF(k); + Py_DECREF(v); } - if (d != NULL && **p_format != endchar) { + if (**p_format != endchar) { Py_DECREF(d); - d = NULL; PyErr_SetString(PyExc_SystemError, "Unmatched paren in format"); + return NULL; } - else if (endchar) + if (endchar) ++*p_format; return d; } @@ -114,29 +150,24 @@ { PyObject *v; int i; - int itemfailed = 0; if (n < 0) return NULL; - v = PyList_New(n); - if (v == NULL) - return NULL; /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + v = PyList_New(n); + if (v == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i++) { PyObject *w = do_mkvalue(p_format, p_va, flags); if (w == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - w = Py_None; + do_ignore(p_format, p_va, endchar, n - i - 1, flags); + Py_DECREF(v); + return NULL; } PyList_SET_ITEM(v, i, w); } - - if (itemfailed) { - /* do_mkvalue() should have already set an error */ - Py_DECREF(v); - return NULL; - } if (**p_format != endchar) { Py_DECREF(v); PyErr_SetString(PyExc_SystemError, @@ -153,37 +184,23 @@ { PyObject *v; int i; - int itemfailed = 0; if (n < 0) return NULL; - if ((v = PyTuple_New(n)) == NULL) - return NULL; /* Note that we can't bail immediately on error as this will leak refcounts on any 'N' arguments. */ + if ((v = PyTuple_New(n)) == NULL) { + do_ignore(p_format, p_va, endchar, n, flags); + return NULL; + } for (i = 0; i < n; i++) { - PyObject *w; - - if (itemfailed) { - PyObject *exception, *value, *tb; - PyErr_Fetch(&exception, &value, &tb); - w = do_mkvalue(p_format, p_va, flags); - PyErr_Restore(exception, value, tb); - } - else { - w = do_mkvalue(p_format, p_va, flags); - } + PyObject *w = do_mkvalue(p_format, p_va, flags); if (w == NULL) { - itemfailed = 1; - Py_INCREF(Py_None); - w = Py_None; + do_ignore(p_format, p_va, endchar, n - i - 1, flags); + Py_DECREF(v); + return NULL; } PyTuple_SET_ITEM(v, i, w); } - if (itemfailed) { - /* do_mkvalue() should have already set an error */ - Py_DECREF(v); - return NULL; - } if (**p_format != endchar) { Py_DECREF(v); PyErr_SetString(PyExc_SystemError, -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 16:19:50 2016 From: python-checkins at python.org (brett.cannon) Date: Fri, 20 May 2016 20:19:50 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Update_what_needs_to_be_done_?= =?utf-8?q?for_PEP_519?= Message-ID: <20160520201949.30875.37275.7FEF9CE4@psf.io> https://hg.python.org/peps/rev/1e6be487bcd1 changeset: 6340:1e6be487bcd1 user: Brett Cannon date: Fri May 20 13:19:36 2016 -0700 summary: Update what needs to be done for PEP 519 files: pep-0519.txt | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pep-0519.txt b/pep-0519.txt --- a/pep-0519.txt +++ b/pep-0519.txt @@ -316,20 +316,33 @@ Implementation ============== -This is the task list for what this PEP proposes: +This is the task list for what this PEP proposes to be changed in +Python 3.6: #. Remove the ``path`` attribute from pathlib + (`done `_) #. Remove the provisional status of pathlib #. Add ``os.PathLike`` +#. Add ``PyOS_FSPath()`` #. Add ``os.fspath()`` -#. Add ``PyOS_FSPath()`` #. Update ``os.fsencode()`` #. Update ``os.fsdecode()`` #. Update ``pathlib.PurePath`` and ``pathlib.Path`` + + #. Add ``__fspath__()`` + #. Add ``os.PathLike`` support to the constructors + +#. Update ``os.DirEntry`` + + #. Add ``__fspath__()`` + #. Add ``os.pathLike`` support to the constructor + #. Alias ``DirEntry`` to ``os.DirEntry`` + (`bug `_) + #. Update ``builtins.open()`` -#. Update ``os.DirEntry`` #. Update ``os.path`` -#. Add a glossary entry for "path-like" +#. Add a `glossary `_ entry for "path-like" +#. Update `"What's New" `_ Rejected Ideas -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Fri May 20 16:30:10 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Fri, 20 May 2016 20:30:10 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MDYz?= =?utf-8?q?=3A_Some_unittest_loader_tests_were_silently_skipped=2E?= Message-ID: <20160520203008.21486.38141.C5E43AA6@psf.io> https://hg.python.org/cpython/rev/e715ffd2d938 changeset: 101457:e715ffd2d938 branch: 3.5 parent: 101454:4e605f809551 user: Serhiy Storchaka date: Fri May 20 23:28:37 2016 +0300 summary: Issue #27063: Some unittest loader tests were silently skipped. files: Lib/unittest/test/test_loader.py | 54 ++++++++++--------- 1 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Lib/unittest/test/test_loader.py b/Lib/unittest/test/test_loader.py --- a/Lib/unittest/test/test_loader.py +++ b/Lib/unittest/test/test_loader.py @@ -8,7 +8,7 @@ # test isolation and reproducibility. def warningregistry(func): def wrapper(*args, **kws): - missing = object() + missing = [] saved = getattr(warnings, '__warningregistry__', missing).copy() try: return func(*args, **kws) @@ -20,6 +20,7 @@ pass else: warnings.__warningregistry__ = saved + return wrapper class Test_TestLoader(unittest.TestCase): @@ -197,9 +198,9 @@ # ignored (and deprecated). load_tests_args = [] with warnings.catch_warnings(record=False): - warnings.simplefilter('never') + warnings.simplefilter('ignore') suite = loader.loadTestsFromModule(m, use_load_tests=False) - self.assertEqual(load_tests_args, [loader, suite, None]) + self.assertEqual(load_tests_args, [loader, suite, None]) @warningregistry def test_loadTestsFromModule__use_load_tests_deprecated_positional(self): @@ -221,10 +222,10 @@ with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always') suite = loader.loadTestsFromModule(m, False) - self.assertIsInstance(suite, unittest.TestSuite) - # load_tests was still called because use_load_tests is deprecated - # and ignored. - self.assertEqual(load_tests_args, [loader, suite, None]) + self.assertIsInstance(suite, unittest.TestSuite) + # load_tests was still called because use_load_tests is deprecated + # and ignored. + self.assertEqual(load_tests_args, [loader, suite, None]) # We got a warning. self.assertIs(w[-1].category, DeprecationWarning) self.assertEqual(str(w[-1].message), @@ -249,14 +250,14 @@ with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always') suite = loader.loadTestsFromModule(m, use_load_tests=False) - self.assertIsInstance(suite, unittest.TestSuite) - # load_tests was still called because use_load_tests is deprecated - # and ignored. - self.assertEqual(load_tests_args, [loader, suite, None]) - # We got a warning. - self.assertIs(w[-1].category, DeprecationWarning) - self.assertEqual(str(w[-1].message), - 'use_load_tests is deprecated and ignored') + self.assertIsInstance(suite, unittest.TestSuite) + # load_tests was still called because use_load_tests is deprecated + # and ignored. + self.assertEqual(load_tests_args, [loader, suite, None]) + # We got a warning. + self.assertIs(w[-1].category, DeprecationWarning) + self.assertEqual(str(w[-1].message), + 'use_load_tests is deprecated and ignored') @warningregistry def test_loadTestsFromModule__too_many_positional_args(self): @@ -274,17 +275,18 @@ m.load_tests = load_tests loader = unittest.TestLoader() with self.assertRaises(TypeError) as cm, \ - warnings.catch_warning(record=True) as w: + warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always') loader.loadTestsFromModule(m, False, 'testme.*') - # We still got the deprecation warning. - self.assertIs(w[-1].category, DeprecationWarning) - self.assertEqual(str(w[-1].message), - 'use_load_tests is deprecated and ignored') - # We also got a TypeError for too many positional arguments. - self.assertEqual(type(cm.exception), TypeError) - self.assertEqual( - str(cm.exception), - 'loadTestsFromModule() takes 1 positional argument but 3 were given') + # We still got the deprecation warning. + self.assertIs(w[-1].category, DeprecationWarning) + self.assertEqual(str(w[-1].message), + 'use_load_tests is deprecated and ignored') + # We also got a TypeError for too many positional arguments. + self.assertEqual(type(cm.exception), TypeError) + self.assertEqual( + str(cm.exception), + 'loadTestsFromModule() takes 1 positional argument but 3 were given') @warningregistry def test_loadTestsFromModule__use_load_tests_other_bad_keyword(self): @@ -302,7 +304,7 @@ m.load_tests = load_tests loader = unittest.TestLoader() with warnings.catch_warnings(): - warnings.simplefilter('never') + warnings.simplefilter('ignore') with self.assertRaises(TypeError) as cm: loader.loadTestsFromModule( m, use_load_tests=False, very_bad=True, worse=False) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 16:30:12 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Fri, 20 May 2016 20:30:12 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327063=3A_Some_unittest_loader_tests_were_silent?= =?utf-8?q?ly_skipped=2E?= Message-ID: <20160520203009.47736.18174.4FC2A532@psf.io> https://hg.python.org/cpython/rev/f4f615edb6b1 changeset: 101458:f4f615edb6b1 parent: 101456:03b32f854680 parent: 101457:e715ffd2d938 user: Serhiy Storchaka date: Fri May 20 23:29:07 2016 +0300 summary: Issue #27063: Some unittest loader tests were silently skipped. files: Lib/unittest/test/test_loader.py | 54 ++++++++++--------- 1 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Lib/unittest/test/test_loader.py b/Lib/unittest/test/test_loader.py --- a/Lib/unittest/test/test_loader.py +++ b/Lib/unittest/test/test_loader.py @@ -8,7 +8,7 @@ # test isolation and reproducibility. def warningregistry(func): def wrapper(*args, **kws): - missing = object() + missing = [] saved = getattr(warnings, '__warningregistry__', missing).copy() try: return func(*args, **kws) @@ -20,6 +20,7 @@ pass else: warnings.__warningregistry__ = saved + return wrapper class Test_TestLoader(unittest.TestCase): @@ -197,9 +198,9 @@ # ignored (and deprecated). load_tests_args = [] with warnings.catch_warnings(record=False): - warnings.simplefilter('never') + warnings.simplefilter('ignore') suite = loader.loadTestsFromModule(m, use_load_tests=False) - self.assertEqual(load_tests_args, [loader, suite, None]) + self.assertEqual(load_tests_args, [loader, suite, None]) @warningregistry def test_loadTestsFromModule__use_load_tests_deprecated_positional(self): @@ -221,10 +222,10 @@ with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always') suite = loader.loadTestsFromModule(m, False) - self.assertIsInstance(suite, unittest.TestSuite) - # load_tests was still called because use_load_tests is deprecated - # and ignored. - self.assertEqual(load_tests_args, [loader, suite, None]) + self.assertIsInstance(suite, unittest.TestSuite) + # load_tests was still called because use_load_tests is deprecated + # and ignored. + self.assertEqual(load_tests_args, [loader, suite, None]) # We got a warning. self.assertIs(w[-1].category, DeprecationWarning) self.assertEqual(str(w[-1].message), @@ -249,14 +250,14 @@ with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always') suite = loader.loadTestsFromModule(m, use_load_tests=False) - self.assertIsInstance(suite, unittest.TestSuite) - # load_tests was still called because use_load_tests is deprecated - # and ignored. - self.assertEqual(load_tests_args, [loader, suite, None]) - # We got a warning. - self.assertIs(w[-1].category, DeprecationWarning) - self.assertEqual(str(w[-1].message), - 'use_load_tests is deprecated and ignored') + self.assertIsInstance(suite, unittest.TestSuite) + # load_tests was still called because use_load_tests is deprecated + # and ignored. + self.assertEqual(load_tests_args, [loader, suite, None]) + # We got a warning. + self.assertIs(w[-1].category, DeprecationWarning) + self.assertEqual(str(w[-1].message), + 'use_load_tests is deprecated and ignored') @warningregistry def test_loadTestsFromModule__too_many_positional_args(self): @@ -274,17 +275,18 @@ m.load_tests = load_tests loader = unittest.TestLoader() with self.assertRaises(TypeError) as cm, \ - warnings.catch_warning(record=True) as w: + warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always') loader.loadTestsFromModule(m, False, 'testme.*') - # We still got the deprecation warning. - self.assertIs(w[-1].category, DeprecationWarning) - self.assertEqual(str(w[-1].message), - 'use_load_tests is deprecated and ignored') - # We also got a TypeError for too many positional arguments. - self.assertEqual(type(cm.exception), TypeError) - self.assertEqual( - str(cm.exception), - 'loadTestsFromModule() takes 1 positional argument but 3 were given') + # We still got the deprecation warning. + self.assertIs(w[-1].category, DeprecationWarning) + self.assertEqual(str(w[-1].message), + 'use_load_tests is deprecated and ignored') + # We also got a TypeError for too many positional arguments. + self.assertEqual(type(cm.exception), TypeError) + self.assertEqual( + str(cm.exception), + 'loadTestsFromModule() takes 1 positional argument but 3 were given') @warningregistry def test_loadTestsFromModule__use_load_tests_other_bad_keyword(self): @@ -302,7 +304,7 @@ m.load_tests = load_tests loader = unittest.TestLoader() with warnings.catch_warnings(): - warnings.simplefilter('never') + warnings.simplefilter('ignore') with self.assertRaises(TypeError) as cm: loader.loadTestsFromModule( m, use_load_tests=False, very_bad=True, worse=False) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 17:44:49 2016 From: python-checkins at python.org (yury.selivanov) Date: Fri, 20 May 2016 21:44:49 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_3=2E5_=28asyncio=29?= Message-ID: <20160520214449.3453.22975.6AA1D9BF@psf.io> https://hg.python.org/cpython/rev/e0212060c80e changeset: 101460:e0212060c80e parent: 101458:f4f615edb6b1 parent: 101459:1570e3855ce8 user: Yury Selivanov date: Fri May 20 17:44:44 2016 -0400 summary: Merge 3.5 (asyncio) files: Lib/asyncio/base_events.py | 5 ++ Lib/test/test_asyncio/test_base_events.py | 22 +++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -102,6 +102,11 @@ else: return None + if port in {None, ''}: + port = 0 + elif isinstance(port, (bytes, str)): + port = int(port) + if hasattr(socket, 'inet_pton'): if family == socket.AF_UNSPEC: afs = [socket.AF_INET, socket.AF_INET6] diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -120,6 +120,28 @@ (INET6, STREAM, TCP, '', ('::3%lo0', 1)), base_events._ipaddr_info('::3%lo0', 1, INET6, STREAM, TCP)) + def test_port_parameter_types(self): + # Test obscure kinds of arguments for "port". + INET = socket.AF_INET + STREAM = socket.SOCK_STREAM + TCP = socket.IPPROTO_TCP + + self.assertEqual( + (INET, STREAM, TCP, '', ('1.2.3.4', 0)), + base_events._ipaddr_info('1.2.3.4', None, INET, STREAM, TCP)) + + self.assertEqual( + (INET, STREAM, TCP, '', ('1.2.3.4', 0)), + base_events._ipaddr_info('1.2.3.4', '', INET, STREAM, TCP)) + + self.assertEqual( + (INET, STREAM, TCP, '', ('1.2.3.4', 1)), + base_events._ipaddr_info('1.2.3.4', '1', INET, STREAM, TCP)) + + self.assertEqual( + (INET, STREAM, TCP, '', ('1.2.3.4', 1)), + base_events._ipaddr_info('1.2.3.4', b'1', INET, STREAM, TCP)) + @patch_socket def test_ipaddr_info_no_inet_pton(self, m_socket): del m_socket.inet_pton -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 20 17:44:54 2016 From: python-checkins at python.org (yury.selivanov) Date: Fri, 20 May 2016 21:44:54 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogYXN5bmNpbzogRml4?= =?utf-8?q?_getaddrinfo_to_accept_None/str/bytes_for_=27port=27_arg?= Message-ID: <20160520214449.20736.11956.8AF2B1A1@psf.io> https://hg.python.org/cpython/rev/1570e3855ce8 changeset: 101459:1570e3855ce8 branch: 3.5 parent: 101457:e715ffd2d938 user: Yury Selivanov date: Fri May 20 17:44:19 2016 -0400 summary: asyncio: Fix getaddrinfo to accept None/str/bytes for 'port' arg Patch by A. Jesse Jiryu Davis. files: Lib/asyncio/base_events.py | 5 ++ Lib/test/test_asyncio/test_base_events.py | 22 +++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -102,6 +102,11 @@ else: return None + if port in {None, ''}: + port = 0 + elif isinstance(port, (bytes, str)): + port = int(port) + if hasattr(socket, 'inet_pton'): if family == socket.AF_UNSPEC: afs = [socket.AF_INET, socket.AF_INET6] diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -120,6 +120,28 @@ (INET6, STREAM, TCP, '', ('::3%lo0', 1)), base_events._ipaddr_info('::3%lo0', 1, INET6, STREAM, TCP)) + def test_port_parameter_types(self): + # Test obscure kinds of arguments for "port". + INET = socket.AF_INET + STREAM = socket.SOCK_STREAM + TCP = socket.IPPROTO_TCP + + self.assertEqual( + (INET, STREAM, TCP, '', ('1.2.3.4', 0)), + base_events._ipaddr_info('1.2.3.4', None, INET, STREAM, TCP)) + + self.assertEqual( + (INET, STREAM, TCP, '', ('1.2.3.4', 0)), + base_events._ipaddr_info('1.2.3.4', '', INET, STREAM, TCP)) + + self.assertEqual( + (INET, STREAM, TCP, '', ('1.2.3.4', 1)), + base_events._ipaddr_info('1.2.3.4', '1', INET, STREAM, TCP)) + + self.assertEqual( + (INET, STREAM, TCP, '', ('1.2.3.4', 1)), + base_events._ipaddr_info('1.2.3.4', b'1', INET, STREAM, TCP)) + @patch_socket def test_ipaddr_info_no_inet_pton(self, m_socket): del m_socket.inet_pton -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Sat May 21 04:53:11 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 21 May 2016 08:53:11 +0000 Subject: [Python-checkins] Daily reference leaks (e0212060c80e): sum=2 Message-ID: <20160521085310.21206.20306.875FF979@psf.io> results for e0212060c80e on branch "default" -------------------------------------------- test_collections leaked [-4, 4, -4] memory blocks, sum=-4 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [2, 0, 0] memory blocks, sum=2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogsS8CZA', '--timeout', '7200'] From python-checkins at python.org Sat May 21 07:56:32 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 21 May 2016 11:56:32 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327075=3A_Link_to_StreamReader_and_StreamWriter_?= =?utf-8?q?docs?= Message-ID: <20160521115631.3443.98501.56931A7F@psf.io> https://hg.python.org/cpython/rev/b11b71aaf864 changeset: 101462:b11b71aaf864 parent: 101460:e0212060c80e parent: 101461:c1628c1162a4 user: Berker Peksag date: Sat May 21 14:56:53 2016 +0300 summary: Issue #27075: Link to StreamReader and StreamWriter docs Patch by Ville Skytt?. files: Doc/library/codecs.rst | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -137,16 +137,16 @@ .. function:: getreader(encoding) - Look up the codec for the given encoding and return its StreamReader class or - factory function. + Look up the codec for the given encoding and return its :class:`StreamReader` + class or factory function. Raises a :exc:`LookupError` in case the encoding cannot be found. .. function:: getwriter(encoding) - Look up the codec for the given encoding and return its StreamWriter class or - factory function. + Look up the codec for the given encoding and return its :class:`StreamWriter` + class or factory function. Raises a :exc:`LookupError` in case the encoding cannot be found. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 07:56:32 2016 From: python-checkins at python.org (berker.peksag) Date: Sat, 21 May 2016 11:56:32 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MDc1?= =?utf-8?q?=3A_Link_to_StreamReader_and_StreamWriter_docs?= Message-ID: <20160521115631.29964.80537.C746EC36@psf.io> https://hg.python.org/cpython/rev/c1628c1162a4 changeset: 101461:c1628c1162a4 branch: 3.5 parent: 101459:1570e3855ce8 user: Berker Peksag date: Sat May 21 14:56:35 2016 +0300 summary: Issue #27075: Link to StreamReader and StreamWriter docs Patch by Ville Skytt?. files: Doc/library/codecs.rst | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -137,16 +137,16 @@ .. function:: getreader(encoding) - Look up the codec for the given encoding and return its StreamReader class or - factory function. + Look up the codec for the given encoding and return its :class:`StreamReader` + class or factory function. Raises a :exc:`LookupError` in case the encoding cannot be found. .. function:: getwriter(encoding) - Look up the codec for the given encoding and return its StreamWriter class or - factory function. + Look up the codec for the given encoding and return its :class:`StreamWriter` + class or factory function. Raises a :exc:`LookupError` in case the encoding cannot be found. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 14:41:28 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 21 May 2016 18:41:28 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327067=3A_Improved_curses_tests=2E?= Message-ID: <20160521184128.3437.47908.AE3A10ED@psf.io> https://hg.python.org/cpython/rev/2917a3ce988e changeset: 101464:2917a3ce988e parent: 101462:b11b71aaf864 parent: 101463:55852de7d032 user: Serhiy Storchaka date: Sat May 21 21:36:29 2016 +0300 summary: Issue #27067: Improved curses tests. files: Lib/test/test_curses.py | 157 ++++++++++++++++----------- 1 files changed, 93 insertions(+), 64 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -24,19 +24,39 @@ # If either of these don't exist, skip the tests. curses = import_module('curses') -curses.panel = import_module('curses.panel') +import_module('curses.panel') +import_module('curses.ascii') -term = os.environ.get('TERM', 'unknown') +def requires_curses_func(name): + return unittest.skipUnless(hasattr(curses, name), + 'requires curses.%s' % name) - at unittest.skipUnless(sys.__stdout__.isatty(), 'sys.__stdout__ is not a tty') - at unittest.skipIf(term == 'unknown', +term = os.environ.get('TERM') + +# If newterm was supported we could use it instead of initscr and not exit + at unittest.skipIf(not term or term == 'unknown', "$TERM=%r, calling initscr() may cause exit" % term) @unittest.skipIf(sys.platform == "cygwin", "cygwin's curses mostly just hangs") class TestCurses(unittest.TestCase): + @classmethod def setUpClass(cls): - curses.setupterm(fd=sys.__stdout__.fileno()) + if not sys.__stdout__.isatty(): + cls.tmp = tempfile.TemporaryFile() + fd = cls.tmp.fileno() + else: + cls.tmp = None + fd = sys.__stdout__.fileno() + # testing setupterm() inside initscr/endwin + # causes terminal breakage + curses.setupterm(fd=fd) + + @classmethod + def tearDownClass(cls): + if cls.tmp: + cls.tmp.close() + del cls.tmp def setUp(self): if verbose: @@ -59,7 +79,8 @@ for meth in [stdscr.addch, stdscr.addstr]: for args in [('a'), ('a', curses.A_BOLD), (4,4, 'a'), (5,5, 'a', curses.A_BOLD)]: - meth(*args) + with self.subTest(meth=meth.__qualname__, args=args): + meth(*args) for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot, stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch, @@ -70,7 +91,8 @@ win.noutrefresh, stdscr.redrawwin, stdscr.refresh, stdscr.standout, stdscr.standend, stdscr.syncdown, stdscr.syncup, stdscr.touchwin, stdscr.untouchwin]: - meth() + with self.subTest(meth=meth.__qualname__): + meth() stdscr.addnstr('1234', 3) stdscr.addnstr('1234', 3, curses.A_BOLD) @@ -166,7 +188,6 @@ def test_module_funcs(self): "Test module-level functions" - stdscr = self.stdscr for func in [curses.baudrate, curses.beep, curses.can_change_color, curses.cbreak, curses.def_prog_mode, curses.doupdate, curses.filter, curses.flash, curses.flushinp, @@ -176,7 +197,8 @@ curses.noqiflush, curses.noraw, curses.reset_prog_mode, curses.termattrs, curses.termname, curses.erasechar, curses.getsyx]: - func() + with self.subTest(func=func.__qualname__): + func() # Functions that actually need arguments if curses.tigetstr("cnorm"): @@ -184,11 +206,10 @@ curses.delay_output(1) curses.echo() ; curses.echo(1) - f = tempfile.TemporaryFile() - stdscr.putwin(f) - f.seek(0) - curses.getwin(f) - f.close() + with tempfile.TemporaryFile() as f: + self.stdscr.putwin(f) + f.seek(0) + curses.getwin(f) curses.halfdelay(1) curses.intrflush(1) @@ -211,51 +232,37 @@ curses.ungetch('a') curses.use_env(1) - # Functions only available on a few platforms - if curses.has_colors(): - curses.start_color() - curses.init_pair(2, 1,1) - curses.color_content(1) - curses.color_pair(2) - curses.pair_content(curses.COLOR_PAIRS - 1) - curses.pair_number(0) + # Functions only available on a few platforms + def test_colors_funcs(self): + if not curses.has_colors(): + self.skip('requires colors support') + curses.start_color() + curses.init_pair(2, 1,1) + curses.color_content(1) + curses.color_pair(2) + curses.pair_content(curses.COLOR_PAIRS - 1) + curses.pair_number(0) - if hasattr(curses, 'use_default_colors'): - curses.use_default_colors() + if hasattr(curses, 'use_default_colors'): + curses.use_default_colors() - if hasattr(curses, 'keyname'): - curses.keyname(13) + @requires_curses_func('keyname') + def test_keyname(self): + curses.keyname(13) - if hasattr(curses, 'has_key'): - curses.has_key(13) + @requires_curses_func('has_key') + def test_has_key(self): + curses.has_key(13) - if hasattr(curses, 'getmouse'): - (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED) - # availmask indicates that mouse stuff not available. - if availmask != 0: - curses.mouseinterval(10) - # just verify these don't cause errors - curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED) - m = curses.getmouse() - - if hasattr(curses, 'is_term_resized'): - curses.is_term_resized(*stdscr.getmaxyx()) - if hasattr(curses, 'resizeterm'): - curses.resizeterm(*stdscr.getmaxyx()) - if hasattr(curses, 'resize_term'): - curses.resize_term(*stdscr.getmaxyx()) - - def test_unctrl(self): - from curses import ascii - for ch, expected in [('a', 'a'), ('A', 'A'), - (';', ';'), (' ', ' '), - ('\x7f', '^?'), ('\n', '^J'), ('\0', '^@'), - # Meta-bit characters - ('\x8a', '!^J'), ('\xc1', '!A'), - ]: - self.assertEqual(ascii.unctrl(ch), expected, - 'curses.unctrl fails on character %r' % ch) - + @requires_curses_func('getmouse') + def test_getmouse(self): + (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED) + if availmask == 0: + self.skip('mouse stuff not available') + curses.mouseinterval(10) + # just verify these don't cause errors + curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED) + m = curses.getmouse() def test_userptr_without_set(self): w = curses.newwin(10, 10) @@ -289,9 +296,17 @@ panel = curses.panel.new_panel(self.stdscr) self.assertRaises(TypeError, type(panel)) - @unittest.skipUnless(hasattr(curses, 'resizeterm'), - 'resizeterm not available') + @requires_curses_func('is_term_resized') + def test_is_term_resized(self): + curses.is_term_resized(*self.stdscr.getmaxyx()) + + @requires_curses_func('resize_term') def test_resize_term(self): + curses.resize_term(*self.stdscr.getmaxyx()) + + @requires_curses_func('resizeterm') + def test_resizeterm(self): + stdscr = self.stdscr lines, cols = curses.LINES, curses.COLS new_lines = lines - 1 new_cols = cols + 1 @@ -304,8 +319,7 @@ curses.ungetch(1025) self.stdscr.getkey() - @unittest.skipUnless(hasattr(curses, 'unget_wch'), - 'unget_wch not available') + @requires_curses_func('unget_wch') def test_unget_wch(self): stdscr = self.stdscr encoding = stdscr.encoding @@ -330,17 +344,14 @@ def test_issue10570(self): b = curses.tparm(curses.tigetstr("cup"), 5, 3) self.assertIs(type(b), bytes) - curses.putp(b) def test_encoding(self): stdscr = self.stdscr import codecs encoding = stdscr.encoding codecs.lookup(encoding) - with self.assertRaises(TypeError): stdscr.encoding = 10 - stdscr.encoding = encoding with self.assertRaises(TypeError): del stdscr.encoding @@ -371,8 +382,10 @@ # be reasonably certain the generated parsing code will be # correct too. human_readable_signature = stdscr.addch.__doc__.split("\n")[0] - offset = human_readable_signature.find("[y, x,]") - assert offset >= 0, "" + self.assertIn("[y, x,]", human_readable_signature) + + +class MiscTests(unittest.TestCase): def test_update_lines_cols(self): # this doesn't actually test that LINES and COLS are updated, @@ -382,5 +395,21 @@ curses.update_lines_cols() +class TestAscii(unittest.TestCase): + + def test_unctrl(self): + unctrl = curses.ascii.unctrl + self.assertEqual(unctrl('a'), 'a') + self.assertEqual(unctrl('A'), 'A') + self.assertEqual(unctrl(';'), ';') + self.assertEqual(unctrl(' '), ' ') + self.assertEqual(unctrl('\x7f'), '^?') + self.assertEqual(unctrl('\n'), '^J') + self.assertEqual(unctrl('\0'), '^@') + # Meta-bit characters + self.assertEqual(unctrl('\x8a'), '!^J') + self.assertEqual(unctrl('\xc1'), '!A') + + if __name__ == '__main__': unittest.main() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 14:41:28 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 21 May 2016 18:41:28 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MDY3?= =?utf-8?q?=3A_Improved_curses_tests=2E?= Message-ID: <20160521184128.29816.58487.9A0F4440@psf.io> https://hg.python.org/cpython/rev/55852de7d032 changeset: 101463:55852de7d032 branch: 3.5 parent: 101461:c1628c1162a4 user: Serhiy Storchaka date: Sat May 21 21:36:11 2016 +0300 summary: Issue #27067: Improved curses tests. files: Lib/test/test_curses.py | 157 ++++++++++++++++----------- 1 files changed, 93 insertions(+), 64 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -24,19 +24,39 @@ # If either of these don't exist, skip the tests. curses = import_module('curses') -curses.panel = import_module('curses.panel') +import_module('curses.panel') +import_module('curses.ascii') -term = os.environ.get('TERM', 'unknown') +def requires_curses_func(name): + return unittest.skipUnless(hasattr(curses, name), + 'requires curses.%s' % name) - at unittest.skipUnless(sys.__stdout__.isatty(), 'sys.__stdout__ is not a tty') - at unittest.skipIf(term == 'unknown', +term = os.environ.get('TERM') + +# If newterm was supported we could use it instead of initscr and not exit + at unittest.skipIf(not term or term == 'unknown', "$TERM=%r, calling initscr() may cause exit" % term) @unittest.skipIf(sys.platform == "cygwin", "cygwin's curses mostly just hangs") class TestCurses(unittest.TestCase): + @classmethod def setUpClass(cls): - curses.setupterm(fd=sys.__stdout__.fileno()) + if not sys.__stdout__.isatty(): + cls.tmp = tempfile.TemporaryFile() + fd = cls.tmp.fileno() + else: + cls.tmp = None + fd = sys.__stdout__.fileno() + # testing setupterm() inside initscr/endwin + # causes terminal breakage + curses.setupterm(fd=fd) + + @classmethod + def tearDownClass(cls): + if cls.tmp: + cls.tmp.close() + del cls.tmp def setUp(self): if verbose: @@ -59,7 +79,8 @@ for meth in [stdscr.addch, stdscr.addstr]: for args in [('a'), ('a', curses.A_BOLD), (4,4, 'a'), (5,5, 'a', curses.A_BOLD)]: - meth(*args) + with self.subTest(meth=meth.__qualname__, args=args): + meth(*args) for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot, stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch, @@ -70,7 +91,8 @@ win.noutrefresh, stdscr.redrawwin, stdscr.refresh, stdscr.standout, stdscr.standend, stdscr.syncdown, stdscr.syncup, stdscr.touchwin, stdscr.untouchwin]: - meth() + with self.subTest(meth=meth.__qualname__): + meth() stdscr.addnstr('1234', 3) stdscr.addnstr('1234', 3, curses.A_BOLD) @@ -166,7 +188,6 @@ def test_module_funcs(self): "Test module-level functions" - stdscr = self.stdscr for func in [curses.baudrate, curses.beep, curses.can_change_color, curses.cbreak, curses.def_prog_mode, curses.doupdate, curses.filter, curses.flash, curses.flushinp, @@ -176,7 +197,8 @@ curses.noqiflush, curses.noraw, curses.reset_prog_mode, curses.termattrs, curses.termname, curses.erasechar, curses.getsyx]: - func() + with self.subTest(func=func.__qualname__): + func() # Functions that actually need arguments if curses.tigetstr("cnorm"): @@ -184,11 +206,10 @@ curses.delay_output(1) curses.echo() ; curses.echo(1) - f = tempfile.TemporaryFile() - stdscr.putwin(f) - f.seek(0) - curses.getwin(f) - f.close() + with tempfile.TemporaryFile() as f: + self.stdscr.putwin(f) + f.seek(0) + curses.getwin(f) curses.halfdelay(1) curses.intrflush(1) @@ -211,51 +232,37 @@ curses.ungetch('a') curses.use_env(1) - # Functions only available on a few platforms - if curses.has_colors(): - curses.start_color() - curses.init_pair(2, 1,1) - curses.color_content(1) - curses.color_pair(2) - curses.pair_content(curses.COLOR_PAIRS - 1) - curses.pair_number(0) + # Functions only available on a few platforms + def test_colors_funcs(self): + if not curses.has_colors(): + self.skip('requires colors support') + curses.start_color() + curses.init_pair(2, 1,1) + curses.color_content(1) + curses.color_pair(2) + curses.pair_content(curses.COLOR_PAIRS - 1) + curses.pair_number(0) - if hasattr(curses, 'use_default_colors'): - curses.use_default_colors() + if hasattr(curses, 'use_default_colors'): + curses.use_default_colors() - if hasattr(curses, 'keyname'): - curses.keyname(13) + @requires_curses_func('keyname') + def test_keyname(self): + curses.keyname(13) - if hasattr(curses, 'has_key'): - curses.has_key(13) + @requires_curses_func('has_key') + def test_has_key(self): + curses.has_key(13) - if hasattr(curses, 'getmouse'): - (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED) - # availmask indicates that mouse stuff not available. - if availmask != 0: - curses.mouseinterval(10) - # just verify these don't cause errors - curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED) - m = curses.getmouse() - - if hasattr(curses, 'is_term_resized'): - curses.is_term_resized(*stdscr.getmaxyx()) - if hasattr(curses, 'resizeterm'): - curses.resizeterm(*stdscr.getmaxyx()) - if hasattr(curses, 'resize_term'): - curses.resize_term(*stdscr.getmaxyx()) - - def test_unctrl(self): - from curses import ascii - for ch, expected in [('a', 'a'), ('A', 'A'), - (';', ';'), (' ', ' '), - ('\x7f', '^?'), ('\n', '^J'), ('\0', '^@'), - # Meta-bit characters - ('\x8a', '!^J'), ('\xc1', '!A'), - ]: - self.assertEqual(ascii.unctrl(ch), expected, - 'curses.unctrl fails on character %r' % ch) - + @requires_curses_func('getmouse') + def test_getmouse(self): + (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED) + if availmask == 0: + self.skip('mouse stuff not available') + curses.mouseinterval(10) + # just verify these don't cause errors + curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED) + m = curses.getmouse() def test_userptr_without_set(self): w = curses.newwin(10, 10) @@ -289,9 +296,17 @@ panel = curses.panel.new_panel(self.stdscr) self.assertRaises(TypeError, type(panel)) - @unittest.skipUnless(hasattr(curses, 'resizeterm'), - 'resizeterm not available') + @requires_curses_func('is_term_resized') + def test_is_term_resized(self): + curses.is_term_resized(*self.stdscr.getmaxyx()) + + @requires_curses_func('resize_term') def test_resize_term(self): + curses.resize_term(*self.stdscr.getmaxyx()) + + @requires_curses_func('resizeterm') + def test_resizeterm(self): + stdscr = self.stdscr lines, cols = curses.LINES, curses.COLS new_lines = lines - 1 new_cols = cols + 1 @@ -304,8 +319,7 @@ curses.ungetch(1025) self.stdscr.getkey() - @unittest.skipUnless(hasattr(curses, 'unget_wch'), - 'unget_wch not available') + @requires_curses_func('unget_wch') def test_unget_wch(self): stdscr = self.stdscr encoding = stdscr.encoding @@ -330,17 +344,14 @@ def test_issue10570(self): b = curses.tparm(curses.tigetstr("cup"), 5, 3) self.assertIs(type(b), bytes) - curses.putp(b) def test_encoding(self): stdscr = self.stdscr import codecs encoding = stdscr.encoding codecs.lookup(encoding) - with self.assertRaises(TypeError): stdscr.encoding = 10 - stdscr.encoding = encoding with self.assertRaises(TypeError): del stdscr.encoding @@ -371,8 +382,10 @@ # be reasonably certain the generated parsing code will be # correct too. human_readable_signature = stdscr.addch.__doc__.split("\n")[0] - offset = human_readable_signature.find("[y, x,]") - assert offset >= 0, "" + self.assertIn("[y, x,]", human_readable_signature) + + +class MiscTests(unittest.TestCase): def test_update_lines_cols(self): # this doesn't actually test that LINES and COLS are updated, @@ -382,5 +395,21 @@ curses.update_lines_cols() +class TestAscii(unittest.TestCase): + + def test_unctrl(self): + unctrl = curses.ascii.unctrl + self.assertEqual(unctrl('a'), 'a') + self.assertEqual(unctrl('A'), 'A') + self.assertEqual(unctrl(';'), ';') + self.assertEqual(unctrl(' '), ' ') + self.assertEqual(unctrl('\x7f'), '^?') + self.assertEqual(unctrl('\n'), '^J') + self.assertEqual(unctrl('\0'), '^@') + # Meta-bit characters + self.assertEqual(unctrl('\x8a'), '!^J') + self.assertEqual(unctrl('\xc1'), '!A') + + if __name__ == '__main__': unittest.main() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 16:50:39 2016 From: python-checkins at python.org (yury.selivanov) Date: Sat, 21 May 2016 20:50:39 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogYXN5bmNpbzogRml4?= =?utf-8?q?_BytesWarning_=28use_typed=3DTrue_in_lru=5Fcache_for_=5Fipaddr?= =?utf-8?b?X2luZm8p?= Message-ID: <20160521205038.99050.52562.EB65898B@psf.io> https://hg.python.org/cpython/rev/bdfb15aa3ac5 changeset: 101465:bdfb15aa3ac5 branch: 3.5 parent: 101463:55852de7d032 user: Yury Selivanov date: Sat May 21 16:50:16 2016 -0400 summary: asyncio: Fix BytesWarning (use typed=True in lru_cache for _ipaddr_info) files: Lib/asyncio/base_events.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -86,7 +86,7 @@ _SOCKET_TYPE_MASK |= socket.SOCK_CLOEXEC - at functools.lru_cache(maxsize=1024) + at functools.lru_cache(maxsize=1024, typed=True) def _ipaddr_info(host, port, family, type, proto): # Try to skip getaddrinfo if "host" is already an IP. Since getaddrinfo # blocks on an exclusive lock on some platforms, users might handle name -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 16:50:39 2016 From: python-checkins at python.org (yury.selivanov) Date: Sat, 21 May 2016 20:50:39 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_3=2E5_=28asyncio=29?= Message-ID: <20160521205039.54586.41858.7466A0DB@psf.io> https://hg.python.org/cpython/rev/10f4d6c35b8a changeset: 101466:10f4d6c35b8a parent: 101464:2917a3ce988e parent: 101465:bdfb15aa3ac5 user: Yury Selivanov date: Sat May 21 16:50:31 2016 -0400 summary: Merge 3.5 (asyncio) files: Lib/asyncio/base_events.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -86,7 +86,7 @@ _SOCKET_TYPE_MASK |= socket.SOCK_CLOEXEC - at functools.lru_cache(maxsize=1024) + at functools.lru_cache(maxsize=1024, typed=True) def _ipaddr_info(host, port, family, type, proto): # Try to skip getaddrinfo if "host" is already an IP. Since getaddrinfo # blocks on an exclusive lock on some platforms, users might handle name -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 23:19:53 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 22 May 2016 03:19:53 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Fix_minor_inco?= =?utf-8?q?nsistencies_with_Issue_=23N_references_in_NEWS_and_HISTORY?= Message-ID: <20160522031953.27159.48786.46F6FCD7@psf.io> https://hg.python.org/cpython/rev/3e6da30fa033 changeset: 101467:3e6da30fa033 branch: 3.5 parent: 101465:bdfb15aa3ac5 user: Martin Panter date: Sun May 22 03:01:52 2016 +0000 summary: Fix minor inconsistencies with Issue #N references in NEWS and HISTORY files: Misc/HISTORY | 14 +++++++------- Misc/NEWS | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -187,7 +187,7 @@ - Issue #15777: Fix a refleak in _posixsubprocess. -- Issue ##665194: Update `email.utils.localtime` to use datetime.astimezone and +- Issue #665194: Update `email.utils.localtime` to use datetime.astimezone and correctly handle historic changes in UTC offsets. - Issue #15199: Fix JavaScript's default MIME type to application/javascript. @@ -782,7 +782,7 @@ - Issue #15008: Implement PEP 362 "Signature Objects". Patch by Yury Selivanov. -- Issue: #15138: base64.urlsafe_{en,de}code() are now 3-4x faster. +- Issue #15138: base64.urlsafe_{en,de}code() are now 3-4x faster. - Issue #444582: Add shutil.which, for finding programs on the system path. Original patch by Erik Demaine, with later iterations by Jan Killian @@ -2482,11 +2482,11 @@ - Issue #13591: A bug in importlib has been fixed that caused import_module to load a module twice. -- Issue #13449 sched.scheduler.run() method has a new "blocking" parameter which +- Issue #13449: sched.scheduler.run() method has a new "blocking" parameter which when set to False makes run() execute the scheduled events due to expire soonest (if any) and then return. Patch by Giampaolo Rodol?. -- Issue #8684 sched.scheduler class can be safely used in multi-threaded +- Issue #8684: sched.scheduler class can be safely used in multi-threaded environments. Patch by Josiah Carlson and Giampaolo Rodol?. - Alias resource.error to OSError ala PEP 3151. @@ -9822,7 +9822,7 @@ the recursion limit checking code, due to bogus handling of recursion limit when USE_STACKCHEK was enabled. -- Issue 3639: The _warnings module could segfault the interpreter when +- Issue #3639: The _warnings module could segfault the interpreter when unexpected types were passed in as arguments. - Issue #3712: The memoryview object had a reference leak and didn't support @@ -9901,14 +9901,14 @@ It is now maintained outside of the standard library at http://www.jcea.es/programacion/pybsddb.htm. -- Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module +- Issue #600362: Relocated parse_qs() and parse_qsl(), from the cgi module to the urlparse one. Added a DeprecationWarning in the old module, it will be deprecated in the future. - Issue #3719: platform.architecture() fails if there are spaces in the path to the Python binary. -- Issue 3602: As part of the merge of r66135, make the parameters on +- Issue #3602: As part of the merge of r66135, make the parameters on warnings.catch_warnings() keyword-only. Also remove a DeprecationWarning. - The deprecation warnings for the camelCase threading API names were removed. diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -781,7 +781,7 @@ - Issue #25111: Fixed comparison of traceback.FrameSummary. -- Issue #25262. Added support for BINBYTES8 opcode in Python implementation of +- Issue #25262: Added support for BINBYTES8 opcode in Python implementation of unpickler. Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8 opcodes no longer silently ignored on 32-bit platforms in C implementation. @@ -906,7 +906,7 @@ IDLE ---- -- Issue 15348: Stop the debugger engine (normally in a user process) +- Issue #15348: Stop the debugger engine (normally in a user process) before closing the debugger window (running in the IDLE process). This prevents the RuntimeErrors that were being caught and ignored. @@ -2754,7 +2754,7 @@ - Issue #21971: Update turtledemo doc and add module to the index. -- Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails. +- Issue #21032: Fixed socket leak if HTTPConnection.getresponse() fails. Original patch by Martin Panter. - Issue #22407: Deprecated the use of re.LOCALE flag with str patterns or -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 23:19:53 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 22 May 2016 03:19:53 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Extra_NEWS_formatting_fix_?= =?utf-8?q?for_3=2E6?= Message-ID: <20160522031953.29808.79264.F36A650D@psf.io> https://hg.python.org/cpython/rev/40db18240177 changeset: 101469:40db18240177 user: Martin Panter date: Sun May 22 03:10:11 2016 +0000 summary: Extra NEWS formatting fix for 3.6 files: Misc/NEWS | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1025,7 +1025,7 @@ IDLE ---- -- Issue 15348: Stop the debugger engine (normally in a user process) +- Issue #15348: Stop the debugger engine (normally in a user process) before closing the debugger window (running in the IDLE process). This prevents the RuntimeErrors that were being caught and ignored. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 23:19:53 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 22 May 2016 03:19:53 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_NEWS_formatting_from_3=2E5?= Message-ID: <20160522031953.99060.95073.6D3E9291@psf.io> https://hg.python.org/cpython/rev/053a2366dd0e changeset: 101468:053a2366dd0e parent: 101466:10f4d6c35b8a parent: 101467:3e6da30fa033 user: Martin Panter date: Sun May 22 03:05:44 2016 +0000 summary: Merge NEWS formatting from 3.5 files: Misc/HISTORY | 14 +++++++------- Misc/NEWS | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -187,7 +187,7 @@ - Issue #15777: Fix a refleak in _posixsubprocess. -- Issue ##665194: Update `email.utils.localtime` to use datetime.astimezone and +- Issue #665194: Update `email.utils.localtime` to use datetime.astimezone and correctly handle historic changes in UTC offsets. - Issue #15199: Fix JavaScript's default MIME type to application/javascript. @@ -782,7 +782,7 @@ - Issue #15008: Implement PEP 362 "Signature Objects". Patch by Yury Selivanov. -- Issue: #15138: base64.urlsafe_{en,de}code() are now 3-4x faster. +- Issue #15138: base64.urlsafe_{en,de}code() are now 3-4x faster. - Issue #444582: Add shutil.which, for finding programs on the system path. Original patch by Erik Demaine, with later iterations by Jan Killian @@ -2482,11 +2482,11 @@ - Issue #13591: A bug in importlib has been fixed that caused import_module to load a module twice. -- Issue #13449 sched.scheduler.run() method has a new "blocking" parameter which +- Issue #13449: sched.scheduler.run() method has a new "blocking" parameter which when set to False makes run() execute the scheduled events due to expire soonest (if any) and then return. Patch by Giampaolo Rodol?. -- Issue #8684 sched.scheduler class can be safely used in multi-threaded +- Issue #8684: sched.scheduler class can be safely used in multi-threaded environments. Patch by Josiah Carlson and Giampaolo Rodol?. - Alias resource.error to OSError ala PEP 3151. @@ -9822,7 +9822,7 @@ the recursion limit checking code, due to bogus handling of recursion limit when USE_STACKCHEK was enabled. -- Issue 3639: The _warnings module could segfault the interpreter when +- Issue #3639: The _warnings module could segfault the interpreter when unexpected types were passed in as arguments. - Issue #3712: The memoryview object had a reference leak and didn't support @@ -9901,14 +9901,14 @@ It is now maintained outside of the standard library at http://www.jcea.es/programacion/pybsddb.htm. -- Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module +- Issue #600362: Relocated parse_qs() and parse_qsl(), from the cgi module to the urlparse one. Added a DeprecationWarning in the old module, it will be deprecated in the future. - Issue #3719: platform.architecture() fails if there are spaces in the path to the Python binary. -- Issue 3602: As part of the merge of r66135, make the parameters on +- Issue #3602: As part of the merge of r66135, make the parameters on warnings.catch_warnings() keyword-only. Also remove a DeprecationWarning. - The deprecation warnings for the camelCase threading API names were removed. diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1480,7 +1480,7 @@ - Issue #25111: Fixed comparison of traceback.FrameSummary. -- Issue #25262. Added support for BINBYTES8 opcode in Python implementation of +- Issue #25262: Added support for BINBYTES8 opcode in Python implementation of unpickler. Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8 opcodes no longer silently ignored on 32-bit platforms in C implementation. @@ -1605,7 +1605,7 @@ IDLE ---- -- Issue 15348: Stop the debugger engine (normally in a user process) +- Issue #15348: Stop the debugger engine (normally in a user process) before closing the debugger window (running in the IDLE process). This prevents the RuntimeErrors that were being caught and ignored. @@ -3452,7 +3452,7 @@ - Issue #21971: Update turtledemo doc and add module to the index. -- Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails. +- Issue #21032: Fixed socket leak if HTTPConnection.getresponse() fails. Original patch by Martin Panter. - Issue #22407: Deprecated the use of re.LOCALE flag with str patterns or -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 21 23:19:53 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 22 May 2016 03:19:53 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Fix_minor_inco?= =?utf-8?q?nsistencies_with_Issue_=23N_references_in_NEWS?= Message-ID: <20160522031953.3455.61351.876A0584@psf.io> https://hg.python.org/cpython/rev/1237fdd7cc68 changeset: 101470:1237fdd7cc68 branch: 2.7 parent: 101455:0285173d81b4 user: Martin Panter date: Sun May 22 03:11:44 2016 +0000 summary: Fix minor inconsistencies with Issue #N references in NEWS files: Misc/NEWS | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -565,7 +565,7 @@ IDLE ---- -- Issue 15348: Stop the debugger engine (normally in a user process) +- Issue #15348: Stop the debugger engine (normally in a user process) before closing the debugger window (running in the IDLE process). This prevents the RuntimeErrors that were being caught and ignored. @@ -662,7 +662,7 @@ - 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. @@ -936,7 +936,7 @@ - Issue #23016: A warning no longer produces an AttributeError when sys.stderr is None. -- Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails. +- Issue #21032: Fixed socket leak if HTTPConnection.getresponse() fails. Original patch by Martin Panter. - Issue #22609: Constructors and update methods of mapping classes in the @@ -2493,7 +2493,7 @@ - Issue #16601: Restarting iteration over tarfile no more continues from where it left off. Patch by Michael Birtwell. -- Issue 16584: in filecomp._cmp, catch IOError as well as os.error. +- Issue #16584: in filecomp._cmp, catch IOError as well as os.error. Patch by Till Maas. - Issue #17926: Fix dbm.__contains__ on 64-bit big-endian machines. @@ -2663,7 +2663,7 @@ Documentation ------------- -- Issue 17538: Document XML vulnerabilties +- Issue #17538: Document XML vulnerabilties What's New in Python 2.7.4 release candidate 1 @@ -4247,7 +4247,7 @@ IDLE ---- -- Issue #964437 Make IDLE help window non-modal. +- Issue #964437: Make IDLE help window non-modal. Patch by Guilherme Polo and Roger Serwy. - Issue #13933: IDLE auto-complete did not work with some imported @@ -4720,7 +4720,7 @@ - Subclasses of collections.OrderedDict now work correctly with __missing__. -- Issue #10753 - Characters ';', '=' and ',' in the PATH_INFO environment +- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable won't be quoted when the URI is constructed by the wsgiref.util 's request_uri method. According to RFC 3986, these characters can be a part of params in PATH component of URI and need not be quoted. @@ -4850,7 +4850,7 @@ - Issue #4676: toggle failing on Tk 8.5, causing IDLE exits and strange selection behavior. Improve selection extension behaviour. -- Issue #3851 toggle non-functional when NumLock set on Windows. +- Issue #3851: toggle non-functional when NumLock set on Windows. Build ----- @@ -5279,10 +5279,10 @@ - Issue #6869: Fix a refcount problem in the _ctypes extension. -- Issue5504 - ctypes should now work with systems where mmap can't be +- Issue #5504: ctypes should now work with systems where mmap can't be PROT_WRITE and PROT_EXEC. -- Fix Issue8280 - urllib2's Request method will remove fragements in the url. +- Issue #8280: urllib2's Request method will remove fragements in the url. This is how it is supposed to work, wget and curl do the same. Previous behavior was wrong. @@ -5634,7 +5634,7 @@ Documentation ------------- -- Issues #8909: Added the size of the bitmap used in the installer created by +- Issue #8909: Added the size of the bitmap used in the installer created by distutils' bdist_wininst. Patch by Anatoly Techtonik. Misc @@ -10600,7 +10600,7 @@ - Doctest now returns results as a named tuple for readability: (0, 7) --> TestResults(failed=0, attempted=7) -- Issue #846388:q re.match is interruptible now, which is particularly +- Issue #846388: re.match is interruptible now, which is particularly good for long regular expression matches. - Patch #1137: allow setting buffer_size attribute on pyexpat Parser -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Sun May 22 04:53:04 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 22 May 2016 08:53:04 +0000 Subject: [Python-checkins] Daily reference leaks (40db18240177): sum=2 Message-ID: <20160522085303.29808.62830.F7716B0C@psf.io> results for 40db18240177 on branch "default" -------------------------------------------- test_asyncio leaked [0, -22, 22] references, sum=0 test_asyncio leaked [0, -6, 8] memory blocks, sum=2 test_collections leaked [-4, 0, 0] memory blocks, sum=-4 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogUbhXSS', '--timeout', '7200'] From python-checkins at python.org Sun May 22 07:34:59 2016 From: python-checkins at python.org (paul.moore) Date: Sun, 22 May 2016 11:34:59 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327064=3A_The_py?= =?utf-8?q?=2Eexe_launcher_now_defaults_to_Python_3=2E?= Message-ID: <20160522113458.71380.8680.5985A911@psf.io> https://hg.python.org/cpython/rev/26c1e3dab624 changeset: 101471:26c1e3dab624 parent: 101469:40db18240177 user: Paul Moore date: Sun May 22 12:28:41 2016 +0100 summary: Issue #27064: The py.exe launcher now defaults to Python 3. The Windows launcher ``py.exe`` no longer prefers an installed Python 2 version over Python 3 by default when used interactively. files: Doc/using/windows.rst | 22 +++++++++++++++------- Doc/whatsnew/3.6.rst | 9 +++++++++ Misc/NEWS | 7 +++++++ PC/launcher.c | 21 ++++++++++++++------- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -418,6 +418,8 @@ From the command-line ^^^^^^^^^^^^^^^^^^^^^ +.. versionchanged:: 3.6 + System-wide installations of Python 3.3 and later will put the launcher on your :envvar:`PATH`. The launcher is compatible with all available versions of Python, so it does not matter which version is installed. To check that the @@ -427,25 +429,26 @@ py -You should find that the latest version of Python 2.x you have installed is +You should find that the latest version of Python you have installed is started - it can be exited as normal, and any additional command-line arguments specified will be sent directly to Python. -If you have multiple versions of Python 2.x installed (e.g., 2.6 and 2.7) you -will have noticed that Python 2.7 was started - to launch Python 2.6, try the +If you have multiple versions of Python installed (e.g., 2.7 and 3.6) you +will have noticed that Python 3.6 was started - to launch Python 2.7, try the command: :: - py -2.6 + py -2.7 -If you have a Python 3.x installed, try the command: +If you want the latest version of Python 2.x you have installed, try the +command: :: - py -3 + py -2 -You should find the latest version of Python 3.x starts. +You should find the latest version of Python 2.x starts. If you see the following error, you do not have the launcher installed: @@ -500,6 +503,11 @@ first line to ``#! python2.6`` and you should find the 2.6 version information printed. +Note that unlike interactive use, a bare "python" will use the latest +version of Python 2.x that you have installed. This is for backward +compatibility and for compatibility with Unix, where the command ``python`` +typically refers to Python 2. + From file associations ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -62,8 +62,17 @@ .. This section singles out the most important changes in Python 3.6. Brevity is key. +New syntax features: + * PEP 498: :ref:`Formatted string literals ` +Windows improvements: + +* The ``py.exe`` launcher, when used interactively, no longer prefers + Python 2 over Python 3 when the user doesn't specify a version (via + command line arguments or a config file). Handling of shebang lines + remains unchanged - "python" refers to Python 2 in that case. + .. PEP-sized items next. .. _pep-4XX: diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -32,6 +32,13 @@ - Issue #25285: Tools/buildbot/test.bat script now uses -j1 by default to run each test file in fresh child process. +Windows +------- + +- Issue #27064: The py.exe launcher now defaults to Python 3. + The Windows launcher ``py.exe`` no longer prefers an installed + Python 2 version over Python 3 by default when used interactively. + What's New in Python 3.6.0 alpha 1? =================================== diff --git a/PC/launcher.c b/PC/launcher.c --- a/PC/launcher.c +++ b/PC/launcher.c @@ -465,7 +465,7 @@ } static INSTALLED_PYTHON * -locate_python(wchar_t * wanted_ver) +locate_python(wchar_t * wanted_ver, BOOL from_shebang) { static wchar_t config_key [] = { L"pythonX" }; static wchar_t * last_char = &config_key[sizeof(config_key) / @@ -497,10 +497,17 @@ configured_value = get_configured_value(config_key); if (configured_value) result = find_python_by_version(configured_value); + /* Not found a value yet - try by major version. + * If we're looking for an interpreter specified in a shebang line, + * we want to try Python 2 first, then Python 3 (for Unix and backward + * compatibility). If we're being called interactively, assume the user + * wants the latest version available, so try Python 3 first, then + * Python 2. + */ if (result == NULL) - result = find_python_by_version(L"2"); + result = find_python_by_version(from_shebang ? L"2" : L"3"); if (result == NULL) - result = find_python_by_version(L"3"); + result = find_python_by_version(from_shebang ? L"3" : L"2"); debug(L"search for default Python found "); if (result) { debug(L"version %ls at '%ls'\n", @@ -1094,7 +1101,7 @@ for (mp = magic_values; mp->min; mp++) { if ((magic >= mp->min) && (magic <= mp->max)) { - result = locate_python(mp->version); + result = locate_python(mp->version, FALSE); if (result != NULL) break; } @@ -1279,7 +1286,7 @@ followed by a valid version specifier.\nPlease check the documentation.", command); /* TODO could call validate_version(command) */ - ip = locate_python(command); + ip = locate_python(command, TRUE); if (ip == NULL) { error(RC_NO_PYTHON, L"Requested Python version \ (%ls) is not installed", command); @@ -1485,7 +1492,7 @@ plen = wcslen(p); valid = (*p == L'-') && validate_version(&p[1]); if (valid) { - ip = locate_python(&p[1]); + ip = locate_python(&p[1], FALSE); if (ip == NULL) error(RC_NO_PYTHON, L"Requested Python version (%ls) not \ installed", &p[1]); @@ -1512,7 +1519,7 @@ /* If we didn't find one, look for the default Python */ if (executable == NULL) { - ip = locate_python(L""); + ip = locate_python(L"", FALSE); if (ip == NULL) error(RC_NO_PYTHON, L"Can't find a default Python."); executable = ip->executable; -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 11:20:14 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 22 May 2016 15:20:14 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Temporary_skip?= =?utf-8?q?_curses_tests_on_non-tty_=28issue_=2327067=29=2E?= Message-ID: <20160522152014.19654.85945.339F3AE0@psf.io> https://hg.python.org/cpython/rev/433839643bbb changeset: 101472:433839643bbb branch: 3.5 parent: 101467:3e6da30fa033 user: Serhiy Storchaka date: Sun May 22 18:16:20 2016 +0300 summary: Temporary skip curses tests on non-tty (issue #27067). files: Lib/test/test_curses.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -43,6 +43,8 @@ @classmethod def setUpClass(cls): if not sys.__stdout__.isatty(): + # Temporary skip tests on non-tty + self.skip('sys.__stdout__ is not a tty') cls.tmp = tempfile.TemporaryFile() fd = cls.tmp.fileno() else: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 11:20:14 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 22 May 2016 15:20:14 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Temporary_skip_curses_tests_on_non-tty_=28issue_=2327067?= =?utf-8?b?KS4=?= Message-ID: <20160522152014.21206.53197.4FEBB474@psf.io> https://hg.python.org/cpython/rev/debe693c62b4 changeset: 101473:debe693c62b4 parent: 101471:26c1e3dab624 parent: 101472:433839643bbb user: Serhiy Storchaka date: Sun May 22 18:17:25 2016 +0300 summary: Temporary skip curses tests on non-tty (issue #27067). files: Lib/test/test_curses.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -43,6 +43,8 @@ @classmethod def setUpClass(cls): if not sys.__stdout__.isatty(): + # Temporary skip tests on non-tty + self.skip('sys.__stdout__ is not a tty') cls.tmp = tempfile.TemporaryFile() fd = cls.tmp.fileno() else: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 11:24:07 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 22 May 2016 15:24:07 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Fixed_an_error?= =?utf-8?q?_in_previous_commit=2E?= Message-ID: <20160522152407.19646.8256.517ED3F5@psf.io> https://hg.python.org/cpython/rev/41f065b2e451 changeset: 101474:41f065b2e451 branch: 3.5 parent: 101472:433839643bbb user: Serhiy Storchaka date: Sun May 22 18:23:36 2016 +0300 summary: Fixed an error in previous commit. files: Lib/test/test_curses.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -44,7 +44,7 @@ def setUpClass(cls): if not sys.__stdout__.isatty(): # Temporary skip tests on non-tty - self.skip('sys.__stdout__ is not a tty') + raise unittest.SkipTest('sys.__stdout__ is not a tty') cls.tmp = tempfile.TemporaryFile() fd = cls.tmp.fileno() else: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 11:24:08 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 22 May 2016 15:24:08 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Fixed_an_error_in_previous_commit=2E?= Message-ID: <20160522152407.62628.71902.7EFCDA5A@psf.io> https://hg.python.org/cpython/rev/bd67fd3eb42e changeset: 101475:bd67fd3eb42e parent: 101473:debe693c62b4 parent: 101474:41f065b2e451 user: Serhiy Storchaka date: Sun May 22 18:23:51 2016 +0300 summary: Fixed an error in previous commit. files: Lib/test/test_curses.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -44,7 +44,7 @@ def setUpClass(cls): if not sys.__stdout__.isatty(): # Temporary skip tests on non-tty - self.skip('sys.__stdout__ is not a tty') + raise unittest.SkipTest('sys.__stdout__ is not a tty') cls.tmp = tempfile.TemporaryFile() fd = cls.tmp.fileno() else: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 11:25:10 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 22 May 2016 15:25:10 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Backported_cur?= =?utf-8?q?ses_tests=2E?= Message-ID: <20160522152509.7345.35114.DB691472@psf.io> https://hg.python.org/cpython/rev/710ea69c61ac changeset: 101476:710ea69c61ac branch: 2.7 parent: 101470:1237fdd7cc68 user: Serhiy Storchaka date: Sun May 22 18:24:48 2016 +0300 summary: Backported curses tests. files: Lib/test/test_curses.py | 516 ++++++++++++++------------- 1 files changed, 275 insertions(+), 241 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -2,200 +2,238 @@ # Test script for the curses module # # This script doesn't actually display anything very coherent. but it -# does call every method and function. +# does call (nearly) every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # -import sys, tempfile, os +import os +import sys +import tempfile +import unittest + +from test.test_support import requires, import_module, verbose, run_unittest # Optionally test curses module. This currently requires that the # 'curses' resource be given on the regrtest command line using the -u # option. If not available, nothing after this line will be executed. +requires('curses') -import unittest -from test.test_support import requires, import_module -requires('curses') +# If either of these don't exist, skip the tests. curses = import_module('curses') -curses.panel = import_module('curses.panel') +import_module('curses.panel') +import_module('curses.ascii') +def requires_curses_func(name): + return unittest.skipUnless(hasattr(curses, name), + 'requires curses.%s' % name) -# XXX: if newterm was supported we could use it instead of initscr and not exit term = os.environ.get('TERM') -if not term or term == 'unknown': - raise unittest.SkipTest, "$TERM=%r, calling initscr() may cause exit" % term -if sys.platform == "cygwin": - raise unittest.SkipTest("cygwin's curses mostly just hangs") +# If newterm was supported we could use it instead of initscr and not exit + at unittest.skipIf(not term or term == 'unknown', + "$TERM=%r, calling initscr() may cause exit" % term) + at unittest.skipIf(sys.platform == "cygwin", + "cygwin's curses mostly just hangs") +class TestCurses(unittest.TestCase): -def window_funcs(stdscr): - "Test the methods of windows" - win = curses.newwin(10,10) - win = curses.newwin(5,5, 5,5) - win2 = curses.newwin(15,15, 5,5) + @classmethod + def setUpClass(cls): + if not sys.__stdout__.isatty(): + # Temporary skip tests on non-tty + raise unittest.SkipTest('sys.__stdout__ is not a tty') + cls.tmp = tempfile.TemporaryFile() + fd = cls.tmp.fileno() + else: + cls.tmp = None + fd = sys.__stdout__.fileno() + # testing setupterm() inside initscr/endwin + # causes terminal breakage + curses.setupterm(fd=fd) - for meth in [stdscr.addch, stdscr.addstr]: - for args in [('a'), ('a', curses.A_BOLD), - (4,4, 'a'), (5,5, 'a', curses.A_BOLD)]: - meth(*args) + @classmethod + def tearDownClass(cls): + if cls.tmp: + cls.tmp.close() + del cls.tmp - for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot, - stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch, - stdscr.deleteln, stdscr.erase, stdscr.getbegyx, - stdscr.getbkgd, stdscr.getkey, stdscr.getmaxyx, - stdscr.getparyx, stdscr.getyx, stdscr.inch, - stdscr.insertln, stdscr.instr, stdscr.is_wintouched, - win.noutrefresh, stdscr.redrawwin, stdscr.refresh, - stdscr.standout, stdscr.standend, stdscr.syncdown, - stdscr.syncup, stdscr.touchwin, stdscr.untouchwin]: - meth() + def setUp(self): + if verbose: + # just to make the test output a little more readable + print() + self.stdscr = curses.initscr() + curses.savetty() - stdscr.addnstr('1234', 3) - stdscr.addnstr('1234', 3, curses.A_BOLD) - stdscr.addnstr(4,4, '1234', 3) - stdscr.addnstr(5,5, '1234', 3, curses.A_BOLD) + def tearDown(self): + curses.resetty() + curses.endwin() - stdscr.attron(curses.A_BOLD) - stdscr.attroff(curses.A_BOLD) - stdscr.attrset(curses.A_BOLD) - stdscr.bkgd(' ') - stdscr.bkgd(' ', curses.A_REVERSE) - stdscr.bkgdset(' ') - stdscr.bkgdset(' ', curses.A_REVERSE) + def test_window_funcs(self): + "Test the methods of windows" + stdscr = self.stdscr + win = curses.newwin(10,10) + win = curses.newwin(5,5, 5,5) + win2 = curses.newwin(15,15, 5,5) - win.border(65, 66, 67, 68, - 69, 70, 71, 72) - win.border('|', '!', '-', '_', - '+', '\\', '#', '/') - try: + for meth in [stdscr.addch, stdscr.addstr]: + for args in [('a'), ('a', curses.A_BOLD), + (4,4, 'a'), (5,5, 'a', curses.A_BOLD)]: + meth(*args) + + for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot, + stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch, + stdscr.deleteln, stdscr.erase, stdscr.getbegyx, + stdscr.getbkgd, stdscr.getkey, stdscr.getmaxyx, + stdscr.getparyx, stdscr.getyx, stdscr.inch, + stdscr.insertln, stdscr.instr, stdscr.is_wintouched, + win.noutrefresh, stdscr.redrawwin, stdscr.refresh, + stdscr.standout, stdscr.standend, stdscr.syncdown, + stdscr.syncup, stdscr.touchwin, stdscr.untouchwin]: + meth() + + stdscr.addnstr('1234', 3) + stdscr.addnstr('1234', 3, curses.A_BOLD) + stdscr.addnstr(4,4, '1234', 3) + stdscr.addnstr(5,5, '1234', 3, curses.A_BOLD) + + stdscr.attron(curses.A_BOLD) + stdscr.attroff(curses.A_BOLD) + stdscr.attrset(curses.A_BOLD) + stdscr.bkgd(' ') + stdscr.bkgd(' ', curses.A_REVERSE) + stdscr.bkgdset(' ') + stdscr.bkgdset(' ', curses.A_REVERSE) + win.border(65, 66, 67, 68, - 69, [], 71, 72) - except TypeError: - pass - else: - raise RuntimeError, "Expected win.border() to raise TypeError" + 69, 70, 71, 72) + win.border('|', '!', '-', '_', + '+', '\\', '#', '/') + with self.assertRaises(TypeError, + msg="Expected win.border() to raise TypeError"): + win.border(65, 66, 67, 68, + 69, [], 71, 72) - stdscr.clearok(1) + stdscr.clearok(1) - win4 = stdscr.derwin(2,2) - win4 = stdscr.derwin(1,1, 5,5) - win4.mvderwin(9,9) + win4 = stdscr.derwin(2,2) + win4 = stdscr.derwin(1,1, 5,5) + win4.mvderwin(9,9) - stdscr.echochar('a') - stdscr.echochar('a', curses.A_BOLD) - stdscr.hline('-', 5) - stdscr.hline('-', 5, curses.A_BOLD) - stdscr.hline(1,1,'-', 5) - stdscr.hline(1,1,'-', 5, curses.A_BOLD) + stdscr.echochar('a') + stdscr.echochar('a', curses.A_BOLD) + stdscr.hline('-', 5) + stdscr.hline('-', 5, curses.A_BOLD) + stdscr.hline(1,1,'-', 5) + stdscr.hline(1,1,'-', 5, curses.A_BOLD) - stdscr.idcok(1) - stdscr.idlok(1) - stdscr.immedok(1) - stdscr.insch('c') - stdscr.insdelln(1) - stdscr.insnstr('abc', 3) - stdscr.insnstr('abc', 3, curses.A_BOLD) - stdscr.insnstr(5, 5, 'abc', 3) - stdscr.insnstr(5, 5, 'abc', 3, curses.A_BOLD) + stdscr.idcok(1) + stdscr.idlok(1) + stdscr.immedok(1) + stdscr.insch('c') + stdscr.insdelln(1) + stdscr.insnstr('abc', 3) + stdscr.insnstr('abc', 3, curses.A_BOLD) + stdscr.insnstr(5, 5, 'abc', 3) + stdscr.insnstr(5, 5, 'abc', 3, curses.A_BOLD) - stdscr.insstr('def') - stdscr.insstr('def', curses.A_BOLD) - stdscr.insstr(5, 5, 'def') - stdscr.insstr(5, 5, 'def', curses.A_BOLD) - stdscr.is_linetouched(0) - stdscr.keypad(1) - stdscr.leaveok(1) - stdscr.move(3,3) - win.mvwin(2,2) - stdscr.nodelay(1) - stdscr.notimeout(1) - win2.overlay(win) - win2.overwrite(win) - win2.overlay(win, 1, 2, 3, 3, 2, 1) - win2.overwrite(win, 1, 2, 3, 3, 2, 1) - stdscr.redrawln(1,2) + stdscr.insstr('def') + stdscr.insstr('def', curses.A_BOLD) + stdscr.insstr(5, 5, 'def') + stdscr.insstr(5, 5, 'def', curses.A_BOLD) + stdscr.is_linetouched(0) + stdscr.keypad(1) + stdscr.leaveok(1) + stdscr.move(3,3) + win.mvwin(2,2) + stdscr.nodelay(1) + stdscr.notimeout(1) + win2.overlay(win) + win2.overwrite(win) + win2.overlay(win, 1, 2, 2, 1, 3, 3) + win2.overwrite(win, 1, 2, 2, 1, 3, 3) + stdscr.redrawln(1,2) - stdscr.scrollok(1) - stdscr.scroll() - stdscr.scroll(2) - stdscr.scroll(-3) + stdscr.scrollok(1) + stdscr.scroll() + stdscr.scroll(2) + stdscr.scroll(-3) - stdscr.move(12, 2) - stdscr.setscrreg(10,15) - win3 = stdscr.subwin(10,10) - win3 = stdscr.subwin(10,10, 5,5) - stdscr.syncok(1) - stdscr.timeout(5) - stdscr.touchline(5,5) - stdscr.touchline(5,5,0) - stdscr.vline('a', 3) - stdscr.vline('a', 3, curses.A_STANDOUT) - stdscr.chgat(5, 2, 3, curses.A_BLINK) - stdscr.chgat(3, curses.A_BOLD) - stdscr.chgat(5, 8, curses.A_UNDERLINE) - stdscr.chgat(curses.A_BLINK) - stdscr.refresh() + stdscr.move(12, 2) + stdscr.setscrreg(10,15) + win3 = stdscr.subwin(10,10) + win3 = stdscr.subwin(10,10, 5,5) + stdscr.syncok(1) + stdscr.timeout(5) + stdscr.touchline(5,5) + stdscr.touchline(5,5,0) + stdscr.vline('a', 3) + stdscr.vline('a', 3, curses.A_STANDOUT) + stdscr.chgat(5, 2, 3, curses.A_BLINK) + stdscr.chgat(3, curses.A_BOLD) + stdscr.chgat(5, 8, curses.A_UNDERLINE) + stdscr.chgat(curses.A_BLINK) + stdscr.refresh() - stdscr.vline(1,1, 'a', 3) - stdscr.vline(1,1, 'a', 3, curses.A_STANDOUT) + stdscr.vline(1,1, 'a', 3) + stdscr.vline(1,1, 'a', 3, curses.A_STANDOUT) - if hasattr(curses, 'resize'): - stdscr.resize() - if hasattr(curses, 'enclose'): - stdscr.enclose() + if hasattr(curses, 'resize'): + stdscr.resize() + if hasattr(curses, 'enclose'): + stdscr.enclose() -def module_funcs(stdscr): - "Test module-level functions" + def test_module_funcs(self): + "Test module-level functions" + for func in [curses.baudrate, curses.beep, curses.can_change_color, + curses.cbreak, curses.def_prog_mode, curses.doupdate, + curses.filter, curses.flash, curses.flushinp, + curses.has_colors, curses.has_ic, curses.has_il, + curses.isendwin, curses.killchar, curses.longname, + curses.nocbreak, curses.noecho, curses.nonl, + curses.noqiflush, curses.noraw, + curses.reset_prog_mode, curses.termattrs, + curses.termname, curses.erasechar, curses.getsyx]: + func() - for func in [curses.baudrate, curses.beep, curses.can_change_color, - curses.cbreak, curses.def_prog_mode, curses.doupdate, - curses.filter, curses.flash, curses.flushinp, - curses.has_colors, curses.has_ic, curses.has_il, - curses.isendwin, curses.killchar, curses.longname, - curses.nocbreak, curses.noecho, curses.nonl, - curses.noqiflush, curses.noraw, - curses.reset_prog_mode, curses.termattrs, - curses.termname, curses.erasechar, curses.getsyx]: - func() + # Functions that actually need arguments + if curses.tigetstr("cnorm"): + curses.curs_set(1) + curses.delay_output(1) + curses.echo() ; curses.echo(1) - # Functions that actually need arguments - if curses.tigetstr("cnorm"): - curses.curs_set(1) - curses.delay_output(1) - curses.echo() ; curses.echo(1) + with tempfile.TemporaryFile() as f: + self.stdscr.putwin(f) + f.seek(0) + curses.getwin(f) - f = tempfile.TemporaryFile() - stdscr.putwin(f) - f.seek(0) - curses.getwin(f) - f.close() - - curses.halfdelay(1) - curses.intrflush(1) - curses.meta(1) - curses.napms(100) - curses.newpad(50,50) - win = curses.newwin(5,5) - win = curses.newwin(5,5, 1,1) - curses.nl() ; curses.nl(1) - curses.putp('abc') - curses.qiflush() - curses.raw() ; curses.raw(1) - curses.setsyx(5,5) - curses.tigetflag('hc') - curses.tigetnum('co') - curses.tigetstr('cr') - curses.tparm('cr') - curses.typeahead(sys.__stdin__.fileno()) - curses.unctrl('a') - curses.ungetch('a') - curses.use_env(1) + curses.halfdelay(1) + curses.intrflush(1) + curses.meta(1) + curses.napms(100) + curses.newpad(50,50) + win = curses.newwin(5,5) + win = curses.newwin(5,5, 1,1) + curses.nl() ; curses.nl(1) + curses.putp(b'abc') + curses.qiflush() + curses.raw() ; curses.raw(1) + curses.setsyx(5,5) + curses.tigetflag('hc') + curses.tigetnum('co') + curses.tigetstr('cr') + curses.tparm(b'cr') + curses.typeahead(sys.__stdin__.fileno()) + curses.unctrl('a') + curses.ungetch('a') + curses.use_env(1) # Functions only available on a few platforms - if curses.has_colors(): + def test_colors_funcs(self): + if not curses.has_colors(): + self.skip('requires colors support') curses.start_color() curses.init_pair(2, 1,1) curses.color_content(1) @@ -206,107 +244,103 @@ if hasattr(curses, 'use_default_colors'): curses.use_default_colors() - if hasattr(curses, 'keyname'): + @requires_curses_func('keyname') + def test_keyname(self): curses.keyname(13) - if hasattr(curses, 'has_key'): + @requires_curses_func('has_key') + def test_has_key(self): curses.has_key(13) - if hasattr(curses, 'getmouse'): + @requires_curses_func('getmouse') + def test_getmouse(self): (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED) - # availmask indicates that mouse stuff not available. - if availmask != 0: - curses.mouseinterval(10) - # just verify these don't cause errors - curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED) - m = curses.getmouse() + if availmask == 0: + self.skip('mouse stuff not available') + curses.mouseinterval(10) + # just verify these don't cause errors + curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED) + m = curses.getmouse() - if hasattr(curses, 'is_term_resized'): - curses.is_term_resized(*stdscr.getmaxyx()) - if hasattr(curses, 'resizeterm'): - curses.resizeterm(*stdscr.getmaxyx()) - if hasattr(curses, 'resize_term'): - curses.resize_term(*stdscr.getmaxyx()) + def test_userptr_without_set(self): + w = curses.newwin(10, 10) + p = curses.panel.new_panel(w) + # try to access userptr() before calling set_userptr() -- segfaults + with self.assertRaises(curses.panel.error, + msg='userptr should fail since not set'): + p.userptr() -def unit_tests(): - from curses import ascii - for ch, expected in [('a', 'a'), ('A', 'A'), - (';', ';'), (' ', ' '), - ('\x7f', '^?'), ('\n', '^J'), ('\0', '^@'), - # Meta-bit characters - ('\x8a', '!^J'), ('\xc1', '!A'), - ]: - if ascii.unctrl(ch) != expected: - print 'curses.unctrl fails on character', repr(ch) + def test_userptr_memory_leak(self): + w = curses.newwin(10, 10) + p = curses.panel.new_panel(w) + obj = object() + nrefs = sys.getrefcount(obj) + for i in range(100): + p.set_userptr(obj) + p.set_userptr(None) + self.assertEqual(sys.getrefcount(obj), nrefs, + "set_userptr leaked references") -def test_userptr_without_set(stdscr): - w = curses.newwin(10, 10) - p = curses.panel.new_panel(w) - # try to access userptr() before calling set_userptr() -- segfaults - try: - p.userptr() - raise RuntimeError, 'userptr should fail since not set' - except curses.panel.error: - pass + def test_userptr_segfault(self): + panel = curses.panel.new_panel(self.stdscr) + class A: + def __del__(self): + panel.set_userptr(None) + panel.set_userptr(A()) + panel.set_userptr(None) -def test_userptr_memory_leak(stdscr): - w = curses.newwin(10, 10) - p = curses.panel.new_panel(w) - obj = object() - nrefs = sys.getrefcount(obj) - for i in range(100): - p.set_userptr(obj) + def test_new_curses_panel(self): + panel = curses.panel.new_panel(self.stdscr) + self.assertRaises(TypeError, type(panel)) - p.set_userptr(None) - if sys.getrefcount(obj) != nrefs: - raise RuntimeError, "set_userptr leaked references" + @requires_curses_func('is_term_resized') + def test_is_term_resized(self): + curses.is_term_resized(*self.stdscr.getmaxyx()) -def test_userptr_segfault(stdscr): - panel = curses.panel.new_panel(stdscr) - class A: - def __del__(self): - panel.set_userptr(None) - panel.set_userptr(A()) - panel.set_userptr(None) + @requires_curses_func('resize_term') + def test_resize_term(self): + curses.resize_term(*self.stdscr.getmaxyx()) -def test_resize_term(stdscr): - if hasattr(curses, 'resizeterm'): + @requires_curses_func('resizeterm') + def test_resizeterm(self): + stdscr = self.stdscr lines, cols = curses.LINES, curses.COLS - curses.resizeterm(lines - 1, cols + 1) + new_lines = lines - 1 + new_cols = cols + 1 + curses.resizeterm(new_lines, new_cols) - if curses.LINES != lines - 1 or curses.COLS != cols + 1: - raise RuntimeError, "Expected resizeterm to update LINES and COLS" + self.assertEqual(curses.LINES, new_lines) + self.assertEqual(curses.COLS, new_cols) -def test_issue6243(stdscr): - curses.ungetch(1025) - stdscr.getkey() + def test_issue6243(self): + curses.ungetch(1025) + self.stdscr.getkey() -def main(stdscr): - curses.savetty() - try: - module_funcs(stdscr) - window_funcs(stdscr) - test_userptr_without_set(stdscr) - test_userptr_memory_leak(stdscr) - test_userptr_segfault(stdscr) - test_resize_term(stdscr) - test_issue6243(stdscr) - finally: - curses.resetty() + def test_issue10570(self): + b = curses.tparm(curses.tigetstr("cup"), 5, 3) + self.assertIs(type(b), bytes) -if __name__ == '__main__': - curses.wrapper(main) - unit_tests() -else: - if not sys.__stdout__.isatty(): - raise unittest.SkipTest("sys.__stdout__ is not a tty") - # testing setupterm() inside initscr/endwin - # causes terminal breakage - curses.setupterm(fd=sys.__stdout__.fileno()) - try: - stdscr = curses.initscr() - main(stdscr) - finally: - curses.endwin() - unit_tests() + +class TestAscii(unittest.TestCase): + + def test_unctrl(self): + unctrl = curses.ascii.unctrl + self.assertEqual(unctrl('a'), 'a') + self.assertEqual(unctrl('A'), 'A') + self.assertEqual(unctrl(';'), ';') + self.assertEqual(unctrl(' '), ' ') + self.assertEqual(unctrl('\x7f'), '^?') + self.assertEqual(unctrl('\n'), '^J') + self.assertEqual(unctrl('\0'), '^@') + # Meta-bit characters + self.assertEqual(unctrl('\x8a'), '!^J') + self.assertEqual(unctrl('\xc1'), '!A') + + +def test_main(): + run_unittest(TestCurses, TestAscii) + + +if __name__ == "__main__": + unittest.main() -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 11:36:13 2016 From: python-checkins at python.org (stefan.krah) Date: Sun, 22 May 2016 15:36:13 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326857=3A_The_geth?= =?utf-8?q?ostbyaddr=5Fr=28=29_workaround_is_no_longer_needed_with?= Message-ID: <20160522153613.4508.65405.1EFD4AD2@psf.io> https://hg.python.org/cpython/rev/09af54099973 changeset: 101477:09af54099973 parent: 101475:bd67fd3eb42e user: Stefan Krah date: Sun May 22 17:35:34 2016 +0200 summary: Issue #26857: The gethostbyaddr_r() workaround is no longer needed with api-level >= 23. Patch by Xavier de Gaye. files: Include/pyport.h | 4 ++++ Modules/socketmodule.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/Include/pyport.h b/Include/pyport.h --- a/Include/pyport.h +++ b/Include/pyport.h @@ -897,4 +897,8 @@ #endif /* _MSC_VER >= 1900 */ #endif /* Py_BUILD_CORE */ +#ifdef __ANDROID__ +#include +#endif + #endif /* Py_PYPORT_H */ diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -163,7 +163,11 @@ # include #endif -#if !defined(WITH_THREAD) || defined(__ANDROID__) +#if !defined(WITH_THREAD) +# undef HAVE_GETHOSTBYNAME_R +#endif + +#if defined(__ANDROID__) && __ANDROID_API__ < 23 # undef HAVE_GETHOSTBYNAME_R #endif -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 14:36:06 2016 From: python-checkins at python.org (terry.reedy) Date: Sun, 22 May 2016 18:36:06 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_with_3=2E5?= Message-ID: <20160522183604.62628.65517.93D5EE02@psf.io> https://hg.python.org/cpython/rev/7eb20f06c6e9 changeset: 101480:7eb20f06c6e9 parent: 101477:09af54099973 parent: 101479:1464df337152 user: Terry Jan Reedy date: Sun May 22 14:35:43 2016 -0400 summary: Merge with 3.5 files: Lib/idlelib/configHandler.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -720,7 +720,7 @@ actualFont = Font.actual(f) family = actualFont['family'] size = actualFont['size'] - if size < 0: + if size <= 0: size = 10 # if font in pixels, ignore actual size bold = actualFont['weight']=='bold' return (family, size, 'bold' if bold else 'normal') -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 14:36:06 2016 From: python-checkins at python.org (terry.reedy) Date: Sun, 22 May 2016 18:36:06 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2Njcz?= =?utf-8?q?=3A_Protect_IDLE_from_Linux_fonts_with_reported_default_size_0?= =?utf-8?q?=2E?= Message-ID: <20160522183604.72580.99702.B71E7E24@psf.io> https://hg.python.org/cpython/rev/1464df337152 changeset: 101479:1464df337152 branch: 3.5 parent: 101474:41f065b2e451 user: Terry Jan Reedy date: Sun May 22 14:35:24 2016 -0400 summary: Issue #26673: Protect IDLE from Linux fonts with reported default size 0. Such fonts on Linux prevented the configuration dialog from opening. files: Lib/idlelib/configHandler.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -720,7 +720,7 @@ actualFont = Font.actual(f) family = actualFont['family'] size = actualFont['size'] - if size < 0: + if size <= 0: size = 10 # if font in pixels, ignore actual size bold = actualFont['weight']=='bold' return (family, size, 'bold' if bold else 'normal') -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 22 14:36:07 2016 From: python-checkins at python.org (terry.reedy) Date: Sun, 22 May 2016 18:36:07 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2Njcz?= =?utf-8?q?=3A_Protect_IDLE_from_Linux_fonts_with_reported_default_size_0?= =?utf-8?q?=2E?= Message-ID: <20160522183603.54562.60922.194CF38C@psf.io> https://hg.python.org/cpython/rev/a873265366ba changeset: 101478:a873265366ba branch: 2.7 parent: 101476:710ea69c61ac user: Terry Jan Reedy date: Sun May 22 14:35:13 2016 -0400 summary: Issue #26673: Protect IDLE from Linux fonts with reported default size 0. Such fonts on Linux prevented the configuration dialog from opening. files: Lib/idlelib/configHandler.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -721,7 +721,7 @@ actualFont = Font.actual(f) family = actualFont['family'] size = actualFont['size'] - if size < 0: + if size <= 0: size = 10 # if font in pixels, ignore actual size bold = actualFont['weight']=='bold' return (family, size, 'bold' if bold else 'normal') -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 23 01:42:28 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Mon, 23 May 2016 05:42:28 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326927=3A_Fixed_test=5Fmmap_on_platforms_with_32?= =?utf-8?q?-bit_off=5Ft_=28like_Android=29=2E?= Message-ID: <20160523054228.28850.84554.8937350A@psf.io> https://hg.python.org/cpython/rev/6147a2c99db0 changeset: 101482:6147a2c99db0 parent: 101480:7eb20f06c6e9 parent: 101481:bca81ea8f898 user: Serhiy Storchaka date: Mon May 23 08:42:09 2016 +0300 summary: Issue #26927: Fixed test_mmap on platforms with 32-bit off_t (like Android). Patch by Xavier de Gaye. files: Lib/test/test_mmap.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -738,7 +738,7 @@ f.seek(num_zeroes) f.write(tail) f.flush() - except (OSError, OverflowError): + except (OSError, OverflowError, ValueError): try: f.close() except (OSError, OverflowError): -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 23 01:42:31 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Mon, 23 May 2016 05:42:31 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2OTI3?= =?utf-8?q?=3A_Fixed_test=5Fmmap_on_platforms_with_32-bit_off=5Ft_=28like_?= =?utf-8?b?QW5kcm9pZCku?= Message-ID: <20160523054228.65278.85103.094ABA2E@psf.io> https://hg.python.org/cpython/rev/bca81ea8f898 changeset: 101481:bca81ea8f898 branch: 3.5 parent: 101479:1464df337152 user: Serhiy Storchaka date: Mon May 23 08:41:48 2016 +0300 summary: Issue #26927: Fixed test_mmap on platforms with 32-bit off_t (like Android). Patch by Xavier de Gaye. files: Lib/test/test_mmap.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -730,7 +730,7 @@ f.seek(num_zeroes) f.write(tail) f.flush() - except (OSError, OverflowError): + except (OSError, OverflowError, ValueError): try: f.close() except (OSError, OverflowError): -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Mon May 23 04:51:26 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 23 May 2016 08:51:26 +0000 Subject: [Python-checkins] Daily reference leaks (6147a2c99db0): sum=6 Message-ID: <20160523085125.18711.63494.1ED2F06E@psf.io> results for 6147a2c99db0 on branch "default" -------------------------------------------- test_collections leaked [4, -4, 4] memory blocks, sum=4 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [-2, 1, 1] memory blocks, sum=0 test_multiprocessing_forkserver leaked [0, 0, -2] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflog1lcFSE', '--timeout', '7200'] From lp_benchmark_robot at intel.com Mon May 23 09:35:33 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Mon, 23 May 2016 14:35:33 +0100 Subject: [Python-checkins] BAD Benchmark Results for Python Default 2016-05-23 Message-ID: Results for project Python default, build date 2016-05-23 02:02:11 +0000 commit: 7eb20f06c6e9 previous commit: ade839421b8f revision date: 2016-05-22 18:35:43 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.36% 0.62% 9.72% 15.70% :-) pybench 0.14% 0.81% 2.53% 5.33% :-( regex_v8 2.86% -0.03% -2.16% 5.19% :-| nbody 0.10% -0.83% 0.25% 7.55% :-( json_dump_v2 0.31% -1.98% -2.99% 12.28% :-| normal_startup 0.79% 0.15% -0.40% 5.88% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/bad-benchmark-results-for-python-default-2016-05-23/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Mon May 23 09:36:02 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Mon, 23 May 2016 14:36:02 +0100 Subject: [Python-checkins] UGLY Benchmark Results for Python 2.7 2016-05-23 Message-ID: <85d7cebb-f84b-424f-b2f2-2870a5a654f8@irsmsx153.ger.corp.intel.com> Results for project Python 2.7, build date 2016-05-23 02:46:22 +0000 commit: a873265366ba previous commit: 18c5e4d82d83 revision date: 2016-05-22 18:35:13 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.16% -1.73% 4.31% 5.77% :-) pybench 0.29% 0.15% 6.06% 4.70% :-( regex_v8 0.64% 0.23% -2.22% 10.48% :-) nbody 0.33% -0.46% 9.28% 1.54% :-| json_dump_v2 0.62% -0.40% 1.19% 12.14% :-( normal_startup 1.70% 1.56% -4.53% 1.72% :-) ssbench 0.17% -0.45% 2.29% 1.30% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/ugly-benchmark-results-for-python-2-7-2016-05-23/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Tue May 24 01:48:16 2016 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 24 May 2016 05:48:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_fix_indentatio?= =?utf-8?q?n_and_add_curlies_=28closes_=2327093=29?= Message-ID: <20160524054815.11804.30329.F8188578@psf.io> https://hg.python.org/cpython/rev/f0438e1a4761 changeset: 101484:f0438e1a4761 branch: 2.7 parent: 101478:a873265366ba user: Benjamin Peterson date: Mon May 23 22:47:50 2016 -0700 summary: fix indentation and add curlies (closes #27093) files: Modules/cjkcodecs/cjkcodecs.h | 26 +++++++++++++--------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h --- a/Modules/cjkcodecs/cjkcodecs.h +++ b/Modules/cjkcodecs/cjkcodecs.h @@ -325,22 +325,26 @@ min = 0; max = haystacksize; - for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) + for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) { if (value < haystack[pos].uniseq) { - if (max == pos) break; - else max = pos; + if (max != pos) { + max = pos; + continue; + } } else if (value > haystack[pos].uniseq) { - if (min == pos) break; - else min = pos; + if (min != pos) { + min = pos; + continue; + } } - else - break; + break; + } - if (value == haystack[pos].uniseq) - return haystack[pos].code; - else - return DBCINV; + if (value == haystack[pos].uniseq) { + return haystack[pos].code; + } + return DBCINV; } #endif -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 24 01:48:15 2016 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 24 May 2016 05:48:15 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_fix_indentatio?= =?utf-8?q?n_and_add_curlies_=28closes_=2327093=29?= Message-ID: <20160524054815.60004.10303.BC2A1DBA@psf.io> https://hg.python.org/cpython/rev/3732828f2835 changeset: 101483:3732828f2835 branch: 3.5 parent: 101481:bca81ea8f898 user: Benjamin Peterson date: Mon May 23 22:47:50 2016 -0700 summary: fix indentation and add curlies (closes #27093) files: Modules/cjkcodecs/cjkcodecs.h | 26 +++++++++++++--------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h --- a/Modules/cjkcodecs/cjkcodecs.h +++ b/Modules/cjkcodecs/cjkcodecs.h @@ -328,22 +328,26 @@ min = 0; max = haystacksize; - for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) + for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) { if (value < haystack[pos].uniseq) { - if (max == pos) break; - else max = pos; + if (max != pos) { + max = pos; + continue; + } } else if (value > haystack[pos].uniseq) { - if (min == pos) break; - else min = pos; + if (min != pos) { + min = pos; + continue; + } } - else - break; + break; + } - if (value == haystack[pos].uniseq) - return haystack[pos].code; - else - return DBCINV; + if (value == haystack[pos].uniseq) { + return haystack[pos].code; + } + return DBCINV; } #endif -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 24 01:48:16 2016 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 24 May 2016 05:48:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogbWVyZ2UgMy41ICgjMjcwOTMp?= Message-ID: <20160524054816.60979.81502.F3503214@psf.io> https://hg.python.org/cpython/rev/7a7f54fe0698 changeset: 101485:7a7f54fe0698 parent: 101482:6147a2c99db0 parent: 101483:3732828f2835 user: Benjamin Peterson date: Mon May 23 22:48:05 2016 -0700 summary: merge 3.5 (#27093) files: Modules/cjkcodecs/cjkcodecs.h | 26 +++++++++++++--------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h --- a/Modules/cjkcodecs/cjkcodecs.h +++ b/Modules/cjkcodecs/cjkcodecs.h @@ -328,22 +328,26 @@ min = 0; max = haystacksize; - for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) + for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) { if (value < haystack[pos].uniseq) { - if (max == pos) break; - else max = pos; + if (max != pos) { + max = pos; + continue; + } } else if (value > haystack[pos].uniseq) { - if (min == pos) break; - else min = pos; + if (min != pos) { + min = pos; + continue; + } } - else - break; + break; + } - if (value == haystack[pos].uniseq) - return haystack[pos].code; - else - return DBCINV; + if (value == haystack[pos].uniseq) { + return haystack[pos].code; + } + return DBCINV; } #endif -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 24 02:15:43 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Tue, 24 May 2016 06:15:43 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2326647=3A_Python_i?= =?utf-8?q?nterpreter_now_uses_16-bit_wordcode_instead_of_bytecode=2E?= Message-ID: <20160524061542.28801.84595.29E5EEA7@psf.io> https://hg.python.org/cpython/rev/3a57eafd8401 changeset: 101486:3a57eafd8401 user: Serhiy Storchaka date: Tue May 24 09:15:14 2016 +0300 summary: Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode. Patch by Demur Rumed. files: Doc/library/dis.rst | 9 +- Lib/ctypes/test/test_values.py | 6 +- Lib/dis.py | 35 +- Lib/importlib/_bootstrap_external.py | 3 +- Lib/test/test_dis.py | 512 +- Misc/NEWS | 3 + Objects/frameobject.c | 12 +- Objects/genobject.c | 4 +- PC/launcher.c | 2 +- PCbuild/pythoncore.vcxproj | 1 + PCbuild/pythoncore.vcxproj.filters | 3 + Python/ceval.c | 133 +- Python/compile.c | 81 +- Python/frozen.c | 20 +- Python/importlib.h | 3719 +++++----- Python/importlib_external.h | 4612 ++++++------- Python/peephole.c | 578 +- Python/wordcode_helpers.h | 38 + 18 files changed, 4748 insertions(+), 5023 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -31,9 +31,9 @@ >>> dis.dis(myfunc) 2 0 LOAD_GLOBAL 0 (len) - 3 LOAD_FAST 0 (alist) - 6 CALL_FUNCTION 1 - 9 RETURN_VALUE + 2 LOAD_FAST 0 (alist) + 4 CALL_FUNCTION 1 + 6 RETURN_VALUE (The "2" is a line number). @@ -682,8 +682,7 @@ .. XXX explain the WHY stuff! -All of the following opcodes expect arguments. An argument is two bytes, with -the more significant byte last. +All of the following opcodes use their arguments. .. opcode:: STORE_NAME (namei) diff --git a/Lib/ctypes/test/test_values.py b/Lib/ctypes/test/test_values.py --- a/Lib/ctypes/test/test_values.py +++ b/Lib/ctypes/test/test_values.py @@ -79,9 +79,9 @@ continue items.append((entry.name.decode("ascii"), entry.size)) - expected = [("__hello__", 161), - ("__phello__", -161), - ("__phello__.spam", 161), + expected = [("__hello__", 139), + ("__phello__", -139), + ("__phello__.spam", 139), ] self.assertEqual(items, expected, "PyImport_FrozenModules example " "in Doc/library/ctypes.rst may be out of date") diff --git a/Lib/dis.py b/Lib/dis.py --- a/Lib/dis.py +++ b/Lib/dis.py @@ -285,7 +285,6 @@ """ labels = findlabels(code) starts_line = None - free = None for offset, op, arg in _unpack_opargs(code): if linestarts is not None: starts_line = linestarts.get(offset, None) @@ -296,7 +295,7 @@ argrepr = '' if arg is not None: # Set argval to the dereferenced value of the argument when - # availabe, and argrepr to the string representation of argval. + # available, and argrepr to the string representation of argval. # _disassemble_bytes needs the string repr of the # raw name index for LOAD_GLOBAL, LOAD_CONST, etc. argval = arg @@ -305,7 +304,7 @@ elif op in hasname: argval, argrepr = _get_name_info(arg, names) elif op in hasjrel: - argval = offset + 3 + arg + argval = offset + 2 + arg argrepr = "to " + repr(argval) elif op in haslocal: argval, argrepr = _get_name_info(arg, varnames) @@ -352,23 +351,15 @@ disco = disassemble # XXX For backwards compatibility def _unpack_opargs(code): - # enumerate() is not an option, since we sometimes process - # multiple elements on a single pass through the loop extended_arg = 0 - n = len(code) - i = 0 - while i < n: + for i in range(0, len(code), 2): op = code[i] - offset = i - i = i+1 - arg = None if op >= HAVE_ARGUMENT: - arg = code[i] + code[i+1]*256 + extended_arg - extended_arg = 0 - i = i+2 - if op == EXTENDED_ARG: - extended_arg = arg*65536 - yield (offset, op, arg) + arg = code[i+1] | extended_arg + extended_arg = (arg << 8) if op == EXTENDED_ARG else 0 + else: + arg = None + yield (i, op, arg) def findlabels(code): """Detect all offsets in a byte code which are jump targets. @@ -379,14 +370,14 @@ labels = [] for offset, op, arg in _unpack_opargs(code): if arg is not None: - label = -1 if op in hasjrel: - label = offset + 3 + arg + label = offset + 2 + arg elif op in hasjabs: label = arg - if label >= 0: - if label not in labels: - labels.append(label) + else: + continue + if label not in labels: + labels.append(label) return labels def findlinestarts(code): diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -225,6 +225,7 @@ # Python 3.5b2 3350 (add GET_YIELD_FROM_ITER opcode #24400) # Python 3.6a0 3360 (add FORMAT_VALUE opcode #25483 # Python 3.6a0 3361 (lineno delta of code.co_lnotab becomes signed) +# Python 3.6a0 3370 (16 bit wordcode) # # MAGIC must change whenever the bytecode emitted by the compiler may no # longer be understood by older implementations of the eval loop (usually @@ -233,7 +234,7 @@ # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array # in PC/launcher.c must also be updated. -MAGIC_NUMBER = (3361).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3370).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -40,41 +40,41 @@ dis_c_instance_method = """\ %3d 0 LOAD_FAST 1 (x) - 3 LOAD_CONST 1 (1) - 6 COMPARE_OP 2 (==) - 9 LOAD_FAST 0 (self) - 12 STORE_ATTR 0 (x) - 15 LOAD_CONST 0 (None) - 18 RETURN_VALUE + 2 LOAD_CONST 1 (1) + 4 COMPARE_OP 2 (==) + 6 LOAD_FAST 0 (self) + 8 STORE_ATTR 0 (x) + 10 LOAD_CONST 0 (None) + 12 RETURN_VALUE """ % (_C.__init__.__code__.co_firstlineno + 1,) dis_c_instance_method_bytes = """\ 0 LOAD_FAST 1 (1) - 3 LOAD_CONST 1 (1) - 6 COMPARE_OP 2 (==) - 9 LOAD_FAST 0 (0) - 12 STORE_ATTR 0 (0) - 15 LOAD_CONST 0 (0) - 18 RETURN_VALUE + 2 LOAD_CONST 1 (1) + 4 COMPARE_OP 2 (==) + 6 LOAD_FAST 0 (0) + 8 STORE_ATTR 0 (0) + 10 LOAD_CONST 0 (0) + 12 RETURN_VALUE """ dis_c_class_method = """\ %3d 0 LOAD_FAST 1 (x) - 3 LOAD_CONST 1 (1) - 6 COMPARE_OP 2 (==) - 9 LOAD_FAST 0 (cls) - 12 STORE_ATTR 0 (x) - 15 LOAD_CONST 0 (None) - 18 RETURN_VALUE + 2 LOAD_CONST 1 (1) + 4 COMPARE_OP 2 (==) + 6 LOAD_FAST 0 (cls) + 8 STORE_ATTR 0 (x) + 10 LOAD_CONST 0 (None) + 12 RETURN_VALUE """ % (_C.cm.__code__.co_firstlineno + 2,) dis_c_static_method = """\ %3d 0 LOAD_FAST 0 (x) - 3 LOAD_CONST 1 (1) - 6 COMPARE_OP 2 (==) - 9 STORE_FAST 0 (x) - 12 LOAD_CONST 0 (None) - 15 RETURN_VALUE + 2 LOAD_CONST 1 (1) + 4 COMPARE_OP 2 (==) + 6 STORE_FAST 0 (x) + 8 LOAD_CONST 0 (None) + 10 RETURN_VALUE """ % (_C.sm.__code__.co_firstlineno + 2,) # Class disassembling info has an extra newline at end. @@ -95,23 +95,23 @@ dis_f = """\ %3d 0 LOAD_GLOBAL 0 (print) - 3 LOAD_FAST 0 (a) - 6 CALL_FUNCTION 1 (1 positional, 0 keyword pair) - 9 POP_TOP + 2 LOAD_FAST 0 (a) + 4 CALL_FUNCTION 1 (1 positional, 0 keyword pair) + 6 POP_TOP -%3d 10 LOAD_CONST 1 (1) - 13 RETURN_VALUE +%3d 8 LOAD_CONST 1 (1) + 10 RETURN_VALUE """ % (_f.__code__.co_firstlineno + 1, _f.__code__.co_firstlineno + 2) dis_f_co_code = """\ 0 LOAD_GLOBAL 0 (0) - 3 LOAD_FAST 0 (0) - 6 CALL_FUNCTION 1 (1 positional, 0 keyword pair) - 9 POP_TOP - 10 LOAD_CONST 1 (1) - 13 RETURN_VALUE + 2 LOAD_FAST 0 (0) + 4 CALL_FUNCTION 1 (1 positional, 0 keyword pair) + 6 POP_TOP + 8 LOAD_CONST 1 (1) + 10 RETURN_VALUE """ @@ -121,20 +121,20 @@ pass dis_bug708901 = """\ -%3d 0 SETUP_LOOP 23 (to 26) - 3 LOAD_GLOBAL 0 (range) - 6 LOAD_CONST 1 (1) +%3d 0 SETUP_LOOP 18 (to 20) + 2 LOAD_GLOBAL 0 (range) + 4 LOAD_CONST 1 (1) -%3d 9 LOAD_CONST 2 (10) - 12 CALL_FUNCTION 2 (2 positional, 0 keyword pair) - 15 GET_ITER - >> 16 FOR_ITER 6 (to 25) - 19 STORE_FAST 0 (res) +%3d 6 LOAD_CONST 2 (10) + 8 CALL_FUNCTION 2 (2 positional, 0 keyword pair) + 10 GET_ITER + >> 12 FOR_ITER 4 (to 18) + 14 STORE_FAST 0 (res) -%3d 22 JUMP_ABSOLUTE 16 - >> 25 POP_BLOCK - >> 26 LOAD_CONST 0 (None) - 29 RETURN_VALUE +%3d 16 JUMP_ABSOLUTE 12 + >> 18 POP_BLOCK + >> 20 LOAD_CONST 0 (None) + 22 RETURN_VALUE """ % (bug708901.__code__.co_firstlineno + 1, bug708901.__code__.co_firstlineno + 2, bug708901.__code__.co_firstlineno + 3) @@ -147,22 +147,22 @@ dis_bug1333982 = """\ %3d 0 LOAD_CONST 1 (0) - 3 POP_JUMP_IF_TRUE 35 - 6 LOAD_GLOBAL 0 (AssertionError) - 9 LOAD_CONST 2 ( at 0x..., file "%s", line %d>) - 12 LOAD_CONST 3 ('bug1333982..') - 15 MAKE_FUNCTION 0 - 18 LOAD_FAST 0 (x) - 21 GET_ITER + 2 POP_JUMP_IF_TRUE 26 + 4 LOAD_GLOBAL 0 (AssertionError) + 6 LOAD_CONST 2 ( at 0x..., file "%s", line %d>) + 8 LOAD_CONST 3 ('bug1333982..') + 10 MAKE_FUNCTION 0 + 12 LOAD_FAST 0 (x) + 14 GET_ITER + 16 CALL_FUNCTION 1 (1 positional, 0 keyword pair) + +%3d 18 LOAD_CONST 4 (1) + 20 BINARY_ADD 22 CALL_FUNCTION 1 (1 positional, 0 keyword pair) + 24 RAISE_VARARGS 1 -%3d 25 LOAD_CONST 4 (1) - 28 BINARY_ADD - 29 CALL_FUNCTION 1 (1 positional, 0 keyword pair) - 32 RAISE_VARARGS 1 - -%3d >> 35 LOAD_CONST 0 (None) - 38 RETURN_VALUE +%3d >> 26 LOAD_CONST 0 (None) + 28 RETURN_VALUE """ % (bug1333982.__code__.co_firstlineno + 1, __file__, bug1333982.__code__.co_firstlineno + 1, @@ -171,19 +171,19 @@ _BIG_LINENO_FORMAT = """\ %3d 0 LOAD_GLOBAL 0 (spam) - 3 POP_TOP + 2 POP_TOP 4 LOAD_CONST 0 (None) - 7 RETURN_VALUE + 6 RETURN_VALUE """ dis_module_expected_results = """\ Disassembly of f: 4 0 LOAD_CONST 0 (None) - 3 RETURN_VALUE + 2 RETURN_VALUE Disassembly of g: 5 0 LOAD_CONST 0 (None) - 3 RETURN_VALUE + 2 RETURN_VALUE """ @@ -191,20 +191,20 @@ dis_expr_str = """\ 1 0 LOAD_NAME 0 (x) - 3 LOAD_CONST 0 (1) - 6 BINARY_ADD - 7 RETURN_VALUE + 2 LOAD_CONST 0 (1) + 4 BINARY_ADD + 6 RETURN_VALUE """ simple_stmt_str = "x = x + 1" dis_simple_stmt_str = """\ 1 0 LOAD_NAME 0 (x) - 3 LOAD_CONST 0 (1) - 6 BINARY_ADD - 7 STORE_NAME 0 (x) - 10 LOAD_CONST 1 (None) - 13 RETURN_VALUE + 2 LOAD_CONST 0 (1) + 4 BINARY_ADD + 6 STORE_NAME 0 (x) + 8 LOAD_CONST 1 (None) + 10 RETURN_VALUE """ compound_stmt_str = """\ @@ -215,54 +215,54 @@ dis_compound_stmt_str = """\ 1 0 LOAD_CONST 0 (0) - 3 STORE_NAME 0 (x) + 2 STORE_NAME 0 (x) - 2 6 SETUP_LOOP 14 (to 23) + 2 4 SETUP_LOOP 12 (to 18) - 3 >> 9 LOAD_NAME 0 (x) - 12 LOAD_CONST 1 (1) - 15 INPLACE_ADD - 16 STORE_NAME 0 (x) - 19 JUMP_ABSOLUTE 9 - 22 POP_BLOCK - >> 23 LOAD_CONST 2 (None) - 26 RETURN_VALUE + 3 >> 6 LOAD_NAME 0 (x) + 8 LOAD_CONST 1 (1) + 10 INPLACE_ADD + 12 STORE_NAME 0 (x) + 14 JUMP_ABSOLUTE 6 + 16 POP_BLOCK + >> 18 LOAD_CONST 2 (None) + 20 RETURN_VALUE """ dis_traceback = """\ -%3d 0 SETUP_EXCEPT 12 (to 15) +%3d 0 SETUP_EXCEPT 12 (to 14) -%3d 3 LOAD_CONST 1 (1) - 6 LOAD_CONST 2 (0) - --> 9 BINARY_TRUE_DIVIDE - 10 POP_TOP - 11 POP_BLOCK - 12 JUMP_FORWARD 46 (to 61) +%3d 2 LOAD_CONST 1 (1) + 4 LOAD_CONST 2 (0) + --> 6 BINARY_TRUE_DIVIDE + 8 POP_TOP + 10 POP_BLOCK + 12 JUMP_FORWARD 40 (to 54) -%3d >> 15 DUP_TOP +%3d >> 14 DUP_TOP 16 LOAD_GLOBAL 0 (Exception) - 19 COMPARE_OP 10 (exception match) - 22 POP_JUMP_IF_FALSE 60 - 25 POP_TOP - 26 STORE_FAST 0 (e) - 29 POP_TOP - 30 SETUP_FINALLY 14 (to 47) + 18 COMPARE_OP 10 (exception match) + 20 POP_JUMP_IF_FALSE 52 + 22 POP_TOP + 24 STORE_FAST 0 (e) + 26 POP_TOP + 28 SETUP_FINALLY 12 (to 42) -%3d 33 LOAD_FAST 0 (e) - 36 LOAD_ATTR 1 (__traceback__) - 39 STORE_FAST 1 (tb) - 42 POP_BLOCK - 43 POP_EXCEPT - 44 LOAD_CONST 0 (None) - >> 47 LOAD_CONST 0 (None) - 50 STORE_FAST 0 (e) - 53 DELETE_FAST 0 (e) - 56 END_FINALLY - 57 JUMP_FORWARD 1 (to 61) - >> 60 END_FINALLY +%3d 30 LOAD_FAST 0 (e) + 32 LOAD_ATTR 1 (__traceback__) + 34 STORE_FAST 1 (tb) + 36 POP_BLOCK + 38 POP_EXCEPT + 40 LOAD_CONST 0 (None) + >> 42 LOAD_CONST 0 (None) + 44 STORE_FAST 0 (e) + 46 DELETE_FAST 0 (e) + 48 END_FINALLY + 50 JUMP_FORWARD 2 (to 54) + >> 52 END_FINALLY -%3d >> 61 LOAD_FAST 1 (tb) - 64 RETURN_VALUE +%3d >> 54 LOAD_FAST 1 (tb) + 56 RETURN_VALUE """ % (TRACEBACK_CODE.co_firstlineno + 1, TRACEBACK_CODE.co_firstlineno + 2, TRACEBACK_CODE.co_firstlineno + 3, @@ -650,170 +650,170 @@ Instruction = dis.Instruction expected_opinfo_outer = [ Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=3, argrepr='3', offset=0, starts_line=2, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=3, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='a', argrepr='a', offset=6, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='b', argrepr='b', offset=9, starts_line=None, is_jump_target=False), - Instruction(opname='BUILD_TUPLE', opcode=102, arg=2, argval=2, argrepr='', offset=12, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=code_object_f, argrepr=repr(code_object_f), offset=15, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='outer..f', argrepr="'outer..f'", offset=18, starts_line=None, is_jump_target=False), - Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, argrepr='', offset=21, starts_line=None, is_jump_target=False), - Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='f', argrepr='f', offset=24, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', argrepr='print', offset=27, starts_line=7, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', argrepr='a', offset=30, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', argrepr='b', offset=33, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval='', argrepr="''", offset=36, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval=1, argrepr='1', offset=39, starts_line=None, is_jump_target=False), - Instruction(opname='BUILD_LIST', opcode=103, arg=0, argval=0, argrepr='', offset=42, starts_line=None, is_jump_target=False), - Instruction(opname='BUILD_MAP', opcode=105, arg=0, argval=0, argrepr='', offset=45, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval='Hello world!', argrepr="'Hello world!'", offset=48, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=7, argval=7, argrepr='7 positional, 0 keyword pair', offset=51, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=54, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', argrepr='f', offset=55, starts_line=8, is_jump_target=False), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=58, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=2, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='a', argrepr='a', offset=4, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='b', argrepr='b', offset=6, starts_line=None, is_jump_target=False), + Instruction(opname='BUILD_TUPLE', opcode=102, arg=2, argval=2, argrepr='', offset=8, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=code_object_f, argrepr=repr(code_object_f), offset=10, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='outer..f', argrepr="'outer..f'", offset=12, starts_line=None, is_jump_target=False), + Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, argrepr='', offset=14, starts_line=None, is_jump_target=False), + Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='f', argrepr='f', offset=16, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', argrepr='print', offset=18, starts_line=7, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', argrepr='a', offset=20, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', argrepr='b', offset=22, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval='', argrepr="''", offset=24, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval=1, argrepr='1', offset=26, starts_line=None, is_jump_target=False), + Instruction(opname='BUILD_LIST', opcode=103, arg=0, argval=0, argrepr='', offset=28, starts_line=None, is_jump_target=False), + Instruction(opname='BUILD_MAP', opcode=105, arg=0, argval=0, argrepr='', offset=30, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval='Hello world!', argrepr="'Hello world!'", offset=32, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=7, argval=7, argrepr='7 positional, 0 keyword pair', offset=34, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=36, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', argrepr='f', offset=38, starts_line=8, is_jump_target=False), + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=40, starts_line=None, is_jump_target=False), ] expected_opinfo_f = [ Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=5, argrepr='5', offset=0, starts_line=3, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=6, argrepr='6', offset=3, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=2, argval='a', argrepr='a', offset=6, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=3, argval='b', argrepr='b', offset=9, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='c', argrepr='c', offset=12, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='d', argrepr='d', offset=15, starts_line=None, is_jump_target=False), - Instruction(opname='BUILD_TUPLE', opcode=102, arg=4, argval=4, argrepr='', offset=18, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=code_object_inner, argrepr=repr(code_object_inner), offset=21, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='outer..f..inner', argrepr="'outer..f..inner'", offset=24, starts_line=None, is_jump_target=False), - Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, argrepr='', offset=27, starts_line=None, is_jump_target=False), - Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='inner', argrepr='inner', offset=30, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', argrepr='print', offset=33, starts_line=5, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='a', argrepr='a', offset=36, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='b', argrepr='b', offset=39, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='c', argrepr='c', offset=42, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='d', argrepr='d', offset=45, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=4, argval=4, argrepr='4 positional, 0 keyword pair', offset=48, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=51, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', argrepr='inner', offset=52, starts_line=6, is_jump_target=False), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=55, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=6, argrepr='6', offset=2, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=2, argval='a', argrepr='a', offset=4, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=3, argval='b', argrepr='b', offset=6, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='c', argrepr='c', offset=8, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='d', argrepr='d', offset=10, starts_line=None, is_jump_target=False), + Instruction(opname='BUILD_TUPLE', opcode=102, arg=4, argval=4, argrepr='', offset=12, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=code_object_inner, argrepr=repr(code_object_inner), offset=14, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='outer..f..inner', argrepr="'outer..f..inner'", offset=16, starts_line=None, is_jump_target=False), + Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, argrepr='', offset=18, starts_line=None, is_jump_target=False), + Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='inner', argrepr='inner', offset=20, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', argrepr='print', offset=22, starts_line=5, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='a', argrepr='a', offset=24, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='b', argrepr='b', offset=26, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='c', argrepr='c', offset=28, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='d', argrepr='d', offset=30, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=4, argval=4, argrepr='4 positional, 0 keyword pair', offset=32, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=34, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', argrepr='inner', offset=36, starts_line=6, is_jump_target=False), + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=38, starts_line=None, is_jump_target=False), ] expected_opinfo_inner = [ Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', argrepr='print', offset=0, starts_line=4, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', argrepr='a', offset=3, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', argrepr='b', offset=6, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='c', argrepr='c', offset=9, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='d', argrepr='d', offset=12, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='e', argrepr='e', offset=15, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=1, argval='f', argrepr='f', offset=18, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=6, argval=6, argrepr='6 positional, 0 keyword pair', offset=21, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=24, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=25, starts_line=None, is_jump_target=False), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=28, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', argrepr='a', offset=2, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', argrepr='b', offset=4, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='c', argrepr='c', offset=6, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='d', argrepr='d', offset=8, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='e', argrepr='e', offset=10, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=1, argval='f', argrepr='f', offset=12, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=6, argval=6, argrepr='6 positional, 0 keyword pair', offset=14, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=16, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=18, starts_line=None, is_jump_target=False), + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=20, starts_line=None, is_jump_target=False), ] expected_opinfo_jumpy = [ - Instruction(opname='SETUP_LOOP', opcode=120, arg=68, argval=71, argrepr='to 71', offset=0, starts_line=3, is_jump_target=False), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='range', argrepr='range', offset=3, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, argrepr='10', offset=6, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=9, starts_line=None, is_jump_target=False), - Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=12, starts_line=None, is_jump_target=False), - Instruction(opname='FOR_ITER', opcode=93, arg=44, argval=60, argrepr='to 60', offset=13, starts_line=None, is_jump_target=True), - Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=16, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=19, starts_line=4, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=22, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=25, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=28, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=29, starts_line=5, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=32, starts_line=None, is_jump_target=False), - Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=35, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=44, argval=44, argrepr='', offset=38, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=13, argval=13, argrepr='', offset=41, starts_line=6, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=44, starts_line=7, is_jump_target=True), - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=47, starts_line=None, is_jump_target=False), - Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=50, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=13, argval=13, argrepr='', offset=53, starts_line=None, is_jump_target=False), - Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, argrepr='', offset=56, starts_line=8, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=13, argval=13, argrepr='', offset=57, starts_line=None, is_jump_target=False), - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=60, starts_line=None, is_jump_target=True), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=61, starts_line=10, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=64, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=67, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=70, starts_line=None, is_jump_target=False), - Instruction(opname='SETUP_LOOP', opcode=120, arg=68, argval=142, argrepr='to 142', offset=71, starts_line=11, is_jump_target=True), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=74, starts_line=None, is_jump_target=True), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=131, argval=131, argrepr='', offset=77, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=80, starts_line=12, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=83, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=86, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=89, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=90, starts_line=13, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=93, starts_line=None, is_jump_target=False), - Instruction(opname='INPLACE_SUBTRACT', opcode=56, arg=None, argval=None, argrepr='', offset=96, starts_line=None, is_jump_target=False), - Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=97, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=100, starts_line=14, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=103, starts_line=None, is_jump_target=False), - Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=106, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=115, argval=115, argrepr='', offset=109, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=74, argval=74, argrepr='', offset=112, starts_line=15, is_jump_target=False), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=115, starts_line=16, is_jump_target=True), - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=118, starts_line=None, is_jump_target=False), - Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=121, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=74, argval=74, argrepr='', offset=124, starts_line=None, is_jump_target=False), - Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, argrepr='', offset=127, starts_line=17, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=74, argval=74, argrepr='', offset=128, starts_line=None, is_jump_target=False), - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=131, starts_line=None, is_jump_target=True), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=132, starts_line=19, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=135, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=138, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=141, starts_line=None, is_jump_target=False), - Instruction(opname='SETUP_FINALLY', opcode=122, arg=73, argval=218, argrepr='to 218', offset=142, starts_line=20, is_jump_target=True), - Instruction(opname='SETUP_EXCEPT', opcode=121, arg=12, argval=160, argrepr='to 160', offset=145, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=148, starts_line=21, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=151, starts_line=None, is_jump_target=False), - Instruction(opname='BINARY_TRUE_DIVIDE', opcode=27, arg=None, argval=None, argrepr='', offset=154, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=155, starts_line=None, is_jump_target=False), - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=156, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=28, argval=188, argrepr='to 188', offset=157, starts_line=None, is_jump_target=False), - Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, argrepr='', offset=160, starts_line=22, is_jump_target=True), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=2, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=161, starts_line=None, is_jump_target=False), - Instruction(opname='COMPARE_OP', opcode=107, arg=10, argval='exception match', argrepr='exception match', offset=164, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=187, argval=187, argrepr='', offset=167, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=170, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=171, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=172, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=173, starts_line=23, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=176, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=179, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=182, starts_line=None, is_jump_target=False), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=183, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=27, argval=214, argrepr='to 214', offset=184, starts_line=None, is_jump_target=False), - Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=187, starts_line=None, is_jump_target=True), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=188, starts_line=25, is_jump_target=True), - Instruction(opname='SETUP_WITH', opcode=143, arg=17, argval=211, argrepr='to 211', offset=191, starts_line=None, is_jump_target=False), - Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=194, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=197, starts_line=26, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Never reach this', argrepr="'Never reach this'", offset=200, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=203, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=206, starts_line=None, is_jump_target=False), - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=207, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=208, starts_line=None, is_jump_target=False), - Instruction(opname='WITH_CLEANUP_START', opcode=81, arg=None, argval=None, argrepr='', offset=211, starts_line=None, is_jump_target=True), - Instruction(opname='WITH_CLEANUP_FINISH', opcode=82, arg=None, argval=None, argrepr='', offset=212, starts_line=None, is_jump_target=False), - Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=213, starts_line=None, is_jump_target=False), - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=214, starts_line=None, is_jump_target=True), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=215, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=218, starts_line=28, is_jump_target=True), - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=221, starts_line=None, is_jump_target=False), - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=224, starts_line=None, is_jump_target=False), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=227, starts_line=None, is_jump_target=False), - Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=228, starts_line=None, is_jump_target=False), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=229, starts_line=None, is_jump_target=False), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=232, starts_line=None, is_jump_target=False), + Instruction(opname='SETUP_LOOP', opcode=120, arg=52, argval=54, argrepr='to 54', offset=0, starts_line=3, is_jump_target=False), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='range', argrepr='range', offset=2, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, argrepr='10', offset=4, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=6, starts_line=None, is_jump_target=False), + Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=8, starts_line=None, is_jump_target=False), + Instruction(opname='FOR_ITER', opcode=93, arg=32, argval=44, argrepr='to 44', offset=10, starts_line=None, is_jump_target=True), + Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=12, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=14, starts_line=4, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=16, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=18, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=20, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=22, starts_line=5, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=24, starts_line=None, is_jump_target=False), + Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=26, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=32, argval=32, argrepr='', offset=28, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=10, argval=10, argrepr='', offset=30, starts_line=6, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=32, starts_line=7, is_jump_target=True), + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=34, starts_line=None, is_jump_target=False), + Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=36, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=10, argval=10, argrepr='', offset=38, starts_line=None, is_jump_target=False), + Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, argrepr='', offset=40, starts_line=8, is_jump_target=False), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=10, argval=10, argrepr='', offset=42, starts_line=None, is_jump_target=False), + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=44, starts_line=None, is_jump_target=True), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=46, starts_line=10, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=48, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=50, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=52, starts_line=None, is_jump_target=False), + Instruction(opname='SETUP_LOOP', opcode=120, arg=52, argval=108, argrepr='to 108', offset=54, starts_line=11, is_jump_target=True), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=56, starts_line=None, is_jump_target=True), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=98, argval=98, argrepr='', offset=58, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=60, starts_line=12, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=62, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=64, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=66, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=68, starts_line=13, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=70, starts_line=None, is_jump_target=False), + Instruction(opname='INPLACE_SUBTRACT', opcode=56, arg=None, argval=None, argrepr='', offset=72, starts_line=None, is_jump_target=False), + Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=74, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=76, starts_line=14, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=78, starts_line=None, is_jump_target=False), + Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=80, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=86, argval=86, argrepr='', offset=82, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=56, argval=56, argrepr='', offset=84, starts_line=15, is_jump_target=False), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=86, starts_line=16, is_jump_target=True), + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=88, starts_line=None, is_jump_target=False), + Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=90, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=56, argval=56, argrepr='', offset=92, starts_line=None, is_jump_target=False), + Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, argrepr='', offset=94, starts_line=17, is_jump_target=False), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=56, argval=56, argrepr='', offset=96, starts_line=None, is_jump_target=False), + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=98, starts_line=None, is_jump_target=True), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=100, starts_line=19, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=102, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=104, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=106, starts_line=None, is_jump_target=False), + Instruction(opname='SETUP_FINALLY', opcode=122, arg=70, argval=180, argrepr='to 180', offset=108, starts_line=20, is_jump_target=True), + Instruction(opname='SETUP_EXCEPT', opcode=121, arg=12, argval=124, argrepr='to 124', offset=110, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=112, starts_line=21, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=114, starts_line=None, is_jump_target=False), + Instruction(opname='BINARY_TRUE_DIVIDE', opcode=27, arg=None, argval=None, argrepr='', offset=116, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=118, starts_line=None, is_jump_target=False), + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=120, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=28, argval=152, argrepr='to 152', offset=122, starts_line=None, is_jump_target=False), + Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, argrepr='', offset=124, starts_line=22, is_jump_target=True), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=2, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=126, starts_line=None, is_jump_target=False), + Instruction(opname='COMPARE_OP', opcode=107, arg=10, argval='exception match', argrepr='exception match', offset=128, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=150, argval=150, argrepr='', offset=130, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=132, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=134, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=136, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=138, starts_line=23, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=140, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=142, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=144, starts_line=None, is_jump_target=False), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=146, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=26, argval=176, argrepr='to 176', offset=148, starts_line=None, is_jump_target=False), + Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=150, starts_line=None, is_jump_target=True), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=152, starts_line=25, is_jump_target=True), + Instruction(opname='SETUP_WITH', opcode=143, arg=14, argval=170, argrepr='to 170', offset=154, starts_line=None, is_jump_target=False), + Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=156, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=158, starts_line=26, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Never reach this', argrepr="'Never reach this'", offset=160, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=162, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=164, starts_line=None, is_jump_target=False), + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=166, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=168, starts_line=None, is_jump_target=False), + Instruction(opname='WITH_CLEANUP_START', opcode=81, arg=None, argval=None, argrepr='', offset=170, starts_line=None, is_jump_target=True), + Instruction(opname='WITH_CLEANUP_FINISH', opcode=82, arg=None, argval=None, argrepr='', offset=172, starts_line=None, is_jump_target=False), + Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=174, starts_line=None, is_jump_target=False), + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=176, starts_line=None, is_jump_target=True), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=178, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=180, starts_line=28, is_jump_target=True), + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=182, starts_line=None, is_jump_target=False), + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='1 positional, 0 keyword pair', offset=184, starts_line=None, is_jump_target=False), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=186, starts_line=None, is_jump_target=False), + Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, argrepr='', offset=188, starts_line=None, is_jump_target=False), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=190, starts_line=None, is_jump_target=False), + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=192, starts_line=None, is_jump_target=False), ] # One last piece of inspect fodder to check the default line number handling def simple(): pass expected_opinfo_simple = [ Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=0, starts_line=simple.__code__.co_firstlineno, is_jump_target=False), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=3, starts_line=None, is_jump_target=False) + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=2, starts_line=None, is_jump_target=False) ] diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode. + Patch by Demur Rumed. + - Issue #23275: Allow assigning to an empty target list in round brackets: () = iterable. diff --git a/Objects/frameobject.c b/Objects/frameobject.c --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -189,7 +189,7 @@ memset(blockstack, '\0', sizeof(blockstack)); memset(in_finally, '\0', sizeof(in_finally)); blockstack_top = 0; - for (addr = 0; addr < code_len; addr++) { + for (addr = 0; addr < code_len; addr += 2) { unsigned char op = code[addr]; switch (op) { case SETUP_LOOP: @@ -251,10 +251,6 @@ } } } - - if (op >= HAVE_ARGUMENT) { - addr += 2; - } } /* Verify that the blockstack tracking code didn't get lost. */ @@ -277,7 +273,7 @@ * can tell whether the jump goes into any blocks without coming out * again - in that case we raise an exception below. */ delta_iblock = 0; - for (addr = min_addr; addr < max_addr; addr++) { + for (addr = min_addr; addr < max_addr; addr += 2) { unsigned char op = code[addr]; switch (op) { case SETUP_LOOP: @@ -294,10 +290,6 @@ } min_delta_iblock = Py_MIN(min_delta_iblock, delta_iblock); - - if (op >= HAVE_ARGUMENT) { - addr += 2; - } } /* Derive the absolute iblock values from the deltas. */ diff --git a/Objects/genobject.c b/Objects/genobject.c --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -277,7 +277,7 @@ PyObject *bytecode = f->f_code->co_code; unsigned char *code = (unsigned char *)PyBytes_AS_STRING(bytecode); - if (code[f->f_lasti + 1] != YIELD_FROM) + if (code[f->f_lasti + 2] != YIELD_FROM) return NULL; yf = f->f_stacktop[-1]; Py_INCREF(yf); @@ -376,7 +376,7 @@ assert(ret == yf); Py_DECREF(ret); /* Termination repetition of YIELD_FROM */ - gen->gi_frame->f_lasti++; + gen->gi_frame->f_lasti += 2; if (_PyGen_FetchStopIterationValue(&val) == 0) { ret = gen_send_ex(gen, val, 0, 0); Py_DECREF(val); diff --git a/PC/launcher.c b/PC/launcher.c --- a/PC/launcher.c +++ b/PC/launcher.c @@ -1089,7 +1089,7 @@ { 3190, 3230, L"3.3" }, { 3250, 3310, L"3.4" }, { 3320, 3350, L"3.5" }, - { 3360, 3361, L"3.6" }, + { 3360, 3370, L"3.6" }, { 0 } }; diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -209,6 +209,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -420,6 +420,9 @@ Python + + Python + Python diff --git a/Python/ceval.c b/Python/ceval.c --- a/Python/ceval.c +++ b/Python/ceval.c @@ -886,24 +886,10 @@ /* Import the static jump table */ #include "opcode_targets.h" -/* This macro is used when several opcodes defer to the same implementation - (e.g. SETUP_LOOP, SETUP_FINALLY) */ -#define TARGET_WITH_IMPL(op, impl) \ - TARGET_##op: \ - opcode = op; \ - if (HAS_ARG(op)) \ - oparg = NEXTARG(); \ - case op: \ - goto impl; \ - #define TARGET(op) \ TARGET_##op: \ - opcode = op; \ - if (HAS_ARG(op)) \ - oparg = NEXTARG(); \ case op: - #define DISPATCH() \ { \ if (!_Py_atomic_load_relaxed(&eval_breaker)) { \ @@ -917,7 +903,9 @@ { \ if (!lltrace && !_Py_TracingPossible) { \ f->f_lasti = INSTR_OFFSET(); \ - goto *opcode_targets[*next_instr++]; \ + opcode = NEXTOP(); \ + oparg = NEXTARG(); \ + goto *opcode_targets[opcode]; \ } \ goto fast_next_opcode; \ } @@ -926,7 +914,9 @@ { \ if (!_Py_TracingPossible) { \ f->f_lasti = INSTR_OFFSET(); \ - goto *opcode_targets[*next_instr++]; \ + opcode = NEXTOP(); \ + oparg = NEXTARG(); \ + goto *opcode_targets[opcode]; \ } \ goto fast_next_opcode; \ } @@ -935,10 +925,7 @@ #else #define TARGET(op) \ case op: -#define TARGET_WITH_IMPL(op, impl) \ - /* silence compiler warnings about `impl` unused */ \ - if (0) goto impl; \ - case op: + #define DISPATCH() continue #define FAST_DISPATCH() goto fast_next_opcode #endif @@ -995,9 +982,9 @@ /* Code access macros */ #define INSTR_OFFSET() ((int)(next_instr - first_instr)) -#define NEXTOP() (*next_instr++) -#define NEXTARG() (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2]) -#define PEEKARG() ((next_instr[2]<<8) + next_instr[1]) +#define NEXTOP() (next_instr+=2, next_instr[-2]) +#define NEXTARG() (next_instr[-1]) +#define PEEKARG() (next_instr[1]) #define JUMPTO(x) (next_instr = first_instr + (x)) #define JUMPBY(x) (next_instr += (x)) @@ -1012,10 +999,10 @@ processor's own internal branch predication has a high likelihood of success, resulting in a nearly zero-overhead transition to the next opcode. A successful prediction saves a trip through the eval-loop - including its two unpredictable branches, the HAS_ARG test and the - switch-case. Combined with the processor's internal branch prediction, - a successful PREDICT has the effect of making the two opcodes run as if - they were a single new opcode with the bodies combined. + including its unpredictable switch-case branch. Combined with the + processor's internal branch prediction, a successful PREDICT has the + effect of making the two opcodes run as if they were a single new opcode + with the bodies combined. If collecting opcode statistics, your choices are to either keep the predictions turned-on and interpret the results as if some opcodes @@ -1030,13 +1017,18 @@ #if defined(DYNAMIC_EXECUTION_PROFILE) || USE_COMPUTED_GOTOS #define PREDICT(op) if (0) goto PRED_##op +#else +#define PREDICT(op) \ + do{ \ + if (*next_instr == op){ \ + opcode = op; \ + oparg = PEEKARG(); \ + next_instr += 2; \ + goto PRED_##op; \ + } \ + } while(0) +#endif #define PREDICTED(op) PRED_##op: -#define PREDICTED_WITH_ARG(op) PRED_##op: -#else -#define PREDICT(op) if (*next_instr == op) goto PRED_##op -#define PREDICTED(op) PRED_##op: next_instr++ -#define PREDICTED_WITH_ARG(op) PRED_##op: oparg = PEEKARG(); next_instr += 3 -#endif /* Stack manipulation macros */ @@ -1100,7 +1092,7 @@ } #define UNWIND_EXCEPT_HANDLER(b) \ - { \ + do { \ PyObject *type, *value, *traceback; \ assert(STACK_LEVEL() >= (b)->b_level + 3); \ while (STACK_LEVEL() > (b)->b_level + 3) { \ @@ -1116,7 +1108,7 @@ Py_XDECREF(type); \ Py_XDECREF(value); \ Py_XDECREF(traceback); \ - } + } while(0) /* Start of code */ @@ -1166,15 +1158,11 @@ fastlocals = f->f_localsplus; freevars = f->f_localsplus + co->co_nlocals; first_instr = (unsigned char*) PyBytes_AS_STRING(co->co_code); - /* An explanation is in order for the next line. - - f->f_lasti now refers to the index of the last instruction - executed. You might think this was obvious from the name, but - this wasn't always true before 2.3! PyFrame_New now sets - f->f_lasti to -1 (i.e. the index *before* the first instruction) - and YIELD_VALUE doesn't fiddle with f_lasti any more. So this - does work. Promise. - YIELD_FROM sets f_lasti to itself, in order to repeated yield + /* + f->f_lasti refers to the index of the last instruction, + unless it's -1 in which case next_instr should be first_instr. + + YIELD_FROM sets f_lasti to itself, in order to repeatedly yield multiple values. When the PREDICT() macros are enabled, some opcode pairs follow in @@ -1183,9 +1171,12 @@ were a single new opcode; accordingly,f->f_lasti will point to the first code in the pair (for instance, GET_ITER followed by FOR_ITER is effectively a single opcode and f->f_lasti will point - at to the beginning of the combined pair.) + to the beginning of the combined pair.) */ - next_instr = first_instr + f->f_lasti + 1; + next_instr = first_instr; + if (f->f_lasti >= 0) { + next_instr += f->f_lasti + 2; + } stack_pointer = f->f_stacktop; assert(stack_pointer != NULL); f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */ @@ -1323,10 +1314,7 @@ /* Extract opcode and argument */ opcode = NEXTOP(); - oparg = 0; /* allows oparg to be stored in a register because - it doesn't have to be remembered across a full loop */ - if (HAS_ARG(opcode)) - oparg = NEXTARG(); + oparg = NEXTARG(); dispatch_opcode: #ifdef DYNAMIC_EXECUTION_PROFILE #ifdef DXPAIRS @@ -1384,7 +1372,7 @@ FAST_DISPATCH(); } - PREDICTED_WITH_ARG(STORE_FAST); + PREDICTED(STORE_FAST); TARGET(STORE_FAST) { PyObject *value = POP(); SETLOCAL(oparg, value); @@ -2075,7 +2063,7 @@ f->f_stacktop = stack_pointer; why = WHY_YIELD; /* and repeat... */ - f->f_lasti--; + f->f_lasti -= 2; goto fast_yield; } @@ -2213,7 +2201,7 @@ DISPATCH(); } - PREDICTED_WITH_ARG(UNPACK_SEQUENCE); + PREDICTED(UNPACK_SEQUENCE); TARGET(UNPACK_SEQUENCE) { PyObject *seq = POP(), *item, **items; if (PyTuple_CheckExact(seq) && @@ -2511,9 +2499,8 @@ DISPATCH(); } - TARGET_WITH_IMPL(BUILD_TUPLE_UNPACK, _build_list_unpack) - TARGET(BUILD_LIST_UNPACK) - _build_list_unpack: { + TARGET(BUILD_TUPLE_UNPACK) + TARGET(BUILD_LIST_UNPACK) { int convert_to_tuple = opcode == BUILD_TUPLE_UNPACK; int i; PyObject *sum = PyList_New(0); @@ -2610,9 +2597,8 @@ DISPATCH(); } - TARGET_WITH_IMPL(BUILD_MAP_UNPACK_WITH_CALL, _build_map_unpack) - TARGET(BUILD_MAP_UNPACK) - _build_map_unpack: { + TARGET(BUILD_MAP_UNPACK_WITH_CALL) + TARGET(BUILD_MAP_UNPACK) { int with_call = opcode == BUILD_MAP_UNPACK_WITH_CALL; int num_maps; int function_location; @@ -2819,7 +2805,7 @@ FAST_DISPATCH(); } - PREDICTED_WITH_ARG(POP_JUMP_IF_FALSE); + PREDICTED(POP_JUMP_IF_FALSE); TARGET(POP_JUMP_IF_FALSE) { PyObject *cond = POP(); int err; @@ -2843,7 +2829,7 @@ DISPATCH(); } - PREDICTED_WITH_ARG(POP_JUMP_IF_TRUE); + PREDICTED(POP_JUMP_IF_TRUE); TARGET(POP_JUMP_IF_TRUE) { PyObject *cond = POP(); int err; @@ -2920,7 +2906,7 @@ DISPATCH(); } - PREDICTED_WITH_ARG(JUMP_ABSOLUTE); + PREDICTED(JUMP_ABSOLUTE); TARGET(JUMP_ABSOLUTE) { JUMPTO(oparg); #if FAST_LOOPS @@ -2977,7 +2963,7 @@ DISPATCH(); } - PREDICTED_WITH_ARG(FOR_ITER); + PREDICTED(FOR_ITER); TARGET(FOR_ITER) { /* before: [iter]; after: [iter, iter()] *or* [] */ PyObject *iter = TOP(); @@ -3015,10 +3001,9 @@ goto fast_block_end; } - TARGET_WITH_IMPL(SETUP_LOOP, _setup_finally) - TARGET_WITH_IMPL(SETUP_EXCEPT, _setup_finally) - TARGET(SETUP_FINALLY) - _setup_finally: { + TARGET(SETUP_LOOP) + TARGET(SETUP_EXCEPT) + TARGET(SETUP_FINALLY) { /* NOTE: If you add any new block-setup opcodes that are not try/except/finally handlers, you may need to update the PyGen_NeedsFinalizing() function. @@ -3213,10 +3198,9 @@ DISPATCH(); } - TARGET_WITH_IMPL(CALL_FUNCTION_VAR, _call_function_var_kw) - TARGET_WITH_IMPL(CALL_FUNCTION_KW, _call_function_var_kw) - TARGET(CALL_FUNCTION_VAR_KW) - _call_function_var_kw: { + TARGET(CALL_FUNCTION_VAR) + TARGET(CALL_FUNCTION_KW) + TARGET(CALL_FUNCTION_VAR_KW) { int na = oparg & 0xff; int nk = (oparg>>8) & 0xff; int flags = (opcode - CALL_FUNCTION) & 3; @@ -3258,9 +3242,8 @@ DISPATCH(); } - TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function) - TARGET(MAKE_FUNCTION) - _make_function: { + TARGET(MAKE_CLOSURE) + TARGET(MAKE_FUNCTION) { int posdefaults = oparg & 0xff; int kwdefaults = (oparg>>8) & 0xff; int num_annotations = (oparg >> 16) & 0x7fff; @@ -3450,7 +3433,7 @@ TARGET(EXTENDED_ARG) { opcode = NEXTOP(); - oparg = oparg<<16 | NEXTARG(); + oparg = oparg<<8 | NEXTARG(); goto dispatch_opcode; } diff --git a/Python/compile.c b/Python/compile.c --- a/Python/compile.c +++ b/Python/compile.c @@ -29,6 +29,7 @@ #include "code.h" #include "symtable.h" #include "opcode.h" +#include "wordcode_helpers.h" #define DEFAULT_BLOCK_SIZE 16 #define DEFAULT_BLOCKS 8 @@ -43,7 +44,6 @@ struct instr { unsigned i_jabs : 1; unsigned i_jrel : 1; - unsigned i_hasarg : 1; unsigned char i_opcode; int i_oparg; struct basicblock_ *i_target; /* target block (if jump instruction) */ @@ -1080,13 +1080,14 @@ basicblock *b; struct instr *i; int off; + assert(!HAS_ARG(opcode)); off = compiler_next_instr(c, c->u->u_curblock); if (off < 0) return 0; b = c->u->u_curblock; i = &b->b_instr[off]; i->i_opcode = opcode; - i->i_hasarg = 0; + i->i_oparg = 0; if (opcode == RETURN_VALUE) b->b_return = 1; compiler_set_lineno(c, off); @@ -1168,8 +1169,9 @@ Limit to 32-bit signed C int (rather than INT_MAX) for portability. - The argument of a concrete bytecode instruction is limited to 16-bit. - EXTENDED_ARG is used for 32-bit arguments. */ + The argument of a concrete bytecode instruction is limited to 8-bit. + EXTENDED_ARG is used for 16, 24, and 32-bit arguments. */ + assert(HAS_ARG(opcode)); assert(0 <= oparg && oparg <= 2147483647); off = compiler_next_instr(c, c->u->u_curblock); @@ -1178,7 +1180,6 @@ i = &c->u->u_curblock->b_instr[off]; i->i_opcode = opcode; i->i_oparg = Py_SAFE_DOWNCAST(oparg, Py_ssize_t, int); - i->i_hasarg = 1; compiler_set_lineno(c, off); return 1; } @@ -1189,6 +1190,7 @@ struct instr *i; int off; + assert(HAS_ARG(opcode)); assert(b != NULL); off = compiler_next_instr(c, c->u->u_curblock); if (off < 0) @@ -1196,7 +1198,6 @@ i = &c->u->u_curblock->b_instr[off]; i->i_opcode = opcode; i->i_target = b; - i->i_hasarg = 1; if (absolute) i->i_jabs = 1; else @@ -4397,18 +4398,6 @@ PyObject_Free(a->a_postorder); } -/* Return the size of a basic block in bytes. */ - -static int -instrsize(struct instr *instr) -{ - if (!instr->i_hasarg) - return 1; /* 1 byte for the opcode*/ - if (instr->i_oparg > 0xffff) - return 6; /* 1 (opcode) + 1 (EXTENDED_ARG opcode) + 2 (oparg) + 2(oparg extended) */ - return 3; /* 1 (opcode) + 2 (oparg) */ -} - static int blocksize(basicblock *b) { @@ -4416,7 +4405,7 @@ int size = 0; for (i = 0; i < b->b_iused; i++) - size += instrsize(&b->b_instr[i]); + size += instrsize(b->b_instr[i].i_oparg); return size; } @@ -4536,15 +4525,12 @@ static int assemble_emit(struct assembler *a, struct instr *i) { - int size, arg = 0, ext = 0; + int size, arg = 0; Py_ssize_t len = PyBytes_GET_SIZE(a->a_bytecode); char *code; - size = instrsize(i); - if (i->i_hasarg) { - arg = i->i_oparg; - ext = arg >> 16; - } + arg = i->i_oparg; + size = instrsize(arg); if (i->i_lineno && !assemble_lnotab(a, i)) return 0; if (a->a_offset + size >= len) { @@ -4555,19 +4541,7 @@ } code = PyBytes_AS_STRING(a->a_bytecode) + a->a_offset; a->a_offset += size; - if (size == 6) { - assert(i->i_hasarg); - *code++ = (char)EXTENDED_ARG; - *code++ = ext & 0xff; - *code++ = ext >> 8; - arg &= 0xffff; - } - *code++ = i->i_opcode; - if (i->i_hasarg) { - assert(size == 3 || size == 6); - *code++ = arg & 0xff; - *code++ = arg >> 8; - } + write_op_arg((unsigned char*)code, i->i_opcode, arg, size); return 1; } @@ -4575,7 +4549,7 @@ assemble_jump_offsets(struct assembler *a, struct compiler *c) { basicblock *b; - int bsize, totsize, extended_arg_count = 0, last_extended_arg_count; + int bsize, totsize, extended_arg_recompile; int i; /* Compute the size of each block and fixup jump args. @@ -4588,27 +4562,26 @@ b->b_offset = totsize; totsize += bsize; } - last_extended_arg_count = extended_arg_count; - extended_arg_count = 0; + extended_arg_recompile = 0; for (b = c->u->u_blocks; b != NULL; b = b->b_list) { bsize = b->b_offset; for (i = 0; i < b->b_iused; i++) { struct instr *instr = &b->b_instr[i]; + int isize = instrsize(instr->i_oparg); /* Relative jumps are computed relative to the instruction pointer after fetching the jump instruction. */ - bsize += instrsize(instr); - if (instr->i_jabs) + bsize += isize; + if (instr->i_jabs || instr->i_jrel) { instr->i_oparg = instr->i_target->b_offset; - else if (instr->i_jrel) { - int delta = instr->i_target->b_offset - bsize; - instr->i_oparg = delta; + if (instr->i_jrel) { + instr->i_oparg -= bsize; + } + if (instrsize(instr->i_oparg) != isize) { + extended_arg_recompile = 1; + } } - else - continue; - if (instr->i_oparg > 0xffff) - extended_arg_count++; } } @@ -4618,7 +4591,7 @@ The issue is that in the first loop blocksize() is called which calls instrsize() which requires i_oparg be set - appropriately. There is a bootstrap problem because + appropriately. There is a bootstrap problem because i_oparg is calculated in the second loop above. So we loop until we stop seeing new EXTENDED_ARGs. @@ -4626,7 +4599,7 @@ ones in jump instructions. So this should converge fairly quickly. */ - } while (last_extended_arg_count != extended_arg_count); + } while (extended_arg_recompile); } static PyObject * @@ -4772,9 +4745,9 @@ char arg[128]; *arg = '\0'; - if (i->i_hasarg) + if (HAS_ARG(i->i_opcode)) { sprintf(arg, "arg: %d ", i->i_oparg); - + } fprintf(stderr, "line: %d, opcode: %d %s%s%s\n", i->i_lineno, i->i_opcode, arg, jabs, jrel); } diff --git a/Python/frozen.c b/Python/frozen.c --- a/Python/frozen.c +++ b/Python/frozen.c @@ -14,17 +14,15 @@ the appropriate bytes from M___main__.c. */ static unsigned char M___hello__[] = { - 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,64,0,0,0,115,20,0,0,0,100,2,0,90,1,0, - 101,2,0,100,0,0,131,1,0,1,100,1,0,83,40,3, - 0,0,0,117,12,0,0,0,72,101,108,108,111,32,119,111, - 114,108,100,33,78,84,40,3,0,0,0,117,4,0,0,0, - 84,114,117,101,117,11,0,0,0,105,110,105,116,105,97,108, - 105,122,101,100,117,5,0,0,0,112,114,105,110,116,40,0, - 0,0,0,40,0,0,0,0,40,0,0,0,0,117,7,0, - 0,0,102,108,97,103,46,112,121,117,8,0,0,0,60,109, - 111,100,117,108,101,62,1,0,0,0,115,2,0,0,0,6, - 1, + 227,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,64,0,0,0,115,16,0,0,0,100,0,90,0,101,1, + 100,1,131,1,1,0,100,2,83,0,41,3,84,122,12,72, + 101,108,108,111,32,119,111,114,108,100,33,78,41,2,218,11, + 105,110,105,116,105,97,108,105,122,101,100,218,5,112,114,105, + 110,116,169,0,114,3,0,0,0,114,3,0,0,0,250,22, + 46,47,84,111,111,108,115,47,102,114,101,101,122,101,47,102, + 108,97,103,46,112,121,218,8,60,109,111,100,117,108,101,62, + 1,0,0,0,115,2,0,0,0,4,1, }; #define SIZE (int)sizeof(M___hello__) diff --git a/Python/importlib.h b/Python/importlib.h --- a/Python/importlib.h +++ b/Python/importlib.h [stripped] diff --git a/Python/importlib_external.h b/Python/importlib_external.h --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -1,291 +1,262 @@ /* Auto-generated by Programs/_freeze_importlib.c */ const unsigned char _Py_M__importlib_external[] = { 99,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0, - 0,64,0,0,0,115,210,2,0,0,100,0,0,90,0,0, - 100,92,0,90,1,0,100,4,0,100,5,0,132,0,0,90, - 2,0,100,6,0,100,7,0,132,0,0,90,3,0,100,8, - 0,100,9,0,132,0,0,90,4,0,100,10,0,100,11,0, - 132,0,0,90,5,0,100,12,0,100,13,0,132,0,0,90, - 6,0,100,14,0,100,15,0,132,0,0,90,7,0,100,16, - 0,100,17,0,132,0,0,90,8,0,100,18,0,100,19,0, - 132,0,0,90,9,0,100,20,0,100,21,0,132,0,0,90, - 10,0,100,22,0,100,23,0,100,24,0,132,1,0,90,11, - 0,101,12,0,101,11,0,106,13,0,131,1,0,90,14,0, - 100,25,0,106,15,0,100,26,0,100,27,0,131,2,0,100, - 28,0,23,90,16,0,101,17,0,106,18,0,101,16,0,100, - 27,0,131,2,0,90,19,0,100,29,0,90,20,0,100,30, - 0,90,21,0,100,31,0,103,1,0,90,22,0,100,32,0, - 103,1,0,90,23,0,101,23,0,4,90,24,0,90,25,0, - 100,33,0,100,34,0,100,33,0,100,35,0,100,36,0,132, - 1,1,90,26,0,100,37,0,100,38,0,132,0,0,90,27, - 0,100,39,0,100,40,0,132,0,0,90,28,0,100,41,0, - 100,42,0,132,0,0,90,29,0,100,43,0,100,44,0,132, - 0,0,90,30,0,100,45,0,100,46,0,132,0,0,90,31, - 0,100,47,0,100,48,0,132,0,0,90,32,0,100,33,0, - 100,33,0,100,33,0,100,49,0,100,50,0,132,3,0,90, - 33,0,100,33,0,100,33,0,100,33,0,100,51,0,100,52, - 0,132,3,0,90,34,0,100,53,0,100,53,0,100,54,0, - 100,55,0,132,2,0,90,35,0,100,56,0,100,57,0,132, - 0,0,90,36,0,101,37,0,131,0,0,90,38,0,100,33, - 0,100,58,0,100,33,0,100,59,0,101,38,0,100,60,0, - 100,61,0,132,1,2,90,39,0,71,100,62,0,100,63,0, - 132,0,0,100,63,0,131,2,0,90,40,0,71,100,64,0, - 100,65,0,132,0,0,100,65,0,131,2,0,90,41,0,71, - 100,66,0,100,67,0,132,0,0,100,67,0,101,41,0,131, - 3,0,90,42,0,71,100,68,0,100,69,0,132,0,0,100, - 69,0,131,2,0,90,43,0,71,100,70,0,100,71,0,132, - 0,0,100,71,0,101,43,0,101,42,0,131,4,0,90,44, - 0,71,100,72,0,100,73,0,132,0,0,100,73,0,101,43, - 0,101,41,0,131,4,0,90,45,0,103,0,0,90,46,0, - 71,100,74,0,100,75,0,132,0,0,100,75,0,101,43,0, - 101,41,0,131,4,0,90,47,0,71,100,76,0,100,77,0, - 132,0,0,100,77,0,131,2,0,90,48,0,71,100,78,0, - 100,79,0,132,0,0,100,79,0,131,2,0,90,49,0,71, - 100,80,0,100,81,0,132,0,0,100,81,0,131,2,0,90, - 50,0,71,100,82,0,100,83,0,132,0,0,100,83,0,131, - 2,0,90,51,0,100,33,0,100,84,0,100,85,0,132,1, - 0,90,52,0,100,86,0,100,87,0,132,0,0,90,53,0, - 100,88,0,100,89,0,132,0,0,90,54,0,100,90,0,100, - 91,0,132,0,0,90,55,0,100,33,0,83,41,93,97,94, - 1,0,0,67,111,114,101,32,105,109,112,108,101,109,101,110, - 116,97,116,105,111,110,32,111,102,32,112,97,116,104,45,98, - 97,115,101,100,32,105,109,112,111,114,116,46,10,10,84,104, - 105,115,32,109,111,100,117,108,101,32,105,115,32,78,79,84, - 32,109,101,97,110,116,32,116,111,32,98,101,32,100,105,114, - 101,99,116,108,121,32,105,109,112,111,114,116,101,100,33,32, - 73,116,32,104,97,115,32,98,101,101,110,32,100,101,115,105, - 103,110,101,100,32,115,117,99,104,10,116,104,97,116,32,105, - 116,32,99,97,110,32,98,101,32,98,111,111,116,115,116,114, - 97,112,112,101,100,32,105,110,116,111,32,80,121,116,104,111, - 110,32,97,115,32,116,104,101,32,105,109,112,108,101,109,101, - 110,116,97,116,105,111,110,32,111,102,32,105,109,112,111,114, - 116,46,32,65,115,10,115,117,99,104,32,105,116,32,114,101, - 113,117,105,114,101,115,32,116,104,101,32,105,110,106,101,99, - 116,105,111,110,32,111,102,32,115,112,101,99,105,102,105,99, - 32,109,111,100,117,108,101,115,32,97,110,100,32,97,116,116, - 114,105,98,117,116,101,115,32,105,110,32,111,114,100,101,114, - 32,116,111,10,119,111,114,107,46,32,79,110,101,32,115,104, - 111,117,108,100,32,117,115,101,32,105,109,112,111,114,116,108, - 105,98,32,97,115,32,116,104,101,32,112,117,98,108,105,99, - 45,102,97,99,105,110,103,32,118,101,114,115,105,111,110,32, - 111,102,32,116,104,105,115,32,109,111,100,117,108,101,46,10, - 10,218,3,119,105,110,218,6,99,121,103,119,105,110,218,6, - 100,97,114,119,105,110,99,0,0,0,0,0,0,0,0,1, - 0,0,0,2,0,0,0,67,0,0,0,115,49,0,0,0, - 116,0,0,106,1,0,106,2,0,116,3,0,131,1,0,114, - 33,0,100,1,0,100,2,0,132,0,0,125,0,0,110,12, - 0,100,3,0,100,2,0,132,0,0,125,0,0,124,0,0, - 83,41,4,78,99,0,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,83,0,0,0,115,13,0,0,0,100,1, - 0,116,0,0,106,1,0,107,6,0,83,41,2,122,53,84, - 114,117,101,32,105,102,32,102,105,108,101,110,97,109,101,115, - 32,109,117,115,116,32,98,101,32,99,104,101,99,107,101,100, - 32,99,97,115,101,45,105,110,115,101,110,115,105,116,105,118, - 101,108,121,46,115,12,0,0,0,80,89,84,72,79,78,67, - 65,83,69,79,75,41,2,218,3,95,111,115,90,7,101,110, - 118,105,114,111,110,169,0,114,4,0,0,0,114,4,0,0, - 0,250,38,60,102,114,111,122,101,110,32,105,109,112,111,114, - 116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,95, - 101,120,116,101,114,110,97,108,62,218,11,95,114,101,108,97, - 120,95,99,97,115,101,30,0,0,0,115,2,0,0,0,0, - 2,122,37,95,109,97,107,101,95,114,101,108,97,120,95,99, - 97,115,101,46,60,108,111,99,97,108,115,62,46,95,114,101, - 108,97,120,95,99,97,115,101,99,0,0,0,0,0,0,0, - 0,0,0,0,0,1,0,0,0,83,0,0,0,115,4,0, - 0,0,100,1,0,83,41,2,122,53,84,114,117,101,32,105, - 102,32,102,105,108,101,110,97,109,101,115,32,109,117,115,116, - 32,98,101,32,99,104,101,99,107,101,100,32,99,97,115,101, - 45,105,110,115,101,110,115,105,116,105,118,101,108,121,46,70, - 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,6,0,0,0,34,0, - 0,0,115,2,0,0,0,0,2,41,4,218,3,115,121,115, - 218,8,112,108,97,116,102,111,114,109,218,10,115,116,97,114, - 116,115,119,105,116,104,218,27,95,67,65,83,69,95,73,78, - 83,69,78,83,73,84,73,86,69,95,80,76,65,84,70,79, - 82,77,83,41,1,114,6,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,218,16,95,109,97,107,101, - 95,114,101,108,97,120,95,99,97,115,101,28,0,0,0,115, - 8,0,0,0,0,1,18,1,15,4,12,3,114,11,0,0, - 0,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, - 0,0,67,0,0,0,115,26,0,0,0,116,0,0,124,0, - 0,131,1,0,100,1,0,64,106,1,0,100,2,0,100,3, - 0,131,2,0,83,41,4,122,42,67,111,110,118,101,114,116, - 32,97,32,51,50,45,98,105,116,32,105,110,116,101,103,101, - 114,32,116,111,32,108,105,116,116,108,101,45,101,110,100,105, - 97,110,46,108,3,0,0,0,255,127,255,127,3,0,233,4, - 0,0,0,218,6,108,105,116,116,108,101,41,2,218,3,105, - 110,116,218,8,116,111,95,98,121,116,101,115,41,1,218,1, - 120,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, - 218,7,95,119,95,108,111,110,103,40,0,0,0,115,2,0, - 0,0,0,2,114,17,0,0,0,99,1,0,0,0,0,0, - 0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,16, - 0,0,0,116,0,0,106,1,0,124,0,0,100,1,0,131, - 2,0,83,41,2,122,47,67,111,110,118,101,114,116,32,52, - 32,98,121,116,101,115,32,105,110,32,108,105,116,116,108,101, - 45,101,110,100,105,97,110,32,116,111,32,97,110,32,105,110, - 116,101,103,101,114,46,114,13,0,0,0,41,2,114,14,0, - 0,0,218,10,102,114,111,109,95,98,121,116,101,115,41,1, - 90,9,105,110,116,95,98,121,116,101,115,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,7,95,114,95,108, - 111,110,103,45,0,0,0,115,2,0,0,0,0,2,114,19, - 0,0,0,99,0,0,0,0,0,0,0,0,1,0,0,0, - 3,0,0,0,71,0,0,0,115,26,0,0,0,116,0,0, - 106,1,0,100,1,0,100,2,0,132,0,0,124,0,0,68, - 131,1,0,131,1,0,83,41,3,122,31,82,101,112,108,97, - 99,101,109,101,110,116,32,102,111,114,32,111,115,46,112,97, - 116,104,46,106,111,105,110,40,41,46,99,1,0,0,0,0, - 0,0,0,2,0,0,0,4,0,0,0,83,0,0,0,115, - 37,0,0,0,103,0,0,124,0,0,93,27,0,125,1,0, - 124,1,0,114,6,0,124,1,0,106,0,0,116,1,0,131, - 1,0,145,2,0,113,6,0,83,114,4,0,0,0,41,2, - 218,6,114,115,116,114,105,112,218,15,112,97,116,104,95,115, - 101,112,97,114,97,116,111,114,115,41,2,218,2,46,48,218, - 4,112,97,114,116,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,250,10,60,108,105,115,116,99,111,109,112,62, - 52,0,0,0,115,2,0,0,0,9,1,122,30,95,112,97, - 116,104,95,106,111,105,110,46,60,108,111,99,97,108,115,62, - 46,60,108,105,115,116,99,111,109,112,62,41,2,218,8,112, - 97,116,104,95,115,101,112,218,4,106,111,105,110,41,1,218, - 10,112,97,116,104,95,112,97,114,116,115,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,10,95,112,97,116, - 104,95,106,111,105,110,50,0,0,0,115,4,0,0,0,0, - 2,15,1,114,28,0,0,0,99,1,0,0,0,0,0,0, - 0,5,0,0,0,5,0,0,0,67,0,0,0,115,134,0, - 0,0,116,0,0,116,1,0,131,1,0,100,1,0,107,2, - 0,114,52,0,124,0,0,106,2,0,116,3,0,131,1,0, - 92,3,0,125,1,0,125,2,0,125,3,0,124,1,0,124, - 3,0,102,2,0,83,120,69,0,116,4,0,124,0,0,131, - 1,0,68,93,55,0,125,4,0,124,4,0,116,1,0,107, - 6,0,114,65,0,124,0,0,106,5,0,124,4,0,100,2, - 0,100,1,0,131,1,1,92,2,0,125,1,0,125,3,0, - 124,1,0,124,3,0,102,2,0,83,113,65,0,87,100,3, - 0,124,0,0,102,2,0,83,41,4,122,32,82,101,112,108, - 97,99,101,109,101,110,116,32,102,111,114,32,111,115,46,112, - 97,116,104,46,115,112,108,105,116,40,41,46,233,1,0,0, - 0,90,8,109,97,120,115,112,108,105,116,218,0,41,6,218, - 3,108,101,110,114,21,0,0,0,218,10,114,112,97,114,116, - 105,116,105,111,110,114,25,0,0,0,218,8,114,101,118,101, - 114,115,101,100,218,6,114,115,112,108,105,116,41,5,218,4, - 112,97,116,104,90,5,102,114,111,110,116,218,1,95,218,4, - 116,97,105,108,114,16,0,0,0,114,4,0,0,0,114,4, - 0,0,0,114,5,0,0,0,218,11,95,112,97,116,104,95, - 115,112,108,105,116,56,0,0,0,115,16,0,0,0,0,2, - 18,1,24,1,10,1,19,1,12,1,27,1,14,1,114,38, - 0,0,0,99,1,0,0,0,0,0,0,0,1,0,0,0, - 2,0,0,0,67,0,0,0,115,13,0,0,0,116,0,0, - 106,1,0,124,0,0,131,1,0,83,41,1,122,126,83,116, - 97,116,32,116,104,101,32,112,97,116,104,46,10,10,32,32, - 32,32,77,97,100,101,32,97,32,115,101,112,97,114,97,116, - 101,32,102,117,110,99,116,105,111,110,32,116,111,32,109,97, - 107,101,32,105,116,32,101,97,115,105,101,114,32,116,111,32, - 111,118,101,114,114,105,100,101,32,105,110,32,101,120,112,101, - 114,105,109,101,110,116,115,10,32,32,32,32,40,101,46,103, - 46,32,99,97,99,104,101,32,115,116,97,116,32,114,101,115, - 117,108,116,115,41,46,10,10,32,32,32,32,41,2,114,3, - 0,0,0,90,4,115,116,97,116,41,1,114,35,0,0,0, - 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, - 10,95,112,97,116,104,95,115,116,97,116,68,0,0,0,115, - 2,0,0,0,0,7,114,39,0,0,0,99,2,0,0,0, - 0,0,0,0,3,0,0,0,11,0,0,0,67,0,0,0, - 115,58,0,0,0,121,16,0,116,0,0,124,0,0,131,1, - 0,125,2,0,87,110,22,0,4,116,1,0,107,10,0,114, - 40,0,1,1,1,100,1,0,83,89,110,1,0,88,124,2, - 0,106,2,0,100,2,0,64,124,1,0,107,2,0,83,41, - 3,122,49,84,101,115,116,32,119,104,101,116,104,101,114,32, - 116,104,101,32,112,97,116,104,32,105,115,32,116,104,101,32, - 115,112,101,99,105,102,105,101,100,32,109,111,100,101,32,116, - 121,112,101,46,70,105,0,240,0,0,41,3,114,39,0,0, - 0,218,7,79,83,69,114,114,111,114,218,7,115,116,95,109, - 111,100,101,41,3,114,35,0,0,0,218,4,109,111,100,101, - 90,9,115,116,97,116,95,105,110,102,111,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,18,95,112,97,116, - 104,95,105,115,95,109,111,100,101,95,116,121,112,101,78,0, - 0,0,115,10,0,0,0,0,2,3,1,16,1,13,1,9, - 1,114,43,0,0,0,99,1,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,13,0,0,0, - 116,0,0,124,0,0,100,1,0,131,2,0,83,41,2,122, - 31,82,101,112,108,97,99,101,109,101,110,116,32,102,111,114, - 32,111,115,46,112,97,116,104,46,105,115,102,105,108,101,46, - 105,0,128,0,0,41,1,114,43,0,0,0,41,1,114,35, - 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, - 0,0,218,12,95,112,97,116,104,95,105,115,102,105,108,101, - 87,0,0,0,115,2,0,0,0,0,2,114,44,0,0,0, - 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, - 0,67,0,0,0,115,31,0,0,0,124,0,0,115,18,0, - 116,0,0,106,1,0,131,0,0,125,0,0,116,2,0,124, - 0,0,100,1,0,131,2,0,83,41,2,122,30,82,101,112, - 108,97,99,101,109,101,110,116,32,102,111,114,32,111,115,46, - 112,97,116,104,46,105,115,100,105,114,46,105,0,64,0,0, - 41,3,114,3,0,0,0,218,6,103,101,116,99,119,100,114, - 43,0,0,0,41,1,114,35,0,0,0,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,11,95,112,97,116, - 104,95,105,115,100,105,114,92,0,0,0,115,6,0,0,0, - 0,2,6,1,12,1,114,46,0,0,0,105,182,1,0,0, - 99,3,0,0,0,0,0,0,0,6,0,0,0,17,0,0, - 0,67,0,0,0,115,193,0,0,0,100,1,0,106,0,0, - 124,0,0,116,1,0,124,0,0,131,1,0,131,2,0,125, - 3,0,116,2,0,106,3,0,124,3,0,116,2,0,106,4, - 0,116,2,0,106,5,0,66,116,2,0,106,6,0,66,124, - 2,0,100,2,0,64,131,3,0,125,4,0,121,61,0,116, - 7,0,106,8,0,124,4,0,100,3,0,131,2,0,143,20, - 0,125,5,0,124,5,0,106,9,0,124,1,0,131,1,0, - 1,87,100,4,0,81,82,88,116,2,0,106,10,0,124,3, - 0,124,0,0,131,2,0,1,87,110,59,0,4,116,11,0, - 107,10,0,114,188,0,1,1,1,121,17,0,116,2,0,106, - 12,0,124,3,0,131,1,0,1,87,110,18,0,4,116,11, - 0,107,10,0,114,180,0,1,1,1,89,110,1,0,88,130, - 0,0,89,110,1,0,88,100,4,0,83,41,5,122,162,66, - 101,115,116,45,101,102,102,111,114,116,32,102,117,110,99,116, - 105,111,110,32,116,111,32,119,114,105,116,101,32,100,97,116, - 97,32,116,111,32,97,32,112,97,116,104,32,97,116,111,109, - 105,99,97,108,108,121,46,10,32,32,32,32,66,101,32,112, - 114,101,112,97,114,101,100,32,116,111,32,104,97,110,100,108, - 101,32,97,32,70,105,108,101,69,120,105,115,116,115,69,114, - 114,111,114,32,105,102,32,99,111,110,99,117,114,114,101,110, - 116,32,119,114,105,116,105,110,103,32,111,102,32,116,104,101, - 10,32,32,32,32,116,101,109,112,111,114,97,114,121,32,102, - 105,108,101,32,105,115,32,97,116,116,101,109,112,116,101,100, - 46,122,5,123,125,46,123,125,105,182,1,0,0,90,2,119, - 98,78,41,13,218,6,102,111,114,109,97,116,218,2,105,100, - 114,3,0,0,0,90,4,111,112,101,110,90,6,79,95,69, - 88,67,76,90,7,79,95,67,82,69,65,84,90,8,79,95, - 87,82,79,78,76,89,218,3,95,105,111,218,6,70,105,108, - 101,73,79,218,5,119,114,105,116,101,218,7,114,101,112,108, - 97,99,101,114,40,0,0,0,90,6,117,110,108,105,110,107, - 41,6,114,35,0,0,0,218,4,100,97,116,97,114,42,0, - 0,0,90,8,112,97,116,104,95,116,109,112,90,2,102,100, - 218,4,102,105,108,101,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,218,13,95,119,114,105,116,101,95,97,116, - 111,109,105,99,99,0,0,0,115,26,0,0,0,0,5,24, - 1,9,1,33,1,3,3,21,1,20,1,20,1,13,1,3, - 1,17,1,13,1,5,1,114,55,0,0,0,105,33,13,0, - 0,233,2,0,0,0,114,13,0,0,0,115,2,0,0,0, - 13,10,90,11,95,95,112,121,99,97,99,104,101,95,95,122, - 4,111,112,116,45,122,3,46,112,121,122,4,46,112,121,99, - 78,218,12,111,112,116,105,109,105,122,97,116,105,111,110,99, - 2,0,0,0,1,0,0,0,11,0,0,0,6,0,0,0, - 67,0,0,0,115,87,1,0,0,124,1,0,100,1,0,107, - 9,0,114,76,0,116,0,0,106,1,0,100,2,0,116,2, - 0,131,2,0,1,124,2,0,100,1,0,107,9,0,114,58, - 0,100,3,0,125,3,0,116,3,0,124,3,0,131,1,0, - 130,1,0,124,1,0,114,70,0,100,4,0,110,3,0,100, - 5,0,125,2,0,116,4,0,124,0,0,131,1,0,92,2, - 0,125,4,0,125,5,0,124,5,0,106,5,0,100,6,0, - 131,1,0,92,3,0,125,6,0,125,7,0,125,8,0,116, - 6,0,106,7,0,106,8,0,125,9,0,124,9,0,100,1, - 0,107,8,0,114,154,0,116,9,0,100,7,0,131,1,0, - 130,1,0,100,4,0,106,10,0,124,6,0,114,172,0,124, - 6,0,110,3,0,124,8,0,124,7,0,124,9,0,103,3, - 0,131,1,0,125,10,0,124,2,0,100,1,0,107,8,0, - 114,241,0,116,6,0,106,11,0,106,12,0,100,8,0,107, - 2,0,114,229,0,100,4,0,125,2,0,110,12,0,116,6, - 0,106,11,0,106,12,0,125,2,0,116,13,0,124,2,0, - 131,1,0,125,2,0,124,2,0,100,4,0,107,3,0,114, - 63,1,124,2,0,106,14,0,131,0,0,115,42,1,116,15, - 0,100,9,0,106,16,0,124,2,0,131,1,0,131,1,0, - 130,1,0,100,10,0,106,16,0,124,10,0,116,17,0,124, - 2,0,131,3,0,125,10,0,116,18,0,124,4,0,116,19, - 0,124,10,0,116,20,0,100,8,0,25,23,131,3,0,83, + 0,64,0,0,0,115,248,1,0,0,100,0,90,0,100,92, + 90,1,100,4,100,5,132,0,90,2,100,6,100,7,132,0, + 90,3,100,8,100,9,132,0,90,4,100,10,100,11,132,0, + 90,5,100,12,100,13,132,0,90,6,100,14,100,15,132,0, + 90,7,100,16,100,17,132,0,90,8,100,18,100,19,132,0, + 90,9,100,20,100,21,132,0,90,10,100,22,100,23,100,24, + 132,1,90,11,101,12,101,11,106,13,131,1,90,14,100,25, + 106,15,100,26,100,27,131,2,100,28,23,0,90,16,101,17, + 106,18,101,16,100,27,131,2,90,19,100,29,90,20,100,30, + 90,21,100,31,103,1,90,22,100,32,103,1,90,23,101,23, + 4,0,90,24,90,25,100,33,100,34,100,33,100,35,100,36, + 144,1,132,1,90,26,100,37,100,38,132,0,90,27,100,39, + 100,40,132,0,90,28,100,41,100,42,132,0,90,29,100,43, + 100,44,132,0,90,30,100,45,100,46,132,0,90,31,100,47, + 100,48,132,0,90,32,100,33,100,33,100,33,100,49,100,50, + 132,3,90,33,100,33,100,33,100,33,100,51,100,52,132,3, + 90,34,100,53,100,53,100,54,100,55,132,2,90,35,100,56, + 100,57,132,0,90,36,101,37,131,0,90,38,100,33,100,58, + 100,33,100,59,101,38,100,60,100,61,144,2,132,1,90,39, + 71,0,100,62,100,63,132,0,100,63,131,2,90,40,71,0, + 100,64,100,65,132,0,100,65,131,2,90,41,71,0,100,66, + 100,67,132,0,100,67,101,41,131,3,90,42,71,0,100,68, + 100,69,132,0,100,69,131,2,90,43,71,0,100,70,100,71, + 132,0,100,71,101,43,101,42,131,4,90,44,71,0,100,72, + 100,73,132,0,100,73,101,43,101,41,131,4,90,45,103,0, + 90,46,71,0,100,74,100,75,132,0,100,75,101,43,101,41, + 131,4,90,47,71,0,100,76,100,77,132,0,100,77,131,2, + 90,48,71,0,100,78,100,79,132,0,100,79,131,2,90,49, + 71,0,100,80,100,81,132,0,100,81,131,2,90,50,71,0, + 100,82,100,83,132,0,100,83,131,2,90,51,100,33,100,84, + 100,85,132,1,90,52,100,86,100,87,132,0,90,53,100,88, + 100,89,132,0,90,54,100,90,100,91,132,0,90,55,100,33, + 83,0,41,93,97,94,1,0,0,67,111,114,101,32,105,109, + 112,108,101,109,101,110,116,97,116,105,111,110,32,111,102,32, + 112,97,116,104,45,98,97,115,101,100,32,105,109,112,111,114, + 116,46,10,10,84,104,105,115,32,109,111,100,117,108,101,32, + 105,115,32,78,79,84,32,109,101,97,110,116,32,116,111,32, + 98,101,32,100,105,114,101,99,116,108,121,32,105,109,112,111, + 114,116,101,100,33,32,73,116,32,104,97,115,32,98,101,101, + 110,32,100,101,115,105,103,110,101,100,32,115,117,99,104,10, + 116,104,97,116,32,105,116,32,99,97,110,32,98,101,32,98, + 111,111,116,115,116,114,97,112,112,101,100,32,105,110,116,111, + 32,80,121,116,104,111,110,32,97,115,32,116,104,101,32,105, + 109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,102, + 32,105,109,112,111,114,116,46,32,65,115,10,115,117,99,104, + 32,105,116,32,114,101,113,117,105,114,101,115,32,116,104,101, + 32,105,110,106,101,99,116,105,111,110,32,111,102,32,115,112, + 101,99,105,102,105,99,32,109,111,100,117,108,101,115,32,97, + 110,100,32,97,116,116,114,105,98,117,116,101,115,32,105,110, + 32,111,114,100,101,114,32,116,111,10,119,111,114,107,46,32, + 79,110,101,32,115,104,111,117,108,100,32,117,115,101,32,105, + 109,112,111,114,116,108,105,98,32,97,115,32,116,104,101,32, + 112,117,98,108,105,99,45,102,97,99,105,110,103,32,118,101, + 114,115,105,111,110,32,111,102,32,116,104,105,115,32,109,111, + 100,117,108,101,46,10,10,218,3,119,105,110,218,6,99,121, + 103,119,105,110,218,6,100,97,114,119,105,110,99,0,0,0, + 0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,0, + 0,115,34,0,0,0,116,0,106,1,106,2,116,3,131,1, + 114,22,100,1,100,2,132,0,125,0,110,8,100,3,100,2, + 132,0,125,0,124,0,83,0,41,4,78,99,0,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,83,0,0,0, + 115,10,0,0,0,100,1,116,0,106,1,107,6,83,0,41, + 2,122,53,84,114,117,101,32,105,102,32,102,105,108,101,110, + 97,109,101,115,32,109,117,115,116,32,98,101,32,99,104,101, + 99,107,101,100,32,99,97,115,101,45,105,110,115,101,110,115, + 105,116,105,118,101,108,121,46,115,12,0,0,0,80,89,84, + 72,79,78,67,65,83,69,79,75,41,2,218,3,95,111,115, + 90,7,101,110,118,105,114,111,110,169,0,114,4,0,0,0, + 114,4,0,0,0,250,38,60,102,114,111,122,101,110,32,105, + 109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116, + 114,97,112,95,101,120,116,101,114,110,97,108,62,218,11,95, + 114,101,108,97,120,95,99,97,115,101,30,0,0,0,115,2, + 0,0,0,0,2,122,37,95,109,97,107,101,95,114,101,108, + 97,120,95,99,97,115,101,46,60,108,111,99,97,108,115,62, + 46,95,114,101,108,97,120,95,99,97,115,101,99,0,0,0, + 0,0,0,0,0,0,0,0,0,1,0,0,0,83,0,0, + 0,115,4,0,0,0,100,1,83,0,41,2,122,53,84,114, + 117,101,32,105,102,32,102,105,108,101,110,97,109,101,115,32, + 109,117,115,116,32,98,101,32,99,104,101,99,107,101,100,32, + 99,97,115,101,45,105,110,115,101,110,115,105,116,105,118,101, + 108,121,46,70,114,4,0,0,0,114,4,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,114,6,0, + 0,0,34,0,0,0,115,2,0,0,0,0,2,41,4,218, + 3,115,121,115,218,8,112,108,97,116,102,111,114,109,218,10, + 115,116,97,114,116,115,119,105,116,104,218,27,95,67,65,83, + 69,95,73,78,83,69,78,83,73,84,73,86,69,95,80,76, + 65,84,70,79,82,77,83,41,1,114,6,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,218,16,95, + 109,97,107,101,95,114,101,108,97,120,95,99,97,115,101,28, + 0,0,0,115,8,0,0,0,0,1,12,1,10,4,8,3, + 114,11,0,0,0,99,1,0,0,0,0,0,0,0,1,0, + 0,0,3,0,0,0,67,0,0,0,115,20,0,0,0,116, + 0,124,0,131,1,100,1,64,0,106,1,100,2,100,3,131, + 2,83,0,41,4,122,42,67,111,110,118,101,114,116,32,97, + 32,51,50,45,98,105,116,32,105,110,116,101,103,101,114,32, + 116,111,32,108,105,116,116,108,101,45,101,110,100,105,97,110, + 46,108,3,0,0,0,255,127,255,127,3,0,233,4,0,0, + 0,218,6,108,105,116,116,108,101,41,2,218,3,105,110,116, + 218,8,116,111,95,98,121,116,101,115,41,1,218,1,120,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,7, + 95,119,95,108,111,110,103,40,0,0,0,115,2,0,0,0, + 0,2,114,17,0,0,0,99,1,0,0,0,0,0,0,0, + 1,0,0,0,3,0,0,0,67,0,0,0,115,12,0,0, + 0,116,0,106,1,124,0,100,1,131,2,83,0,41,2,122, + 47,67,111,110,118,101,114,116,32,52,32,98,121,116,101,115, + 32,105,110,32,108,105,116,116,108,101,45,101,110,100,105,97, + 110,32,116,111,32,97,110,32,105,110,116,101,103,101,114,46, + 114,13,0,0,0,41,2,114,14,0,0,0,218,10,102,114, + 111,109,95,98,121,116,101,115,41,1,90,9,105,110,116,95, + 98,121,116,101,115,114,4,0,0,0,114,4,0,0,0,114, + 5,0,0,0,218,7,95,114,95,108,111,110,103,45,0,0, + 0,115,2,0,0,0,0,2,114,19,0,0,0,99,0,0, + 0,0,0,0,0,0,1,0,0,0,3,0,0,0,71,0, + 0,0,115,20,0,0,0,116,0,106,1,100,1,100,2,132, + 0,124,0,68,0,131,1,131,1,83,0,41,3,122,31,82, + 101,112,108,97,99,101,109,101,110,116,32,102,111,114,32,111, + 115,46,112,97,116,104,46,106,111,105,110,40,41,46,99,1, + 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,83, + 0,0,0,115,26,0,0,0,103,0,124,0,93,18,125,1, + 124,1,114,4,124,1,106,0,116,1,131,1,145,2,113,4, + 83,0,114,4,0,0,0,41,2,218,6,114,115,116,114,105, + 112,218,15,112,97,116,104,95,115,101,112,97,114,97,116,111, + 114,115,41,2,218,2,46,48,218,4,112,97,114,116,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,250,10,60, + 108,105,115,116,99,111,109,112,62,52,0,0,0,115,2,0, + 0,0,6,1,122,30,95,112,97,116,104,95,106,111,105,110, + 46,60,108,111,99,97,108,115,62,46,60,108,105,115,116,99, + 111,109,112,62,41,2,218,8,112,97,116,104,95,115,101,112, + 218,4,106,111,105,110,41,1,218,10,112,97,116,104,95,112, + 97,114,116,115,114,4,0,0,0,114,4,0,0,0,114,5, + 0,0,0,218,10,95,112,97,116,104,95,106,111,105,110,50, + 0,0,0,115,4,0,0,0,0,2,10,1,114,28,0,0, + 0,99,1,0,0,0,0,0,0,0,5,0,0,0,5,0, + 0,0,67,0,0,0,115,98,0,0,0,116,0,116,1,131, + 1,100,1,107,2,114,36,124,0,106,2,116,3,131,1,92, + 3,125,1,125,2,125,3,124,1,124,3,102,2,83,0,120, + 52,116,4,124,0,131,1,68,0,93,40,125,4,124,4,116, + 1,107,6,114,46,124,0,106,5,124,4,100,2,100,1,144, + 1,131,1,92,2,125,1,125,3,124,1,124,3,102,2,83, + 0,113,46,87,0,100,3,124,0,102,2,83,0,41,4,122, + 32,82,101,112,108,97,99,101,109,101,110,116,32,102,111,114, + 32,111,115,46,112,97,116,104,46,115,112,108,105,116,40,41, + 46,233,1,0,0,0,90,8,109,97,120,115,112,108,105,116, + 218,0,41,6,218,3,108,101,110,114,21,0,0,0,218,10, + 114,112,97,114,116,105,116,105,111,110,114,25,0,0,0,218, + 8,114,101,118,101,114,115,101,100,218,6,114,115,112,108,105, + 116,41,5,218,4,112,97,116,104,90,5,102,114,111,110,116, + 218,1,95,218,4,116,97,105,108,114,16,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,218,11,95, + 112,97,116,104,95,115,112,108,105,116,56,0,0,0,115,16, + 0,0,0,0,2,12,1,16,1,8,1,14,1,8,1,20, + 1,12,1,114,38,0,0,0,99,1,0,0,0,0,0,0, + 0,1,0,0,0,2,0,0,0,67,0,0,0,115,10,0, + 0,0,116,0,106,1,124,0,131,1,83,0,41,1,122,126, + 83,116,97,116,32,116,104,101,32,112,97,116,104,46,10,10, + 32,32,32,32,77,97,100,101,32,97,32,115,101,112,97,114, + 97,116,101,32,102,117,110,99,116,105,111,110,32,116,111,32, + 109,97,107,101,32,105,116,32,101,97,115,105,101,114,32,116, + 111,32,111,118,101,114,114,105,100,101,32,105,110,32,101,120, + 112,101,114,105,109,101,110,116,115,10,32,32,32,32,40,101, + 46,103,46,32,99,97,99,104,101,32,115,116,97,116,32,114, + 101,115,117,108,116,115,41,46,10,10,32,32,32,32,41,2, + 114,3,0,0,0,90,4,115,116,97,116,41,1,114,35,0, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, + 0,218,10,95,112,97,116,104,95,115,116,97,116,68,0,0, + 0,115,2,0,0,0,0,7,114,39,0,0,0,99,2,0, + 0,0,0,0,0,0,3,0,0,0,11,0,0,0,67,0, + 0,0,115,48,0,0,0,121,12,116,0,124,0,131,1,125, + 2,87,0,110,20,4,0,116,1,107,10,114,32,1,0,1, + 0,1,0,100,1,83,0,88,0,124,2,106,2,100,2,64, + 0,124,1,107,2,83,0,41,3,122,49,84,101,115,116,32, + 119,104,101,116,104,101,114,32,116,104,101,32,112,97,116,104, + 32,105,115,32,116,104,101,32,115,112,101,99,105,102,105,101, + 100,32,109,111,100,101,32,116,121,112,101,46,70,105,0,240, + 0,0,41,3,114,39,0,0,0,218,7,79,83,69,114,114, + 111,114,218,7,115,116,95,109,111,100,101,41,3,114,35,0, + 0,0,218,4,109,111,100,101,90,9,115,116,97,116,95,105, + 110,102,111,114,4,0,0,0,114,4,0,0,0,114,5,0, + 0,0,218,18,95,112,97,116,104,95,105,115,95,109,111,100, + 101,95,116,121,112,101,78,0,0,0,115,10,0,0,0,0, + 2,2,1,12,1,14,1,6,1,114,43,0,0,0,99,1, + 0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,67, + 0,0,0,115,10,0,0,0,116,0,124,0,100,1,131,2, + 83,0,41,2,122,31,82,101,112,108,97,99,101,109,101,110, + 116,32,102,111,114,32,111,115,46,112,97,116,104,46,105,115, + 102,105,108,101,46,105,0,128,0,0,41,1,114,43,0,0, + 0,41,1,114,35,0,0,0,114,4,0,0,0,114,4,0, + 0,0,114,5,0,0,0,218,12,95,112,97,116,104,95,105, + 115,102,105,108,101,87,0,0,0,115,2,0,0,0,0,2, + 114,44,0,0,0,99,1,0,0,0,0,0,0,0,1,0, + 0,0,3,0,0,0,67,0,0,0,115,22,0,0,0,124, + 0,115,12,116,0,106,1,131,0,125,0,116,2,124,0,100, + 1,131,2,83,0,41,2,122,30,82,101,112,108,97,99,101, + 109,101,110,116,32,102,111,114,32,111,115,46,112,97,116,104, + 46,105,115,100,105,114,46,105,0,64,0,0,41,3,114,3, + 0,0,0,218,6,103,101,116,99,119,100,114,43,0,0,0, + 41,1,114,35,0,0,0,114,4,0,0,0,114,4,0,0, + 0,114,5,0,0,0,218,11,95,112,97,116,104,95,105,115, + 100,105,114,92,0,0,0,115,6,0,0,0,0,2,4,1, + 8,1,114,46,0,0,0,105,182,1,0,0,99,3,0,0, + 0,0,0,0,0,6,0,0,0,17,0,0,0,67,0,0, + 0,115,162,0,0,0,100,1,106,0,124,0,116,1,124,0, + 131,1,131,2,125,3,116,2,106,3,124,3,116,2,106,4, + 116,2,106,5,66,0,116,2,106,6,66,0,124,2,100,2, + 64,0,131,3,125,4,121,50,116,7,106,8,124,4,100,3, + 131,2,143,16,125,5,124,5,106,9,124,1,131,1,1,0, + 87,0,100,4,81,0,82,0,88,0,116,2,106,10,124,3, + 124,0,131,2,1,0,87,0,110,58,4,0,116,11,107,10, + 114,156,1,0,1,0,1,0,121,14,116,2,106,12,124,3, + 131,1,1,0,87,0,110,20,4,0,116,11,107,10,114,148, + 1,0,1,0,1,0,89,0,110,2,88,0,130,0,89,0, + 110,2,88,0,100,4,83,0,41,5,122,162,66,101,115,116, + 45,101,102,102,111,114,116,32,102,117,110,99,116,105,111,110, + 32,116,111,32,119,114,105,116,101,32,100,97,116,97,32,116, + 111,32,97,32,112,97,116,104,32,97,116,111,109,105,99,97, + 108,108,121,46,10,32,32,32,32,66,101,32,112,114,101,112, + 97,114,101,100,32,116,111,32,104,97,110,100,108,101,32,97, + 32,70,105,108,101,69,120,105,115,116,115,69,114,114,111,114, + 32,105,102,32,99,111,110,99,117,114,114,101,110,116,32,119, + 114,105,116,105,110,103,32,111,102,32,116,104,101,10,32,32, + 32,32,116,101,109,112,111,114,97,114,121,32,102,105,108,101, + 32,105,115,32,97,116,116,101,109,112,116,101,100,46,122,5, + 123,125,46,123,125,105,182,1,0,0,90,2,119,98,78,41, + 13,218,6,102,111,114,109,97,116,218,2,105,100,114,3,0, + 0,0,90,4,111,112,101,110,90,6,79,95,69,88,67,76, + 90,7,79,95,67,82,69,65,84,90,8,79,95,87,82,79, + 78,76,89,218,3,95,105,111,218,6,70,105,108,101,73,79, + 218,5,119,114,105,116,101,218,7,114,101,112,108,97,99,101, + 114,40,0,0,0,90,6,117,110,108,105,110,107,41,6,114, + 35,0,0,0,218,4,100,97,116,97,114,42,0,0,0,90, + 8,112,97,116,104,95,116,109,112,90,2,102,100,218,4,102, + 105,108,101,114,4,0,0,0,114,4,0,0,0,114,5,0, + 0,0,218,13,95,119,114,105,116,101,95,97,116,111,109,105, + 99,99,0,0,0,115,26,0,0,0,0,5,16,1,6,1, + 26,1,2,3,14,1,20,1,16,1,14,1,2,1,14,1, + 14,1,6,1,114,55,0,0,0,105,42,13,0,0,233,2, + 0,0,0,114,13,0,0,0,115,2,0,0,0,13,10,90, + 11,95,95,112,121,99,97,99,104,101,95,95,122,4,111,112, + 116,45,122,3,46,112,121,122,4,46,112,121,99,78,218,12, + 111,112,116,105,109,105,122,97,116,105,111,110,99,2,0,0, + 0,1,0,0,0,11,0,0,0,6,0,0,0,67,0,0, + 0,115,234,0,0,0,124,1,100,1,107,9,114,52,116,0, + 106,1,100,2,116,2,131,2,1,0,124,2,100,1,107,9, + 114,40,100,3,125,3,116,3,124,3,131,1,130,1,124,1, + 114,48,100,4,110,2,100,5,125,2,116,4,124,0,131,1, + 92,2,125,4,125,5,124,5,106,5,100,6,131,1,92,3, + 125,6,125,7,125,8,116,6,106,7,106,8,125,9,124,9, + 100,1,107,8,114,104,116,9,100,7,131,1,130,1,100,4, + 106,10,124,6,114,116,124,6,110,2,124,8,124,7,124,9, + 103,3,131,1,125,10,124,2,100,1,107,8,114,162,116,6, + 106,11,106,12,100,8,107,2,114,154,100,4,125,2,110,8, + 116,6,106,11,106,12,125,2,116,13,124,2,131,1,125,2, + 124,2,100,4,107,3,114,214,124,2,106,14,131,0,115,200, + 116,15,100,9,106,16,124,2,131,1,131,1,130,1,100,10, + 106,16,124,10,116,17,124,2,131,3,125,10,116,18,124,4, + 116,19,124,10,116,20,100,8,25,0,23,0,131,3,83,0, 41,11,97,254,2,0,0,71,105,118,101,110,32,116,104,101, 32,112,97,116,104,32,116,111,32,97,32,46,112,121,32,102, 105,108,101,44,32,114,101,116,117,114,110,32,116,104,101,32, @@ -368,145 +339,135 @@ 103,90,15,97,108,109,111,115,116,95,102,105,108,101,110,97, 109,101,114,4,0,0,0,114,4,0,0,0,114,5,0,0, 0,218,17,99,97,99,104,101,95,102,114,111,109,95,115,111, - 117,114,99,101,248,0,0,0,115,46,0,0,0,0,18,12, - 1,9,1,7,1,12,1,6,1,12,1,18,1,18,1,24, - 1,12,1,12,1,12,1,36,1,12,1,18,1,9,2,12, - 1,12,1,12,1,12,1,21,1,21,1,114,79,0,0,0, + 117,114,99,101,249,0,0,0,115,46,0,0,0,0,18,8, + 1,6,1,6,1,8,1,4,1,8,1,12,1,12,1,16, + 1,8,1,8,1,8,1,24,1,8,1,12,1,6,2,8, + 1,8,1,8,1,8,1,14,1,14,1,114,79,0,0,0, 99,1,0,0,0,0,0,0,0,8,0,0,0,5,0,0, - 0,67,0,0,0,115,62,1,0,0,116,0,0,106,1,0, - 106,2,0,100,1,0,107,8,0,114,30,0,116,3,0,100, - 2,0,131,1,0,130,1,0,116,4,0,124,0,0,131,1, - 0,92,2,0,125,1,0,125,2,0,116,4,0,124,1,0, - 131,1,0,92,2,0,125,1,0,125,3,0,124,3,0,116, - 5,0,107,3,0,114,102,0,116,6,0,100,3,0,106,7, - 0,116,5,0,124,0,0,131,2,0,131,1,0,130,1,0, - 124,2,0,106,8,0,100,4,0,131,1,0,125,4,0,124, - 4,0,100,11,0,107,7,0,114,153,0,116,6,0,100,7, - 0,106,7,0,124,2,0,131,1,0,131,1,0,130,1,0, - 110,125,0,124,4,0,100,6,0,107,2,0,114,22,1,124, - 2,0,106,9,0,100,4,0,100,5,0,131,2,0,100,12, - 0,25,125,5,0,124,5,0,106,10,0,116,11,0,131,1, - 0,115,223,0,116,6,0,100,8,0,106,7,0,116,11,0, - 131,1,0,131,1,0,130,1,0,124,5,0,116,12,0,116, - 11,0,131,1,0,100,1,0,133,2,0,25,125,6,0,124, - 6,0,106,13,0,131,0,0,115,22,1,116,6,0,100,9, - 0,106,7,0,124,5,0,131,1,0,131,1,0,130,1,0, - 124,2,0,106,14,0,100,4,0,131,1,0,100,10,0,25, - 125,7,0,116,15,0,124,1,0,124,7,0,116,16,0,100, - 10,0,25,23,131,2,0,83,41,13,97,110,1,0,0,71, - 105,118,101,110,32,116,104,101,32,112,97,116,104,32,116,111, - 32,97,32,46,112,121,99,46,32,102,105,108,101,44,32,114, - 101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,116, - 111,32,105,116,115,32,46,112,121,32,102,105,108,101,46,10, - 10,32,32,32,32,84,104,101,32,46,112,121,99,32,102,105, - 108,101,32,100,111,101,115,32,110,111,116,32,110,101,101,100, - 32,116,111,32,101,120,105,115,116,59,32,116,104,105,115,32, - 115,105,109,112,108,121,32,114,101,116,117,114,110,115,32,116, - 104,101,32,112,97,116,104,32,116,111,10,32,32,32,32,116, - 104,101,32,46,112,121,32,102,105,108,101,32,99,97,108,99, - 117,108,97,116,101,100,32,116,111,32,99,111,114,114,101,115, - 112,111,110,100,32,116,111,32,116,104,101,32,46,112,121,99, - 32,102,105,108,101,46,32,32,73,102,32,112,97,116,104,32, - 100,111,101,115,10,32,32,32,32,110,111,116,32,99,111,110, - 102,111,114,109,32,116,111,32,80,69,80,32,51,49,52,55, - 47,52,56,56,32,102,111,114,109,97,116,44,32,86,97,108, - 117,101,69,114,114,111,114,32,119,105,108,108,32,98,101,32, - 114,97,105,115,101,100,46,32,73,102,10,32,32,32,32,115, - 121,115,46,105,109,112,108,101,109,101,110,116,97,116,105,111, - 110,46,99,97,99,104,101,95,116,97,103,32,105,115,32,78, - 111,110,101,32,116,104,101,110,32,78,111,116,73,109,112,108, - 101,109,101,110,116,101,100,69,114,114,111,114,32,105,115,32, - 114,97,105,115,101,100,46,10,10,32,32,32,32,78,122,36, - 115,121,115,46,105,109,112,108,101,109,101,110,116,97,116,105, - 111,110,46,99,97,99,104,101,95,116,97,103,32,105,115,32, - 78,111,110,101,122,37,123,125,32,110,111,116,32,98,111,116, - 116,111,109,45,108,101,118,101,108,32,100,105,114,101,99,116, - 111,114,121,32,105,110,32,123,33,114,125,114,58,0,0,0, - 114,56,0,0,0,233,3,0,0,0,122,33,101,120,112,101, - 99,116,101,100,32,111,110,108,121,32,50,32,111,114,32,51, - 32,100,111,116,115,32,105,110,32,123,33,114,125,122,57,111, - 112,116,105,109,105,122,97,116,105,111,110,32,112,111,114,116, - 105,111,110,32,111,102,32,102,105,108,101,110,97,109,101,32, - 100,111,101,115,32,110,111,116,32,115,116,97,114,116,32,119, - 105,116,104,32,123,33,114,125,122,52,111,112,116,105,109,105, - 122,97,116,105,111,110,32,108,101,118,101,108,32,123,33,114, - 125,32,105,115,32,110,111,116,32,97,110,32,97,108,112,104, - 97,110,117,109,101,114,105,99,32,118,97,108,117,101,114,59, - 0,0,0,62,2,0,0,0,114,56,0,0,0,114,80,0, - 0,0,233,254,255,255,255,41,17,114,7,0,0,0,114,64, - 0,0,0,114,65,0,0,0,114,66,0,0,0,114,38,0, - 0,0,114,73,0,0,0,114,71,0,0,0,114,47,0,0, - 0,218,5,99,111,117,110,116,114,34,0,0,0,114,9,0, - 0,0,114,72,0,0,0,114,31,0,0,0,114,70,0,0, - 0,218,9,112,97,114,116,105,116,105,111,110,114,28,0,0, - 0,218,15,83,79,85,82,67,69,95,83,85,70,70,73,88, - 69,83,41,8,114,35,0,0,0,114,76,0,0,0,90,16, - 112,121,99,97,99,104,101,95,102,105,108,101,110,97,109,101, - 90,7,112,121,99,97,99,104,101,90,9,100,111,116,95,99, - 111,117,110,116,114,57,0,0,0,90,9,111,112,116,95,108, - 101,118,101,108,90,13,98,97,115,101,95,102,105,108,101,110, - 97,109,101,114,4,0,0,0,114,4,0,0,0,114,5,0, - 0,0,218,17,115,111,117,114,99,101,95,102,114,111,109,95, - 99,97,99,104,101,36,1,0,0,115,44,0,0,0,0,9, - 18,1,12,1,18,1,18,1,12,1,9,1,15,1,15,1, - 12,1,9,1,15,1,12,1,22,1,15,1,9,1,12,1, - 22,1,12,1,9,1,12,1,19,1,114,85,0,0,0,99, - 1,0,0,0,0,0,0,0,5,0,0,0,12,0,0,0, - 67,0,0,0,115,164,0,0,0,116,0,0,124,0,0,131, - 1,0,100,1,0,107,2,0,114,22,0,100,2,0,83,124, - 0,0,106,1,0,100,3,0,131,1,0,92,3,0,125,1, - 0,125,2,0,125,3,0,124,1,0,12,115,81,0,124,3, - 0,106,2,0,131,0,0,100,7,0,100,8,0,133,2,0, - 25,100,6,0,107,3,0,114,85,0,124,0,0,83,121,16, - 0,116,3,0,124,0,0,131,1,0,125,4,0,87,110,40, - 0,4,116,4,0,116,5,0,102,2,0,107,10,0,114,143, - 0,1,1,1,124,0,0,100,2,0,100,9,0,133,2,0, - 25,125,4,0,89,110,1,0,88,116,6,0,124,4,0,131, - 1,0,114,160,0,124,4,0,83,124,0,0,83,41,10,122, - 188,67,111,110,118,101,114,116,32,97,32,98,121,116,101,99, - 111,100,101,32,102,105,108,101,32,112,97,116,104,32,116,111, - 32,97,32,115,111,117,114,99,101,32,112,97,116,104,32,40, - 105,102,32,112,111,115,115,105,98,108,101,41,46,10,10,32, - 32,32,32,84,104,105,115,32,102,117,110,99,116,105,111,110, - 32,101,120,105,115,116,115,32,112,117,114,101,108,121,32,102, - 111,114,32,98,97,99,107,119,97,114,100,115,45,99,111,109, - 112,97,116,105,98,105,108,105,116,121,32,102,111,114,10,32, - 32,32,32,80,121,73,109,112,111,114,116,95,69,120,101,99, - 67,111,100,101,77,111,100,117,108,101,87,105,116,104,70,105, - 108,101,110,97,109,101,115,40,41,32,105,110,32,116,104,101, - 32,67,32,65,80,73,46,10,10,32,32,32,32,114,59,0, - 0,0,78,114,58,0,0,0,114,80,0,0,0,114,29,0, - 0,0,90,2,112,121,233,253,255,255,255,233,255,255,255,255, - 114,87,0,0,0,41,7,114,31,0,0,0,114,32,0,0, - 0,218,5,108,111,119,101,114,114,85,0,0,0,114,66,0, - 0,0,114,71,0,0,0,114,44,0,0,0,41,5,218,13, - 98,121,116,101,99,111,100,101,95,112,97,116,104,114,78,0, - 0,0,114,36,0,0,0,90,9,101,120,116,101,110,115,105, - 111,110,218,11,115,111,117,114,99,101,95,112,97,116,104,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,15, - 95,103,101,116,95,115,111,117,114,99,101,102,105,108,101,69, - 1,0,0,115,20,0,0,0,0,7,18,1,4,1,24,1, - 35,1,4,1,3,1,16,1,19,1,21,1,114,91,0,0, - 0,99,1,0,0,0,0,0,0,0,1,0,0,0,11,0, - 0,0,67,0,0,0,115,92,0,0,0,124,0,0,106,0, - 0,116,1,0,116,2,0,131,1,0,131,1,0,114,59,0, - 121,14,0,116,3,0,124,0,0,131,1,0,83,87,113,88, - 0,4,116,4,0,107,10,0,114,55,0,1,1,1,89,113, - 88,0,88,110,29,0,124,0,0,106,0,0,116,1,0,116, - 5,0,131,1,0,131,1,0,114,84,0,124,0,0,83,100, - 0,0,83,100,0,0,83,41,1,78,41,6,218,8,101,110, - 100,115,119,105,116,104,218,5,116,117,112,108,101,114,84,0, - 0,0,114,79,0,0,0,114,66,0,0,0,114,74,0,0, - 0,41,1,218,8,102,105,108,101,110,97,109,101,114,4,0, - 0,0,114,4,0,0,0,114,5,0,0,0,218,11,95,103, - 101,116,95,99,97,99,104,101,100,88,1,0,0,115,16,0, - 0,0,0,1,21,1,3,1,14,1,13,1,8,1,21,1, - 4,2,114,95,0,0,0,99,1,0,0,0,0,0,0,0, - 2,0,0,0,11,0,0,0,67,0,0,0,115,60,0,0, - 0,121,19,0,116,0,0,124,0,0,131,1,0,106,1,0, - 125,1,0,87,110,24,0,4,116,2,0,107,10,0,114,45, - 0,1,1,1,100,1,0,125,1,0,89,110,1,0,88,124, - 1,0,100,2,0,79,125,1,0,124,1,0,83,41,3,122, + 0,67,0,0,0,115,220,0,0,0,116,0,106,1,106,2, + 100,1,107,8,114,20,116,3,100,2,131,1,130,1,116,4, + 124,0,131,1,92,2,125,1,125,2,116,4,124,1,131,1, + 92,2,125,1,125,3,124,3,116,5,107,3,114,68,116,6, + 100,3,106,7,116,5,124,0,131,2,131,1,130,1,124,2, + 106,8,100,4,131,1,125,4,124,4,100,11,107,7,114,102, + 116,6,100,7,106,7,124,2,131,1,131,1,130,1,110,86, + 124,4,100,6,107,2,114,188,124,2,106,9,100,4,100,5, + 131,2,100,12,25,0,125,5,124,5,106,10,116,11,131,1, + 115,150,116,6,100,8,106,7,116,11,131,1,131,1,130,1, + 124,5,116,12,116,11,131,1,100,1,133,2,25,0,125,6, + 124,6,106,13,131,0,115,188,116,6,100,9,106,7,124,5, + 131,1,131,1,130,1,124,2,106,14,100,4,131,1,100,10, + 25,0,125,7,116,15,124,1,124,7,116,16,100,10,25,0, + 23,0,131,2,83,0,41,13,97,110,1,0,0,71,105,118, + 101,110,32,116,104,101,32,112,97,116,104,32,116,111,32,97, + 32,46,112,121,99,46,32,102,105,108,101,44,32,114,101,116, + 117,114,110,32,116,104,101,32,112,97,116,104,32,116,111,32, + 105,116,115,32,46,112,121,32,102,105,108,101,46,10,10,32, + 32,32,32,84,104,101,32,46,112,121,99,32,102,105,108,101, + 32,100,111,101,115,32,110,111,116,32,110,101,101,100,32,116, + 111,32,101,120,105,115,116,59,32,116,104,105,115,32,115,105, + 109,112,108,121,32,114,101,116,117,114,110,115,32,116,104,101, + 32,112,97,116,104,32,116,111,10,32,32,32,32,116,104,101, + 32,46,112,121,32,102,105,108,101,32,99,97,108,99,117,108, + 97,116,101,100,32,116,111,32,99,111,114,114,101,115,112,111, + 110,100,32,116,111,32,116,104,101,32,46,112,121,99,32,102, + 105,108,101,46,32,32,73,102,32,112,97,116,104,32,100,111, + 101,115,10,32,32,32,32,110,111,116,32,99,111,110,102,111, + 114,109,32,116,111,32,80,69,80,32,51,49,52,55,47,52, + 56,56,32,102,111,114,109,97,116,44,32,86,97,108,117,101, + 69,114,114,111,114,32,119,105,108,108,32,98,101,32,114,97, + 105,115,101,100,46,32,73,102,10,32,32,32,32,115,121,115, + 46,105,109,112,108,101,109,101,110,116,97,116,105,111,110,46, + 99,97,99,104,101,95,116,97,103,32,105,115,32,78,111,110, + 101,32,116,104,101,110,32,78,111,116,73,109,112,108,101,109, + 101,110,116,101,100,69,114,114,111,114,32,105,115,32,114,97, + 105,115,101,100,46,10,10,32,32,32,32,78,122,36,115,121, + 115,46,105,109,112,108,101,109,101,110,116,97,116,105,111,110, + 46,99,97,99,104,101,95,116,97,103,32,105,115,32,78,111, + 110,101,122,37,123,125,32,110,111,116,32,98,111,116,116,111, + 109,45,108,101,118,101,108,32,100,105,114,101,99,116,111,114, + 121,32,105,110,32,123,33,114,125,114,58,0,0,0,114,56, + 0,0,0,233,3,0,0,0,122,33,101,120,112,101,99,116, + 101,100,32,111,110,108,121,32,50,32,111,114,32,51,32,100, + 111,116,115,32,105,110,32,123,33,114,125,122,57,111,112,116, + 105,109,105,122,97,116,105,111,110,32,112,111,114,116,105,111, + 110,32,111,102,32,102,105,108,101,110,97,109,101,32,100,111, + 101,115,32,110,111,116,32,115,116,97,114,116,32,119,105,116, + 104,32,123,33,114,125,122,52,111,112,116,105,109,105,122,97, + 116,105,111,110,32,108,101,118,101,108,32,123,33,114,125,32, + 105,115,32,110,111,116,32,97,110,32,97,108,112,104,97,110, + 117,109,101,114,105,99,32,118,97,108,117,101,114,59,0,0, + 0,62,2,0,0,0,114,56,0,0,0,114,80,0,0,0, + 233,254,255,255,255,41,17,114,7,0,0,0,114,64,0,0, + 0,114,65,0,0,0,114,66,0,0,0,114,38,0,0,0, + 114,73,0,0,0,114,71,0,0,0,114,47,0,0,0,218, + 5,99,111,117,110,116,114,34,0,0,0,114,9,0,0,0, + 114,72,0,0,0,114,31,0,0,0,114,70,0,0,0,218, + 9,112,97,114,116,105,116,105,111,110,114,28,0,0,0,218, + 15,83,79,85,82,67,69,95,83,85,70,70,73,88,69,83, + 41,8,114,35,0,0,0,114,76,0,0,0,90,16,112,121, + 99,97,99,104,101,95,102,105,108,101,110,97,109,101,90,7, + 112,121,99,97,99,104,101,90,9,100,111,116,95,99,111,117, + 110,116,114,57,0,0,0,90,9,111,112,116,95,108,101,118, + 101,108,90,13,98,97,115,101,95,102,105,108,101,110,97,109, + 101,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, + 218,17,115,111,117,114,99,101,95,102,114,111,109,95,99,97, + 99,104,101,37,1,0,0,115,44,0,0,0,0,9,12,1, + 8,1,12,1,12,1,8,1,6,1,10,1,10,1,8,1, + 6,1,10,1,8,1,16,1,10,1,6,1,8,1,16,1, + 8,1,6,1,8,1,14,1,114,85,0,0,0,99,1,0, + 0,0,0,0,0,0,5,0,0,0,12,0,0,0,67,0, + 0,0,115,128,0,0,0,116,0,124,0,131,1,100,1,107, + 2,114,16,100,2,83,0,124,0,106,1,100,3,131,1,92, + 3,125,1,125,2,125,3,124,1,12,0,115,58,124,3,106, + 2,131,0,100,7,100,8,133,2,25,0,100,6,107,3,114, + 62,124,0,83,0,121,12,116,3,124,0,131,1,125,4,87, + 0,110,36,4,0,116,4,116,5,102,2,107,10,114,110,1, + 0,1,0,1,0,124,0,100,2,100,9,133,2,25,0,125, + 4,89,0,110,2,88,0,116,6,124,4,131,1,114,124,124, + 4,83,0,124,0,83,0,41,10,122,188,67,111,110,118,101, + 114,116,32,97,32,98,121,116,101,99,111,100,101,32,102,105, + 108,101,32,112,97,116,104,32,116,111,32,97,32,115,111,117, + 114,99,101,32,112,97,116,104,32,40,105,102,32,112,111,115, + 115,105,98,108,101,41,46,10,10,32,32,32,32,84,104,105, + 115,32,102,117,110,99,116,105,111,110,32,101,120,105,115,116, + 115,32,112,117,114,101,108,121,32,102,111,114,32,98,97,99, + 107,119,97,114,100,115,45,99,111,109,112,97,116,105,98,105, + 108,105,116,121,32,102,111,114,10,32,32,32,32,80,121,73, + 109,112,111,114,116,95,69,120,101,99,67,111,100,101,77,111, + 100,117,108,101,87,105,116,104,70,105,108,101,110,97,109,101, + 115,40,41,32,105,110,32,116,104,101,32,67,32,65,80,73, + 46,10,10,32,32,32,32,114,59,0,0,0,78,114,58,0, + 0,0,114,80,0,0,0,114,29,0,0,0,90,2,112,121, + 233,253,255,255,255,233,255,255,255,255,114,87,0,0,0,41, + 7,114,31,0,0,0,114,32,0,0,0,218,5,108,111,119, + 101,114,114,85,0,0,0,114,66,0,0,0,114,71,0,0, + 0,114,44,0,0,0,41,5,218,13,98,121,116,101,99,111, + 100,101,95,112,97,116,104,114,78,0,0,0,114,36,0,0, + 0,90,9,101,120,116,101,110,115,105,111,110,218,11,115,111, + 117,114,99,101,95,112,97,116,104,114,4,0,0,0,114,4, + 0,0,0,114,5,0,0,0,218,15,95,103,101,116,95,115, + 111,117,114,99,101,102,105,108,101,70,1,0,0,115,20,0, + 0,0,0,7,12,1,4,1,16,1,26,1,4,1,2,1, + 12,1,18,1,18,1,114,91,0,0,0,99,1,0,0,0, + 0,0,0,0,1,0,0,0,11,0,0,0,67,0,0,0, + 115,74,0,0,0,124,0,106,0,116,1,116,2,131,1,131, + 1,114,46,121,8,116,3,124,0,131,1,83,0,4,0,116, + 4,107,10,114,42,1,0,1,0,1,0,89,0,113,70,88, + 0,110,24,124,0,106,0,116,1,116,5,131,1,131,1,114, + 66,124,0,83,0,110,4,100,0,83,0,100,0,83,0,41, + 1,78,41,6,218,8,101,110,100,115,119,105,116,104,218,5, + 116,117,112,108,101,114,84,0,0,0,114,79,0,0,0,114, + 66,0,0,0,114,74,0,0,0,41,1,218,8,102,105,108, + 101,110,97,109,101,114,4,0,0,0,114,4,0,0,0,114, + 5,0,0,0,218,11,95,103,101,116,95,99,97,99,104,101, + 100,89,1,0,0,115,16,0,0,0,0,1,14,1,2,1, + 8,1,14,1,8,1,14,1,6,2,114,95,0,0,0,99, + 1,0,0,0,0,0,0,0,2,0,0,0,11,0,0,0, + 67,0,0,0,115,52,0,0,0,121,14,116,0,124,0,131, + 1,106,1,125,1,87,0,110,24,4,0,116,2,107,10,114, + 38,1,0,1,0,1,0,100,1,125,1,89,0,110,2,88, + 0,124,1,100,2,79,0,125,1,124,1,83,0,41,3,122, 51,67,97,108,99,117,108,97,116,101,32,116,104,101,32,109, 111,100,101,32,112,101,114,109,105,115,115,105,111,110,115,32, 102,111,114,32,97,32,98,121,116,101,99,111,100,101,32,102, @@ -514,15 +475,14 @@ 114,39,0,0,0,114,41,0,0,0,114,40,0,0,0,41, 2,114,35,0,0,0,114,42,0,0,0,114,4,0,0,0, 114,4,0,0,0,114,5,0,0,0,218,10,95,99,97,108, - 99,95,109,111,100,101,100,1,0,0,115,12,0,0,0,0, - 2,3,1,19,1,13,1,11,3,10,1,114,97,0,0,0, + 99,95,109,111,100,101,101,1,0,0,115,12,0,0,0,0, + 2,2,1,14,1,14,1,10,3,8,1,114,97,0,0,0, 99,1,0,0,0,0,0,0,0,3,0,0,0,11,0,0, - 0,3,0,0,0,115,84,0,0,0,100,1,0,135,0,0, - 102,1,0,100,2,0,100,3,0,134,1,0,125,1,0,121, - 13,0,116,0,0,106,1,0,125,2,0,87,110,30,0,4, - 116,2,0,107,10,0,114,66,0,1,1,1,100,4,0,100, - 5,0,132,0,0,125,2,0,89,110,1,0,88,124,2,0, - 124,1,0,136,0,0,131,2,0,1,124,1,0,83,41,6, + 0,3,0,0,0,115,68,0,0,0,100,1,135,0,102,1, + 100,2,100,3,134,1,125,1,121,10,116,0,106,1,125,2, + 87,0,110,28,4,0,116,2,107,10,114,52,1,0,1,0, + 1,0,100,4,100,5,132,0,125,2,89,0,110,2,88,0, + 124,2,124,1,136,0,131,2,1,0,124,1,83,0,41,6, 122,252,68,101,99,111,114,97,116,111,114,32,116,111,32,118, 101,114,105,102,121,32,116,104,97,116,32,116,104,101,32,109, 111,100,117,108,101,32,98,101,105,110,103,32,114,101,113,117, @@ -540,552 +500,517 @@ 110,32,73,109,112,111,114,116,69,114,114,111,114,32,105,115, 32,114,97,105,115,101,100,46,10,10,32,32,32,32,78,99, 2,0,0,0,0,0,0,0,4,0,0,0,5,0,0,0, - 31,0,0,0,115,89,0,0,0,124,1,0,100,0,0,107, - 8,0,114,24,0,124,0,0,106,0,0,125,1,0,110,46, - 0,124,0,0,106,0,0,124,1,0,107,3,0,114,70,0, - 116,1,0,100,1,0,124,0,0,106,0,0,124,1,0,102, - 2,0,22,100,2,0,124,1,0,131,1,1,130,1,0,136, - 0,0,124,0,0,124,1,0,124,2,0,124,3,0,142,2, - 0,83,41,3,78,122,30,108,111,97,100,101,114,32,102,111, - 114,32,37,115,32,99,97,110,110,111,116,32,104,97,110,100, - 108,101,32,37,115,218,4,110,97,109,101,41,2,114,98,0, - 0,0,218,11,73,109,112,111,114,116,69,114,114,111,114,41, - 4,218,4,115,101,108,102,114,98,0,0,0,218,4,97,114, - 103,115,90,6,107,119,97,114,103,115,41,1,218,6,109,101, - 116,104,111,100,114,4,0,0,0,114,5,0,0,0,218,19, - 95,99,104,101,99,107,95,110,97,109,101,95,119,114,97,112, - 112,101,114,120,1,0,0,115,12,0,0,0,0,1,12,1, - 12,1,15,1,6,1,25,1,122,40,95,99,104,101,99,107, - 95,110,97,109,101,46,60,108,111,99,97,108,115,62,46,95, - 99,104,101,99,107,95,110,97,109,101,95,119,114,97,112,112, - 101,114,99,2,0,0,0,0,0,0,0,3,0,0,0,7, - 0,0,0,83,0,0,0,115,92,0,0,0,120,66,0,100, - 1,0,100,2,0,100,3,0,100,4,0,103,4,0,68,93, - 46,0,125,2,0,116,0,0,124,1,0,124,2,0,131,2, - 0,114,19,0,116,1,0,124,0,0,124,2,0,116,2,0, - 124,1,0,124,2,0,131,2,0,131,3,0,1,113,19,0, - 87,124,0,0,106,3,0,106,4,0,124,1,0,106,3,0, - 131,1,0,1,100,0,0,83,41,5,78,218,10,95,95,109, - 111,100,117,108,101,95,95,218,8,95,95,110,97,109,101,95, - 95,218,12,95,95,113,117,97,108,110,97,109,101,95,95,218, - 7,95,95,100,111,99,95,95,41,5,218,7,104,97,115,97, - 116,116,114,218,7,115,101,116,97,116,116,114,218,7,103,101, - 116,97,116,116,114,218,8,95,95,100,105,99,116,95,95,218, - 6,117,112,100,97,116,101,41,3,90,3,110,101,119,90,3, - 111,108,100,114,52,0,0,0,114,4,0,0,0,114,4,0, - 0,0,114,5,0,0,0,218,5,95,119,114,97,112,131,1, - 0,0,115,8,0,0,0,0,1,25,1,15,1,29,1,122, - 26,95,99,104,101,99,107,95,110,97,109,101,46,60,108,111, - 99,97,108,115,62,46,95,119,114,97,112,41,3,218,10,95, - 98,111,111,116,115,116,114,97,112,114,113,0,0,0,218,9, - 78,97,109,101,69,114,114,111,114,41,3,114,102,0,0,0, - 114,103,0,0,0,114,113,0,0,0,114,4,0,0,0,41, - 1,114,102,0,0,0,114,5,0,0,0,218,11,95,99,104, - 101,99,107,95,110,97,109,101,112,1,0,0,115,14,0,0, - 0,0,8,21,7,3,1,13,1,13,2,17,5,13,1,114, - 116,0,0,0,99,2,0,0,0,0,0,0,0,5,0,0, - 0,4,0,0,0,67,0,0,0,115,84,0,0,0,124,0, - 0,106,0,0,124,1,0,131,1,0,92,2,0,125,2,0, - 125,3,0,124,2,0,100,1,0,107,8,0,114,80,0,116, - 1,0,124,3,0,131,1,0,114,80,0,100,2,0,125,4, - 0,116,2,0,106,3,0,124,4,0,106,4,0,124,3,0, - 100,3,0,25,131,1,0,116,5,0,131,2,0,1,124,2, - 0,83,41,4,122,155,84,114,121,32,116,111,32,102,105,110, - 100,32,97,32,108,111,97,100,101,114,32,102,111,114,32,116, - 104,101,32,115,112,101,99,105,102,105,101,100,32,109,111,100, - 117,108,101,32,98,121,32,100,101,108,101,103,97,116,105,110, - 103,32,116,111,10,32,32,32,32,115,101,108,102,46,102,105, - 110,100,95,108,111,97,100,101,114,40,41,46,10,10,32,32, - 32,32,84,104,105,115,32,109,101,116,104,111,100,32,105,115, - 32,100,101,112,114,101,99,97,116,101,100,32,105,110,32,102, - 97,118,111,114,32,111,102,32,102,105,110,100,101,114,46,102, - 105,110,100,95,115,112,101,99,40,41,46,10,10,32,32,32, - 32,78,122,44,78,111,116,32,105,109,112,111,114,116,105,110, - 103,32,100,105,114,101,99,116,111,114,121,32,123,125,58,32, - 109,105,115,115,105,110,103,32,95,95,105,110,105,116,95,95, - 114,59,0,0,0,41,6,218,11,102,105,110,100,95,108,111, - 97,100,101,114,114,31,0,0,0,114,60,0,0,0,114,61, - 0,0,0,114,47,0,0,0,218,13,73,109,112,111,114,116, - 87,97,114,110,105,110,103,41,5,114,100,0,0,0,218,8, - 102,117,108,108,110,97,109,101,218,6,108,111,97,100,101,114, - 218,8,112,111,114,116,105,111,110,115,218,3,109,115,103,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,17, - 95,102,105,110,100,95,109,111,100,117,108,101,95,115,104,105, - 109,140,1,0,0,115,10,0,0,0,0,10,21,1,24,1, - 6,1,29,1,114,123,0,0,0,99,4,0,0,0,0,0, - 0,0,11,0,0,0,19,0,0,0,67,0,0,0,115,252, - 1,0,0,105,0,0,125,4,0,124,2,0,100,1,0,107, - 9,0,114,31,0,124,2,0,124,4,0,100,2,0,60,110, - 6,0,100,3,0,125,2,0,124,3,0,100,1,0,107,9, - 0,114,59,0,124,3,0,124,4,0,100,4,0,60,124,0, - 0,100,1,0,100,5,0,133,2,0,25,125,5,0,124,0, - 0,100,5,0,100,6,0,133,2,0,25,125,6,0,124,0, - 0,100,6,0,100,7,0,133,2,0,25,125,7,0,124,5, - 0,116,0,0,107,3,0,114,171,0,100,8,0,106,1,0, - 124,2,0,124,5,0,131,2,0,125,8,0,116,2,0,106, - 3,0,100,9,0,124,8,0,131,2,0,1,116,4,0,124, - 8,0,124,4,0,141,1,0,130,1,0,110,125,0,116,5, - 0,124,6,0,131,1,0,100,5,0,107,3,0,114,235,0, - 100,10,0,106,1,0,124,2,0,131,1,0,125,8,0,116, - 2,0,106,3,0,100,9,0,124,8,0,131,2,0,1,116, - 6,0,124,8,0,131,1,0,130,1,0,110,61,0,116,5, - 0,124,7,0,131,1,0,100,5,0,107,3,0,114,40,1, - 100,11,0,106,1,0,124,2,0,131,1,0,125,8,0,116, - 2,0,106,3,0,100,9,0,124,8,0,131,2,0,1,116, - 6,0,124,8,0,131,1,0,130,1,0,124,1,0,100,1, - 0,107,9,0,114,238,1,121,20,0,116,7,0,124,1,0, - 100,12,0,25,131,1,0,125,9,0,87,110,18,0,4,116, - 8,0,107,10,0,114,92,1,1,1,1,89,110,65,0,88, - 116,9,0,124,6,0,131,1,0,124,9,0,107,3,0,114, - 157,1,100,13,0,106,1,0,124,2,0,131,1,0,125,8, - 0,116,2,0,106,3,0,100,9,0,124,8,0,131,2,0, - 1,116,4,0,124,8,0,124,4,0,141,1,0,130,1,0, - 121,18,0,124,1,0,100,14,0,25,100,15,0,64,125,10, - 0,87,110,18,0,4,116,8,0,107,10,0,114,195,1,1, - 1,1,89,110,43,0,88,116,9,0,124,7,0,131,1,0, - 124,10,0,107,3,0,114,238,1,116,4,0,100,13,0,106, - 1,0,124,2,0,131,1,0,124,4,0,141,1,0,130,1, - 0,124,0,0,100,7,0,100,1,0,133,2,0,25,83,41, - 16,97,122,1,0,0,86,97,108,105,100,97,116,101,32,116, - 104,101,32,104,101,97,100,101,114,32,111,102,32,116,104,101, - 32,112,97,115,115,101,100,45,105,110,32,98,121,116,101,99, - 111,100,101,32,97,103,97,105,110,115,116,32,115,111,117,114, - 99,101,95,115,116,97,116,115,32,40,105,102,10,32,32,32, - 32,103,105,118,101,110,41,32,97,110,100,32,114,101,116,117, - 114,110,105,110,103,32,116,104,101,32,98,121,116,101,99,111, - 100,101,32,116,104,97,116,32,99,97,110,32,98,101,32,99, - 111,109,112,105,108,101,100,32,98,121,32,99,111,109,112,105, - 108,101,40,41,46,10,10,32,32,32,32,65,108,108,32,111, - 116,104,101,114,32,97,114,103,117,109,101,110,116,115,32,97, - 114,101,32,117,115,101,100,32,116,111,32,101,110,104,97,110, - 99,101,32,101,114,114,111,114,32,114,101,112,111,114,116,105, - 110,103,46,10,10,32,32,32,32,73,109,112,111,114,116,69, - 114,114,111,114,32,105,115,32,114,97,105,115,101,100,32,119, - 104,101,110,32,116,104,101,32,109,97,103,105,99,32,110,117, - 109,98,101,114,32,105,115,32,105,110,99,111,114,114,101,99, - 116,32,111,114,32,116,104,101,32,98,121,116,101,99,111,100, - 101,32,105,115,10,32,32,32,32,102,111,117,110,100,32,116, - 111,32,98,101,32,115,116,97,108,101,46,32,69,79,70,69, - 114,114,111,114,32,105,115,32,114,97,105,115,101,100,32,119, - 104,101,110,32,116,104,101,32,100,97,116,97,32,105,115,32, - 102,111,117,110,100,32,116,111,32,98,101,10,32,32,32,32, - 116,114,117,110,99,97,116,101,100,46,10,10,32,32,32,32, - 78,114,98,0,0,0,122,10,60,98,121,116,101,99,111,100, - 101,62,114,35,0,0,0,114,12,0,0,0,233,8,0,0, - 0,233,12,0,0,0,122,30,98,97,100,32,109,97,103,105, - 99,32,110,117,109,98,101,114,32,105,110,32,123,33,114,125, - 58,32,123,33,114,125,122,2,123,125,122,43,114,101,97,99, - 104,101,100,32,69,79,70,32,119,104,105,108,101,32,114,101, - 97,100,105,110,103,32,116,105,109,101,115,116,97,109,112,32, - 105,110,32,123,33,114,125,122,48,114,101,97,99,104,101,100, - 32,69,79,70,32,119,104,105,108,101,32,114,101,97,100,105, - 110,103,32,115,105,122,101,32,111,102,32,115,111,117,114,99, - 101,32,105,110,32,123,33,114,125,218,5,109,116,105,109,101, - 122,26,98,121,116,101,99,111,100,101,32,105,115,32,115,116, - 97,108,101,32,102,111,114,32,123,33,114,125,218,4,115,105, - 122,101,108,3,0,0,0,255,127,255,127,3,0,41,10,218, - 12,77,65,71,73,67,95,78,85,77,66,69,82,114,47,0, - 0,0,114,114,0,0,0,218,16,95,118,101,114,98,111,115, - 101,95,109,101,115,115,97,103,101,114,99,0,0,0,114,31, - 0,0,0,218,8,69,79,70,69,114,114,111,114,114,14,0, - 0,0,218,8,75,101,121,69,114,114,111,114,114,19,0,0, - 0,41,11,114,53,0,0,0,218,12,115,111,117,114,99,101, - 95,115,116,97,116,115,114,98,0,0,0,114,35,0,0,0, - 90,11,101,120,99,95,100,101,116,97,105,108,115,90,5,109, - 97,103,105,99,90,13,114,97,119,95,116,105,109,101,115,116, - 97,109,112,90,8,114,97,119,95,115,105,122,101,114,75,0, - 0,0,218,12,115,111,117,114,99,101,95,109,116,105,109,101, - 218,11,115,111,117,114,99,101,95,115,105,122,101,114,4,0, - 0,0,114,4,0,0,0,114,5,0,0,0,218,25,95,118, - 97,108,105,100,97,116,101,95,98,121,116,101,99,111,100,101, - 95,104,101,97,100,101,114,157,1,0,0,115,76,0,0,0, - 0,11,6,1,12,1,13,3,6,1,12,1,10,1,16,1, - 16,1,16,1,12,1,18,1,16,1,18,1,18,1,15,1, - 16,1,15,1,18,1,15,1,16,1,12,1,12,1,3,1, - 20,1,13,1,5,2,18,1,15,1,16,1,15,1,3,1, - 18,1,13,1,5,2,18,1,15,1,9,1,114,135,0,0, - 0,99,4,0,0,0,0,0,0,0,5,0,0,0,6,0, - 0,0,67,0,0,0,115,115,0,0,0,116,0,0,106,1, - 0,124,0,0,131,1,0,125,4,0,116,2,0,124,4,0, - 116,3,0,131,2,0,114,78,0,116,4,0,106,5,0,100, - 1,0,124,2,0,131,2,0,1,124,3,0,100,2,0,107, - 9,0,114,74,0,116,6,0,106,7,0,124,4,0,124,3, - 0,131,2,0,1,124,4,0,83,116,8,0,100,3,0,106, - 9,0,124,2,0,131,1,0,100,4,0,124,1,0,100,5, - 0,124,2,0,131,1,2,130,1,0,100,2,0,83,41,6, - 122,60,67,111,109,112,105,108,101,32,98,121,116,101,99,111, - 100,101,32,97,115,32,114,101,116,117,114,110,101,100,32,98, - 121,32,95,118,97,108,105,100,97,116,101,95,98,121,116,101, - 99,111,100,101,95,104,101,97,100,101,114,40,41,46,122,21, - 99,111,100,101,32,111,98,106,101,99,116,32,102,114,111,109, - 32,123,33,114,125,78,122,23,78,111,110,45,99,111,100,101, - 32,111,98,106,101,99,116,32,105,110,32,123,33,114,125,114, - 98,0,0,0,114,35,0,0,0,41,10,218,7,109,97,114, - 115,104,97,108,90,5,108,111,97,100,115,218,10,105,115,105, - 110,115,116,97,110,99,101,218,10,95,99,111,100,101,95,116, - 121,112,101,114,114,0,0,0,114,129,0,0,0,218,4,95, - 105,109,112,90,16,95,102,105,120,95,99,111,95,102,105,108, - 101,110,97,109,101,114,99,0,0,0,114,47,0,0,0,41, - 5,114,53,0,0,0,114,98,0,0,0,114,89,0,0,0, - 114,90,0,0,0,218,4,99,111,100,101,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,17,95,99,111,109, - 112,105,108,101,95,98,121,116,101,99,111,100,101,212,1,0, - 0,115,16,0,0,0,0,2,15,1,15,1,16,1,12,1, - 16,1,4,2,18,1,114,141,0,0,0,114,59,0,0,0, - 99,3,0,0,0,0,0,0,0,4,0,0,0,3,0,0, - 0,67,0,0,0,115,76,0,0,0,116,0,0,116,1,0, - 131,1,0,125,3,0,124,3,0,106,2,0,116,3,0,124, - 1,0,131,1,0,131,1,0,1,124,3,0,106,2,0,116, - 3,0,124,2,0,131,1,0,131,1,0,1,124,3,0,106, - 2,0,116,4,0,106,5,0,124,0,0,131,1,0,131,1, - 0,1,124,3,0,83,41,1,122,80,67,111,109,112,105,108, - 101,32,97,32,99,111,100,101,32,111,98,106,101,99,116,32, - 105,110,116,111,32,98,121,116,101,99,111,100,101,32,102,111, - 114,32,119,114,105,116,105,110,103,32,111,117,116,32,116,111, - 32,97,32,98,121,116,101,45,99,111,109,112,105,108,101,100, - 10,32,32,32,32,102,105,108,101,46,41,6,218,9,98,121, - 116,101,97,114,114,97,121,114,128,0,0,0,218,6,101,120, - 116,101,110,100,114,17,0,0,0,114,136,0,0,0,90,5, - 100,117,109,112,115,41,4,114,140,0,0,0,114,126,0,0, - 0,114,134,0,0,0,114,53,0,0,0,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,17,95,99,111,100, - 101,95,116,111,95,98,121,116,101,99,111,100,101,224,1,0, - 0,115,10,0,0,0,0,3,12,1,19,1,19,1,22,1, - 114,144,0,0,0,99,1,0,0,0,0,0,0,0,5,0, - 0,0,4,0,0,0,67,0,0,0,115,89,0,0,0,100, - 1,0,100,2,0,108,0,0,125,1,0,116,1,0,106,2, - 0,124,0,0,131,1,0,106,3,0,125,2,0,124,1,0, - 106,4,0,124,2,0,131,1,0,125,3,0,116,1,0,106, - 5,0,100,2,0,100,3,0,131,2,0,125,4,0,124,4, - 0,106,6,0,124,0,0,106,6,0,124,3,0,100,1,0, - 25,131,1,0,131,1,0,83,41,4,122,121,68,101,99,111, - 100,101,32,98,121,116,101,115,32,114,101,112,114,101,115,101, - 110,116,105,110,103,32,115,111,117,114,99,101,32,99,111,100, - 101,32,97,110,100,32,114,101,116,117,114,110,32,116,104,101, - 32,115,116,114,105,110,103,46,10,10,32,32,32,32,85,110, - 105,118,101,114,115,97,108,32,110,101,119,108,105,110,101,32, - 115,117,112,112,111,114,116,32,105,115,32,117,115,101,100,32, - 105,110,32,116,104,101,32,100,101,99,111,100,105,110,103,46, - 10,32,32,32,32,114,59,0,0,0,78,84,41,7,218,8, - 116,111,107,101,110,105,122,101,114,49,0,0,0,90,7,66, - 121,116,101,115,73,79,90,8,114,101,97,100,108,105,110,101, - 90,15,100,101,116,101,99,116,95,101,110,99,111,100,105,110, - 103,90,25,73,110,99,114,101,109,101,110,116,97,108,78,101, - 119,108,105,110,101,68,101,99,111,100,101,114,218,6,100,101, - 99,111,100,101,41,5,218,12,115,111,117,114,99,101,95,98, - 121,116,101,115,114,145,0,0,0,90,21,115,111,117,114,99, - 101,95,98,121,116,101,115,95,114,101,97,100,108,105,110,101, - 218,8,101,110,99,111,100,105,110,103,90,15,110,101,119,108, - 105,110,101,95,100,101,99,111,100,101,114,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,13,100,101,99,111, - 100,101,95,115,111,117,114,99,101,234,1,0,0,115,10,0, - 0,0,0,5,12,1,18,1,15,1,18,1,114,149,0,0, - 0,114,120,0,0,0,218,26,115,117,98,109,111,100,117,108, - 101,95,115,101,97,114,99,104,95,108,111,99,97,116,105,111, - 110,115,99,2,0,0,0,2,0,0,0,9,0,0,0,19, - 0,0,0,67,0,0,0,115,89,1,0,0,124,1,0,100, - 1,0,107,8,0,114,73,0,100,2,0,125,1,0,116,0, - 0,124,2,0,100,3,0,131,2,0,114,73,0,121,19,0, - 124,2,0,106,1,0,124,0,0,131,1,0,125,1,0,87, - 110,18,0,4,116,2,0,107,10,0,114,72,0,1,1,1, - 89,110,1,0,88,116,3,0,106,4,0,124,0,0,124,2, - 0,100,4,0,124,1,0,131,2,1,125,4,0,100,5,0, - 124,4,0,95,5,0,124,2,0,100,1,0,107,8,0,114, - 194,0,120,73,0,116,6,0,131,0,0,68,93,58,0,92, - 2,0,125,5,0,125,6,0,124,1,0,106,7,0,116,8, - 0,124,6,0,131,1,0,131,1,0,114,128,0,124,5,0, - 124,0,0,124,1,0,131,2,0,125,2,0,124,2,0,124, - 4,0,95,9,0,80,113,128,0,87,100,1,0,83,124,3, - 0,116,10,0,107,8,0,114,23,1,116,0,0,124,2,0, - 100,6,0,131,2,0,114,32,1,121,19,0,124,2,0,106, - 11,0,124,0,0,131,1,0,125,7,0,87,110,18,0,4, - 116,2,0,107,10,0,114,4,1,1,1,1,89,113,32,1, - 88,124,7,0,114,32,1,103,0,0,124,4,0,95,12,0, - 110,9,0,124,3,0,124,4,0,95,12,0,124,4,0,106, - 12,0,103,0,0,107,2,0,114,85,1,124,1,0,114,85, - 1,116,13,0,124,1,0,131,1,0,100,7,0,25,125,8, - 0,124,4,0,106,12,0,106,14,0,124,8,0,131,1,0, - 1,124,4,0,83,41,8,97,61,1,0,0,82,101,116,117, - 114,110,32,97,32,109,111,100,117,108,101,32,115,112,101,99, - 32,98,97,115,101,100,32,111,110,32,97,32,102,105,108,101, - 32,108,111,99,97,116,105,111,110,46,10,10,32,32,32,32, - 84,111,32,105,110,100,105,99,97,116,101,32,116,104,97,116, - 32,116,104,101,32,109,111,100,117,108,101,32,105,115,32,97, - 32,112,97,99,107,97,103,101,44,32,115,101,116,10,32,32, - 32,32,115,117,98,109,111,100,117,108,101,95,115,101,97,114, - 99,104,95,108,111,99,97,116,105,111,110,115,32,116,111,32, - 97,32,108,105,115,116,32,111,102,32,100,105,114,101,99,116, - 111,114,121,32,112,97,116,104,115,46,32,32,65,110,10,32, - 32,32,32,101,109,112,116,121,32,108,105,115,116,32,105,115, - 32,115,117,102,102,105,99,105,101,110,116,44,32,116,104,111, - 117,103,104,32,105,116,115,32,110,111,116,32,111,116,104,101, - 114,119,105,115,101,32,117,115,101,102,117,108,32,116,111,32, - 116,104,101,10,32,32,32,32,105,109,112,111,114,116,32,115, - 121,115,116,101,109,46,10,10,32,32,32,32,84,104,101,32, - 108,111,97,100,101,114,32,109,117,115,116,32,116,97,107,101, - 32,97,32,115,112,101,99,32,97,115,32,105,116,115,32,111, - 110,108,121,32,95,95,105,110,105,116,95,95,40,41,32,97, - 114,103,46,10,10,32,32,32,32,78,122,9,60,117,110,107, - 110,111,119,110,62,218,12,103,101,116,95,102,105,108,101,110, - 97,109,101,218,6,111,114,105,103,105,110,84,218,10,105,115, - 95,112,97,99,107,97,103,101,114,59,0,0,0,41,15,114, - 108,0,0,0,114,151,0,0,0,114,99,0,0,0,114,114, - 0,0,0,218,10,77,111,100,117,108,101,83,112,101,99,90, - 13,95,115,101,116,95,102,105,108,101,97,116,116,114,218,27, - 95,103,101,116,95,115,117,112,112,111,114,116,101,100,95,102, - 105,108,101,95,108,111,97,100,101,114,115,114,92,0,0,0, - 114,93,0,0,0,114,120,0,0,0,218,9,95,80,79,80, - 85,76,65,84,69,114,153,0,0,0,114,150,0,0,0,114, - 38,0,0,0,218,6,97,112,112,101,110,100,41,9,114,98, - 0,0,0,90,8,108,111,99,97,116,105,111,110,114,120,0, - 0,0,114,150,0,0,0,218,4,115,112,101,99,218,12,108, - 111,97,100,101,114,95,99,108,97,115,115,218,8,115,117,102, - 102,105,120,101,115,114,153,0,0,0,90,7,100,105,114,110, - 97,109,101,114,4,0,0,0,114,4,0,0,0,114,5,0, - 0,0,218,23,115,112,101,99,95,102,114,111,109,95,102,105, - 108,101,95,108,111,99,97,116,105,111,110,251,1,0,0,115, - 60,0,0,0,0,12,12,4,6,1,15,2,3,1,19,1, - 13,1,5,8,24,1,9,3,12,1,22,1,21,1,15,1, - 9,1,5,2,4,3,12,2,15,1,3,1,19,1,13,1, - 5,2,6,1,12,2,9,1,15,1,6,1,16,1,16,2, - 114,161,0,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,5,0,0,0,64,0,0,0,115,121,0,0,0,101, - 0,0,90,1,0,100,0,0,90,2,0,100,1,0,90,3, - 0,100,2,0,90,4,0,100,3,0,90,5,0,100,4,0, - 90,6,0,101,7,0,100,5,0,100,6,0,132,0,0,131, - 1,0,90,8,0,101,7,0,100,7,0,100,8,0,132,0, - 0,131,1,0,90,9,0,101,7,0,100,9,0,100,9,0, - 100,10,0,100,11,0,132,2,0,131,1,0,90,10,0,101, - 7,0,100,9,0,100,12,0,100,13,0,132,1,0,131,1, - 0,90,11,0,100,9,0,83,41,14,218,21,87,105,110,100, - 111,119,115,82,101,103,105,115,116,114,121,70,105,110,100,101, - 114,122,62,77,101,116,97,32,112,97,116,104,32,102,105,110, - 100,101,114,32,102,111,114,32,109,111,100,117,108,101,115,32, - 100,101,99,108,97,114,101,100,32,105,110,32,116,104,101,32, - 87,105,110,100,111,119,115,32,114,101,103,105,115,116,114,121, - 46,122,59,83,111,102,116,119,97,114,101,92,80,121,116,104, - 111,110,92,80,121,116,104,111,110,67,111,114,101,92,123,115, - 121,115,95,118,101,114,115,105,111,110,125,92,77,111,100,117, - 108,101,115,92,123,102,117,108,108,110,97,109,101,125,122,65, - 83,111,102,116,119,97,114,101,92,80,121,116,104,111,110,92, - 80,121,116,104,111,110,67,111,114,101,92,123,115,121,115,95, - 118,101,114,115,105,111,110,125,92,77,111,100,117,108,101,115, - 92,123,102,117,108,108,110,97,109,101,125,92,68,101,98,117, - 103,70,99,2,0,0,0,0,0,0,0,2,0,0,0,11, - 0,0,0,67,0,0,0,115,67,0,0,0,121,23,0,116, - 0,0,106,1,0,116,0,0,106,2,0,124,1,0,131,2, - 0,83,87,110,37,0,4,116,3,0,107,10,0,114,62,0, - 1,1,1,116,0,0,106,1,0,116,0,0,106,4,0,124, - 1,0,131,2,0,83,89,110,1,0,88,100,0,0,83,41, - 1,78,41,5,218,7,95,119,105,110,114,101,103,90,7,79, - 112,101,110,75,101,121,90,17,72,75,69,89,95,67,85,82, - 82,69,78,84,95,85,83,69,82,114,40,0,0,0,90,18, - 72,75,69,89,95,76,79,67,65,76,95,77,65,67,72,73, - 78,69,41,2,218,3,99,108,115,218,3,107,101,121,114,4, - 0,0,0,114,4,0,0,0,114,5,0,0,0,218,14,95, - 111,112,101,110,95,114,101,103,105,115,116,114,121,73,2,0, - 0,115,8,0,0,0,0,2,3,1,23,1,13,1,122,36, + 31,0,0,0,115,64,0,0,0,124,1,100,0,107,8,114, + 16,124,0,106,0,125,1,110,34,124,0,106,0,124,1,107, + 3,114,50,116,1,100,1,124,0,106,0,124,1,102,2,22, + 0,100,2,124,1,144,1,131,1,130,1,136,0,124,0,124, + 1,124,2,124,3,142,2,83,0,41,3,78,122,30,108,111, + 97,100,101,114,32,102,111,114,32,37,115,32,99,97,110,110, + 111,116,32,104,97,110,100,108,101,32,37,115,218,4,110,97, + 109,101,41,2,114,98,0,0,0,218,11,73,109,112,111,114, + 116,69,114,114,111,114,41,4,218,4,115,101,108,102,114,98, + 0,0,0,218,4,97,114,103,115,90,6,107,119,97,114,103, + 115,41,1,218,6,109,101,116,104,111,100,114,4,0,0,0, + 114,5,0,0,0,218,19,95,99,104,101,99,107,95,110,97, + 109,101,95,119,114,97,112,112,101,114,121,1,0,0,115,12, + 0,0,0,0,1,8,1,8,1,10,1,4,1,20,1,122, + 40,95,99,104,101,99,107,95,110,97,109,101,46,60,108,111, + 99,97,108,115,62,46,95,99,104,101,99,107,95,110,97,109, + 101,95,119,114,97,112,112,101,114,99,2,0,0,0,0,0, + 0,0,3,0,0,0,7,0,0,0,83,0,0,0,115,60, + 0,0,0,120,40,100,5,68,0,93,32,125,2,116,0,124, + 1,124,2,131,2,114,6,116,1,124,0,124,2,116,2,124, + 1,124,2,131,2,131,3,1,0,113,6,87,0,124,0,106, + 3,106,4,124,1,106,3,131,1,1,0,100,0,83,0,41, + 6,78,218,10,95,95,109,111,100,117,108,101,95,95,218,8, + 95,95,110,97,109,101,95,95,218,12,95,95,113,117,97,108, + 110,97,109,101,95,95,218,7,95,95,100,111,99,95,95,41, + 4,122,10,95,95,109,111,100,117,108,101,95,95,122,8,95, + 95,110,97,109,101,95,95,122,12,95,95,113,117,97,108,110, + 97,109,101,95,95,122,7,95,95,100,111,99,95,95,41,5, + 218,7,104,97,115,97,116,116,114,218,7,115,101,116,97,116, + 116,114,218,7,103,101,116,97,116,116,114,218,8,95,95,100, + 105,99,116,95,95,218,6,117,112,100,97,116,101,41,3,90, + 3,110,101,119,90,3,111,108,100,114,52,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,218,5,95, + 119,114,97,112,132,1,0,0,115,8,0,0,0,0,1,10, + 1,10,1,22,1,122,26,95,99,104,101,99,107,95,110,97, + 109,101,46,60,108,111,99,97,108,115,62,46,95,119,114,97, + 112,41,3,218,10,95,98,111,111,116,115,116,114,97,112,114, + 113,0,0,0,218,9,78,97,109,101,69,114,114,111,114,41, + 3,114,102,0,0,0,114,103,0,0,0,114,113,0,0,0, + 114,4,0,0,0,41,1,114,102,0,0,0,114,5,0,0, + 0,218,11,95,99,104,101,99,107,95,110,97,109,101,113,1, + 0,0,115,14,0,0,0,0,8,14,7,2,1,10,1,14, + 2,14,5,10,1,114,116,0,0,0,99,2,0,0,0,0, + 0,0,0,5,0,0,0,4,0,0,0,67,0,0,0,115, + 60,0,0,0,124,0,106,0,124,1,131,1,92,2,125,2, + 125,3,124,2,100,1,107,8,114,56,116,1,124,3,131,1, + 114,56,100,2,125,4,116,2,106,3,124,4,106,4,124,3, + 100,3,25,0,131,1,116,5,131,2,1,0,124,2,83,0, + 41,4,122,155,84,114,121,32,116,111,32,102,105,110,100,32, + 97,32,108,111,97,100,101,114,32,102,111,114,32,116,104,101, + 32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,108, + 101,32,98,121,32,100,101,108,101,103,97,116,105,110,103,32, + 116,111,10,32,32,32,32,115,101,108,102,46,102,105,110,100, + 95,108,111,97,100,101,114,40,41,46,10,10,32,32,32,32, + 84,104,105,115,32,109,101,116,104,111,100,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,32,105,110,32,102,97,118, + 111,114,32,111,102,32,102,105,110,100,101,114,46,102,105,110, + 100,95,115,112,101,99,40,41,46,10,10,32,32,32,32,78, + 122,44,78,111,116,32,105,109,112,111,114,116,105,110,103,32, + 100,105,114,101,99,116,111,114,121,32,123,125,58,32,109,105, + 115,115,105,110,103,32,95,95,105,110,105,116,95,95,114,59, + 0,0,0,41,6,218,11,102,105,110,100,95,108,111,97,100, + 101,114,114,31,0,0,0,114,60,0,0,0,114,61,0,0, + 0,114,47,0,0,0,218,13,73,109,112,111,114,116,87,97, + 114,110,105,110,103,41,5,114,100,0,0,0,218,8,102,117, + 108,108,110,97,109,101,218,6,108,111,97,100,101,114,218,8, + 112,111,114,116,105,111,110,115,218,3,109,115,103,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,218,17,95,102, + 105,110,100,95,109,111,100,117,108,101,95,115,104,105,109,141, + 1,0,0,115,10,0,0,0,0,10,14,1,16,1,4,1, + 22,1,114,123,0,0,0,99,4,0,0,0,0,0,0,0, + 11,0,0,0,19,0,0,0,67,0,0,0,115,128,1,0, + 0,105,0,125,4,124,2,100,1,107,9,114,22,124,2,124, + 4,100,2,60,0,110,4,100,3,125,2,124,3,100,1,107, + 9,114,42,124,3,124,4,100,4,60,0,124,0,100,1,100, + 5,133,2,25,0,125,5,124,0,100,5,100,6,133,2,25, + 0,125,6,124,0,100,6,100,7,133,2,25,0,125,7,124, + 5,116,0,107,3,114,122,100,8,106,1,124,2,124,5,131, + 2,125,8,116,2,106,3,100,9,124,8,131,2,1,0,116, + 4,124,8,124,4,141,1,130,1,110,86,116,5,124,6,131, + 1,100,5,107,3,114,166,100,10,106,1,124,2,131,1,125, + 8,116,2,106,3,100,9,124,8,131,2,1,0,116,6,124, + 8,131,1,130,1,110,42,116,5,124,7,131,1,100,5,107, + 3,114,208,100,11,106,1,124,2,131,1,125,8,116,2,106, + 3,100,9,124,8,131,2,1,0,116,6,124,8,131,1,130, + 1,124,1,100,1,107,9,144,1,114,116,121,16,116,7,124, + 1,100,12,25,0,131,1,125,9,87,0,110,20,4,0,116, + 8,107,10,114,254,1,0,1,0,1,0,89,0,110,48,88, + 0,116,9,124,6,131,1,124,9,107,3,144,1,114,46,100, + 13,106,1,124,2,131,1,125,8,116,2,106,3,100,9,124, + 8,131,2,1,0,116,4,124,8,124,4,141,1,130,1,121, + 16,124,1,100,14,25,0,100,15,64,0,125,10,87,0,110, + 22,4,0,116,8,107,10,144,1,114,84,1,0,1,0,1, + 0,89,0,110,32,88,0,116,9,124,7,131,1,124,10,107, + 3,144,1,114,116,116,4,100,13,106,1,124,2,131,1,124, + 4,141,1,130,1,124,0,100,7,100,1,133,2,25,0,83, + 0,41,16,97,122,1,0,0,86,97,108,105,100,97,116,101, + 32,116,104,101,32,104,101,97,100,101,114,32,111,102,32,116, + 104,101,32,112,97,115,115,101,100,45,105,110,32,98,121,116, + 101,99,111,100,101,32,97,103,97,105,110,115,116,32,115,111, + 117,114,99,101,95,115,116,97,116,115,32,40,105,102,10,32, + 32,32,32,103,105,118,101,110,41,32,97,110,100,32,114,101, + 116,117,114,110,105,110,103,32,116,104,101,32,98,121,116,101, + 99,111,100,101,32,116,104,97,116,32,99,97,110,32,98,101, + 32,99,111,109,112,105,108,101,100,32,98,121,32,99,111,109, + 112,105,108,101,40,41,46,10,10,32,32,32,32,65,108,108, + 32,111,116,104,101,114,32,97,114,103,117,109,101,110,116,115, + 32,97,114,101,32,117,115,101,100,32,116,111,32,101,110,104, + 97,110,99,101,32,101,114,114,111,114,32,114,101,112,111,114, + 116,105,110,103,46,10,10,32,32,32,32,73,109,112,111,114, + 116,69,114,114,111,114,32,105,115,32,114,97,105,115,101,100, + 32,119,104,101,110,32,116,104,101,32,109,97,103,105,99,32, + 110,117,109,98,101,114,32,105,115,32,105,110,99,111,114,114, + 101,99,116,32,111,114,32,116,104,101,32,98,121,116,101,99, + 111,100,101,32,105,115,10,32,32,32,32,102,111,117,110,100, + 32,116,111,32,98,101,32,115,116,97,108,101,46,32,69,79, + 70,69,114,114,111,114,32,105,115,32,114,97,105,115,101,100, + 32,119,104,101,110,32,116,104,101,32,100,97,116,97,32,105, + 115,32,102,111,117,110,100,32,116,111,32,98,101,10,32,32, + 32,32,116,114,117,110,99,97,116,101,100,46,10,10,32,32, + 32,32,78,114,98,0,0,0,122,10,60,98,121,116,101,99, + 111,100,101,62,114,35,0,0,0,114,12,0,0,0,233,8, + 0,0,0,233,12,0,0,0,122,30,98,97,100,32,109,97, + 103,105,99,32,110,117,109,98,101,114,32,105,110,32,123,33, + 114,125,58,32,123,33,114,125,122,2,123,125,122,43,114,101, + 97,99,104,101,100,32,69,79,70,32,119,104,105,108,101,32, + 114,101,97,100,105,110,103,32,116,105,109,101,115,116,97,109, + 112,32,105,110,32,123,33,114,125,122,48,114,101,97,99,104, + 101,100,32,69,79,70,32,119,104,105,108,101,32,114,101,97, + 100,105,110,103,32,115,105,122,101,32,111,102,32,115,111,117, + 114,99,101,32,105,110,32,123,33,114,125,218,5,109,116,105, + 109,101,122,26,98,121,116,101,99,111,100,101,32,105,115,32, + 115,116,97,108,101,32,102,111,114,32,123,33,114,125,218,4, + 115,105,122,101,108,3,0,0,0,255,127,255,127,3,0,41, + 10,218,12,77,65,71,73,67,95,78,85,77,66,69,82,114, + 47,0,0,0,114,114,0,0,0,218,16,95,118,101,114,98, + 111,115,101,95,109,101,115,115,97,103,101,114,99,0,0,0, + 114,31,0,0,0,218,8,69,79,70,69,114,114,111,114,114, + 14,0,0,0,218,8,75,101,121,69,114,114,111,114,114,19, + 0,0,0,41,11,114,53,0,0,0,218,12,115,111,117,114, + 99,101,95,115,116,97,116,115,114,98,0,0,0,114,35,0, + 0,0,90,11,101,120,99,95,100,101,116,97,105,108,115,90, + 5,109,97,103,105,99,90,13,114,97,119,95,116,105,109,101, + 115,116,97,109,112,90,8,114,97,119,95,115,105,122,101,114, + 75,0,0,0,218,12,115,111,117,114,99,101,95,109,116,105, + 109,101,218,11,115,111,117,114,99,101,95,115,105,122,101,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,25, + 95,118,97,108,105,100,97,116,101,95,98,121,116,101,99,111, + 100,101,95,104,101,97,100,101,114,158,1,0,0,115,76,0, + 0,0,0,11,4,1,8,1,10,3,4,1,8,1,8,1, + 12,1,12,1,12,1,8,1,12,1,12,1,12,1,12,1, + 10,1,12,1,10,1,12,1,10,1,12,1,8,1,10,1, + 2,1,16,1,14,1,6,2,14,1,10,1,12,1,10,1, + 2,1,16,1,16,1,6,2,14,1,10,1,6,1,114,135, + 0,0,0,99,4,0,0,0,0,0,0,0,5,0,0,0, + 6,0,0,0,67,0,0,0,115,86,0,0,0,116,0,106, + 1,124,0,131,1,125,4,116,2,124,4,116,3,131,2,114, + 58,116,4,106,5,100,1,124,2,131,2,1,0,124,3,100, + 2,107,9,114,52,116,6,106,7,124,4,124,3,131,2,1, + 0,124,4,83,0,110,24,116,8,100,3,106,9,124,2,131, + 1,100,4,124,1,100,5,124,2,144,2,131,1,130,1,100, + 2,83,0,41,6,122,60,67,111,109,112,105,108,101,32,98, + 121,116,101,99,111,100,101,32,97,115,32,114,101,116,117,114, + 110,101,100,32,98,121,32,95,118,97,108,105,100,97,116,101, + 95,98,121,116,101,99,111,100,101,95,104,101,97,100,101,114, + 40,41,46,122,21,99,111,100,101,32,111,98,106,101,99,116, + 32,102,114,111,109,32,123,33,114,125,78,122,23,78,111,110, + 45,99,111,100,101,32,111,98,106,101,99,116,32,105,110,32, + 123,33,114,125,114,98,0,0,0,114,35,0,0,0,41,10, + 218,7,109,97,114,115,104,97,108,90,5,108,111,97,100,115, + 218,10,105,115,105,110,115,116,97,110,99,101,218,10,95,99, + 111,100,101,95,116,121,112,101,114,114,0,0,0,114,129,0, + 0,0,218,4,95,105,109,112,90,16,95,102,105,120,95,99, + 111,95,102,105,108,101,110,97,109,101,114,99,0,0,0,114, + 47,0,0,0,41,5,114,53,0,0,0,114,98,0,0,0, + 114,89,0,0,0,114,90,0,0,0,218,4,99,111,100,101, + 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, + 17,95,99,111,109,112,105,108,101,95,98,121,116,101,99,111, + 100,101,213,1,0,0,115,16,0,0,0,0,2,10,1,10, + 1,12,1,8,1,12,1,6,2,12,1,114,141,0,0,0, + 114,59,0,0,0,99,3,0,0,0,0,0,0,0,4,0, + 0,0,3,0,0,0,67,0,0,0,115,56,0,0,0,116, + 0,116,1,131,1,125,3,124,3,106,2,116,3,124,1,131, + 1,131,1,1,0,124,3,106,2,116,3,124,2,131,1,131, + 1,1,0,124,3,106,2,116,4,106,5,124,0,131,1,131, + 1,1,0,124,3,83,0,41,1,122,80,67,111,109,112,105, + 108,101,32,97,32,99,111,100,101,32,111,98,106,101,99,116, + 32,105,110,116,111,32,98,121,116,101,99,111,100,101,32,102, + 111,114,32,119,114,105,116,105,110,103,32,111,117,116,32,116, + 111,32,97,32,98,121,116,101,45,99,111,109,112,105,108,101, + 100,10,32,32,32,32,102,105,108,101,46,41,6,218,9,98, + 121,116,101,97,114,114,97,121,114,128,0,0,0,218,6,101, + 120,116,101,110,100,114,17,0,0,0,114,136,0,0,0,90, + 5,100,117,109,112,115,41,4,114,140,0,0,0,114,126,0, + 0,0,114,134,0,0,0,114,53,0,0,0,114,4,0,0, + 0,114,4,0,0,0,114,5,0,0,0,218,17,95,99,111, + 100,101,95,116,111,95,98,121,116,101,99,111,100,101,225,1, + 0,0,115,10,0,0,0,0,3,8,1,14,1,14,1,16, + 1,114,144,0,0,0,99,1,0,0,0,0,0,0,0,5, + 0,0,0,4,0,0,0,67,0,0,0,115,62,0,0,0, + 100,1,100,2,108,0,125,1,116,1,106,2,124,0,131,1, + 106,3,125,2,124,1,106,4,124,2,131,1,125,3,116,1, + 106,5,100,2,100,3,131,2,125,4,124,4,106,6,124,0, + 106,6,124,3,100,1,25,0,131,1,131,1,83,0,41,4, + 122,121,68,101,99,111,100,101,32,98,121,116,101,115,32,114, + 101,112,114,101,115,101,110,116,105,110,103,32,115,111,117,114, + 99,101,32,99,111,100,101,32,97,110,100,32,114,101,116,117, + 114,110,32,116,104,101,32,115,116,114,105,110,103,46,10,10, + 32,32,32,32,85,110,105,118,101,114,115,97,108,32,110,101, + 119,108,105,110,101,32,115,117,112,112,111,114,116,32,105,115, + 32,117,115,101,100,32,105,110,32,116,104,101,32,100,101,99, + 111,100,105,110,103,46,10,32,32,32,32,114,59,0,0,0, + 78,84,41,7,218,8,116,111,107,101,110,105,122,101,114,49, + 0,0,0,90,7,66,121,116,101,115,73,79,90,8,114,101, + 97,100,108,105,110,101,90,15,100,101,116,101,99,116,95,101, + 110,99,111,100,105,110,103,90,25,73,110,99,114,101,109,101, + 110,116,97,108,78,101,119,108,105,110,101,68,101,99,111,100, + 101,114,218,6,100,101,99,111,100,101,41,5,218,12,115,111, + 117,114,99,101,95,98,121,116,101,115,114,145,0,0,0,90, + 21,115,111,117,114,99,101,95,98,121,116,101,115,95,114,101, + 97,100,108,105,110,101,218,8,101,110,99,111,100,105,110,103, + 90,15,110,101,119,108,105,110,101,95,100,101,99,111,100,101, + 114,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, + 218,13,100,101,99,111,100,101,95,115,111,117,114,99,101,235, + 1,0,0,115,10,0,0,0,0,5,8,1,12,1,10,1, + 12,1,114,149,0,0,0,114,120,0,0,0,218,26,115,117, + 98,109,111,100,117,108,101,95,115,101,97,114,99,104,95,108, + 111,99,97,116,105,111,110,115,99,2,0,0,0,2,0,0, + 0,9,0,0,0,19,0,0,0,67,0,0,0,115,8,1, + 0,0,124,1,100,1,107,8,114,58,100,2,125,1,116,0, + 124,2,100,3,131,2,114,58,121,14,124,2,106,1,124,0, + 131,1,125,1,87,0,110,20,4,0,116,2,107,10,114,56, + 1,0,1,0,1,0,89,0,110,2,88,0,116,3,106,4, + 124,0,124,2,100,4,124,1,144,1,131,2,125,4,100,5, + 124,4,95,5,124,2,100,1,107,8,114,146,120,54,116,6, + 131,0,68,0,93,40,92,2,125,5,125,6,124,1,106,7, + 116,8,124,6,131,1,131,1,114,98,124,5,124,0,124,1, + 131,2,125,2,124,2,124,4,95,9,80,0,113,98,87,0, + 100,1,83,0,124,3,116,10,107,8,114,212,116,0,124,2, + 100,6,131,2,114,218,121,14,124,2,106,11,124,0,131,1, + 125,7,87,0,110,20,4,0,116,2,107,10,114,198,1,0, + 1,0,1,0,89,0,113,218,88,0,124,7,114,218,103,0, + 124,4,95,12,110,6,124,3,124,4,95,12,124,4,106,12, + 103,0,107,2,144,1,114,4,124,1,144,1,114,4,116,13, + 124,1,131,1,100,7,25,0,125,8,124,4,106,12,106,14, + 124,8,131,1,1,0,124,4,83,0,41,8,97,61,1,0, + 0,82,101,116,117,114,110,32,97,32,109,111,100,117,108,101, + 32,115,112,101,99,32,98,97,115,101,100,32,111,110,32,97, + 32,102,105,108,101,32,108,111,99,97,116,105,111,110,46,10, + 10,32,32,32,32,84,111,32,105,110,100,105,99,97,116,101, + 32,116,104,97,116,32,116,104,101,32,109,111,100,117,108,101, + 32,105,115,32,97,32,112,97,99,107,97,103,101,44,32,115, + 101,116,10,32,32,32,32,115,117,98,109,111,100,117,108,101, + 95,115,101,97,114,99,104,95,108,111,99,97,116,105,111,110, + 115,32,116,111,32,97,32,108,105,115,116,32,111,102,32,100, + 105,114,101,99,116,111,114,121,32,112,97,116,104,115,46,32, + 32,65,110,10,32,32,32,32,101,109,112,116,121,32,108,105, + 115,116,32,105,115,32,115,117,102,102,105,99,105,101,110,116, + 44,32,116,104,111,117,103,104,32,105,116,115,32,110,111,116, + 32,111,116,104,101,114,119,105,115,101,32,117,115,101,102,117, + 108,32,116,111,32,116,104,101,10,32,32,32,32,105,109,112, + 111,114,116,32,115,121,115,116,101,109,46,10,10,32,32,32, + 32,84,104,101,32,108,111,97,100,101,114,32,109,117,115,116, + 32,116,97,107,101,32,97,32,115,112,101,99,32,97,115,32, + 105,116,115,32,111,110,108,121,32,95,95,105,110,105,116,95, + 95,40,41,32,97,114,103,46,10,10,32,32,32,32,78,122, + 9,60,117,110,107,110,111,119,110,62,218,12,103,101,116,95, + 102,105,108,101,110,97,109,101,218,6,111,114,105,103,105,110, + 84,218,10,105,115,95,112,97,99,107,97,103,101,114,59,0, + 0,0,41,15,114,108,0,0,0,114,151,0,0,0,114,99, + 0,0,0,114,114,0,0,0,218,10,77,111,100,117,108,101, + 83,112,101,99,90,13,95,115,101,116,95,102,105,108,101,97, + 116,116,114,218,27,95,103,101,116,95,115,117,112,112,111,114, + 116,101,100,95,102,105,108,101,95,108,111,97,100,101,114,115, + 114,92,0,0,0,114,93,0,0,0,114,120,0,0,0,218, + 9,95,80,79,80,85,76,65,84,69,114,153,0,0,0,114, + 150,0,0,0,114,38,0,0,0,218,6,97,112,112,101,110, + 100,41,9,114,98,0,0,0,90,8,108,111,99,97,116,105, + 111,110,114,120,0,0,0,114,150,0,0,0,218,4,115,112, + 101,99,218,12,108,111,97,100,101,114,95,99,108,97,115,115, + 218,8,115,117,102,102,105,120,101,115,114,153,0,0,0,90, + 7,100,105,114,110,97,109,101,114,4,0,0,0,114,4,0, + 0,0,114,5,0,0,0,218,23,115,112,101,99,95,102,114, + 111,109,95,102,105,108,101,95,108,111,99,97,116,105,111,110, + 252,1,0,0,115,60,0,0,0,0,12,8,4,4,1,10, + 2,2,1,14,1,14,1,6,8,18,1,6,3,8,1,16, + 1,14,1,10,1,6,1,6,2,4,3,8,2,10,1,2, + 1,14,1,14,1,6,2,4,1,8,2,6,1,12,1,6, + 1,12,1,12,2,114,161,0,0,0,99,0,0,0,0,0, + 0,0,0,0,0,0,0,5,0,0,0,64,0,0,0,115, + 82,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 100,2,90,4,100,3,90,5,100,4,90,6,101,7,100,5, + 100,6,132,0,131,1,90,8,101,7,100,7,100,8,132,0, + 131,1,90,9,101,7,100,9,100,9,100,10,100,11,132,2, + 131,1,90,10,101,7,100,9,100,12,100,13,132,1,131,1, + 90,11,100,9,83,0,41,14,218,21,87,105,110,100,111,119, + 115,82,101,103,105,115,116,114,121,70,105,110,100,101,114,122, + 62,77,101,116,97,32,112,97,116,104,32,102,105,110,100,101, + 114,32,102,111,114,32,109,111,100,117,108,101,115,32,100,101, + 99,108,97,114,101,100,32,105,110,32,116,104,101,32,87,105, + 110,100,111,119,115,32,114,101,103,105,115,116,114,121,46,122, + 59,83,111,102,116,119,97,114,101,92,80,121,116,104,111,110, + 92,80,121,116,104,111,110,67,111,114,101,92,123,115,121,115, + 95,118,101,114,115,105,111,110,125,92,77,111,100,117,108,101, + 115,92,123,102,117,108,108,110,97,109,101,125,122,65,83,111, + 102,116,119,97,114,101,92,80,121,116,104,111,110,92,80,121, + 116,104,111,110,67,111,114,101,92,123,115,121,115,95,118,101, + 114,115,105,111,110,125,92,77,111,100,117,108,101,115,92,123, + 102,117,108,108,110,97,109,101,125,92,68,101,98,117,103,70, + 99,2,0,0,0,0,0,0,0,2,0,0,0,11,0,0, + 0,67,0,0,0,115,50,0,0,0,121,14,116,0,106,1, + 116,0,106,2,124,1,131,2,83,0,4,0,116,3,107,10, + 114,44,1,0,1,0,1,0,116,0,106,1,116,0,106,4, + 124,1,131,2,83,0,88,0,100,0,83,0,41,1,78,41, + 5,218,7,95,119,105,110,114,101,103,90,7,79,112,101,110, + 75,101,121,90,17,72,75,69,89,95,67,85,82,82,69,78, + 84,95,85,83,69,82,114,40,0,0,0,90,18,72,75,69, + 89,95,76,79,67,65,76,95,77,65,67,72,73,78,69,41, + 2,218,3,99,108,115,218,3,107,101,121,114,4,0,0,0, + 114,4,0,0,0,114,5,0,0,0,218,14,95,111,112,101, + 110,95,114,101,103,105,115,116,114,121,74,2,0,0,115,8, + 0,0,0,0,2,2,1,14,1,14,1,122,36,87,105,110, + 100,111,119,115,82,101,103,105,115,116,114,121,70,105,110,100, + 101,114,46,95,111,112,101,110,95,114,101,103,105,115,116,114, + 121,99,2,0,0,0,0,0,0,0,6,0,0,0,16,0, + 0,0,67,0,0,0,115,116,0,0,0,124,0,106,0,114, + 14,124,0,106,1,125,2,110,6,124,0,106,2,125,2,124, + 2,106,3,100,1,124,1,100,2,100,3,116,4,106,5,100, + 0,100,4,133,2,25,0,22,0,144,2,131,0,125,3,121, + 38,124,0,106,6,124,3,131,1,143,18,125,4,116,7,106, + 8,124,4,100,5,131,2,125,5,87,0,100,0,81,0,82, + 0,88,0,87,0,110,20,4,0,116,9,107,10,114,110,1, + 0,1,0,1,0,100,0,83,0,88,0,124,5,83,0,41, + 6,78,114,119,0,0,0,90,11,115,121,115,95,118,101,114, + 115,105,111,110,122,5,37,100,46,37,100,114,56,0,0,0, + 114,30,0,0,0,41,10,218,11,68,69,66,85,71,95,66, + 85,73,76,68,218,18,82,69,71,73,83,84,82,89,95,75, + 69,89,95,68,69,66,85,71,218,12,82,69,71,73,83,84, + 82,89,95,75,69,89,114,47,0,0,0,114,7,0,0,0, + 218,12,118,101,114,115,105,111,110,95,105,110,102,111,114,166, + 0,0,0,114,163,0,0,0,90,10,81,117,101,114,121,86, + 97,108,117,101,114,40,0,0,0,41,6,114,164,0,0,0, + 114,119,0,0,0,90,12,114,101,103,105,115,116,114,121,95, + 107,101,121,114,165,0,0,0,90,4,104,107,101,121,218,8, + 102,105,108,101,112,97,116,104,114,4,0,0,0,114,4,0, + 0,0,114,5,0,0,0,218,16,95,115,101,97,114,99,104, + 95,114,101,103,105,115,116,114,121,81,2,0,0,115,22,0, + 0,0,0,2,6,1,8,2,6,1,10,1,22,1,2,1, + 12,1,26,1,14,1,6,1,122,38,87,105,110,100,111,119, + 115,82,101,103,105,115,116,114,121,70,105,110,100,101,114,46, + 95,115,101,97,114,99,104,95,114,101,103,105,115,116,114,121, + 78,99,4,0,0,0,0,0,0,0,8,0,0,0,14,0, + 0,0,67,0,0,0,115,122,0,0,0,124,0,106,0,124, + 1,131,1,125,4,124,4,100,0,107,8,114,22,100,0,83, + 0,121,12,116,1,124,4,131,1,1,0,87,0,110,20,4, + 0,116,2,107,10,114,54,1,0,1,0,1,0,100,0,83, + 0,88,0,120,60,116,3,131,0,68,0,93,50,92,2,125, + 5,125,6,124,4,106,4,116,5,124,6,131,1,131,1,114, + 64,116,6,106,7,124,1,124,5,124,1,124,4,131,2,100, + 1,124,4,144,1,131,2,125,7,124,7,83,0,113,64,87, + 0,100,0,83,0,41,2,78,114,152,0,0,0,41,8,114, + 172,0,0,0,114,39,0,0,0,114,40,0,0,0,114,155, + 0,0,0,114,92,0,0,0,114,93,0,0,0,114,114,0, + 0,0,218,16,115,112,101,99,95,102,114,111,109,95,108,111, + 97,100,101,114,41,8,114,164,0,0,0,114,119,0,0,0, + 114,35,0,0,0,218,6,116,97,114,103,101,116,114,171,0, + 0,0,114,120,0,0,0,114,160,0,0,0,114,158,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, + 218,9,102,105,110,100,95,115,112,101,99,96,2,0,0,115, + 26,0,0,0,0,2,10,1,8,1,4,1,2,1,12,1, + 14,1,6,1,16,1,14,1,6,1,10,1,8,1,122,31, 87,105,110,100,111,119,115,82,101,103,105,115,116,114,121,70, - 105,110,100,101,114,46,95,111,112,101,110,95,114,101,103,105, - 115,116,114,121,99,2,0,0,0,0,0,0,0,6,0,0, - 0,16,0,0,0,67,0,0,0,115,147,0,0,0,124,0, - 0,106,0,0,114,21,0,124,0,0,106,1,0,125,2,0, - 110,9,0,124,0,0,106,2,0,125,2,0,124,2,0,106, - 3,0,100,1,0,124,1,0,100,2,0,100,3,0,116,4, - 0,106,5,0,100,0,0,100,4,0,133,2,0,25,22,131, - 0,2,125,3,0,121,47,0,124,0,0,106,6,0,124,3, - 0,131,1,0,143,25,0,125,4,0,116,7,0,106,8,0, - 124,4,0,100,5,0,131,2,0,125,5,0,87,100,0,0, - 81,82,88,87,110,22,0,4,116,9,0,107,10,0,114,142, - 0,1,1,1,100,0,0,83,89,110,1,0,88,124,5,0, - 83,41,6,78,114,119,0,0,0,90,11,115,121,115,95,118, - 101,114,115,105,111,110,122,5,37,100,46,37,100,114,56,0, - 0,0,114,30,0,0,0,41,10,218,11,68,69,66,85,71, - 95,66,85,73,76,68,218,18,82,69,71,73,83,84,82,89, - 95,75,69,89,95,68,69,66,85,71,218,12,82,69,71,73, - 83,84,82,89,95,75,69,89,114,47,0,0,0,114,7,0, - 0,0,218,12,118,101,114,115,105,111,110,95,105,110,102,111, - 114,166,0,0,0,114,163,0,0,0,90,10,81,117,101,114, - 121,86,97,108,117,101,114,40,0,0,0,41,6,114,164,0, - 0,0,114,119,0,0,0,90,12,114,101,103,105,115,116,114, - 121,95,107,101,121,114,165,0,0,0,90,4,104,107,101,121, - 218,8,102,105,108,101,112,97,116,104,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,218,16,95,115,101,97,114, - 99,104,95,114,101,103,105,115,116,114,121,80,2,0,0,115, - 22,0,0,0,0,2,9,1,12,2,9,1,15,1,26,1, - 3,1,18,1,29,1,13,1,9,1,122,38,87,105,110,100, - 111,119,115,82,101,103,105,115,116,114,121,70,105,110,100,101, - 114,46,95,115,101,97,114,99,104,95,114,101,103,105,115,116, - 114,121,78,99,4,0,0,0,0,0,0,0,8,0,0,0, - 14,0,0,0,67,0,0,0,115,158,0,0,0,124,0,0, - 106,0,0,124,1,0,131,1,0,125,4,0,124,4,0,100, - 0,0,107,8,0,114,31,0,100,0,0,83,121,14,0,116, - 1,0,124,4,0,131,1,0,1,87,110,22,0,4,116,2, - 0,107,10,0,114,69,0,1,1,1,100,0,0,83,89,110, - 1,0,88,120,81,0,116,3,0,131,0,0,68,93,70,0, - 92,2,0,125,5,0,125,6,0,124,4,0,106,4,0,116, - 5,0,124,6,0,131,1,0,131,1,0,114,80,0,116,6, - 0,106,7,0,124,1,0,124,5,0,124,1,0,124,4,0, - 131,2,0,100,1,0,124,4,0,131,2,1,125,7,0,124, - 7,0,83,113,80,0,87,100,0,0,83,41,2,78,114,152, - 0,0,0,41,8,114,172,0,0,0,114,39,0,0,0,114, - 40,0,0,0,114,155,0,0,0,114,92,0,0,0,114,93, - 0,0,0,114,114,0,0,0,218,16,115,112,101,99,95,102, - 114,111,109,95,108,111,97,100,101,114,41,8,114,164,0,0, - 0,114,119,0,0,0,114,35,0,0,0,218,6,116,97,114, - 103,101,116,114,171,0,0,0,114,120,0,0,0,114,160,0, - 0,0,114,158,0,0,0,114,4,0,0,0,114,4,0,0, - 0,114,5,0,0,0,218,9,102,105,110,100,95,115,112,101, - 99,95,2,0,0,115,26,0,0,0,0,2,15,1,12,1, - 4,1,3,1,14,1,13,1,9,1,22,1,21,1,9,1, - 15,1,9,1,122,31,87,105,110,100,111,119,115,82,101,103, - 105,115,116,114,121,70,105,110,100,101,114,46,102,105,110,100, - 95,115,112,101,99,99,3,0,0,0,0,0,0,0,4,0, - 0,0,3,0,0,0,67,0,0,0,115,45,0,0,0,124, - 0,0,106,0,0,124,1,0,124,2,0,131,2,0,125,3, - 0,124,3,0,100,1,0,107,9,0,114,37,0,124,3,0, - 106,1,0,83,100,1,0,83,100,1,0,83,41,2,122,108, - 70,105,110,100,32,109,111,100,117,108,101,32,110,97,109,101, - 100,32,105,110,32,116,104,101,32,114,101,103,105,115,116,114, - 121,46,10,10,32,32,32,32,32,32,32,32,84,104,105,115, - 32,109,101,116,104,111,100,32,105,115,32,100,101,112,114,101, - 99,97,116,101,100,46,32,32,85,115,101,32,101,120,101,99, - 95,109,111,100,117,108,101,40,41,32,105,110,115,116,101,97, - 100,46,10,10,32,32,32,32,32,32,32,32,78,41,2,114, - 175,0,0,0,114,120,0,0,0,41,4,114,164,0,0,0, - 114,119,0,0,0,114,35,0,0,0,114,158,0,0,0,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,11, - 102,105,110,100,95,109,111,100,117,108,101,111,2,0,0,115, - 8,0,0,0,0,7,18,1,12,1,7,2,122,33,87,105, - 110,100,111,119,115,82,101,103,105,115,116,114,121,70,105,110, - 100,101,114,46,102,105,110,100,95,109,111,100,117,108,101,41, - 12,114,105,0,0,0,114,104,0,0,0,114,106,0,0,0, - 114,107,0,0,0,114,169,0,0,0,114,168,0,0,0,114, - 167,0,0,0,218,11,99,108,97,115,115,109,101,116,104,111, - 100,114,166,0,0,0,114,172,0,0,0,114,175,0,0,0, - 114,176,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,162,0,0,0,61,2, - 0,0,115,20,0,0,0,12,2,6,3,6,3,6,2,6, - 2,18,7,18,15,3,1,21,15,3,1,114,162,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,64,0,0,0,115,70,0,0,0,101,0,0,90,1,0, - 100,0,0,90,2,0,100,1,0,90,3,0,100,2,0,100, - 3,0,132,0,0,90,4,0,100,4,0,100,5,0,132,0, - 0,90,5,0,100,6,0,100,7,0,132,0,0,90,6,0, - 100,8,0,100,9,0,132,0,0,90,7,0,100,10,0,83, - 41,11,218,13,95,76,111,97,100,101,114,66,97,115,105,99, - 115,122,83,66,97,115,101,32,99,108,97,115,115,32,111,102, - 32,99,111,109,109,111,110,32,99,111,100,101,32,110,101,101, - 100,101,100,32,98,121,32,98,111,116,104,32,83,111,117,114, - 99,101,76,111,97,100,101,114,32,97,110,100,10,32,32,32, - 32,83,111,117,114,99,101,108,101,115,115,70,105,108,101,76, - 111,97,100,101,114,46,99,2,0,0,0,0,0,0,0,5, - 0,0,0,3,0,0,0,67,0,0,0,115,88,0,0,0, - 116,0,0,124,0,0,106,1,0,124,1,0,131,1,0,131, - 1,0,100,1,0,25,125,2,0,124,2,0,106,2,0,100, - 2,0,100,1,0,131,2,0,100,3,0,25,125,3,0,124, - 1,0,106,3,0,100,2,0,131,1,0,100,4,0,25,125, - 4,0,124,3,0,100,5,0,107,2,0,111,87,0,124,4, - 0,100,5,0,107,3,0,83,41,6,122,141,67,111,110,99, - 114,101,116,101,32,105,109,112,108,101,109,101,110,116,97,116, - 105,111,110,32,111,102,32,73,110,115,112,101,99,116,76,111, - 97,100,101,114,46,105,115,95,112,97,99,107,97,103,101,32, - 98,121,32,99,104,101,99,107,105,110,103,32,105,102,10,32, - 32,32,32,32,32,32,32,116,104,101,32,112,97,116,104,32, - 114,101,116,117,114,110,101,100,32,98,121,32,103,101,116,95, - 102,105,108,101,110,97,109,101,32,104,97,115,32,97,32,102, - 105,108,101,110,97,109,101,32,111,102,32,39,95,95,105,110, - 105,116,95,95,46,112,121,39,46,114,29,0,0,0,114,58, - 0,0,0,114,59,0,0,0,114,56,0,0,0,218,8,95, - 95,105,110,105,116,95,95,41,4,114,38,0,0,0,114,151, - 0,0,0,114,34,0,0,0,114,32,0,0,0,41,5,114, - 100,0,0,0,114,119,0,0,0,114,94,0,0,0,90,13, - 102,105,108,101,110,97,109,101,95,98,97,115,101,90,9,116, - 97,105,108,95,110,97,109,101,114,4,0,0,0,114,4,0, - 0,0,114,5,0,0,0,114,153,0,0,0,130,2,0,0, - 115,8,0,0,0,0,3,25,1,22,1,19,1,122,24,95, - 76,111,97,100,101,114,66,97,115,105,99,115,46,105,115,95, - 112,97,99,107,97,103,101,99,2,0,0,0,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, - 0,100,1,0,83,41,2,122,42,85,115,101,32,100,101,102, - 97,117,108,116,32,115,101,109,97,110,116,105,99,115,32,102, - 111,114,32,109,111,100,117,108,101,32,99,114,101,97,116,105, - 111,110,46,78,114,4,0,0,0,41,2,114,100,0,0,0, - 114,158,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,218,13,99,114,101,97,116,101,95,109,111,100, - 117,108,101,138,2,0,0,115,0,0,0,0,122,27,95,76, - 111,97,100,101,114,66,97,115,105,99,115,46,99,114,101,97, - 116,101,95,109,111,100,117,108,101,99,2,0,0,0,0,0, - 0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,80, - 0,0,0,124,0,0,106,0,0,124,1,0,106,1,0,131, - 1,0,125,2,0,124,2,0,100,1,0,107,8,0,114,54, - 0,116,2,0,100,2,0,106,3,0,124,1,0,106,1,0, - 131,1,0,131,1,0,130,1,0,116,4,0,106,5,0,116, - 6,0,124,2,0,124,1,0,106,7,0,131,3,0,1,100, - 1,0,83,41,3,122,19,69,120,101,99,117,116,101,32,116, - 104,101,32,109,111,100,117,108,101,46,78,122,52,99,97,110, - 110,111,116,32,108,111,97,100,32,109,111,100,117,108,101,32, - 123,33,114,125,32,119,104,101,110,32,103,101,116,95,99,111, - 100,101,40,41,32,114,101,116,117,114,110,115,32,78,111,110, - 101,41,8,218,8,103,101,116,95,99,111,100,101,114,105,0, - 0,0,114,99,0,0,0,114,47,0,0,0,114,114,0,0, - 0,218,25,95,99,97,108,108,95,119,105,116,104,95,102,114, - 97,109,101,115,95,114,101,109,111,118,101,100,218,4,101,120, - 101,99,114,111,0,0,0,41,3,114,100,0,0,0,218,6, - 109,111,100,117,108,101,114,140,0,0,0,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,11,101,120,101,99, - 95,109,111,100,117,108,101,141,2,0,0,115,10,0,0,0, - 0,2,18,1,12,1,9,1,15,1,122,25,95,76,111,97, - 100,101,114,66,97,115,105,99,115,46,101,120,101,99,95,109, - 111,100,117,108,101,99,2,0,0,0,0,0,0,0,2,0, - 0,0,3,0,0,0,67,0,0,0,115,16,0,0,0,116, - 0,0,106,1,0,124,0,0,124,1,0,131,2,0,83,41, - 1,122,26,84,104,105,115,32,109,111,100,117,108,101,32,105, - 115,32,100,101,112,114,101,99,97,116,101,100,46,41,2,114, - 114,0,0,0,218,17,95,108,111,97,100,95,109,111,100,117, - 108,101,95,115,104,105,109,41,2,114,100,0,0,0,114,119, - 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, - 0,0,218,11,108,111,97,100,95,109,111,100,117,108,101,149, - 2,0,0,115,2,0,0,0,0,2,122,25,95,76,111,97, - 100,101,114,66,97,115,105,99,115,46,108,111,97,100,95,109, - 111,100,117,108,101,78,41,8,114,105,0,0,0,114,104,0, - 0,0,114,106,0,0,0,114,107,0,0,0,114,153,0,0, - 0,114,180,0,0,0,114,185,0,0,0,114,187,0,0,0, - 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,114,178,0,0,0,125,2,0,0,115,10,0, - 0,0,12,3,6,2,12,8,12,3,12,8,114,178,0,0, - 0,99,0,0,0,0,0,0,0,0,0,0,0,0,4,0, - 0,0,64,0,0,0,115,106,0,0,0,101,0,0,90,1, - 0,100,0,0,90,2,0,100,1,0,100,2,0,132,0,0, - 90,3,0,100,3,0,100,4,0,132,0,0,90,4,0,100, - 5,0,100,6,0,132,0,0,90,5,0,100,7,0,100,8, - 0,132,0,0,90,6,0,100,9,0,100,10,0,132,0,0, - 90,7,0,100,11,0,100,18,0,100,13,0,100,14,0,132, - 0,1,90,8,0,100,15,0,100,16,0,132,0,0,90,9, - 0,100,17,0,83,41,19,218,12,83,111,117,114,99,101,76, - 111,97,100,101,114,99,2,0,0,0,0,0,0,0,2,0, - 0,0,1,0,0,0,67,0,0,0,115,10,0,0,0,116, - 0,0,130,1,0,100,1,0,83,41,2,122,178,79,112,116, - 105,111,110,97,108,32,109,101,116,104,111,100,32,116,104,97, - 116,32,114,101,116,117,114,110,115,32,116,104,101,32,109,111, - 100,105,102,105,99,97,116,105,111,110,32,116,105,109,101,32, - 40,97,110,32,105,110,116,41,32,102,111,114,32,116,104,101, - 10,32,32,32,32,32,32,32,32,115,112,101,99,105,102,105, - 101,100,32,112,97,116,104,44,32,119,104,101,114,101,32,112, - 97,116,104,32,105,115,32,97,32,115,116,114,46,10,10,32, - 32,32,32,32,32,32,32,82,97,105,115,101,115,32,73,79, - 69,114,114,111,114,32,119,104,101,110,32,116,104,101,32,112, - 97,116,104,32,99,97,110,110,111,116,32,98,101,32,104,97, - 110,100,108,101,100,46,10,32,32,32,32,32,32,32,32,78, - 41,1,218,7,73,79,69,114,114,111,114,41,2,114,100,0, - 0,0,114,35,0,0,0,114,4,0,0,0,114,4,0,0, - 0,114,5,0,0,0,218,10,112,97,116,104,95,109,116,105, - 109,101,156,2,0,0,115,2,0,0,0,0,6,122,23,83, - 111,117,114,99,101,76,111,97,100,101,114,46,112,97,116,104, - 95,109,116,105,109,101,99,2,0,0,0,0,0,0,0,2, - 0,0,0,3,0,0,0,67,0,0,0,115,19,0,0,0, - 100,1,0,124,0,0,106,0,0,124,1,0,131,1,0,105, - 1,0,83,41,2,97,170,1,0,0,79,112,116,105,111,110, + 105,110,100,101,114,46,102,105,110,100,95,115,112,101,99,99, + 3,0,0,0,0,0,0,0,4,0,0,0,3,0,0,0, + 67,0,0,0,115,36,0,0,0,124,0,106,0,124,1,124, + 2,131,2,125,3,124,3,100,1,107,9,114,28,124,3,106, + 1,83,0,110,4,100,1,83,0,100,1,83,0,41,2,122, + 108,70,105,110,100,32,109,111,100,117,108,101,32,110,97,109, + 101,100,32,105,110,32,116,104,101,32,114,101,103,105,115,116, + 114,121,46,10,10,32,32,32,32,32,32,32,32,84,104,105, + 115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114, + 101,99,97,116,101,100,46,32,32,85,115,101,32,101,120,101, + 99,95,109,111,100,117,108,101,40,41,32,105,110,115,116,101, + 97,100,46,10,10,32,32,32,32,32,32,32,32,78,41,2, + 114,175,0,0,0,114,120,0,0,0,41,4,114,164,0,0, + 0,114,119,0,0,0,114,35,0,0,0,114,158,0,0,0, + 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, + 11,102,105,110,100,95,109,111,100,117,108,101,112,2,0,0, + 115,8,0,0,0,0,7,12,1,8,1,8,2,122,33,87, + 105,110,100,111,119,115,82,101,103,105,115,116,114,121,70,105, + 110,100,101,114,46,102,105,110,100,95,109,111,100,117,108,101, + 41,12,114,105,0,0,0,114,104,0,0,0,114,106,0,0, + 0,114,107,0,0,0,114,169,0,0,0,114,168,0,0,0, + 114,167,0,0,0,218,11,99,108,97,115,115,109,101,116,104, + 111,100,114,166,0,0,0,114,172,0,0,0,114,175,0,0, + 0,114,176,0,0,0,114,4,0,0,0,114,4,0,0,0, + 114,4,0,0,0,114,5,0,0,0,114,162,0,0,0,62, + 2,0,0,115,20,0,0,0,8,2,4,3,4,3,4,2, + 4,2,12,7,12,15,2,1,14,15,2,1,114,162,0,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,64,0,0,0,115,48,0,0,0,101,0,90,1,100, + 0,90,2,100,1,90,3,100,2,100,3,132,0,90,4,100, + 4,100,5,132,0,90,5,100,6,100,7,132,0,90,6,100, + 8,100,9,132,0,90,7,100,10,83,0,41,11,218,13,95, + 76,111,97,100,101,114,66,97,115,105,99,115,122,83,66,97, + 115,101,32,99,108,97,115,115,32,111,102,32,99,111,109,109, + 111,110,32,99,111,100,101,32,110,101,101,100,101,100,32,98, + 121,32,98,111,116,104,32,83,111,117,114,99,101,76,111,97, + 100,101,114,32,97,110,100,10,32,32,32,32,83,111,117,114, + 99,101,108,101,115,115,70,105,108,101,76,111,97,100,101,114, + 46,99,2,0,0,0,0,0,0,0,5,0,0,0,3,0, + 0,0,67,0,0,0,115,64,0,0,0,116,0,124,0,106, + 1,124,1,131,1,131,1,100,1,25,0,125,2,124,2,106, + 2,100,2,100,1,131,2,100,3,25,0,125,3,124,1,106, + 3,100,2,131,1,100,4,25,0,125,4,124,3,100,5,107, + 2,111,62,124,4,100,5,107,3,83,0,41,6,122,141,67, + 111,110,99,114,101,116,101,32,105,109,112,108,101,109,101,110, + 116,97,116,105,111,110,32,111,102,32,73,110,115,112,101,99, + 116,76,111,97,100,101,114,46,105,115,95,112,97,99,107,97, + 103,101,32,98,121,32,99,104,101,99,107,105,110,103,32,105, + 102,10,32,32,32,32,32,32,32,32,116,104,101,32,112,97, + 116,104,32,114,101,116,117,114,110,101,100,32,98,121,32,103, + 101,116,95,102,105,108,101,110,97,109,101,32,104,97,115,32, + 97,32,102,105,108,101,110,97,109,101,32,111,102,32,39,95, + 95,105,110,105,116,95,95,46,112,121,39,46,114,29,0,0, + 0,114,58,0,0,0,114,59,0,0,0,114,56,0,0,0, + 218,8,95,95,105,110,105,116,95,95,41,4,114,38,0,0, + 0,114,151,0,0,0,114,34,0,0,0,114,32,0,0,0, + 41,5,114,100,0,0,0,114,119,0,0,0,114,94,0,0, + 0,90,13,102,105,108,101,110,97,109,101,95,98,97,115,101, + 90,9,116,97,105,108,95,110,97,109,101,114,4,0,0,0, + 114,4,0,0,0,114,5,0,0,0,114,153,0,0,0,131, + 2,0,0,115,8,0,0,0,0,3,18,1,16,1,14,1, + 122,24,95,76,111,97,100,101,114,66,97,115,105,99,115,46, + 105,115,95,112,97,99,107,97,103,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, + 4,0,0,0,100,1,83,0,41,2,122,42,85,115,101,32, + 100,101,102,97,117,108,116,32,115,101,109,97,110,116,105,99, + 115,32,102,111,114,32,109,111,100,117,108,101,32,99,114,101, + 97,116,105,111,110,46,78,114,4,0,0,0,41,2,114,100, + 0,0,0,114,158,0,0,0,114,4,0,0,0,114,4,0, + 0,0,114,5,0,0,0,218,13,99,114,101,97,116,101,95, + 109,111,100,117,108,101,139,2,0,0,115,0,0,0,0,122, + 27,95,76,111,97,100,101,114,66,97,115,105,99,115,46,99, + 114,101,97,116,101,95,109,111,100,117,108,101,99,2,0,0, + 0,0,0,0,0,3,0,0,0,4,0,0,0,67,0,0, + 0,115,56,0,0,0,124,0,106,0,124,1,106,1,131,1, + 125,2,124,2,100,1,107,8,114,36,116,2,100,2,106,3, + 124,1,106,1,131,1,131,1,130,1,116,4,106,5,116,6, + 124,2,124,1,106,7,131,3,1,0,100,1,83,0,41,3, + 122,19,69,120,101,99,117,116,101,32,116,104,101,32,109,111, + 100,117,108,101,46,78,122,52,99,97,110,110,111,116,32,108, + 111,97,100,32,109,111,100,117,108,101,32,123,33,114,125,32, + 119,104,101,110,32,103,101,116,95,99,111,100,101,40,41,32, + 114,101,116,117,114,110,115,32,78,111,110,101,41,8,218,8, + 103,101,116,95,99,111,100,101,114,105,0,0,0,114,99,0, + 0,0,114,47,0,0,0,114,114,0,0,0,218,25,95,99, + 97,108,108,95,119,105,116,104,95,102,114,97,109,101,115,95, + 114,101,109,111,118,101,100,218,4,101,120,101,99,114,111,0, + 0,0,41,3,114,100,0,0,0,218,6,109,111,100,117,108, + 101,114,140,0,0,0,114,4,0,0,0,114,4,0,0,0, + 114,5,0,0,0,218,11,101,120,101,99,95,109,111,100,117, + 108,101,142,2,0,0,115,10,0,0,0,0,2,12,1,8, + 1,6,1,10,1,122,25,95,76,111,97,100,101,114,66,97, + 115,105,99,115,46,101,120,101,99,95,109,111,100,117,108,101, + 99,2,0,0,0,0,0,0,0,2,0,0,0,3,0,0, + 0,67,0,0,0,115,12,0,0,0,116,0,106,1,124,0, + 124,1,131,2,83,0,41,1,122,26,84,104,105,115,32,109, + 111,100,117,108,101,32,105,115,32,100,101,112,114,101,99,97, + 116,101,100,46,41,2,114,114,0,0,0,218,17,95,108,111, + 97,100,95,109,111,100,117,108,101,95,115,104,105,109,41,2, + 114,100,0,0,0,114,119,0,0,0,114,4,0,0,0,114, + 4,0,0,0,114,5,0,0,0,218,11,108,111,97,100,95, + 109,111,100,117,108,101,150,2,0,0,115,2,0,0,0,0, + 2,122,25,95,76,111,97,100,101,114,66,97,115,105,99,115, + 46,108,111,97,100,95,109,111,100,117,108,101,78,41,8,114, + 105,0,0,0,114,104,0,0,0,114,106,0,0,0,114,107, + 0,0,0,114,153,0,0,0,114,180,0,0,0,114,185,0, + 0,0,114,187,0,0,0,114,4,0,0,0,114,4,0,0, + 0,114,4,0,0,0,114,5,0,0,0,114,178,0,0,0, + 126,2,0,0,115,10,0,0,0,8,3,4,2,8,8,8, + 3,8,8,114,178,0,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,4,0,0,0,64,0,0,0,115,74,0, + 0,0,101,0,90,1,100,0,90,2,100,1,100,2,132,0, + 90,3,100,3,100,4,132,0,90,4,100,5,100,6,132,0, + 90,5,100,7,100,8,132,0,90,6,100,9,100,10,132,0, + 90,7,100,11,100,18,100,13,100,14,144,1,132,0,90,8, + 100,15,100,16,132,0,90,9,100,17,83,0,41,19,218,12, + 83,111,117,114,99,101,76,111,97,100,101,114,99,2,0,0, + 0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, + 0,115,8,0,0,0,116,0,130,1,100,1,83,0,41,2, + 122,178,79,112,116,105,111,110,97,108,32,109,101,116,104,111, + 100,32,116,104,97,116,32,114,101,116,117,114,110,115,32,116, + 104,101,32,109,111,100,105,102,105,99,97,116,105,111,110,32, + 116,105,109,101,32,40,97,110,32,105,110,116,41,32,102,111, + 114,32,116,104,101,10,32,32,32,32,32,32,32,32,115,112, + 101,99,105,102,105,101,100,32,112,97,116,104,44,32,119,104, + 101,114,101,32,112,97,116,104,32,105,115,32,97,32,115,116, + 114,46,10,10,32,32,32,32,32,32,32,32,82,97,105,115, + 101,115,32,73,79,69,114,114,111,114,32,119,104,101,110,32, + 116,104,101,32,112,97,116,104,32,99,97,110,110,111,116,32, + 98,101,32,104,97,110,100,108,101,100,46,10,32,32,32,32, + 32,32,32,32,78,41,1,218,7,73,79,69,114,114,111,114, + 41,2,114,100,0,0,0,114,35,0,0,0,114,4,0,0, + 0,114,4,0,0,0,114,5,0,0,0,218,10,112,97,116, + 104,95,109,116,105,109,101,157,2,0,0,115,2,0,0,0, + 0,6,122,23,83,111,117,114,99,101,76,111,97,100,101,114, + 46,112,97,116,104,95,109,116,105,109,101,99,2,0,0,0, + 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, + 115,14,0,0,0,100,1,124,0,106,0,124,1,131,1,105, + 1,83,0,41,2,97,170,1,0,0,79,112,116,105,111,110, 97,108,32,109,101,116,104,111,100,32,114,101,116,117,114,110, 105,110,103,32,97,32,109,101,116,97,100,97,116,97,32,100, 105,99,116,32,102,111,114,32,116,104,101,32,115,112,101,99, @@ -1115,476 +1040,449 @@ 32,32,32,32,114,126,0,0,0,41,1,114,190,0,0,0, 41,2,114,100,0,0,0,114,35,0,0,0,114,4,0,0, 0,114,4,0,0,0,114,5,0,0,0,218,10,112,97,116, - 104,95,115,116,97,116,115,164,2,0,0,115,2,0,0,0, + 104,95,115,116,97,116,115,165,2,0,0,115,2,0,0,0, 0,11,122,23,83,111,117,114,99,101,76,111,97,100,101,114, 46,112,97,116,104,95,115,116,97,116,115,99,4,0,0,0, 0,0,0,0,4,0,0,0,3,0,0,0,67,0,0,0, - 115,16,0,0,0,124,0,0,106,0,0,124,2,0,124,3, - 0,131,2,0,83,41,1,122,228,79,112,116,105,111,110,97, - 108,32,109,101,116,104,111,100,32,119,104,105,99,104,32,119, - 114,105,116,101,115,32,100,97,116,97,32,40,98,121,116,101, - 115,41,32,116,111,32,97,32,102,105,108,101,32,112,97,116, - 104,32,40,97,32,115,116,114,41,46,10,10,32,32,32,32, - 32,32,32,32,73,109,112,108,101,109,101,110,116,105,110,103, - 32,116,104,105,115,32,109,101,116,104,111,100,32,97,108,108, - 111,119,115,32,102,111,114,32,116,104,101,32,119,114,105,116, - 105,110,103,32,111,102,32,98,121,116,101,99,111,100,101,32, - 102,105,108,101,115,46,10,10,32,32,32,32,32,32,32,32, - 84,104,101,32,115,111,117,114,99,101,32,112,97,116,104,32, - 105,115,32,110,101,101,100,101,100,32,105,110,32,111,114,100, - 101,114,32,116,111,32,99,111,114,114,101,99,116,108,121,32, - 116,114,97,110,115,102,101,114,32,112,101,114,109,105,115,115, - 105,111,110,115,10,32,32,32,32,32,32,32,32,41,1,218, - 8,115,101,116,95,100,97,116,97,41,4,114,100,0,0,0, - 114,90,0,0,0,90,10,99,97,99,104,101,95,112,97,116, - 104,114,53,0,0,0,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,218,15,95,99,97,99,104,101,95,98,121, - 116,101,99,111,100,101,177,2,0,0,115,2,0,0,0,0, - 8,122,28,83,111,117,114,99,101,76,111,97,100,101,114,46, - 95,99,97,99,104,101,95,98,121,116,101,99,111,100,101,99, - 3,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0, - 67,0,0,0,115,4,0,0,0,100,1,0,83,41,2,122, - 150,79,112,116,105,111,110,97,108,32,109,101,116,104,111,100, - 32,119,104,105,99,104,32,119,114,105,116,101,115,32,100,97, - 116,97,32,40,98,121,116,101,115,41,32,116,111,32,97,32, - 102,105,108,101,32,112,97,116,104,32,40,97,32,115,116,114, - 41,46,10,10,32,32,32,32,32,32,32,32,73,109,112,108, - 101,109,101,110,116,105,110,103,32,116,104,105,115,32,109,101, - 116,104,111,100,32,97,108,108,111,119,115,32,102,111,114,32, - 116,104,101,32,119,114,105,116,105,110,103,32,111,102,32,98, - 121,116,101,99,111,100,101,32,102,105,108,101,115,46,10,32, - 32,32,32,32,32,32,32,78,114,4,0,0,0,41,3,114, - 100,0,0,0,114,35,0,0,0,114,53,0,0,0,114,4, - 0,0,0,114,4,0,0,0,114,5,0,0,0,114,192,0, - 0,0,187,2,0,0,115,0,0,0,0,122,21,83,111,117, - 114,99,101,76,111,97,100,101,114,46,115,101,116,95,100,97, - 116,97,99,2,0,0,0,0,0,0,0,5,0,0,0,16, - 0,0,0,67,0,0,0,115,105,0,0,0,124,0,0,106, - 0,0,124,1,0,131,1,0,125,2,0,121,19,0,124,0, - 0,106,1,0,124,2,0,131,1,0,125,3,0,87,110,58, - 0,4,116,2,0,107,10,0,114,94,0,1,125,4,0,1, - 122,26,0,116,3,0,100,1,0,100,2,0,124,1,0,131, - 1,1,124,4,0,130,2,0,87,89,100,3,0,100,3,0, - 125,4,0,126,4,0,88,110,1,0,88,116,4,0,124,3, - 0,131,1,0,83,41,4,122,52,67,111,110,99,114,101,116, - 101,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110, - 32,111,102,32,73,110,115,112,101,99,116,76,111,97,100,101, - 114,46,103,101,116,95,115,111,117,114,99,101,46,122,39,115, - 111,117,114,99,101,32,110,111,116,32,97,118,97,105,108,97, - 98,108,101,32,116,104,114,111,117,103,104,32,103,101,116,95, - 100,97,116,97,40,41,114,98,0,0,0,78,41,5,114,151, - 0,0,0,218,8,103,101,116,95,100,97,116,97,114,40,0, - 0,0,114,99,0,0,0,114,149,0,0,0,41,5,114,100, - 0,0,0,114,119,0,0,0,114,35,0,0,0,114,147,0, - 0,0,218,3,101,120,99,114,4,0,0,0,114,4,0,0, - 0,114,5,0,0,0,218,10,103,101,116,95,115,111,117,114, - 99,101,194,2,0,0,115,14,0,0,0,0,2,15,1,3, - 1,19,1,18,1,9,1,31,1,122,23,83,111,117,114,99, - 101,76,111,97,100,101,114,46,103,101,116,95,115,111,117,114, - 99,101,218,9,95,111,112,116,105,109,105,122,101,114,29,0, - 0,0,99,3,0,0,0,1,0,0,0,4,0,0,0,9, - 0,0,0,67,0,0,0,115,34,0,0,0,116,0,0,106, - 1,0,116,2,0,124,1,0,124,2,0,100,1,0,100,2, - 0,100,3,0,100,4,0,124,3,0,131,4,2,83,41,5, - 122,130,82,101,116,117,114,110,32,116,104,101,32,99,111,100, - 101,32,111,98,106,101,99,116,32,99,111,109,112,105,108,101, - 100,32,102,114,111,109,32,115,111,117,114,99,101,46,10,10, - 32,32,32,32,32,32,32,32,84,104,101,32,39,100,97,116, - 97,39,32,97,114,103,117,109,101,110,116,32,99,97,110,32, - 98,101,32,97,110,121,32,111,98,106,101,99,116,32,116,121, - 112,101,32,116,104,97,116,32,99,111,109,112,105,108,101,40, - 41,32,115,117,112,112,111,114,116,115,46,10,32,32,32,32, - 32,32,32,32,114,183,0,0,0,218,12,100,111,110,116,95, - 105,110,104,101,114,105,116,84,114,68,0,0,0,41,3,114, - 114,0,0,0,114,182,0,0,0,218,7,99,111,109,112,105, - 108,101,41,4,114,100,0,0,0,114,53,0,0,0,114,35, - 0,0,0,114,197,0,0,0,114,4,0,0,0,114,4,0, - 0,0,114,5,0,0,0,218,14,115,111,117,114,99,101,95, - 116,111,95,99,111,100,101,204,2,0,0,115,4,0,0,0, - 0,5,21,1,122,27,83,111,117,114,99,101,76,111,97,100, - 101,114,46,115,111,117,114,99,101,95,116,111,95,99,111,100, - 101,99,2,0,0,0,0,0,0,0,10,0,0,0,43,0, - 0,0,67,0,0,0,115,183,1,0,0,124,0,0,106,0, - 0,124,1,0,131,1,0,125,2,0,100,1,0,125,3,0, - 121,16,0,116,1,0,124,2,0,131,1,0,125,4,0,87, - 110,24,0,4,116,2,0,107,10,0,114,63,0,1,1,1, - 100,1,0,125,4,0,89,110,205,0,88,121,19,0,124,0, - 0,106,3,0,124,2,0,131,1,0,125,5,0,87,110,18, - 0,4,116,4,0,107,10,0,114,103,0,1,1,1,89,110, - 165,0,88,116,5,0,124,5,0,100,2,0,25,131,1,0, - 125,3,0,121,19,0,124,0,0,106,6,0,124,4,0,131, - 1,0,125,6,0,87,110,18,0,4,116,7,0,107,10,0, - 114,159,0,1,1,1,89,110,109,0,88,121,34,0,116,8, - 0,124,6,0,100,3,0,124,5,0,100,4,0,124,1,0, - 100,5,0,124,4,0,131,1,3,125,7,0,87,110,24,0, - 4,116,9,0,116,10,0,102,2,0,107,10,0,114,220,0, - 1,1,1,89,110,48,0,88,116,11,0,106,12,0,100,6, - 0,124,4,0,124,2,0,131,3,0,1,116,13,0,124,7, - 0,100,4,0,124,1,0,100,7,0,124,4,0,100,8,0, - 124,2,0,131,1,3,83,124,0,0,106,6,0,124,2,0, - 131,1,0,125,8,0,124,0,0,106,14,0,124,8,0,124, - 2,0,131,2,0,125,9,0,116,11,0,106,12,0,100,9, - 0,124,2,0,131,2,0,1,116,15,0,106,16,0,12,114, - 179,1,124,4,0,100,1,0,107,9,0,114,179,1,124,3, - 0,100,1,0,107,9,0,114,179,1,116,17,0,124,9,0, - 124,3,0,116,18,0,124,8,0,131,1,0,131,3,0,125, - 6,0,121,39,0,124,0,0,106,19,0,124,2,0,124,4, - 0,124,6,0,131,3,0,1,116,11,0,106,12,0,100,10, - 0,124,4,0,131,2,0,1,87,110,18,0,4,116,2,0, - 107,10,0,114,178,1,1,1,1,89,110,1,0,88,124,9, - 0,83,41,11,122,190,67,111,110,99,114,101,116,101,32,105, - 109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,102, - 32,73,110,115,112,101,99,116,76,111,97,100,101,114,46,103, - 101,116,95,99,111,100,101,46,10,10,32,32,32,32,32,32, - 32,32,82,101,97,100,105,110,103,32,111,102,32,98,121,116, - 101,99,111,100,101,32,114,101,113,117,105,114,101,115,32,112, - 97,116,104,95,115,116,97,116,115,32,116,111,32,98,101,32, - 105,109,112,108,101,109,101,110,116,101,100,46,32,84,111,32, - 119,114,105,116,101,10,32,32,32,32,32,32,32,32,98,121, - 116,101,99,111,100,101,44,32,115,101,116,95,100,97,116,97, - 32,109,117,115,116,32,97,108,115,111,32,98,101,32,105,109, - 112,108,101,109,101,110,116,101,100,46,10,10,32,32,32,32, - 32,32,32,32,78,114,126,0,0,0,114,132,0,0,0,114, - 98,0,0,0,114,35,0,0,0,122,13,123,125,32,109,97, - 116,99,104,101,115,32,123,125,114,89,0,0,0,114,90,0, - 0,0,122,19,99,111,100,101,32,111,98,106,101,99,116,32, - 102,114,111,109,32,123,125,122,10,119,114,111,116,101,32,123, - 33,114,125,41,20,114,151,0,0,0,114,79,0,0,0,114, - 66,0,0,0,114,191,0,0,0,114,189,0,0,0,114,14, - 0,0,0,114,194,0,0,0,114,40,0,0,0,114,135,0, - 0,0,114,99,0,0,0,114,130,0,0,0,114,114,0,0, - 0,114,129,0,0,0,114,141,0,0,0,114,200,0,0,0, - 114,7,0,0,0,218,19,100,111,110,116,95,119,114,105,116, - 101,95,98,121,116,101,99,111,100,101,114,144,0,0,0,114, - 31,0,0,0,114,193,0,0,0,41,10,114,100,0,0,0, - 114,119,0,0,0,114,90,0,0,0,114,133,0,0,0,114, - 89,0,0,0,218,2,115,116,114,53,0,0,0,218,10,98, - 121,116,101,115,95,100,97,116,97,114,147,0,0,0,90,11, - 99,111,100,101,95,111,98,106,101,99,116,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,114,181,0,0,0,212, - 2,0,0,115,78,0,0,0,0,7,15,1,6,1,3,1, - 16,1,13,1,11,2,3,1,19,1,13,1,5,2,16,1, - 3,1,19,1,13,1,5,2,3,1,9,1,12,1,13,1, - 19,1,5,2,12,1,7,1,15,1,6,1,7,1,15,1, - 18,1,16,1,22,1,12,1,9,1,15,1,3,1,19,1, - 20,1,13,1,5,1,122,21,83,111,117,114,99,101,76,111, - 97,100,101,114,46,103,101,116,95,99,111,100,101,78,114,87, - 0,0,0,41,10,114,105,0,0,0,114,104,0,0,0,114, - 106,0,0,0,114,190,0,0,0,114,191,0,0,0,114,193, - 0,0,0,114,192,0,0,0,114,196,0,0,0,114,200,0, - 0,0,114,181,0,0,0,114,4,0,0,0,114,4,0,0, - 0,114,4,0,0,0,114,5,0,0,0,114,188,0,0,0, - 154,2,0,0,115,14,0,0,0,12,2,12,8,12,13,12, - 10,12,7,12,10,18,8,114,188,0,0,0,99,0,0,0, - 0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0, - 0,115,112,0,0,0,101,0,0,90,1,0,100,0,0,90, - 2,0,100,1,0,90,3,0,100,2,0,100,3,0,132,0, - 0,90,4,0,100,4,0,100,5,0,132,0,0,90,5,0, - 100,6,0,100,7,0,132,0,0,90,6,0,101,7,0,135, - 0,0,102,1,0,100,8,0,100,9,0,134,0,0,131,1, - 0,90,8,0,101,7,0,100,10,0,100,11,0,132,0,0, - 131,1,0,90,9,0,100,12,0,100,13,0,132,0,0,90, - 10,0,135,0,0,83,41,14,218,10,70,105,108,101,76,111, - 97,100,101,114,122,103,66,97,115,101,32,102,105,108,101,32, - 108,111,97,100,101,114,32,99,108,97,115,115,32,119,104,105, - 99,104,32,105,109,112,108,101,109,101,110,116,115,32,116,104, - 101,32,108,111,97,100,101,114,32,112,114,111,116,111,99,111, - 108,32,109,101,116,104,111,100,115,32,116,104,97,116,10,32, - 32,32,32,114,101,113,117,105,114,101,32,102,105,108,101,32, - 115,121,115,116,101,109,32,117,115,97,103,101,46,99,3,0, - 0,0,0,0,0,0,3,0,0,0,2,0,0,0,67,0, - 0,0,115,22,0,0,0,124,1,0,124,0,0,95,0,0, - 124,2,0,124,0,0,95,1,0,100,1,0,83,41,2,122, - 75,67,97,99,104,101,32,116,104,101,32,109,111,100,117,108, - 101,32,110,97,109,101,32,97,110,100,32,116,104,101,32,112, - 97,116,104,32,116,111,32,116,104,101,32,102,105,108,101,32, - 102,111,117,110,100,32,98,121,32,116,104,101,10,32,32,32, - 32,32,32,32,32,102,105,110,100,101,114,46,78,41,2,114, - 98,0,0,0,114,35,0,0,0,41,3,114,100,0,0,0, - 114,119,0,0,0,114,35,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,179,0,0,0,13,3, - 0,0,115,4,0,0,0,0,3,9,1,122,19,70,105,108, + 115,12,0,0,0,124,0,106,0,124,2,124,3,131,2,83, + 0,41,1,122,228,79,112,116,105,111,110,97,108,32,109,101, + 116,104,111,100,32,119,104,105,99,104,32,119,114,105,116,101, + 115,32,100,97,116,97,32,40,98,121,116,101,115,41,32,116, + 111,32,97,32,102,105,108,101,32,112,97,116,104,32,40,97, + 32,115,116,114,41,46,10,10,32,32,32,32,32,32,32,32, + 73,109,112,108,101,109,101,110,116,105,110,103,32,116,104,105, + 115,32,109,101,116,104,111,100,32,97,108,108,111,119,115,32, + 102,111,114,32,116,104,101,32,119,114,105,116,105,110,103,32, + 111,102,32,98,121,116,101,99,111,100,101,32,102,105,108,101, + 115,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, + 115,111,117,114,99,101,32,112,97,116,104,32,105,115,32,110, + 101,101,100,101,100,32,105,110,32,111,114,100,101,114,32,116, + 111,32,99,111,114,114,101,99,116,108,121,32,116,114,97,110, + 115,102,101,114,32,112,101,114,109,105,115,115,105,111,110,115, + 10,32,32,32,32,32,32,32,32,41,1,218,8,115,101,116, + 95,100,97,116,97,41,4,114,100,0,0,0,114,90,0,0, + 0,90,10,99,97,99,104,101,95,112,97,116,104,114,53,0, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, + 0,218,15,95,99,97,99,104,101,95,98,121,116,101,99,111, + 100,101,178,2,0,0,115,2,0,0,0,0,8,122,28,83, + 111,117,114,99,101,76,111,97,100,101,114,46,95,99,97,99, + 104,101,95,98,121,116,101,99,111,100,101,99,3,0,0,0, + 0,0,0,0,3,0,0,0,1,0,0,0,67,0,0,0, + 115,4,0,0,0,100,1,83,0,41,2,122,150,79,112,116, + 105,111,110,97,108,32,109,101,116,104,111,100,32,119,104,105, + 99,104,32,119,114,105,116,101,115,32,100,97,116,97,32,40, + 98,121,116,101,115,41,32,116,111,32,97,32,102,105,108,101, + 32,112,97,116,104,32,40,97,32,115,116,114,41,46,10,10, + 32,32,32,32,32,32,32,32,73,109,112,108,101,109,101,110, + 116,105,110,103,32,116,104,105,115,32,109,101,116,104,111,100, + 32,97,108,108,111,119,115,32,102,111,114,32,116,104,101,32, + 119,114,105,116,105,110,103,32,111,102,32,98,121,116,101,99, + 111,100,101,32,102,105,108,101,115,46,10,32,32,32,32,32, + 32,32,32,78,114,4,0,0,0,41,3,114,100,0,0,0, + 114,35,0,0,0,114,53,0,0,0,114,4,0,0,0,114, + 4,0,0,0,114,5,0,0,0,114,192,0,0,0,188,2, + 0,0,115,0,0,0,0,122,21,83,111,117,114,99,101,76, + 111,97,100,101,114,46,115,101,116,95,100,97,116,97,99,2, + 0,0,0,0,0,0,0,5,0,0,0,16,0,0,0,67, + 0,0,0,115,84,0,0,0,124,0,106,0,124,1,131,1, + 125,2,121,14,124,0,106,1,124,2,131,1,125,3,87,0, + 110,50,4,0,116,2,107,10,114,74,1,0,125,4,1,0, + 122,22,116,3,100,1,100,2,124,1,144,1,131,1,124,4, + 130,2,87,0,89,0,100,3,100,3,125,4,126,4,88,0, + 110,2,88,0,116,4,124,3,131,1,83,0,41,4,122,52, + 67,111,110,99,114,101,116,101,32,105,109,112,108,101,109,101, + 110,116,97,116,105,111,110,32,111,102,32,73,110,115,112,101, + 99,116,76,111,97,100,101,114,46,103,101,116,95,115,111,117, + 114,99,101,46,122,39,115,111,117,114,99,101,32,110,111,116, + 32,97,118,97,105,108,97,98,108,101,32,116,104,114,111,117, + 103,104,32,103,101,116,95,100,97,116,97,40,41,114,98,0, + 0,0,78,41,5,114,151,0,0,0,218,8,103,101,116,95, + 100,97,116,97,114,40,0,0,0,114,99,0,0,0,114,149, + 0,0,0,41,5,114,100,0,0,0,114,119,0,0,0,114, + 35,0,0,0,114,147,0,0,0,218,3,101,120,99,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,218,10,103, + 101,116,95,115,111,117,114,99,101,195,2,0,0,115,14,0, + 0,0,0,2,10,1,2,1,14,1,16,1,6,1,28,1, + 122,23,83,111,117,114,99,101,76,111,97,100,101,114,46,103, + 101,116,95,115,111,117,114,99,101,218,9,95,111,112,116,105, + 109,105,122,101,114,29,0,0,0,99,3,0,0,0,1,0, + 0,0,4,0,0,0,9,0,0,0,67,0,0,0,115,26, + 0,0,0,116,0,106,1,116,2,124,1,124,2,100,1,100, + 2,100,3,100,4,124,3,144,2,131,4,83,0,41,5,122, + 130,82,101,116,117,114,110,32,116,104,101,32,99,111,100,101, + 32,111,98,106,101,99,116,32,99,111,109,112,105,108,101,100, + 32,102,114,111,109,32,115,111,117,114,99,101,46,10,10,32, + 32,32,32,32,32,32,32,84,104,101,32,39,100,97,116,97, + 39,32,97,114,103,117,109,101,110,116,32,99,97,110,32,98, + 101,32,97,110,121,32,111,98,106,101,99,116,32,116,121,112, + 101,32,116,104,97,116,32,99,111,109,112,105,108,101,40,41, + 32,115,117,112,112,111,114,116,115,46,10,32,32,32,32,32, + 32,32,32,114,183,0,0,0,218,12,100,111,110,116,95,105, + 110,104,101,114,105,116,84,114,68,0,0,0,41,3,114,114, + 0,0,0,114,182,0,0,0,218,7,99,111,109,112,105,108, + 101,41,4,114,100,0,0,0,114,53,0,0,0,114,35,0, + 0,0,114,197,0,0,0,114,4,0,0,0,114,4,0,0, + 0,114,5,0,0,0,218,14,115,111,117,114,99,101,95,116, + 111,95,99,111,100,101,205,2,0,0,115,4,0,0,0,0, + 5,14,1,122,27,83,111,117,114,99,101,76,111,97,100,101, + 114,46,115,111,117,114,99,101,95,116,111,95,99,111,100,101, + 99,2,0,0,0,0,0,0,0,10,0,0,0,43,0,0, + 0,67,0,0,0,115,106,1,0,0,124,0,106,0,124,1, + 131,1,125,2,100,1,125,3,121,12,116,1,124,2,131,1, + 125,4,87,0,110,24,4,0,116,2,107,10,114,50,1,0, + 1,0,1,0,100,1,125,4,89,0,110,174,88,0,121,14, + 124,0,106,3,124,2,131,1,125,5,87,0,110,20,4,0, + 116,4,107,10,114,86,1,0,1,0,1,0,89,0,110,138, + 88,0,116,5,124,5,100,2,25,0,131,1,125,3,121,14, + 124,0,106,6,124,4,131,1,125,6,87,0,110,20,4,0, + 116,7,107,10,114,134,1,0,1,0,1,0,89,0,110,90, + 88,0,121,26,116,8,124,6,100,3,124,5,100,4,124,1, + 100,5,124,4,144,3,131,1,125,7,87,0,110,24,4,0, + 116,9,116,10,102,2,107,10,114,186,1,0,1,0,1,0, + 89,0,110,38,88,0,116,11,106,12,100,6,124,4,124,2, + 131,3,1,0,116,13,124,7,100,4,124,1,100,7,124,4, + 100,8,124,2,144,3,131,1,83,0,124,0,106,6,124,2, + 131,1,125,8,124,0,106,14,124,8,124,2,131,2,125,9, + 116,11,106,12,100,9,124,2,131,2,1,0,116,15,106,16, + 12,0,144,1,114,102,124,4,100,1,107,9,144,1,114,102, + 124,3,100,1,107,9,144,1,114,102,116,17,124,9,124,3, + 116,18,124,8,131,1,131,3,125,6,121,30,124,0,106,19, + 124,2,124,4,124,6,131,3,1,0,116,11,106,12,100,10, + 124,4,131,2,1,0,87,0,110,22,4,0,116,2,107,10, + 144,1,114,100,1,0,1,0,1,0,89,0,110,2,88,0, + 124,9,83,0,41,11,122,190,67,111,110,99,114,101,116,101, + 32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,32, + 111,102,32,73,110,115,112,101,99,116,76,111,97,100,101,114, + 46,103,101,116,95,99,111,100,101,46,10,10,32,32,32,32, + 32,32,32,32,82,101,97,100,105,110,103,32,111,102,32,98, + 121,116,101,99,111,100,101,32,114,101,113,117,105,114,101,115, + 32,112,97,116,104,95,115,116,97,116,115,32,116,111,32,98, + 101,32,105,109,112,108,101,109,101,110,116,101,100,46,32,84, + 111,32,119,114,105,116,101,10,32,32,32,32,32,32,32,32, + 98,121,116,101,99,111,100,101,44,32,115,101,116,95,100,97, + 116,97,32,109,117,115,116,32,97,108,115,111,32,98,101,32, + 105,109,112,108,101,109,101,110,116,101,100,46,10,10,32,32, + 32,32,32,32,32,32,78,114,126,0,0,0,114,132,0,0, + 0,114,98,0,0,0,114,35,0,0,0,122,13,123,125,32, + 109,97,116,99,104,101,115,32,123,125,114,89,0,0,0,114, + 90,0,0,0,122,19,99,111,100,101,32,111,98,106,101,99, + 116,32,102,114,111,109,32,123,125,122,10,119,114,111,116,101, + 32,123,33,114,125,41,20,114,151,0,0,0,114,79,0,0, + 0,114,66,0,0,0,114,191,0,0,0,114,189,0,0,0, + 114,14,0,0,0,114,194,0,0,0,114,40,0,0,0,114, + 135,0,0,0,114,99,0,0,0,114,130,0,0,0,114,114, + 0,0,0,114,129,0,0,0,114,141,0,0,0,114,200,0, + 0,0,114,7,0,0,0,218,19,100,111,110,116,95,119,114, + 105,116,101,95,98,121,116,101,99,111,100,101,114,144,0,0, + 0,114,31,0,0,0,114,193,0,0,0,41,10,114,100,0, + 0,0,114,119,0,0,0,114,90,0,0,0,114,133,0,0, + 0,114,89,0,0,0,218,2,115,116,114,53,0,0,0,218, + 10,98,121,116,101,115,95,100,97,116,97,114,147,0,0,0, + 90,11,99,111,100,101,95,111,98,106,101,99,116,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,181,0,0, + 0,213,2,0,0,115,78,0,0,0,0,7,10,1,4,1, + 2,1,12,1,14,1,10,2,2,1,14,1,14,1,6,2, + 12,1,2,1,14,1,14,1,6,2,2,1,6,1,8,1, + 12,1,18,1,6,2,8,1,6,1,10,1,4,1,8,1, + 10,1,12,1,12,1,20,1,10,1,6,1,10,1,2,1, + 14,1,16,1,16,1,6,1,122,21,83,111,117,114,99,101, + 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,78, + 114,87,0,0,0,41,10,114,105,0,0,0,114,104,0,0, + 0,114,106,0,0,0,114,190,0,0,0,114,191,0,0,0, + 114,193,0,0,0,114,192,0,0,0,114,196,0,0,0,114, + 200,0,0,0,114,181,0,0,0,114,4,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,114,188,0, + 0,0,155,2,0,0,115,14,0,0,0,8,2,8,8,8, + 13,8,10,8,7,8,10,14,8,114,188,0,0,0,99,0, + 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0, + 0,0,0,115,76,0,0,0,101,0,90,1,100,0,90,2, + 100,1,90,3,100,2,100,3,132,0,90,4,100,4,100,5, + 132,0,90,5,100,6,100,7,132,0,90,6,101,7,135,0, + 102,1,100,8,100,9,134,0,131,1,90,8,101,7,100,10, + 100,11,132,0,131,1,90,9,100,12,100,13,132,0,90,10, + 135,0,83,0,41,14,218,10,70,105,108,101,76,111,97,100, + 101,114,122,103,66,97,115,101,32,102,105,108,101,32,108,111, + 97,100,101,114,32,99,108,97,115,115,32,119,104,105,99,104, + 32,105,109,112,108,101,109,101,110,116,115,32,116,104,101,32, + 108,111,97,100,101,114,32,112,114,111,116,111,99,111,108,32, + 109,101,116,104,111,100,115,32,116,104,97,116,10,32,32,32, + 32,114,101,113,117,105,114,101,32,102,105,108,101,32,115,121, + 115,116,101,109,32,117,115,97,103,101,46,99,3,0,0,0, + 0,0,0,0,3,0,0,0,2,0,0,0,67,0,0,0, + 115,16,0,0,0,124,1,124,0,95,0,124,2,124,0,95, + 1,100,1,83,0,41,2,122,75,67,97,99,104,101,32,116, + 104,101,32,109,111,100,117,108,101,32,110,97,109,101,32,97, + 110,100,32,116,104,101,32,112,97,116,104,32,116,111,32,116, + 104,101,32,102,105,108,101,32,102,111,117,110,100,32,98,121, + 32,116,104,101,10,32,32,32,32,32,32,32,32,102,105,110, + 100,101,114,46,78,41,2,114,98,0,0,0,114,35,0,0, + 0,41,3,114,100,0,0,0,114,119,0,0,0,114,35,0, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, + 0,114,179,0,0,0,14,3,0,0,115,4,0,0,0,0, + 3,6,1,122,19,70,105,108,101,76,111,97,100,101,114,46, + 95,95,105,110,105,116,95,95,99,2,0,0,0,0,0,0, + 0,2,0,0,0,2,0,0,0,67,0,0,0,115,24,0, + 0,0,124,0,106,0,124,1,106,0,107,2,111,22,124,0, + 106,1,124,1,106,1,107,2,83,0,41,1,78,41,2,218, + 9,95,95,99,108,97,115,115,95,95,114,111,0,0,0,41, + 2,114,100,0,0,0,218,5,111,116,104,101,114,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,218,6,95,95, + 101,113,95,95,20,3,0,0,115,4,0,0,0,0,1,12, + 1,122,17,70,105,108,101,76,111,97,100,101,114,46,95,95, + 101,113,95,95,99,1,0,0,0,0,0,0,0,1,0,0, + 0,3,0,0,0,67,0,0,0,115,20,0,0,0,116,0, + 124,0,106,1,131,1,116,0,124,0,106,2,131,1,65,0, + 83,0,41,1,78,41,3,218,4,104,97,115,104,114,98,0, + 0,0,114,35,0,0,0,41,1,114,100,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,218,8,95, + 95,104,97,115,104,95,95,24,3,0,0,115,2,0,0,0, + 0,1,122,19,70,105,108,101,76,111,97,100,101,114,46,95, + 95,104,97,115,104,95,95,99,2,0,0,0,0,0,0,0, + 2,0,0,0,3,0,0,0,3,0,0,0,115,16,0,0, + 0,116,0,116,1,124,0,131,2,106,2,124,1,131,1,83, + 0,41,1,122,100,76,111,97,100,32,97,32,109,111,100,117, + 108,101,32,102,114,111,109,32,97,32,102,105,108,101,46,10, + 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, + 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, + 101,100,46,32,32,85,115,101,32,101,120,101,99,95,109,111, + 100,117,108,101,40,41,32,105,110,115,116,101,97,100,46,10, + 10,32,32,32,32,32,32,32,32,41,3,218,5,115,117,112, + 101,114,114,204,0,0,0,114,187,0,0,0,41,2,114,100, + 0,0,0,114,119,0,0,0,41,1,114,205,0,0,0,114, + 4,0,0,0,114,5,0,0,0,114,187,0,0,0,27,3, + 0,0,115,2,0,0,0,0,10,122,22,70,105,108,101,76, + 111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,108, + 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, + 0,0,67,0,0,0,115,6,0,0,0,124,0,106,0,83, + 0,41,1,122,58,82,101,116,117,114,110,32,116,104,101,32, + 112,97,116,104,32,116,111,32,116,104,101,32,115,111,117,114, + 99,101,32,102,105,108,101,32,97,115,32,102,111,117,110,100, + 32,98,121,32,116,104,101,32,102,105,110,100,101,114,46,41, + 1,114,35,0,0,0,41,2,114,100,0,0,0,114,119,0, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, + 0,114,151,0,0,0,39,3,0,0,115,2,0,0,0,0, + 3,122,23,70,105,108,101,76,111,97,100,101,114,46,103,101, + 116,95,102,105,108,101,110,97,109,101,99,2,0,0,0,0, + 0,0,0,3,0,0,0,9,0,0,0,67,0,0,0,115, + 32,0,0,0,116,0,106,1,124,1,100,1,131,2,143,10, + 125,2,124,2,106,2,131,0,83,0,81,0,82,0,88,0, + 100,2,83,0,41,3,122,39,82,101,116,117,114,110,32,116, + 104,101,32,100,97,116,97,32,102,114,111,109,32,112,97,116, + 104,32,97,115,32,114,97,119,32,98,121,116,101,115,46,218, + 1,114,78,41,3,114,49,0,0,0,114,50,0,0,0,90, + 4,114,101,97,100,41,3,114,100,0,0,0,114,35,0,0, + 0,114,54,0,0,0,114,4,0,0,0,114,4,0,0,0, + 114,5,0,0,0,114,194,0,0,0,44,3,0,0,115,4, + 0,0,0,0,2,14,1,122,19,70,105,108,101,76,111,97, + 100,101,114,46,103,101,116,95,100,97,116,97,41,11,114,105, + 0,0,0,114,104,0,0,0,114,106,0,0,0,114,107,0, + 0,0,114,179,0,0,0,114,207,0,0,0,114,209,0,0, + 0,114,116,0,0,0,114,187,0,0,0,114,151,0,0,0, + 114,194,0,0,0,114,4,0,0,0,114,4,0,0,0,41, + 1,114,205,0,0,0,114,5,0,0,0,114,204,0,0,0, + 9,3,0,0,115,14,0,0,0,8,3,4,2,8,6,8, + 4,8,3,16,12,12,5,114,204,0,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, + 0,115,46,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, + 90,5,100,6,100,7,100,8,100,9,144,1,132,0,90,6, + 100,10,83,0,41,11,218,16,83,111,117,114,99,101,70,105, + 108,101,76,111,97,100,101,114,122,62,67,111,110,99,114,101, + 116,101,32,105,109,112,108,101,109,101,110,116,97,116,105,111, + 110,32,111,102,32,83,111,117,114,99,101,76,111,97,100,101, + 114,32,117,115,105,110,103,32,116,104,101,32,102,105,108,101, + 32,115,121,115,116,101,109,46,99,2,0,0,0,0,0,0, + 0,3,0,0,0,4,0,0,0,67,0,0,0,115,24,0, + 0,0,116,0,124,1,131,1,125,2,100,1,124,2,106,1, + 100,2,124,2,106,2,105,2,83,0,41,3,122,33,82,101, + 116,117,114,110,32,116,104,101,32,109,101,116,97,100,97,116, + 97,32,102,111,114,32,116,104,101,32,112,97,116,104,46,114, + 126,0,0,0,114,127,0,0,0,41,3,114,39,0,0,0, + 218,8,115,116,95,109,116,105,109,101,90,7,115,116,95,115, + 105,122,101,41,3,114,100,0,0,0,114,35,0,0,0,114, + 202,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, + 0,0,0,114,191,0,0,0,54,3,0,0,115,4,0,0, + 0,0,2,8,1,122,27,83,111,117,114,99,101,70,105,108, + 101,76,111,97,100,101,114,46,112,97,116,104,95,115,116,97, + 116,115,99,4,0,0,0,0,0,0,0,5,0,0,0,5, + 0,0,0,67,0,0,0,115,26,0,0,0,116,0,124,1, + 131,1,125,4,124,0,106,1,124,2,124,3,100,1,124,4, + 144,1,131,2,83,0,41,2,78,218,5,95,109,111,100,101, + 41,2,114,97,0,0,0,114,192,0,0,0,41,5,114,100, + 0,0,0,114,90,0,0,0,114,89,0,0,0,114,53,0, + 0,0,114,42,0,0,0,114,4,0,0,0,114,4,0,0, + 0,114,5,0,0,0,114,193,0,0,0,59,3,0,0,115, + 4,0,0,0,0,2,8,1,122,32,83,111,117,114,99,101, + 70,105,108,101,76,111,97,100,101,114,46,95,99,97,99,104, + 101,95,98,121,116,101,99,111,100,101,114,214,0,0,0,105, + 182,1,0,0,99,3,0,0,0,1,0,0,0,9,0,0, + 0,17,0,0,0,67,0,0,0,115,250,0,0,0,116,0, + 124,1,131,1,92,2,125,4,125,5,103,0,125,6,120,40, + 124,4,114,56,116,1,124,4,131,1,12,0,114,56,116,0, + 124,4,131,1,92,2,125,4,125,7,124,6,106,2,124,7, + 131,1,1,0,113,18,87,0,120,108,116,3,124,6,131,1, + 68,0,93,96,125,7,116,4,124,4,124,7,131,2,125,4, + 121,14,116,5,106,6,124,4,131,1,1,0,87,0,113,68, + 4,0,116,7,107,10,114,118,1,0,1,0,1,0,119,68, + 89,0,113,68,4,0,116,8,107,10,114,162,1,0,125,8, + 1,0,122,18,116,9,106,10,100,1,124,4,124,8,131,3, + 1,0,100,2,83,0,100,2,125,8,126,8,88,0,113,68, + 88,0,113,68,87,0,121,28,116,11,124,1,124,2,124,3, + 131,3,1,0,116,9,106,10,100,3,124,1,131,2,1,0, + 87,0,110,48,4,0,116,8,107,10,114,244,1,0,125,8, + 1,0,122,20,116,9,106,10,100,1,124,1,124,8,131,3, + 1,0,87,0,89,0,100,2,100,2,125,8,126,8,88,0, + 110,2,88,0,100,2,83,0,41,4,122,27,87,114,105,116, + 101,32,98,121,116,101,115,32,100,97,116,97,32,116,111,32, + 97,32,102,105,108,101,46,122,27,99,111,117,108,100,32,110, + 111,116,32,99,114,101,97,116,101,32,123,33,114,125,58,32, + 123,33,114,125,78,122,12,99,114,101,97,116,101,100,32,123, + 33,114,125,41,12,114,38,0,0,0,114,46,0,0,0,114, + 157,0,0,0,114,33,0,0,0,114,28,0,0,0,114,3, + 0,0,0,90,5,109,107,100,105,114,218,15,70,105,108,101, + 69,120,105,115,116,115,69,114,114,111,114,114,40,0,0,0, + 114,114,0,0,0,114,129,0,0,0,114,55,0,0,0,41, + 9,114,100,0,0,0,114,35,0,0,0,114,53,0,0,0, + 114,214,0,0,0,218,6,112,97,114,101,110,116,114,94,0, + 0,0,114,27,0,0,0,114,23,0,0,0,114,195,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, + 114,192,0,0,0,64,3,0,0,115,42,0,0,0,0,2, + 12,1,4,2,16,1,12,1,14,2,14,1,10,1,2,1, + 14,1,14,2,6,1,16,3,6,1,8,1,20,1,2,1, + 12,1,16,1,16,2,8,1,122,25,83,111,117,114,99,101, + 70,105,108,101,76,111,97,100,101,114,46,115,101,116,95,100, + 97,116,97,78,41,7,114,105,0,0,0,114,104,0,0,0, + 114,106,0,0,0,114,107,0,0,0,114,191,0,0,0,114, + 193,0,0,0,114,192,0,0,0,114,4,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,114,212,0, + 0,0,50,3,0,0,115,8,0,0,0,8,2,4,2,8, + 5,8,5,114,212,0,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,2,0,0,0,64,0,0,0,115,32,0, + 0,0,101,0,90,1,100,0,90,2,100,1,90,3,100,2, + 100,3,132,0,90,4,100,4,100,5,132,0,90,5,100,6, + 83,0,41,7,218,20,83,111,117,114,99,101,108,101,115,115, + 70,105,108,101,76,111,97,100,101,114,122,45,76,111,97,100, + 101,114,32,119,104,105,99,104,32,104,97,110,100,108,101,115, + 32,115,111,117,114,99,101,108,101,115,115,32,102,105,108,101, + 32,105,109,112,111,114,116,115,46,99,2,0,0,0,0,0, + 0,0,5,0,0,0,6,0,0,0,67,0,0,0,115,56, + 0,0,0,124,0,106,0,124,1,131,1,125,2,124,0,106, + 1,124,2,131,1,125,3,116,2,124,3,100,1,124,1,100, + 2,124,2,144,2,131,1,125,4,116,3,124,4,100,1,124, + 1,100,3,124,2,144,2,131,1,83,0,41,4,78,114,98, + 0,0,0,114,35,0,0,0,114,89,0,0,0,41,4,114, + 151,0,0,0,114,194,0,0,0,114,135,0,0,0,114,141, + 0,0,0,41,5,114,100,0,0,0,114,119,0,0,0,114, + 35,0,0,0,114,53,0,0,0,114,203,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,114,181,0, + 0,0,99,3,0,0,115,8,0,0,0,0,1,10,1,10, + 1,18,1,122,29,83,111,117,114,99,101,108,101,115,115,70, + 105,108,101,76,111,97,100,101,114,46,103,101,116,95,99,111, + 100,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, + 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, + 41,2,122,39,82,101,116,117,114,110,32,78,111,110,101,32, + 97,115,32,116,104,101,114,101,32,105,115,32,110,111,32,115, + 111,117,114,99,101,32,99,111,100,101,46,78,114,4,0,0, + 0,41,2,114,100,0,0,0,114,119,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,196,0,0, + 0,105,3,0,0,115,2,0,0,0,0,2,122,31,83,111, + 117,114,99,101,108,101,115,115,70,105,108,101,76,111,97,100, + 101,114,46,103,101,116,95,115,111,117,114,99,101,78,41,6, + 114,105,0,0,0,114,104,0,0,0,114,106,0,0,0,114, + 107,0,0,0,114,181,0,0,0,114,196,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, + 0,0,114,217,0,0,0,95,3,0,0,115,6,0,0,0, + 8,2,4,2,8,6,114,217,0,0,0,99,0,0,0,0, + 0,0,0,0,0,0,0,0,3,0,0,0,64,0,0,0, + 115,92,0,0,0,101,0,90,1,100,0,90,2,100,1,90, + 3,100,2,100,3,132,0,90,4,100,4,100,5,132,0,90, + 5,100,6,100,7,132,0,90,6,100,8,100,9,132,0,90, + 7,100,10,100,11,132,0,90,8,100,12,100,13,132,0,90, + 9,100,14,100,15,132,0,90,10,100,16,100,17,132,0,90, + 11,101,12,100,18,100,19,132,0,131,1,90,13,100,20,83, + 0,41,21,218,19,69,120,116,101,110,115,105,111,110,70,105, + 108,101,76,111,97,100,101,114,122,93,76,111,97,100,101,114, + 32,102,111,114,32,101,120,116,101,110,115,105,111,110,32,109, + 111,100,117,108,101,115,46,10,10,32,32,32,32,84,104,101, + 32,99,111,110,115,116,114,117,99,116,111,114,32,105,115,32, + 100,101,115,105,103,110,101,100,32,116,111,32,119,111,114,107, + 32,119,105,116,104,32,70,105,108,101,70,105,110,100,101,114, + 46,10,10,32,32,32,32,99,3,0,0,0,0,0,0,0, + 3,0,0,0,2,0,0,0,67,0,0,0,115,16,0,0, + 0,124,1,124,0,95,0,124,2,124,0,95,1,100,0,83, + 0,41,1,78,41,2,114,98,0,0,0,114,35,0,0,0, + 41,3,114,100,0,0,0,114,98,0,0,0,114,35,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, + 114,179,0,0,0,122,3,0,0,115,4,0,0,0,0,1, + 6,1,122,28,69,120,116,101,110,115,105,111,110,70,105,108, 101,76,111,97,100,101,114,46,95,95,105,110,105,116,95,95, 99,2,0,0,0,0,0,0,0,2,0,0,0,2,0,0, - 0,67,0,0,0,115,34,0,0,0,124,0,0,106,0,0, - 124,1,0,106,0,0,107,2,0,111,33,0,124,0,0,106, - 1,0,124,1,0,106,1,0,107,2,0,83,41,1,78,41, - 2,218,9,95,95,99,108,97,115,115,95,95,114,111,0,0, - 0,41,2,114,100,0,0,0,218,5,111,116,104,101,114,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,6, - 95,95,101,113,95,95,19,3,0,0,115,4,0,0,0,0, - 1,18,1,122,17,70,105,108,101,76,111,97,100,101,114,46, - 95,95,101,113,95,95,99,1,0,0,0,0,0,0,0,1, - 0,0,0,3,0,0,0,67,0,0,0,115,26,0,0,0, - 116,0,0,124,0,0,106,1,0,131,1,0,116,0,0,124, - 0,0,106,2,0,131,1,0,65,83,41,1,78,41,3,218, - 4,104,97,115,104,114,98,0,0,0,114,35,0,0,0,41, - 1,114,100,0,0,0,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,218,8,95,95,104,97,115,104,95,95,23, - 3,0,0,115,2,0,0,0,0,1,122,19,70,105,108,101, - 76,111,97,100,101,114,46,95,95,104,97,115,104,95,95,99, - 2,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 3,0,0,0,115,22,0,0,0,116,0,0,116,1,0,124, - 0,0,131,2,0,106,2,0,124,1,0,131,1,0,83,41, - 1,122,100,76,111,97,100,32,97,32,109,111,100,117,108,101, - 32,102,114,111,109,32,97,32,102,105,108,101,46,10,10,32, - 32,32,32,32,32,32,32,84,104,105,115,32,109,101,116,104, - 111,100,32,105,115,32,100,101,112,114,101,99,97,116,101,100, - 46,32,32,85,115,101,32,101,120,101,99,95,109,111,100,117, - 108,101,40,41,32,105,110,115,116,101,97,100,46,10,10,32, - 32,32,32,32,32,32,32,41,3,218,5,115,117,112,101,114, - 114,204,0,0,0,114,187,0,0,0,41,2,114,100,0,0, - 0,114,119,0,0,0,41,1,114,205,0,0,0,114,4,0, - 0,0,114,5,0,0,0,114,187,0,0,0,26,3,0,0, - 115,2,0,0,0,0,10,122,22,70,105,108,101,76,111,97, - 100,101,114,46,108,111,97,100,95,109,111,100,117,108,101,99, - 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, - 67,0,0,0,115,7,0,0,0,124,0,0,106,0,0,83, - 41,1,122,58,82,101,116,117,114,110,32,116,104,101,32,112, - 97,116,104,32,116,111,32,116,104,101,32,115,111,117,114,99, - 101,32,102,105,108,101,32,97,115,32,102,111,117,110,100,32, - 98,121,32,116,104,101,32,102,105,110,100,101,114,46,41,1, - 114,35,0,0,0,41,2,114,100,0,0,0,114,119,0,0, + 0,67,0,0,0,115,24,0,0,0,124,0,106,0,124,1, + 106,0,107,2,111,22,124,0,106,1,124,1,106,1,107,2, + 83,0,41,1,78,41,2,114,205,0,0,0,114,111,0,0, + 0,41,2,114,100,0,0,0,114,206,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,207,0,0, + 0,126,3,0,0,115,4,0,0,0,0,1,12,1,122,26, + 69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,97, + 100,101,114,46,95,95,101,113,95,95,99,1,0,0,0,0, + 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, + 20,0,0,0,116,0,124,0,106,1,131,1,116,0,124,0, + 106,2,131,1,65,0,83,0,41,1,78,41,3,114,208,0, + 0,0,114,98,0,0,0,114,35,0,0,0,41,1,114,100, + 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, + 0,0,114,209,0,0,0,130,3,0,0,115,2,0,0,0, + 0,1,122,28,69,120,116,101,110,115,105,111,110,70,105,108, + 101,76,111,97,100,101,114,46,95,95,104,97,115,104,95,95, + 99,2,0,0,0,0,0,0,0,3,0,0,0,4,0,0, + 0,67,0,0,0,115,36,0,0,0,116,0,106,1,116,2, + 106,3,124,1,131,2,125,2,116,0,106,4,100,1,124,1, + 106,5,124,0,106,6,131,3,1,0,124,2,83,0,41,2, + 122,38,67,114,101,97,116,101,32,97,110,32,117,110,105,116, + 105,97,108,105,122,101,100,32,101,120,116,101,110,115,105,111, + 110,32,109,111,100,117,108,101,122,38,101,120,116,101,110,115, + 105,111,110,32,109,111,100,117,108,101,32,123,33,114,125,32, + 108,111,97,100,101,100,32,102,114,111,109,32,123,33,114,125, + 41,7,114,114,0,0,0,114,182,0,0,0,114,139,0,0, + 0,90,14,99,114,101,97,116,101,95,100,121,110,97,109,105, + 99,114,129,0,0,0,114,98,0,0,0,114,35,0,0,0, + 41,3,114,100,0,0,0,114,158,0,0,0,114,184,0,0, 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, - 114,151,0,0,0,38,3,0,0,115,2,0,0,0,0,3, - 122,23,70,105,108,101,76,111,97,100,101,114,46,103,101,116, - 95,102,105,108,101,110,97,109,101,99,2,0,0,0,0,0, - 0,0,3,0,0,0,9,0,0,0,67,0,0,0,115,42, - 0,0,0,116,0,0,106,1,0,124,1,0,100,1,0,131, - 2,0,143,17,0,125,2,0,124,2,0,106,2,0,131,0, - 0,83,87,100,2,0,81,82,88,100,2,0,83,41,3,122, - 39,82,101,116,117,114,110,32,116,104,101,32,100,97,116,97, - 32,102,114,111,109,32,112,97,116,104,32,97,115,32,114,97, - 119,32,98,121,116,101,115,46,218,1,114,78,41,3,114,49, - 0,0,0,114,50,0,0,0,90,4,114,101,97,100,41,3, - 114,100,0,0,0,114,35,0,0,0,114,54,0,0,0,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,194, - 0,0,0,43,3,0,0,115,4,0,0,0,0,2,21,1, - 122,19,70,105,108,101,76,111,97,100,101,114,46,103,101,116, - 95,100,97,116,97,41,11,114,105,0,0,0,114,104,0,0, - 0,114,106,0,0,0,114,107,0,0,0,114,179,0,0,0, - 114,207,0,0,0,114,209,0,0,0,114,116,0,0,0,114, - 187,0,0,0,114,151,0,0,0,114,194,0,0,0,114,4, - 0,0,0,114,4,0,0,0,41,1,114,205,0,0,0,114, - 5,0,0,0,114,204,0,0,0,8,3,0,0,115,14,0, - 0,0,12,3,6,2,12,6,12,4,12,3,24,12,18,5, - 114,204,0,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,4,0,0,0,64,0,0,0,115,64,0,0,0,101, - 0,0,90,1,0,100,0,0,90,2,0,100,1,0,90,3, - 0,100,2,0,100,3,0,132,0,0,90,4,0,100,4,0, - 100,5,0,132,0,0,90,5,0,100,6,0,100,7,0,100, - 8,0,100,9,0,132,0,1,90,6,0,100,10,0,83,41, - 11,218,16,83,111,117,114,99,101,70,105,108,101,76,111,97, - 100,101,114,122,62,67,111,110,99,114,101,116,101,32,105,109, - 112,108,101,109,101,110,116,97,116,105,111,110,32,111,102,32, - 83,111,117,114,99,101,76,111,97,100,101,114,32,117,115,105, - 110,103,32,116,104,101,32,102,105,108,101,32,115,121,115,116, - 101,109,46,99,2,0,0,0,0,0,0,0,3,0,0,0, - 4,0,0,0,67,0,0,0,115,34,0,0,0,116,0,0, - 124,1,0,131,1,0,125,2,0,100,1,0,124,2,0,106, - 1,0,100,2,0,124,2,0,106,2,0,105,2,0,83,41, - 3,122,33,82,101,116,117,114,110,32,116,104,101,32,109,101, - 116,97,100,97,116,97,32,102,111,114,32,116,104,101,32,112, - 97,116,104,46,114,126,0,0,0,114,127,0,0,0,41,3, - 114,39,0,0,0,218,8,115,116,95,109,116,105,109,101,90, - 7,115,116,95,115,105,122,101,41,3,114,100,0,0,0,114, - 35,0,0,0,114,202,0,0,0,114,4,0,0,0,114,4, - 0,0,0,114,5,0,0,0,114,191,0,0,0,53,3,0, - 0,115,4,0,0,0,0,2,12,1,122,27,83,111,117,114, - 99,101,70,105,108,101,76,111,97,100,101,114,46,112,97,116, - 104,95,115,116,97,116,115,99,4,0,0,0,0,0,0,0, - 5,0,0,0,5,0,0,0,67,0,0,0,115,34,0,0, - 0,116,0,0,124,1,0,131,1,0,125,4,0,124,0,0, - 106,1,0,124,2,0,124,3,0,100,1,0,124,4,0,131, - 2,1,83,41,2,78,218,5,95,109,111,100,101,41,2,114, - 97,0,0,0,114,192,0,0,0,41,5,114,100,0,0,0, - 114,90,0,0,0,114,89,0,0,0,114,53,0,0,0,114, - 42,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, - 0,0,0,114,193,0,0,0,58,3,0,0,115,4,0,0, - 0,0,2,12,1,122,32,83,111,117,114,99,101,70,105,108, - 101,76,111,97,100,101,114,46,95,99,97,99,104,101,95,98, - 121,116,101,99,111,100,101,114,214,0,0,0,105,182,1,0, - 0,99,3,0,0,0,1,0,0,0,9,0,0,0,17,0, - 0,0,67,0,0,0,115,62,1,0,0,116,0,0,124,1, - 0,131,1,0,92,2,0,125,4,0,125,5,0,103,0,0, - 125,6,0,120,54,0,124,4,0,114,80,0,116,1,0,124, - 4,0,131,1,0,12,114,80,0,116,0,0,124,4,0,131, - 1,0,92,2,0,125,4,0,125,7,0,124,6,0,106,2, - 0,124,7,0,131,1,0,1,113,27,0,87,120,135,0,116, - 3,0,124,6,0,131,1,0,68,93,121,0,125,7,0,116, - 4,0,124,4,0,124,7,0,131,2,0,125,4,0,121,17, - 0,116,5,0,106,6,0,124,4,0,131,1,0,1,87,113, - 94,0,4,116,7,0,107,10,0,114,155,0,1,1,1,119, - 94,0,89,113,94,0,4,116,8,0,107,10,0,114,214,0, - 1,125,8,0,1,122,28,0,116,9,0,106,10,0,100,1, - 0,124,4,0,124,8,0,131,3,0,1,100,2,0,83,87, - 89,100,2,0,100,2,0,125,8,0,126,8,0,88,113,94, - 0,88,113,94,0,87,121,36,0,116,11,0,124,1,0,124, - 2,0,124,3,0,131,3,0,1,116,9,0,106,10,0,100, - 3,0,124,1,0,131,2,0,1,87,110,56,0,4,116,8, - 0,107,10,0,114,57,1,1,125,8,0,1,122,24,0,116, - 9,0,106,10,0,100,1,0,124,1,0,124,8,0,131,3, - 0,1,87,89,100,2,0,100,2,0,125,8,0,126,8,0, - 88,110,1,0,88,100,2,0,83,41,4,122,27,87,114,105, - 116,101,32,98,121,116,101,115,32,100,97,116,97,32,116,111, - 32,97,32,102,105,108,101,46,122,27,99,111,117,108,100,32, - 110,111,116,32,99,114,101,97,116,101,32,123,33,114,125,58, - 32,123,33,114,125,78,122,12,99,114,101,97,116,101,100,32, - 123,33,114,125,41,12,114,38,0,0,0,114,46,0,0,0, - 114,157,0,0,0,114,33,0,0,0,114,28,0,0,0,114, - 3,0,0,0,90,5,109,107,100,105,114,218,15,70,105,108, - 101,69,120,105,115,116,115,69,114,114,111,114,114,40,0,0, - 0,114,114,0,0,0,114,129,0,0,0,114,55,0,0,0, - 41,9,114,100,0,0,0,114,35,0,0,0,114,53,0,0, - 0,114,214,0,0,0,218,6,112,97,114,101,110,116,114,94, - 0,0,0,114,27,0,0,0,114,23,0,0,0,114,195,0, - 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, - 0,114,192,0,0,0,63,3,0,0,115,42,0,0,0,0, - 2,18,1,6,2,22,1,18,1,17,2,19,1,15,1,3, - 1,17,1,13,2,7,1,18,3,9,1,10,1,27,1,3, - 1,16,1,20,1,18,2,12,1,122,25,83,111,117,114,99, - 101,70,105,108,101,76,111,97,100,101,114,46,115,101,116,95, - 100,97,116,97,78,41,7,114,105,0,0,0,114,104,0,0, - 0,114,106,0,0,0,114,107,0,0,0,114,191,0,0,0, - 114,193,0,0,0,114,192,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,212, - 0,0,0,49,3,0,0,115,8,0,0,0,12,2,6,2, - 12,5,12,5,114,212,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,46, - 0,0,0,101,0,0,90,1,0,100,0,0,90,2,0,100, - 1,0,90,3,0,100,2,0,100,3,0,132,0,0,90,4, - 0,100,4,0,100,5,0,132,0,0,90,5,0,100,6,0, - 83,41,7,218,20,83,111,117,114,99,101,108,101,115,115,70, - 105,108,101,76,111,97,100,101,114,122,45,76,111,97,100,101, - 114,32,119,104,105,99,104,32,104,97,110,100,108,101,115,32, - 115,111,117,114,99,101,108,101,115,115,32,102,105,108,101,32, - 105,109,112,111,114,116,115,46,99,2,0,0,0,0,0,0, - 0,5,0,0,0,6,0,0,0,67,0,0,0,115,76,0, - 0,0,124,0,0,106,0,0,124,1,0,131,1,0,125,2, - 0,124,0,0,106,1,0,124,2,0,131,1,0,125,3,0, - 116,2,0,124,3,0,100,1,0,124,1,0,100,2,0,124, - 2,0,131,1,2,125,4,0,116,3,0,124,4,0,100,1, - 0,124,1,0,100,3,0,124,2,0,131,1,2,83,41,4, - 78,114,98,0,0,0,114,35,0,0,0,114,89,0,0,0, - 41,4,114,151,0,0,0,114,194,0,0,0,114,135,0,0, - 0,114,141,0,0,0,41,5,114,100,0,0,0,114,119,0, - 0,0,114,35,0,0,0,114,53,0,0,0,114,203,0,0, - 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, - 114,181,0,0,0,98,3,0,0,115,8,0,0,0,0,1, - 15,1,15,1,24,1,122,29,83,111,117,114,99,101,108,101, - 115,115,70,105,108,101,76,111,97,100,101,114,46,103,101,116, - 95,99,111,100,101,99,2,0,0,0,0,0,0,0,2,0, - 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, - 1,0,83,41,2,122,39,82,101,116,117,114,110,32,78,111, - 110,101,32,97,115,32,116,104,101,114,101,32,105,115,32,110, - 111,32,115,111,117,114,99,101,32,99,111,100,101,46,78,114, - 4,0,0,0,41,2,114,100,0,0,0,114,119,0,0,0, + 114,180,0,0,0,133,3,0,0,115,10,0,0,0,0,2, + 4,1,10,1,6,1,12,1,122,33,69,120,116,101,110,115, + 105,111,110,70,105,108,101,76,111,97,100,101,114,46,99,114, + 101,97,116,101,95,109,111,100,117,108,101,99,2,0,0,0, + 0,0,0,0,2,0,0,0,4,0,0,0,67,0,0,0, + 115,36,0,0,0,116,0,106,1,116,2,106,3,124,1,131, + 2,1,0,116,0,106,4,100,1,124,0,106,5,124,0,106, + 6,131,3,1,0,100,2,83,0,41,3,122,30,73,110,105, + 116,105,97,108,105,122,101,32,97,110,32,101,120,116,101,110, + 115,105,111,110,32,109,111,100,117,108,101,122,40,101,120,116, + 101,110,115,105,111,110,32,109,111,100,117,108,101,32,123,33, + 114,125,32,101,120,101,99,117,116,101,100,32,102,114,111,109, + 32,123,33,114,125,78,41,7,114,114,0,0,0,114,182,0, + 0,0,114,139,0,0,0,90,12,101,120,101,99,95,100,121, + 110,97,109,105,99,114,129,0,0,0,114,98,0,0,0,114, + 35,0,0,0,41,2,114,100,0,0,0,114,184,0,0,0, 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, - 196,0,0,0,104,3,0,0,115,2,0,0,0,0,2,122, - 31,83,111,117,114,99,101,108,101,115,115,70,105,108,101,76, - 111,97,100,101,114,46,103,101,116,95,115,111,117,114,99,101, - 78,41,6,114,105,0,0,0,114,104,0,0,0,114,106,0, - 0,0,114,107,0,0,0,114,181,0,0,0,114,196,0,0, - 0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,114,217,0,0,0,94,3,0,0,115,6, - 0,0,0,12,2,6,2,12,6,114,217,0,0,0,99,0, - 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,64, - 0,0,0,115,136,0,0,0,101,0,0,90,1,0,100,0, - 0,90,2,0,100,1,0,90,3,0,100,2,0,100,3,0, - 132,0,0,90,4,0,100,4,0,100,5,0,132,0,0,90, - 5,0,100,6,0,100,7,0,132,0,0,90,6,0,100,8, - 0,100,9,0,132,0,0,90,7,0,100,10,0,100,11,0, - 132,0,0,90,8,0,100,12,0,100,13,0,132,0,0,90, - 9,0,100,14,0,100,15,0,132,0,0,90,10,0,100,16, - 0,100,17,0,132,0,0,90,11,0,101,12,0,100,18,0, - 100,19,0,132,0,0,131,1,0,90,13,0,100,20,0,83, - 41,21,218,19,69,120,116,101,110,115,105,111,110,70,105,108, - 101,76,111,97,100,101,114,122,93,76,111,97,100,101,114,32, - 102,111,114,32,101,120,116,101,110,115,105,111,110,32,109,111, - 100,117,108,101,115,46,10,10,32,32,32,32,84,104,101,32, - 99,111,110,115,116,114,117,99,116,111,114,32,105,115,32,100, - 101,115,105,103,110,101,100,32,116,111,32,119,111,114,107,32, - 119,105,116,104,32,70,105,108,101,70,105,110,100,101,114,46, - 10,10,32,32,32,32,99,3,0,0,0,0,0,0,0,3, - 0,0,0,2,0,0,0,67,0,0,0,115,22,0,0,0, - 124,1,0,124,0,0,95,0,0,124,2,0,124,0,0,95, - 1,0,100,0,0,83,41,1,78,41,2,114,98,0,0,0, - 114,35,0,0,0,41,3,114,100,0,0,0,114,98,0,0, - 0,114,35,0,0,0,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,114,179,0,0,0,121,3,0,0,115,4, - 0,0,0,0,1,9,1,122,28,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,105, - 110,105,116,95,95,99,2,0,0,0,0,0,0,0,2,0, - 0,0,2,0,0,0,67,0,0,0,115,34,0,0,0,124, - 0,0,106,0,0,124,1,0,106,0,0,107,2,0,111,33, - 0,124,0,0,106,1,0,124,1,0,106,1,0,107,2,0, - 83,41,1,78,41,2,114,205,0,0,0,114,111,0,0,0, - 41,2,114,100,0,0,0,114,206,0,0,0,114,4,0,0, - 0,114,4,0,0,0,114,5,0,0,0,114,207,0,0,0, - 125,3,0,0,115,4,0,0,0,0,1,18,1,122,26,69, - 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, - 101,114,46,95,95,101,113,95,95,99,1,0,0,0,0,0, - 0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,26, - 0,0,0,116,0,0,124,0,0,106,1,0,131,1,0,116, - 0,0,124,0,0,106,2,0,131,1,0,65,83,41,1,78, - 41,3,114,208,0,0,0,114,98,0,0,0,114,35,0,0, - 0,41,1,114,100,0,0,0,114,4,0,0,0,114,4,0, - 0,0,114,5,0,0,0,114,209,0,0,0,129,3,0,0, - 115,2,0,0,0,0,1,122,28,69,120,116,101,110,115,105, - 111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,104, - 97,115,104,95,95,99,2,0,0,0,0,0,0,0,3,0, - 0,0,4,0,0,0,67,0,0,0,115,50,0,0,0,116, - 0,0,106,1,0,116,2,0,106,3,0,124,1,0,131,2, - 0,125,2,0,116,0,0,106,4,0,100,1,0,124,1,0, - 106,5,0,124,0,0,106,6,0,131,3,0,1,124,2,0, - 83,41,2,122,38,67,114,101,97,116,101,32,97,110,32,117, - 110,105,116,105,97,108,105,122,101,100,32,101,120,116,101,110, - 115,105,111,110,32,109,111,100,117,108,101,122,38,101,120,116, - 101,110,115,105,111,110,32,109,111,100,117,108,101,32,123,33, - 114,125,32,108,111,97,100,101,100,32,102,114,111,109,32,123, - 33,114,125,41,7,114,114,0,0,0,114,182,0,0,0,114, - 139,0,0,0,90,14,99,114,101,97,116,101,95,100,121,110, - 97,109,105,99,114,129,0,0,0,114,98,0,0,0,114,35, - 0,0,0,41,3,114,100,0,0,0,114,158,0,0,0,114, - 184,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, - 0,0,0,114,180,0,0,0,132,3,0,0,115,10,0,0, - 0,0,2,6,1,15,1,9,1,16,1,122,33,69,120,116, - 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, - 46,99,114,101,97,116,101,95,109,111,100,117,108,101,99,2, - 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,67, - 0,0,0,115,48,0,0,0,116,0,0,106,1,0,116,2, - 0,106,3,0,124,1,0,131,2,0,1,116,0,0,106,4, - 0,100,1,0,124,0,0,106,5,0,124,0,0,106,6,0, - 131,3,0,1,100,2,0,83,41,3,122,30,73,110,105,116, - 105,97,108,105,122,101,32,97,110,32,101,120,116,101,110,115, - 105,111,110,32,109,111,100,117,108,101,122,40,101,120,116,101, - 110,115,105,111,110,32,109,111,100,117,108,101,32,123,33,114, - 125,32,101,120,101,99,117,116,101,100,32,102,114,111,109,32, - 123,33,114,125,78,41,7,114,114,0,0,0,114,182,0,0, - 0,114,139,0,0,0,90,12,101,120,101,99,95,100,121,110, - 97,109,105,99,114,129,0,0,0,114,98,0,0,0,114,35, - 0,0,0,41,2,114,100,0,0,0,114,184,0,0,0,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,185, - 0,0,0,140,3,0,0,115,6,0,0,0,0,2,19,1, - 9,1,122,31,69,120,116,101,110,115,105,111,110,70,105,108, - 101,76,111,97,100,101,114,46,101,120,101,99,95,109,111,100, - 117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 4,0,0,0,3,0,0,0,115,48,0,0,0,116,0,0, - 124,0,0,106,1,0,131,1,0,100,1,0,25,137,0,0, - 116,2,0,135,0,0,102,1,0,100,2,0,100,3,0,134, - 0,0,116,3,0,68,131,1,0,131,1,0,83,41,4,122, - 49,82,101,116,117,114,110,32,84,114,117,101,32,105,102,32, - 116,104,101,32,101,120,116,101,110,115,105,111,110,32,109,111, - 100,117,108,101,32,105,115,32,97,32,112,97,99,107,97,103, - 101,46,114,29,0,0,0,99,1,0,0,0,0,0,0,0, - 2,0,0,0,4,0,0,0,51,0,0,0,115,31,0,0, - 0,124,0,0,93,21,0,125,1,0,136,0,0,100,0,0, - 124,1,0,23,107,2,0,86,1,113,3,0,100,1,0,83, + 185,0,0,0,141,3,0,0,115,6,0,0,0,0,2,14, + 1,6,1,122,31,69,120,116,101,110,115,105,111,110,70,105, + 108,101,76,111,97,100,101,114,46,101,120,101,99,95,109,111, + 100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0, + 0,4,0,0,0,3,0,0,0,115,36,0,0,0,116,0, + 124,0,106,1,131,1,100,1,25,0,137,0,116,2,135,0, + 102,1,100,2,100,3,134,0,116,3,68,0,131,1,131,1, + 83,0,41,4,122,49,82,101,116,117,114,110,32,84,114,117, + 101,32,105,102,32,116,104,101,32,101,120,116,101,110,115,105, + 111,110,32,109,111,100,117,108,101,32,105,115,32,97,32,112, + 97,99,107,97,103,101,46,114,29,0,0,0,99,1,0,0, + 0,0,0,0,0,2,0,0,0,4,0,0,0,51,0,0, + 0,115,26,0,0,0,124,0,93,18,125,1,136,0,100,0, + 124,1,23,0,107,2,86,0,1,0,113,2,100,1,83,0, 41,2,114,179,0,0,0,78,114,4,0,0,0,41,2,114, 22,0,0,0,218,6,115,117,102,102,105,120,41,1,218,9, 102,105,108,101,95,110,97,109,101,114,4,0,0,0,114,5, - 0,0,0,250,9,60,103,101,110,101,120,112,114,62,149,3, - 0,0,115,2,0,0,0,6,1,122,49,69,120,116,101,110, + 0,0,0,250,9,60,103,101,110,101,120,112,114,62,150,3, + 0,0,115,2,0,0,0,4,1,122,49,69,120,116,101,110, 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,105, 115,95,112,97,99,107,97,103,101,46,60,108,111,99,97,108, 115,62,46,60,103,101,110,101,120,112,114,62,41,4,114,38, @@ -1592,474 +1490,445 @@ 88,84,69,78,83,73,79,78,95,83,85,70,70,73,88,69, 83,41,2,114,100,0,0,0,114,119,0,0,0,114,4,0, 0,0,41,1,114,220,0,0,0,114,5,0,0,0,114,153, - 0,0,0,146,3,0,0,115,6,0,0,0,0,2,19,1, - 18,1,122,30,69,120,116,101,110,115,105,111,110,70,105,108, + 0,0,0,147,3,0,0,115,6,0,0,0,0,2,14,1, + 12,1,122,30,69,120,116,101,110,115,105,111,110,70,105,108, 101,76,111,97,100,101,114,46,105,115,95,112,97,99,107,97, 103,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, - 0,0,0,67,0,0,0,115,4,0,0,0,100,1,0,83, + 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, 41,2,122,63,82,101,116,117,114,110,32,78,111,110,101,32, 97,115,32,97,110,32,101,120,116,101,110,115,105,111,110,32, 109,111,100,117,108,101,32,99,97,110,110,111,116,32,99,114, 101,97,116,101,32,97,32,99,111,100,101,32,111,98,106,101, 99,116,46,78,114,4,0,0,0,41,2,114,100,0,0,0, 114,119,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,114,181,0,0,0,152,3,0,0,115,2,0, + 5,0,0,0,114,181,0,0,0,153,3,0,0,115,2,0, 0,0,0,2,122,28,69,120,116,101,110,115,105,111,110,70, 105,108,101,76,111,97,100,101,114,46,103,101,116,95,99,111, 100,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, - 0,0,0,67,0,0,0,115,4,0,0,0,100,1,0,83, + 0,0,0,67,0,0,0,115,4,0,0,0,100,1,83,0, 41,2,122,53,82,101,116,117,114,110,32,78,111,110,101,32, 97,115,32,101,120,116,101,110,115,105,111,110,32,109,111,100, 117,108,101,115,32,104,97,118,101,32,110,111,32,115,111,117, 114,99,101,32,99,111,100,101,46,78,114,4,0,0,0,41, 2,114,100,0,0,0,114,119,0,0,0,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,114,196,0,0,0,156, + 114,4,0,0,0,114,5,0,0,0,114,196,0,0,0,157, 3,0,0,115,2,0,0,0,0,2,122,30,69,120,116,101, 110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,46, 103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0, 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, - 7,0,0,0,124,0,0,106,0,0,83,41,1,122,58,82, - 101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,116, - 111,32,116,104,101,32,115,111,117,114,99,101,32,102,105,108, - 101,32,97,115,32,102,111,117,110,100,32,98,121,32,116,104, - 101,32,102,105,110,100,101,114,46,41,1,114,35,0,0,0, - 41,2,114,100,0,0,0,114,119,0,0,0,114,4,0,0, - 0,114,4,0,0,0,114,5,0,0,0,114,151,0,0,0, - 160,3,0,0,115,2,0,0,0,0,3,122,32,69,120,116, - 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, - 46,103,101,116,95,102,105,108,101,110,97,109,101,78,41,14, - 114,105,0,0,0,114,104,0,0,0,114,106,0,0,0,114, - 107,0,0,0,114,179,0,0,0,114,207,0,0,0,114,209, - 0,0,0,114,180,0,0,0,114,185,0,0,0,114,153,0, - 0,0,114,181,0,0,0,114,196,0,0,0,114,116,0,0, - 0,114,151,0,0,0,114,4,0,0,0,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,114,218,0,0,0,113, - 3,0,0,115,20,0,0,0,12,6,6,2,12,4,12,4, - 12,3,12,8,12,6,12,6,12,4,12,4,114,218,0,0, - 0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,64,0,0,0,115,142,0,0,0,101,0,0,90,1, - 0,100,0,0,90,2,0,100,1,0,90,3,0,100,2,0, - 100,3,0,132,0,0,90,4,0,100,4,0,100,5,0,132, - 0,0,90,5,0,100,6,0,100,7,0,132,0,0,90,6, - 0,100,8,0,100,9,0,132,0,0,90,7,0,100,10,0, - 100,11,0,132,0,0,90,8,0,100,12,0,100,13,0,132, - 0,0,90,9,0,100,14,0,100,15,0,132,0,0,90,10, - 0,100,16,0,100,17,0,132,0,0,90,11,0,100,18,0, - 100,19,0,132,0,0,90,12,0,100,20,0,100,21,0,132, - 0,0,90,13,0,100,22,0,83,41,23,218,14,95,78,97, - 109,101,115,112,97,99,101,80,97,116,104,97,38,1,0,0, - 82,101,112,114,101,115,101,110,116,115,32,97,32,110,97,109, - 101,115,112,97,99,101,32,112,97,99,107,97,103,101,39,115, - 32,112,97,116,104,46,32,32,73,116,32,117,115,101,115,32, - 116,104,101,32,109,111,100,117,108,101,32,110,97,109,101,10, - 32,32,32,32,116,111,32,102,105,110,100,32,105,116,115,32, - 112,97,114,101,110,116,32,109,111,100,117,108,101,44,32,97, - 110,100,32,102,114,111,109,32,116,104,101,114,101,32,105,116, - 32,108,111,111,107,115,32,117,112,32,116,104,101,32,112,97, - 114,101,110,116,39,115,10,32,32,32,32,95,95,112,97,116, - 104,95,95,46,32,32,87,104,101,110,32,116,104,105,115,32, - 99,104,97,110,103,101,115,44,32,116,104,101,32,109,111,100, - 117,108,101,39,115,32,111,119,110,32,112,97,116,104,32,105, - 115,32,114,101,99,111,109,112,117,116,101,100,44,10,32,32, - 32,32,117,115,105,110,103,32,112,97,116,104,95,102,105,110, - 100,101,114,46,32,32,70,111,114,32,116,111,112,45,108,101, - 118,101,108,32,109,111,100,117,108,101,115,44,32,116,104,101, - 32,112,97,114,101,110,116,32,109,111,100,117,108,101,39,115, - 32,112,97,116,104,10,32,32,32,32,105,115,32,115,121,115, - 46,112,97,116,104,46,99,4,0,0,0,0,0,0,0,4, - 0,0,0,2,0,0,0,67,0,0,0,115,52,0,0,0, - 124,1,0,124,0,0,95,0,0,124,2,0,124,0,0,95, - 1,0,116,2,0,124,0,0,106,3,0,131,0,0,131,1, - 0,124,0,0,95,4,0,124,3,0,124,0,0,95,5,0, - 100,0,0,83,41,1,78,41,6,218,5,95,110,97,109,101, - 218,5,95,112,97,116,104,114,93,0,0,0,218,16,95,103, - 101,116,95,112,97,114,101,110,116,95,112,97,116,104,218,17, - 95,108,97,115,116,95,112,97,114,101,110,116,95,112,97,116, - 104,218,12,95,112,97,116,104,95,102,105,110,100,101,114,41, - 4,114,100,0,0,0,114,98,0,0,0,114,35,0,0,0, - 218,11,112,97,116,104,95,102,105,110,100,101,114,114,4,0, - 0,0,114,4,0,0,0,114,5,0,0,0,114,179,0,0, - 0,173,3,0,0,115,8,0,0,0,0,1,9,1,9,1, - 21,1,122,23,95,78,97,109,101,115,112,97,99,101,80,97, - 116,104,46,95,95,105,110,105,116,95,95,99,1,0,0,0, - 0,0,0,0,4,0,0,0,3,0,0,0,67,0,0,0, - 115,53,0,0,0,124,0,0,106,0,0,106,1,0,100,1, - 0,131,1,0,92,3,0,125,1,0,125,2,0,125,3,0, - 124,2,0,100,2,0,107,2,0,114,43,0,100,6,0,83, - 124,1,0,100,5,0,102,2,0,83,41,7,122,62,82,101, - 116,117,114,110,115,32,97,32,116,117,112,108,101,32,111,102, - 32,40,112,97,114,101,110,116,45,109,111,100,117,108,101,45, - 110,97,109,101,44,32,112,97,114,101,110,116,45,112,97,116, - 104,45,97,116,116,114,45,110,97,109,101,41,114,58,0,0, - 0,114,30,0,0,0,114,7,0,0,0,114,35,0,0,0, - 90,8,95,95,112,97,116,104,95,95,41,2,122,3,115,121, - 115,122,4,112,97,116,104,41,2,114,225,0,0,0,114,32, - 0,0,0,41,4,114,100,0,0,0,114,216,0,0,0,218, - 3,100,111,116,90,2,109,101,114,4,0,0,0,114,4,0, - 0,0,114,5,0,0,0,218,23,95,102,105,110,100,95,112, - 97,114,101,110,116,95,112,97,116,104,95,110,97,109,101,115, - 179,3,0,0,115,8,0,0,0,0,2,27,1,12,2,4, - 3,122,38,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,46,95,102,105,110,100,95,112,97,114,101,110,116,95,112, - 97,116,104,95,110,97,109,101,115,99,1,0,0,0,0,0, - 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,38, - 0,0,0,124,0,0,106,0,0,131,0,0,92,2,0,125, - 1,0,125,2,0,116,1,0,116,2,0,106,3,0,124,1, - 0,25,124,2,0,131,2,0,83,41,1,78,41,4,114,232, - 0,0,0,114,110,0,0,0,114,7,0,0,0,218,7,109, - 111,100,117,108,101,115,41,3,114,100,0,0,0,90,18,112, - 97,114,101,110,116,95,109,111,100,117,108,101,95,110,97,109, - 101,90,14,112,97,116,104,95,97,116,116,114,95,110,97,109, - 101,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, - 114,227,0,0,0,189,3,0,0,115,4,0,0,0,0,1, - 18,1,122,31,95,78,97,109,101,115,112,97,99,101,80,97, - 116,104,46,95,103,101,116,95,112,97,114,101,110,116,95,112, - 97,116,104,99,1,0,0,0,0,0,0,0,3,0,0,0, - 3,0,0,0,67,0,0,0,115,118,0,0,0,116,0,0, - 124,0,0,106,1,0,131,0,0,131,1,0,125,1,0,124, - 1,0,124,0,0,106,2,0,107,3,0,114,111,0,124,0, - 0,106,3,0,124,0,0,106,4,0,124,1,0,131,2,0, - 125,2,0,124,2,0,100,0,0,107,9,0,114,102,0,124, - 2,0,106,5,0,100,0,0,107,8,0,114,102,0,124,2, - 0,106,6,0,114,102,0,124,2,0,106,6,0,124,0,0, - 95,7,0,124,1,0,124,0,0,95,2,0,124,0,0,106, - 7,0,83,41,1,78,41,8,114,93,0,0,0,114,227,0, - 0,0,114,228,0,0,0,114,229,0,0,0,114,225,0,0, - 0,114,120,0,0,0,114,150,0,0,0,114,226,0,0,0, - 41,3,114,100,0,0,0,90,11,112,97,114,101,110,116,95, - 112,97,116,104,114,158,0,0,0,114,4,0,0,0,114,4, - 0,0,0,114,5,0,0,0,218,12,95,114,101,99,97,108, - 99,117,108,97,116,101,193,3,0,0,115,16,0,0,0,0, - 2,18,1,15,1,21,3,27,1,9,1,12,1,9,1,122, - 27,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, - 95,114,101,99,97,108,99,117,108,97,116,101,99,1,0,0, - 0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,0, - 0,115,16,0,0,0,116,0,0,124,0,0,106,1,0,131, - 0,0,131,1,0,83,41,1,78,41,2,218,4,105,116,101, - 114,114,234,0,0,0,41,1,114,100,0,0,0,114,4,0, - 0,0,114,4,0,0,0,114,5,0,0,0,218,8,95,95, - 105,116,101,114,95,95,206,3,0,0,115,2,0,0,0,0, - 1,122,23,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,46,95,95,105,116,101,114,95,95,99,3,0,0,0,0, - 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, - 17,0,0,0,124,2,0,124,0,0,106,0,0,124,1,0, - 60,100,0,0,83,41,1,78,41,1,114,226,0,0,0,41, - 3,114,100,0,0,0,218,5,105,110,100,101,120,114,35,0, + 6,0,0,0,124,0,106,0,83,0,41,1,122,58,82,101, + 116,117,114,110,32,116,104,101,32,112,97,116,104,32,116,111, + 32,116,104,101,32,115,111,117,114,99,101,32,102,105,108,101, + 32,97,115,32,102,111,117,110,100,32,98,121,32,116,104,101, + 32,102,105,110,100,101,114,46,41,1,114,35,0,0,0,41, + 2,114,100,0,0,0,114,119,0,0,0,114,4,0,0,0, + 114,4,0,0,0,114,5,0,0,0,114,151,0,0,0,161, + 3,0,0,115,2,0,0,0,0,3,122,32,69,120,116,101, + 110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,46, + 103,101,116,95,102,105,108,101,110,97,109,101,78,41,14,114, + 105,0,0,0,114,104,0,0,0,114,106,0,0,0,114,107, + 0,0,0,114,179,0,0,0,114,207,0,0,0,114,209,0, + 0,0,114,180,0,0,0,114,185,0,0,0,114,153,0,0, + 0,114,181,0,0,0,114,196,0,0,0,114,116,0,0,0, + 114,151,0,0,0,114,4,0,0,0,114,4,0,0,0,114, + 4,0,0,0,114,5,0,0,0,114,218,0,0,0,114,3, + 0,0,115,20,0,0,0,8,6,4,2,8,4,8,4,8, + 3,8,8,8,6,8,6,8,4,8,4,114,218,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,64,0,0,0,115,96,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,100,3,132,0,90,4,100,4, + 100,5,132,0,90,5,100,6,100,7,132,0,90,6,100,8, + 100,9,132,0,90,7,100,10,100,11,132,0,90,8,100,12, + 100,13,132,0,90,9,100,14,100,15,132,0,90,10,100,16, + 100,17,132,0,90,11,100,18,100,19,132,0,90,12,100,20, + 100,21,132,0,90,13,100,22,83,0,41,23,218,14,95,78, + 97,109,101,115,112,97,99,101,80,97,116,104,97,38,1,0, + 0,82,101,112,114,101,115,101,110,116,115,32,97,32,110,97, + 109,101,115,112,97,99,101,32,112,97,99,107,97,103,101,39, + 115,32,112,97,116,104,46,32,32,73,116,32,117,115,101,115, + 32,116,104,101,32,109,111,100,117,108,101,32,110,97,109,101, + 10,32,32,32,32,116,111,32,102,105,110,100,32,105,116,115, + 32,112,97,114,101,110,116,32,109,111,100,117,108,101,44,32, + 97,110,100,32,102,114,111,109,32,116,104,101,114,101,32,105, + 116,32,108,111,111,107,115,32,117,112,32,116,104,101,32,112, + 97,114,101,110,116,39,115,10,32,32,32,32,95,95,112,97, + 116,104,95,95,46,32,32,87,104,101,110,32,116,104,105,115, + 32,99,104,97,110,103,101,115,44,32,116,104,101,32,109,111, + 100,117,108,101,39,115,32,111,119,110,32,112,97,116,104,32, + 105,115,32,114,101,99,111,109,112,117,116,101,100,44,10,32, + 32,32,32,117,115,105,110,103,32,112,97,116,104,95,102,105, + 110,100,101,114,46,32,32,70,111,114,32,116,111,112,45,108, + 101,118,101,108,32,109,111,100,117,108,101,115,44,32,116,104, + 101,32,112,97,114,101,110,116,32,109,111,100,117,108,101,39, + 115,32,112,97,116,104,10,32,32,32,32,105,115,32,115,121, + 115,46,112,97,116,104,46,99,4,0,0,0,0,0,0,0, + 4,0,0,0,2,0,0,0,67,0,0,0,115,36,0,0, + 0,124,1,124,0,95,0,124,2,124,0,95,1,116,2,124, + 0,106,3,131,0,131,1,124,0,95,4,124,3,124,0,95, + 5,100,0,83,0,41,1,78,41,6,218,5,95,110,97,109, + 101,218,5,95,112,97,116,104,114,93,0,0,0,218,16,95, + 103,101,116,95,112,97,114,101,110,116,95,112,97,116,104,218, + 17,95,108,97,115,116,95,112,97,114,101,110,116,95,112,97, + 116,104,218,12,95,112,97,116,104,95,102,105,110,100,101,114, + 41,4,114,100,0,0,0,114,98,0,0,0,114,35,0,0, + 0,218,11,112,97,116,104,95,102,105,110,100,101,114,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,114,179,0, + 0,0,174,3,0,0,115,8,0,0,0,0,1,6,1,6, + 1,14,1,122,23,95,78,97,109,101,115,112,97,99,101,80, + 97,116,104,46,95,95,105,110,105,116,95,95,99,1,0,0, + 0,0,0,0,0,4,0,0,0,3,0,0,0,67,0,0, + 0,115,38,0,0,0,124,0,106,0,106,1,100,1,131,1, + 92,3,125,1,125,2,125,3,124,2,100,2,107,2,114,30, + 100,6,83,0,124,1,100,5,102,2,83,0,41,7,122,62, + 82,101,116,117,114,110,115,32,97,32,116,117,112,108,101,32, + 111,102,32,40,112,97,114,101,110,116,45,109,111,100,117,108, + 101,45,110,97,109,101,44,32,112,97,114,101,110,116,45,112, + 97,116,104,45,97,116,116,114,45,110,97,109,101,41,114,58, + 0,0,0,114,30,0,0,0,114,7,0,0,0,114,35,0, + 0,0,90,8,95,95,112,97,116,104,95,95,41,2,122,3, + 115,121,115,122,4,112,97,116,104,41,2,114,225,0,0,0, + 114,32,0,0,0,41,4,114,100,0,0,0,114,216,0,0, + 0,218,3,100,111,116,90,2,109,101,114,4,0,0,0,114, + 4,0,0,0,114,5,0,0,0,218,23,95,102,105,110,100, + 95,112,97,114,101,110,116,95,112,97,116,104,95,110,97,109, + 101,115,180,3,0,0,115,8,0,0,0,0,2,18,1,8, + 2,4,3,122,38,95,78,97,109,101,115,112,97,99,101,80, + 97,116,104,46,95,102,105,110,100,95,112,97,114,101,110,116, + 95,112,97,116,104,95,110,97,109,101,115,99,1,0,0,0, + 0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,0, + 115,28,0,0,0,124,0,106,0,131,0,92,2,125,1,125, + 2,116,1,116,2,106,3,124,1,25,0,124,2,131,2,83, + 0,41,1,78,41,4,114,232,0,0,0,114,110,0,0,0, + 114,7,0,0,0,218,7,109,111,100,117,108,101,115,41,3, + 114,100,0,0,0,90,18,112,97,114,101,110,116,95,109,111, + 100,117,108,101,95,110,97,109,101,90,14,112,97,116,104,95, + 97,116,116,114,95,110,97,109,101,114,4,0,0,0,114,4, + 0,0,0,114,5,0,0,0,114,227,0,0,0,190,3,0, + 0,115,4,0,0,0,0,1,12,1,122,31,95,78,97,109, + 101,115,112,97,99,101,80,97,116,104,46,95,103,101,116,95, + 112,97,114,101,110,116,95,112,97,116,104,99,1,0,0,0, + 0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,0, + 115,80,0,0,0,116,0,124,0,106,1,131,0,131,1,125, + 1,124,1,124,0,106,2,107,3,114,74,124,0,106,3,124, + 0,106,4,124,1,131,2,125,2,124,2,100,0,107,9,114, + 68,124,2,106,5,100,0,107,8,114,68,124,2,106,6,114, + 68,124,2,106,6,124,0,95,7,124,1,124,0,95,2,124, + 0,106,7,83,0,41,1,78,41,8,114,93,0,0,0,114, + 227,0,0,0,114,228,0,0,0,114,229,0,0,0,114,225, + 0,0,0,114,120,0,0,0,114,150,0,0,0,114,226,0, + 0,0,41,3,114,100,0,0,0,90,11,112,97,114,101,110, + 116,95,112,97,116,104,114,158,0,0,0,114,4,0,0,0, + 114,4,0,0,0,114,5,0,0,0,218,12,95,114,101,99, + 97,108,99,117,108,97,116,101,194,3,0,0,115,16,0,0, + 0,0,2,12,1,10,1,14,3,18,1,6,1,8,1,6, + 1,122,27,95,78,97,109,101,115,112,97,99,101,80,97,116, + 104,46,95,114,101,99,97,108,99,117,108,97,116,101,99,1, + 0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,67, + 0,0,0,115,12,0,0,0,116,0,124,0,106,1,131,0, + 131,1,83,0,41,1,78,41,2,218,4,105,116,101,114,114, + 234,0,0,0,41,1,114,100,0,0,0,114,4,0,0,0, + 114,4,0,0,0,114,5,0,0,0,218,8,95,95,105,116, + 101,114,95,95,207,3,0,0,115,2,0,0,0,0,1,122, + 23,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, + 95,95,105,116,101,114,95,95,99,3,0,0,0,0,0,0, + 0,3,0,0,0,3,0,0,0,67,0,0,0,115,14,0, + 0,0,124,2,124,0,106,0,124,1,60,0,100,0,83,0, + 41,1,78,41,1,114,226,0,0,0,41,3,114,100,0,0, + 0,218,5,105,110,100,101,120,114,35,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,218,11,95,95, + 115,101,116,105,116,101,109,95,95,210,3,0,0,115,2,0, + 0,0,0,1,122,26,95,78,97,109,101,115,112,97,99,101, + 80,97,116,104,46,95,95,115,101,116,105,116,101,109,95,95, + 99,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0, + 0,67,0,0,0,115,12,0,0,0,116,0,124,0,106,1, + 131,0,131,1,83,0,41,1,78,41,2,114,31,0,0,0, + 114,234,0,0,0,41,1,114,100,0,0,0,114,4,0,0, + 0,114,4,0,0,0,114,5,0,0,0,218,7,95,95,108, + 101,110,95,95,213,3,0,0,115,2,0,0,0,0,1,122, + 22,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, + 95,95,108,101,110,95,95,99,1,0,0,0,0,0,0,0, + 1,0,0,0,2,0,0,0,67,0,0,0,115,12,0,0, + 0,100,1,106,0,124,0,106,1,131,1,83,0,41,2,78, + 122,20,95,78,97,109,101,115,112,97,99,101,80,97,116,104, + 40,123,33,114,125,41,41,2,114,47,0,0,0,114,226,0, + 0,0,41,1,114,100,0,0,0,114,4,0,0,0,114,4, + 0,0,0,114,5,0,0,0,218,8,95,95,114,101,112,114, + 95,95,216,3,0,0,115,2,0,0,0,0,1,122,23,95, + 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,95, + 114,101,112,114,95,95,99,2,0,0,0,0,0,0,0,2, + 0,0,0,2,0,0,0,67,0,0,0,115,12,0,0,0, + 124,1,124,0,106,0,131,0,107,6,83,0,41,1,78,41, + 1,114,234,0,0,0,41,2,114,100,0,0,0,218,4,105, + 116,101,109,114,4,0,0,0,114,4,0,0,0,114,5,0, + 0,0,218,12,95,95,99,111,110,116,97,105,110,115,95,95, + 219,3,0,0,115,2,0,0,0,0,1,122,27,95,78,97, + 109,101,115,112,97,99,101,80,97,116,104,46,95,95,99,111, + 110,116,97,105,110,115,95,95,99,2,0,0,0,0,0,0, + 0,2,0,0,0,2,0,0,0,67,0,0,0,115,16,0, + 0,0,124,0,106,0,106,1,124,1,131,1,1,0,100,0, + 83,0,41,1,78,41,2,114,226,0,0,0,114,157,0,0, + 0,41,2,114,100,0,0,0,114,241,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,157,0,0, + 0,222,3,0,0,115,2,0,0,0,0,1,122,21,95,78, + 97,109,101,115,112,97,99,101,80,97,116,104,46,97,112,112, + 101,110,100,78,41,14,114,105,0,0,0,114,104,0,0,0, + 114,106,0,0,0,114,107,0,0,0,114,179,0,0,0,114, + 232,0,0,0,114,227,0,0,0,114,234,0,0,0,114,236, + 0,0,0,114,238,0,0,0,114,239,0,0,0,114,240,0, + 0,0,114,242,0,0,0,114,157,0,0,0,114,4,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, + 114,224,0,0,0,167,3,0,0,115,22,0,0,0,8,5, + 4,2,8,6,8,10,8,4,8,13,8,3,8,3,8,3, + 8,3,8,3,114,224,0,0,0,99,0,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,64,0,0,0,115,80, + 0,0,0,101,0,90,1,100,0,90,2,100,1,100,2,132, + 0,90,3,101,4,100,3,100,4,132,0,131,1,90,5,100, + 5,100,6,132,0,90,6,100,7,100,8,132,0,90,7,100, + 9,100,10,132,0,90,8,100,11,100,12,132,0,90,9,100, + 13,100,14,132,0,90,10,100,15,100,16,132,0,90,11,100, + 17,83,0,41,18,218,16,95,78,97,109,101,115,112,97,99, + 101,76,111,97,100,101,114,99,4,0,0,0,0,0,0,0, + 4,0,0,0,4,0,0,0,67,0,0,0,115,18,0,0, + 0,116,0,124,1,124,2,124,3,131,3,124,0,95,1,100, + 0,83,0,41,1,78,41,2,114,224,0,0,0,114,226,0, + 0,0,41,4,114,100,0,0,0,114,98,0,0,0,114,35, + 0,0,0,114,230,0,0,0,114,4,0,0,0,114,4,0, + 0,0,114,5,0,0,0,114,179,0,0,0,228,3,0,0, + 115,2,0,0,0,0,1,122,25,95,78,97,109,101,115,112, + 97,99,101,76,111,97,100,101,114,46,95,95,105,110,105,116, + 95,95,99,2,0,0,0,0,0,0,0,2,0,0,0,2, + 0,0,0,67,0,0,0,115,12,0,0,0,100,1,106,0, + 124,1,106,1,131,1,83,0,41,2,122,115,82,101,116,117, + 114,110,32,114,101,112,114,32,102,111,114,32,116,104,101,32, + 109,111,100,117,108,101,46,10,10,32,32,32,32,32,32,32, + 32,84,104,101,32,109,101,116,104,111,100,32,105,115,32,100, + 101,112,114,101,99,97,116,101,100,46,32,32,84,104,101,32, + 105,109,112,111,114,116,32,109,97,99,104,105,110,101,114,121, + 32,100,111,101,115,32,116,104,101,32,106,111,98,32,105,116, + 115,101,108,102,46,10,10,32,32,32,32,32,32,32,32,122, + 25,60,109,111,100,117,108,101,32,123,33,114,125,32,40,110, + 97,109,101,115,112,97,99,101,41,62,41,2,114,47,0,0, + 0,114,105,0,0,0,41,2,114,164,0,0,0,114,184,0, 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, - 0,218,11,95,95,115,101,116,105,116,101,109,95,95,209,3, - 0,0,115,2,0,0,0,0,1,122,26,95,78,97,109,101, - 115,112,97,99,101,80,97,116,104,46,95,95,115,101,116,105, - 116,101,109,95,95,99,1,0,0,0,0,0,0,0,1,0, - 0,0,2,0,0,0,67,0,0,0,115,16,0,0,0,116, - 0,0,124,0,0,106,1,0,131,0,0,131,1,0,83,41, - 1,78,41,2,114,31,0,0,0,114,234,0,0,0,41,1, - 114,100,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,218,7,95,95,108,101,110,95,95,212,3,0, - 0,115,2,0,0,0,0,1,122,22,95,78,97,109,101,115, - 112,97,99,101,80,97,116,104,46,95,95,108,101,110,95,95, - 99,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0, - 0,67,0,0,0,115,16,0,0,0,100,1,0,106,0,0, - 124,0,0,106,1,0,131,1,0,83,41,2,78,122,20,95, - 78,97,109,101,115,112,97,99,101,80,97,116,104,40,123,33, - 114,125,41,41,2,114,47,0,0,0,114,226,0,0,0,41, - 1,114,100,0,0,0,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,218,8,95,95,114,101,112,114,95,95,215, - 3,0,0,115,2,0,0,0,0,1,122,23,95,78,97,109, - 101,115,112,97,99,101,80,97,116,104,46,95,95,114,101,112, - 114,95,95,99,2,0,0,0,0,0,0,0,2,0,0,0, - 2,0,0,0,67,0,0,0,115,16,0,0,0,124,1,0, - 124,0,0,106,0,0,131,0,0,107,6,0,83,41,1,78, - 41,1,114,234,0,0,0,41,2,114,100,0,0,0,218,4, - 105,116,101,109,114,4,0,0,0,114,4,0,0,0,114,5, - 0,0,0,218,12,95,95,99,111,110,116,97,105,110,115,95, - 95,218,3,0,0,115,2,0,0,0,0,1,122,27,95,78, - 97,109,101,115,112,97,99,101,80,97,116,104,46,95,95,99, - 111,110,116,97,105,110,115,95,95,99,2,0,0,0,0,0, - 0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,20, - 0,0,0,124,0,0,106,0,0,106,1,0,124,1,0,131, - 1,0,1,100,0,0,83,41,1,78,41,2,114,226,0,0, - 0,114,157,0,0,0,41,2,114,100,0,0,0,114,241,0, + 0,218,11,109,111,100,117,108,101,95,114,101,112,114,231,3, + 0,0,115,2,0,0,0,0,7,122,28,95,78,97,109,101, + 115,112,97,99,101,76,111,97,100,101,114,46,109,111,100,117, + 108,101,95,114,101,112,114,99,2,0,0,0,0,0,0,0, + 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, + 0,100,1,83,0,41,2,78,84,114,4,0,0,0,41,2, + 114,100,0,0,0,114,119,0,0,0,114,4,0,0,0,114, + 4,0,0,0,114,5,0,0,0,114,153,0,0,0,240,3, + 0,0,115,2,0,0,0,0,1,122,27,95,78,97,109,101, + 115,112,97,99,101,76,111,97,100,101,114,46,105,115,95,112, + 97,99,107,97,103,101,99,2,0,0,0,0,0,0,0,2, + 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, + 100,1,83,0,41,2,78,114,30,0,0,0,114,4,0,0, + 0,41,2,114,100,0,0,0,114,119,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,196,0,0, + 0,243,3,0,0,115,2,0,0,0,0,1,122,27,95,78, + 97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,103, + 101,116,95,115,111,117,114,99,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,6,0,0,0,67,0,0,0,115,18, + 0,0,0,116,0,100,1,100,2,100,3,100,4,100,5,144, + 1,131,3,83,0,41,6,78,114,30,0,0,0,122,8,60, + 115,116,114,105,110,103,62,114,183,0,0,0,114,198,0,0, + 0,84,41,1,114,199,0,0,0,41,2,114,100,0,0,0, + 114,119,0,0,0,114,4,0,0,0,114,4,0,0,0,114, + 5,0,0,0,114,181,0,0,0,246,3,0,0,115,2,0, + 0,0,0,1,122,25,95,78,97,109,101,115,112,97,99,101, + 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,99, + 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, + 67,0,0,0,115,4,0,0,0,100,1,83,0,41,2,122, + 42,85,115,101,32,100,101,102,97,117,108,116,32,115,101,109, + 97,110,116,105,99,115,32,102,111,114,32,109,111,100,117,108, + 101,32,99,114,101,97,116,105,111,110,46,78,114,4,0,0, + 0,41,2,114,100,0,0,0,114,158,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,180,0,0, + 0,249,3,0,0,115,0,0,0,0,122,30,95,78,97,109, + 101,115,112,97,99,101,76,111,97,100,101,114,46,99,114,101, + 97,116,101,95,109,111,100,117,108,101,99,2,0,0,0,0, + 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, + 4,0,0,0,100,0,83,0,41,1,78,114,4,0,0,0, + 41,2,114,100,0,0,0,114,184,0,0,0,114,4,0,0, + 0,114,4,0,0,0,114,5,0,0,0,114,185,0,0,0, + 252,3,0,0,115,2,0,0,0,0,1,122,28,95,78,97, + 109,101,115,112,97,99,101,76,111,97,100,101,114,46,101,120, + 101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,26, + 0,0,0,116,0,106,1,100,1,124,0,106,2,131,2,1, + 0,116,0,106,3,124,0,124,1,131,2,83,0,41,2,122, + 98,76,111,97,100,32,97,32,110,97,109,101,115,112,97,99, + 101,32,109,111,100,117,108,101,46,10,10,32,32,32,32,32, + 32,32,32,84,104,105,115,32,109,101,116,104,111,100,32,105, + 115,32,100,101,112,114,101,99,97,116,101,100,46,32,32,85, + 115,101,32,101,120,101,99,95,109,111,100,117,108,101,40,41, + 32,105,110,115,116,101,97,100,46,10,10,32,32,32,32,32, + 32,32,32,122,38,110,97,109,101,115,112,97,99,101,32,109, + 111,100,117,108,101,32,108,111,97,100,101,100,32,119,105,116, + 104,32,112,97,116,104,32,123,33,114,125,41,4,114,114,0, + 0,0,114,129,0,0,0,114,226,0,0,0,114,186,0,0, + 0,41,2,114,100,0,0,0,114,119,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,187,0,0, + 0,255,3,0,0,115,6,0,0,0,0,7,6,1,8,1, + 122,28,95,78,97,109,101,115,112,97,99,101,76,111,97,100, + 101,114,46,108,111,97,100,95,109,111,100,117,108,101,78,41, + 12,114,105,0,0,0,114,104,0,0,0,114,106,0,0,0, + 114,179,0,0,0,114,177,0,0,0,114,244,0,0,0,114, + 153,0,0,0,114,196,0,0,0,114,181,0,0,0,114,180, + 0,0,0,114,185,0,0,0,114,187,0,0,0,114,4,0, 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, - 0,114,157,0,0,0,221,3,0,0,115,2,0,0,0,0, - 1,122,21,95,78,97,109,101,115,112,97,99,101,80,97,116, - 104,46,97,112,112,101,110,100,78,41,14,114,105,0,0,0, - 114,104,0,0,0,114,106,0,0,0,114,107,0,0,0,114, - 179,0,0,0,114,232,0,0,0,114,227,0,0,0,114,234, - 0,0,0,114,236,0,0,0,114,238,0,0,0,114,239,0, - 0,0,114,240,0,0,0,114,242,0,0,0,114,157,0,0, - 0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,114,224,0,0,0,166,3,0,0,115,22, - 0,0,0,12,5,6,2,12,6,12,10,12,4,12,13,12, - 3,12,3,12,3,12,3,12,3,114,224,0,0,0,99,0, - 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,64, - 0,0,0,115,118,0,0,0,101,0,0,90,1,0,100,0, - 0,90,2,0,100,1,0,100,2,0,132,0,0,90,3,0, - 101,4,0,100,3,0,100,4,0,132,0,0,131,1,0,90, - 5,0,100,5,0,100,6,0,132,0,0,90,6,0,100,7, - 0,100,8,0,132,0,0,90,7,0,100,9,0,100,10,0, - 132,0,0,90,8,0,100,11,0,100,12,0,132,0,0,90, - 9,0,100,13,0,100,14,0,132,0,0,90,10,0,100,15, - 0,100,16,0,132,0,0,90,11,0,100,17,0,83,41,18, - 218,16,95,78,97,109,101,115,112,97,99,101,76,111,97,100, - 101,114,99,4,0,0,0,0,0,0,0,4,0,0,0,4, - 0,0,0,67,0,0,0,115,25,0,0,0,116,0,0,124, - 1,0,124,2,0,124,3,0,131,3,0,124,0,0,95,1, - 0,100,0,0,83,41,1,78,41,2,114,224,0,0,0,114, - 226,0,0,0,41,4,114,100,0,0,0,114,98,0,0,0, - 114,35,0,0,0,114,230,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,179,0,0,0,227,3, - 0,0,115,2,0,0,0,0,1,122,25,95,78,97,109,101, - 115,112,97,99,101,76,111,97,100,101,114,46,95,95,105,110, - 105,116,95,95,99,2,0,0,0,0,0,0,0,2,0,0, - 0,2,0,0,0,67,0,0,0,115,16,0,0,0,100,1, - 0,106,0,0,124,1,0,106,1,0,131,1,0,83,41,2, - 122,115,82,101,116,117,114,110,32,114,101,112,114,32,102,111, - 114,32,116,104,101,32,109,111,100,117,108,101,46,10,10,32, - 32,32,32,32,32,32,32,84,104,101,32,109,101,116,104,111, - 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, - 32,32,84,104,101,32,105,109,112,111,114,116,32,109,97,99, - 104,105,110,101,114,121,32,100,111,101,115,32,116,104,101,32, - 106,111,98,32,105,116,115,101,108,102,46,10,10,32,32,32, - 32,32,32,32,32,122,25,60,109,111,100,117,108,101,32,123, - 33,114,125,32,40,110,97,109,101,115,112,97,99,101,41,62, - 41,2,114,47,0,0,0,114,105,0,0,0,41,2,114,164, - 0,0,0,114,184,0,0,0,114,4,0,0,0,114,4,0, - 0,0,114,5,0,0,0,218,11,109,111,100,117,108,101,95, - 114,101,112,114,230,3,0,0,115,2,0,0,0,0,7,122, - 28,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, - 114,46,109,111,100,117,108,101,95,114,101,112,114,99,2,0, - 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, - 0,0,115,4,0,0,0,100,1,0,83,41,2,78,84,114, - 4,0,0,0,41,2,114,100,0,0,0,114,119,0,0,0, - 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, - 153,0,0,0,239,3,0,0,115,2,0,0,0,0,1,122, - 27,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, - 114,46,105,115,95,112,97,99,107,97,103,101,99,2,0,0, - 0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, - 0,115,4,0,0,0,100,1,0,83,41,2,78,114,30,0, - 0,0,114,4,0,0,0,41,2,114,100,0,0,0,114,119, - 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, - 0,0,114,196,0,0,0,242,3,0,0,115,2,0,0,0, - 0,1,122,27,95,78,97,109,101,115,112,97,99,101,76,111, - 97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,99, - 2,0,0,0,0,0,0,0,2,0,0,0,6,0,0,0, - 67,0,0,0,115,22,0,0,0,116,0,0,100,1,0,100, - 2,0,100,3,0,100,4,0,100,5,0,131,3,1,83,41, - 6,78,114,30,0,0,0,122,8,60,115,116,114,105,110,103, - 62,114,183,0,0,0,114,198,0,0,0,84,41,1,114,199, - 0,0,0,41,2,114,100,0,0,0,114,119,0,0,0,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,181, - 0,0,0,245,3,0,0,115,2,0,0,0,0,1,122,25, - 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, - 46,103,101,116,95,99,111,100,101,99,2,0,0,0,0,0, - 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, - 0,0,0,100,1,0,83,41,2,122,42,85,115,101,32,100, - 101,102,97,117,108,116,32,115,101,109,97,110,116,105,99,115, - 32,102,111,114,32,109,111,100,117,108,101,32,99,114,101,97, - 116,105,111,110,46,78,114,4,0,0,0,41,2,114,100,0, - 0,0,114,158,0,0,0,114,4,0,0,0,114,4,0,0, - 0,114,5,0,0,0,114,180,0,0,0,248,3,0,0,115, - 0,0,0,0,122,30,95,78,97,109,101,115,112,97,99,101, - 76,111,97,100,101,114,46,99,114,101,97,116,101,95,109,111, - 100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0, - 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,0, - 0,83,41,1,78,114,4,0,0,0,41,2,114,100,0,0, - 0,114,184,0,0,0,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,114,185,0,0,0,251,3,0,0,115,2, - 0,0,0,0,1,122,28,95,78,97,109,101,115,112,97,99, - 101,76,111,97,100,101,114,46,101,120,101,99,95,109,111,100, - 117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0, - 3,0,0,0,67,0,0,0,115,35,0,0,0,116,0,0, - 106,1,0,100,1,0,124,0,0,106,2,0,131,2,0,1, - 116,0,0,106,3,0,124,0,0,124,1,0,131,2,0,83, - 41,2,122,98,76,111,97,100,32,97,32,110,97,109,101,115, - 112,97,99,101,32,109,111,100,117,108,101,46,10,10,32,32, - 32,32,32,32,32,32,84,104,105,115,32,109,101,116,104,111, - 100,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46, - 32,32,85,115,101,32,101,120,101,99,95,109,111,100,117,108, - 101,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, - 32,32,32,32,32,32,122,38,110,97,109,101,115,112,97,99, - 101,32,109,111,100,117,108,101,32,108,111,97,100,101,100,32, - 119,105,116,104,32,112,97,116,104,32,123,33,114,125,41,4, - 114,114,0,0,0,114,129,0,0,0,114,226,0,0,0,114, - 186,0,0,0,41,2,114,100,0,0,0,114,119,0,0,0, - 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, - 187,0,0,0,254,3,0,0,115,6,0,0,0,0,7,9, - 1,10,1,122,28,95,78,97,109,101,115,112,97,99,101,76, - 111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,108, - 101,78,41,12,114,105,0,0,0,114,104,0,0,0,114,106, - 0,0,0,114,179,0,0,0,114,177,0,0,0,114,244,0, - 0,0,114,153,0,0,0,114,196,0,0,0,114,181,0,0, - 0,114,180,0,0,0,114,185,0,0,0,114,187,0,0,0, - 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,114,243,0,0,0,226,3,0,0,115,16,0, - 0,0,12,1,12,3,18,9,12,3,12,3,12,3,12,3, - 12,3,114,243,0,0,0,99,0,0,0,0,0,0,0,0, - 0,0,0,0,5,0,0,0,64,0,0,0,115,160,0,0, - 0,101,0,0,90,1,0,100,0,0,90,2,0,100,1,0, - 90,3,0,101,4,0,100,2,0,100,3,0,132,0,0,131, - 1,0,90,5,0,101,4,0,100,4,0,100,5,0,132,0, - 0,131,1,0,90,6,0,101,4,0,100,6,0,100,7,0, - 132,0,0,131,1,0,90,7,0,101,4,0,100,8,0,100, - 9,0,132,0,0,131,1,0,90,8,0,101,4,0,100,10, - 0,100,11,0,100,12,0,132,1,0,131,1,0,90,9,0, - 101,4,0,100,10,0,100,10,0,100,13,0,100,14,0,132, - 2,0,131,1,0,90,10,0,101,4,0,100,10,0,100,15, - 0,100,16,0,132,1,0,131,1,0,90,11,0,100,10,0, - 83,41,17,218,10,80,97,116,104,70,105,110,100,101,114,122, - 62,77,101,116,97,32,112,97,116,104,32,102,105,110,100,101, - 114,32,102,111,114,32,115,121,115,46,112,97,116,104,32,97, - 110,100,32,112,97,99,107,97,103,101,32,95,95,112,97,116, - 104,95,95,32,97,116,116,114,105,98,117,116,101,115,46,99, - 1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0, - 67,0,0,0,115,55,0,0,0,120,48,0,116,0,0,106, - 1,0,106,2,0,131,0,0,68,93,31,0,125,1,0,116, - 3,0,124,1,0,100,1,0,131,2,0,114,16,0,124,1, - 0,106,4,0,131,0,0,1,113,16,0,87,100,2,0,83, - 41,3,122,125,67,97,108,108,32,116,104,101,32,105,110,118, - 97,108,105,100,97,116,101,95,99,97,99,104,101,115,40,41, - 32,109,101,116,104,111,100,32,111,110,32,97,108,108,32,112, - 97,116,104,32,101,110,116,114,121,32,102,105,110,100,101,114, - 115,10,32,32,32,32,32,32,32,32,115,116,111,114,101,100, - 32,105,110,32,115,121,115,46,112,97,116,104,95,105,109,112, - 111,114,116,101,114,95,99,97,99,104,101,115,32,40,119,104, - 101,114,101,32,105,109,112,108,101,109,101,110,116,101,100,41, - 46,218,17,105,110,118,97,108,105,100,97,116,101,95,99,97, - 99,104,101,115,78,41,5,114,7,0,0,0,218,19,112,97, - 116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,104, - 101,218,6,118,97,108,117,101,115,114,108,0,0,0,114,246, - 0,0,0,41,2,114,164,0,0,0,218,6,102,105,110,100, - 101,114,114,4,0,0,0,114,4,0,0,0,114,5,0,0, - 0,114,246,0,0,0,16,4,0,0,115,6,0,0,0,0, - 4,22,1,15,1,122,28,80,97,116,104,70,105,110,100,101, - 114,46,105,110,118,97,108,105,100,97,116,101,95,99,97,99, - 104,101,115,99,2,0,0,0,0,0,0,0,3,0,0,0, - 12,0,0,0,67,0,0,0,115,107,0,0,0,116,0,0, - 106,1,0,100,1,0,107,9,0,114,41,0,116,0,0,106, - 1,0,12,114,41,0,116,2,0,106,3,0,100,2,0,116, - 4,0,131,2,0,1,120,59,0,116,0,0,106,1,0,68, - 93,44,0,125,2,0,121,14,0,124,2,0,124,1,0,131, - 1,0,83,87,113,51,0,4,116,5,0,107,10,0,114,94, - 0,1,1,1,119,51,0,89,113,51,0,88,113,51,0,87, - 100,1,0,83,100,1,0,83,41,3,122,113,83,101,97,114, - 99,104,32,115,101,113,117,101,110,99,101,32,111,102,32,104, - 111,111,107,115,32,102,111,114,32,97,32,102,105,110,100,101, - 114,32,102,111,114,32,39,112,97,116,104,39,46,10,10,32, - 32,32,32,32,32,32,32,73,102,32,39,104,111,111,107,115, - 39,32,105,115,32,102,97,108,115,101,32,116,104,101,110,32, - 117,115,101,32,115,121,115,46,112,97,116,104,95,104,111,111, - 107,115,46,10,10,32,32,32,32,32,32,32,32,78,122,23, - 115,121,115,46,112,97,116,104,95,104,111,111,107,115,32,105, - 115,32,101,109,112,116,121,41,6,114,7,0,0,0,218,10, - 112,97,116,104,95,104,111,111,107,115,114,60,0,0,0,114, - 61,0,0,0,114,118,0,0,0,114,99,0,0,0,41,3, - 114,164,0,0,0,114,35,0,0,0,90,4,104,111,111,107, - 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, - 11,95,112,97,116,104,95,104,111,111,107,115,24,4,0,0, - 115,16,0,0,0,0,7,25,1,16,1,16,1,3,1,14, - 1,13,1,12,2,122,22,80,97,116,104,70,105,110,100,101, - 114,46,95,112,97,116,104,95,104,111,111,107,115,99,2,0, - 0,0,0,0,0,0,3,0,0,0,19,0,0,0,67,0, - 0,0,115,123,0,0,0,124,1,0,100,1,0,107,2,0, - 114,53,0,121,16,0,116,0,0,106,1,0,131,0,0,125, - 1,0,87,110,22,0,4,116,2,0,107,10,0,114,52,0, - 1,1,1,100,2,0,83,89,110,1,0,88,121,17,0,116, - 3,0,106,4,0,124,1,0,25,125,2,0,87,110,46,0, - 4,116,5,0,107,10,0,114,118,0,1,1,1,124,0,0, - 106,6,0,124,1,0,131,1,0,125,2,0,124,2,0,116, - 3,0,106,4,0,124,1,0,60,89,110,1,0,88,124,2, - 0,83,41,3,122,210,71,101,116,32,116,104,101,32,102,105, - 110,100,101,114,32,102,111,114,32,116,104,101,32,112,97,116, - 104,32,101,110,116,114,121,32,102,114,111,109,32,115,121,115, - 46,112,97,116,104,95,105,109,112,111,114,116,101,114,95,99, - 97,99,104,101,46,10,10,32,32,32,32,32,32,32,32,73, - 102,32,116,104,101,32,112,97,116,104,32,101,110,116,114,121, - 32,105,115,32,110,111,116,32,105,110,32,116,104,101,32,99, - 97,99,104,101,44,32,102,105,110,100,32,116,104,101,32,97, - 112,112,114,111,112,114,105,97,116,101,32,102,105,110,100,101, - 114,10,32,32,32,32,32,32,32,32,97,110,100,32,99,97, - 99,104,101,32,105,116,46,32,73,102,32,110,111,32,102,105, - 110,100,101,114,32,105,115,32,97,118,97,105,108,97,98,108, - 101,44,32,115,116,111,114,101,32,78,111,110,101,46,10,10, - 32,32,32,32,32,32,32,32,114,30,0,0,0,78,41,7, - 114,3,0,0,0,114,45,0,0,0,218,17,70,105,108,101, - 78,111,116,70,111,117,110,100,69,114,114,111,114,114,7,0, - 0,0,114,247,0,0,0,114,131,0,0,0,114,251,0,0, - 0,41,3,114,164,0,0,0,114,35,0,0,0,114,249,0, + 0,114,243,0,0,0,227,3,0,0,115,16,0,0,0,8, + 1,8,3,12,9,8,3,8,3,8,3,8,3,8,3,114, + 243,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0, + 0,5,0,0,0,64,0,0,0,115,108,0,0,0,101,0, + 90,1,100,0,90,2,100,1,90,3,101,4,100,2,100,3, + 132,0,131,1,90,5,101,4,100,4,100,5,132,0,131,1, + 90,6,101,4,100,6,100,7,132,0,131,1,90,7,101,4, + 100,8,100,9,132,0,131,1,90,8,101,4,100,10,100,11, + 100,12,132,1,131,1,90,9,101,4,100,10,100,10,100,13, + 100,14,132,2,131,1,90,10,101,4,100,10,100,15,100,16, + 132,1,131,1,90,11,100,10,83,0,41,17,218,10,80,97, + 116,104,70,105,110,100,101,114,122,62,77,101,116,97,32,112, + 97,116,104,32,102,105,110,100,101,114,32,102,111,114,32,115, + 121,115,46,112,97,116,104,32,97,110,100,32,112,97,99,107, + 97,103,101,32,95,95,112,97,116,104,95,95,32,97,116,116, + 114,105,98,117,116,101,115,46,99,1,0,0,0,0,0,0, + 0,2,0,0,0,4,0,0,0,67,0,0,0,115,42,0, + 0,0,120,36,116,0,106,1,106,2,131,0,68,0,93,22, + 125,1,116,3,124,1,100,1,131,2,114,12,124,1,106,4, + 131,0,1,0,113,12,87,0,100,2,83,0,41,3,122,125, + 67,97,108,108,32,116,104,101,32,105,110,118,97,108,105,100, + 97,116,101,95,99,97,99,104,101,115,40,41,32,109,101,116, + 104,111,100,32,111,110,32,97,108,108,32,112,97,116,104,32, + 101,110,116,114,121,32,102,105,110,100,101,114,115,10,32,32, + 32,32,32,32,32,32,115,116,111,114,101,100,32,105,110,32, + 115,121,115,46,112,97,116,104,95,105,109,112,111,114,116,101, + 114,95,99,97,99,104,101,115,32,40,119,104,101,114,101,32, + 105,109,112,108,101,109,101,110,116,101,100,41,46,218,17,105, + 110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,115, + 78,41,5,114,7,0,0,0,218,19,112,97,116,104,95,105, + 109,112,111,114,116,101,114,95,99,97,99,104,101,218,6,118, + 97,108,117,101,115,114,108,0,0,0,114,246,0,0,0,41, + 2,114,164,0,0,0,218,6,102,105,110,100,101,114,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,114,246,0, + 0,0,17,4,0,0,115,6,0,0,0,0,4,16,1,10, + 1,122,28,80,97,116,104,70,105,110,100,101,114,46,105,110, + 118,97,108,105,100,97,116,101,95,99,97,99,104,101,115,99, + 2,0,0,0,0,0,0,0,3,0,0,0,12,0,0,0, + 67,0,0,0,115,86,0,0,0,116,0,106,1,100,1,107, + 9,114,30,116,0,106,1,12,0,114,30,116,2,106,3,100, + 2,116,4,131,2,1,0,120,50,116,0,106,1,68,0,93, + 36,125,2,121,8,124,2,124,1,131,1,83,0,4,0,116, + 5,107,10,114,72,1,0,1,0,1,0,119,38,89,0,113, + 38,88,0,113,38,87,0,100,1,83,0,100,1,83,0,41, + 3,122,113,83,101,97,114,99,104,32,115,101,113,117,101,110, + 99,101,32,111,102,32,104,111,111,107,115,32,102,111,114,32, + 97,32,102,105,110,100,101,114,32,102,111,114,32,39,112,97, + 116,104,39,46,10,10,32,32,32,32,32,32,32,32,73,102, + 32,39,104,111,111,107,115,39,32,105,115,32,102,97,108,115, + 101,32,116,104,101,110,32,117,115,101,32,115,121,115,46,112, + 97,116,104,95,104,111,111,107,115,46,10,10,32,32,32,32, + 32,32,32,32,78,122,23,115,121,115,46,112,97,116,104,95, + 104,111,111,107,115,32,105,115,32,101,109,112,116,121,41,6, + 114,7,0,0,0,218,10,112,97,116,104,95,104,111,111,107, + 115,114,60,0,0,0,114,61,0,0,0,114,118,0,0,0, + 114,99,0,0,0,41,3,114,164,0,0,0,114,35,0,0, + 0,90,4,104,111,111,107,114,4,0,0,0,114,4,0,0, + 0,114,5,0,0,0,218,11,95,112,97,116,104,95,104,111, + 111,107,115,25,4,0,0,115,16,0,0,0,0,7,18,1, + 12,1,12,1,2,1,8,1,14,1,12,2,122,22,80,97, + 116,104,70,105,110,100,101,114,46,95,112,97,116,104,95,104, + 111,111,107,115,99,2,0,0,0,0,0,0,0,3,0,0, + 0,19,0,0,0,67,0,0,0,115,102,0,0,0,124,1, + 100,1,107,2,114,42,121,12,116,0,106,1,131,0,125,1, + 87,0,110,20,4,0,116,2,107,10,114,40,1,0,1,0, + 1,0,100,2,83,0,88,0,121,14,116,3,106,4,124,1, + 25,0,125,2,87,0,110,40,4,0,116,5,107,10,114,96, + 1,0,1,0,1,0,124,0,106,6,124,1,131,1,125,2, + 124,2,116,3,106,4,124,1,60,0,89,0,110,2,88,0, + 124,2,83,0,41,3,122,210,71,101,116,32,116,104,101,32, + 102,105,110,100,101,114,32,102,111,114,32,116,104,101,32,112, + 97,116,104,32,101,110,116,114,121,32,102,114,111,109,32,115, + 121,115,46,112,97,116,104,95,105,109,112,111,114,116,101,114, + 95,99,97,99,104,101,46,10,10,32,32,32,32,32,32,32, + 32,73,102,32,116,104,101,32,112,97,116,104,32,101,110,116, + 114,121,32,105,115,32,110,111,116,32,105,110,32,116,104,101, + 32,99,97,99,104,101,44,32,102,105,110,100,32,116,104,101, + 32,97,112,112,114,111,112,114,105,97,116,101,32,102,105,110, + 100,101,114,10,32,32,32,32,32,32,32,32,97,110,100,32, + 99,97,99,104,101,32,105,116,46,32,73,102,32,110,111,32, + 102,105,110,100,101,114,32,105,115,32,97,118,97,105,108,97, + 98,108,101,44,32,115,116,111,114,101,32,78,111,110,101,46, + 10,10,32,32,32,32,32,32,32,32,114,30,0,0,0,78, + 41,7,114,3,0,0,0,114,45,0,0,0,218,17,70,105, + 108,101,78,111,116,70,111,117,110,100,69,114,114,111,114,114, + 7,0,0,0,114,247,0,0,0,114,131,0,0,0,114,251, + 0,0,0,41,3,114,164,0,0,0,114,35,0,0,0,114, + 249,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, + 0,0,0,218,20,95,112,97,116,104,95,105,109,112,111,114, + 116,101,114,95,99,97,99,104,101,42,4,0,0,115,22,0, + 0,0,0,8,8,1,2,1,12,1,14,3,6,1,2,1, + 14,1,14,1,10,1,16,1,122,31,80,97,116,104,70,105, + 110,100,101,114,46,95,112,97,116,104,95,105,109,112,111,114, + 116,101,114,95,99,97,99,104,101,99,3,0,0,0,0,0, + 0,0,6,0,0,0,3,0,0,0,67,0,0,0,115,82, + 0,0,0,116,0,124,2,100,1,131,2,114,26,124,2,106, + 1,124,1,131,1,92,2,125,3,125,4,110,14,124,2,106, + 2,124,1,131,1,125,3,103,0,125,4,124,3,100,0,107, + 9,114,60,116,3,106,4,124,1,124,3,131,2,83,0,116, + 3,106,5,124,1,100,0,131,2,125,5,124,4,124,5,95, + 6,124,5,83,0,41,2,78,114,117,0,0,0,41,7,114, + 108,0,0,0,114,117,0,0,0,114,176,0,0,0,114,114, + 0,0,0,114,173,0,0,0,114,154,0,0,0,114,150,0, + 0,0,41,6,114,164,0,0,0,114,119,0,0,0,114,249, + 0,0,0,114,120,0,0,0,114,121,0,0,0,114,158,0, 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, - 0,218,20,95,112,97,116,104,95,105,109,112,111,114,116,101, - 114,95,99,97,99,104,101,41,4,0,0,115,22,0,0,0, - 0,8,12,1,3,1,16,1,13,3,9,1,3,1,17,1, - 13,1,15,1,18,1,122,31,80,97,116,104,70,105,110,100, - 101,114,46,95,112,97,116,104,95,105,109,112,111,114,116,101, - 114,95,99,97,99,104,101,99,3,0,0,0,0,0,0,0, - 6,0,0,0,3,0,0,0,67,0,0,0,115,119,0,0, - 0,116,0,0,124,2,0,100,1,0,131,2,0,114,39,0, - 124,2,0,106,1,0,124,1,0,131,1,0,92,2,0,125, - 3,0,125,4,0,110,21,0,124,2,0,106,2,0,124,1, - 0,131,1,0,125,3,0,103,0,0,125,4,0,124,3,0, - 100,0,0,107,9,0,114,88,0,116,3,0,106,4,0,124, - 1,0,124,3,0,131,2,0,83,116,3,0,106,5,0,124, - 1,0,100,0,0,131,2,0,125,5,0,124,4,0,124,5, - 0,95,6,0,124,5,0,83,41,2,78,114,117,0,0,0, - 41,7,114,108,0,0,0,114,117,0,0,0,114,176,0,0, - 0,114,114,0,0,0,114,173,0,0,0,114,154,0,0,0, - 114,150,0,0,0,41,6,114,164,0,0,0,114,119,0,0, - 0,114,249,0,0,0,114,120,0,0,0,114,121,0,0,0, - 114,158,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,218,16,95,108,101,103,97,99,121,95,103,101, - 116,95,115,112,101,99,63,4,0,0,115,18,0,0,0,0, - 4,15,1,24,2,15,1,6,1,12,1,16,1,18,1,9, - 1,122,27,80,97,116,104,70,105,110,100,101,114,46,95,108, - 101,103,97,99,121,95,103,101,116,95,115,112,101,99,78,99, - 4,0,0,0,0,0,0,0,9,0,0,0,5,0,0,0, - 67,0,0,0,115,243,0,0,0,103,0,0,125,4,0,120, - 230,0,124,2,0,68,93,191,0,125,5,0,116,0,0,124, - 5,0,116,1,0,116,2,0,102,2,0,131,2,0,115,43, - 0,113,13,0,124,0,0,106,3,0,124,5,0,131,1,0, - 125,6,0,124,6,0,100,1,0,107,9,0,114,13,0,116, - 4,0,124,6,0,100,2,0,131,2,0,114,106,0,124,6, - 0,106,5,0,124,1,0,124,3,0,131,2,0,125,7,0, - 110,18,0,124,0,0,106,6,0,124,1,0,124,6,0,131, - 2,0,125,7,0,124,7,0,100,1,0,107,8,0,114,139, - 0,113,13,0,124,7,0,106,7,0,100,1,0,107,9,0, - 114,158,0,124,7,0,83,124,7,0,106,8,0,125,8,0, - 124,8,0,100,1,0,107,8,0,114,191,0,116,9,0,100, - 3,0,131,1,0,130,1,0,124,4,0,106,10,0,124,8, - 0,131,1,0,1,113,13,0,87,116,11,0,106,12,0,124, - 1,0,100,1,0,131,2,0,125,7,0,124,4,0,124,7, - 0,95,8,0,124,7,0,83,100,1,0,83,41,4,122,63, - 70,105,110,100,32,116,104,101,32,108,111,97,100,101,114,32, - 111,114,32,110,97,109,101,115,112,97,99,101,95,112,97,116, - 104,32,102,111,114,32,116,104,105,115,32,109,111,100,117,108, - 101,47,112,97,99,107,97,103,101,32,110,97,109,101,46,78, - 114,175,0,0,0,122,19,115,112,101,99,32,109,105,115,115, - 105,110,103,32,108,111,97,100,101,114,41,13,114,137,0,0, - 0,114,69,0,0,0,218,5,98,121,116,101,115,114,253,0, - 0,0,114,108,0,0,0,114,175,0,0,0,114,254,0,0, - 0,114,120,0,0,0,114,150,0,0,0,114,99,0,0,0, - 114,143,0,0,0,114,114,0,0,0,114,154,0,0,0,41, - 9,114,164,0,0,0,114,119,0,0,0,114,35,0,0,0, - 114,174,0,0,0,218,14,110,97,109,101,115,112,97,99,101, - 95,112,97,116,104,90,5,101,110,116,114,121,114,249,0,0, - 0,114,158,0,0,0,114,121,0,0,0,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,218,9,95,103,101,116, - 95,115,112,101,99,78,4,0,0,115,40,0,0,0,0,5, - 6,1,13,1,21,1,3,1,15,1,12,1,15,1,21,2, - 18,1,12,1,3,1,15,1,4,1,9,1,12,1,12,5, - 17,2,18,1,9,1,122,20,80,97,116,104,70,105,110,100, - 101,114,46,95,103,101,116,95,115,112,101,99,99,4,0,0, - 0,0,0,0,0,6,0,0,0,4,0,0,0,67,0,0, - 0,115,140,0,0,0,124,2,0,100,1,0,107,8,0,114, - 21,0,116,0,0,106,1,0,125,2,0,124,0,0,106,2, - 0,124,1,0,124,2,0,124,3,0,131,3,0,125,4,0, - 124,4,0,100,1,0,107,8,0,114,58,0,100,1,0,83, - 124,4,0,106,3,0,100,1,0,107,8,0,114,132,0,124, - 4,0,106,4,0,125,5,0,124,5,0,114,125,0,100,2, - 0,124,4,0,95,5,0,116,6,0,124,1,0,124,5,0, - 124,0,0,106,2,0,131,3,0,124,4,0,95,4,0,124, - 4,0,83,100,1,0,83,110,4,0,124,4,0,83,100,1, - 0,83,41,3,122,98,102,105,110,100,32,116,104,101,32,109, + 0,218,16,95,108,101,103,97,99,121,95,103,101,116,95,115, + 112,101,99,64,4,0,0,115,18,0,0,0,0,4,10,1, + 16,2,10,1,4,1,8,1,12,1,12,1,6,1,122,27, + 80,97,116,104,70,105,110,100,101,114,46,95,108,101,103,97, + 99,121,95,103,101,116,95,115,112,101,99,78,99,4,0,0, + 0,0,0,0,0,9,0,0,0,5,0,0,0,67,0,0, + 0,115,170,0,0,0,103,0,125,4,120,160,124,2,68,0, + 93,130,125,5,116,0,124,5,116,1,116,2,102,2,131,2, + 115,30,113,10,124,0,106,3,124,5,131,1,125,6,124,6, + 100,1,107,9,114,10,116,4,124,6,100,2,131,2,114,72, + 124,6,106,5,124,1,124,3,131,2,125,7,110,12,124,0, + 106,6,124,1,124,6,131,2,125,7,124,7,100,1,107,8, + 114,94,113,10,124,7,106,7,100,1,107,9,114,108,124,7, + 83,0,124,7,106,8,125,8,124,8,100,1,107,8,114,130, + 116,9,100,3,131,1,130,1,124,4,106,10,124,8,131,1, + 1,0,113,10,87,0,116,11,106,12,124,1,100,1,131,2, + 125,7,124,4,124,7,95,8,124,7,83,0,100,1,83,0, + 41,4,122,63,70,105,110,100,32,116,104,101,32,108,111,97, + 100,101,114,32,111,114,32,110,97,109,101,115,112,97,99,101, + 95,112,97,116,104,32,102,111,114,32,116,104,105,115,32,109, + 111,100,117,108,101,47,112,97,99,107,97,103,101,32,110,97, + 109,101,46,78,114,175,0,0,0,122,19,115,112,101,99,32, + 109,105,115,115,105,110,103,32,108,111,97,100,101,114,41,13, + 114,137,0,0,0,114,69,0,0,0,218,5,98,121,116,101, + 115,114,253,0,0,0,114,108,0,0,0,114,175,0,0,0, + 114,254,0,0,0,114,120,0,0,0,114,150,0,0,0,114, + 99,0,0,0,114,143,0,0,0,114,114,0,0,0,114,154, + 0,0,0,41,9,114,164,0,0,0,114,119,0,0,0,114, + 35,0,0,0,114,174,0,0,0,218,14,110,97,109,101,115, + 112,97,99,101,95,112,97,116,104,90,5,101,110,116,114,121, + 114,249,0,0,0,114,158,0,0,0,114,121,0,0,0,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,9, + 95,103,101,116,95,115,112,101,99,79,4,0,0,115,40,0, + 0,0,0,5,4,1,10,1,14,1,2,1,10,1,8,1, + 10,1,14,2,12,1,8,1,2,1,10,1,4,1,6,1, + 8,1,8,5,14,2,12,1,6,1,122,20,80,97,116,104, + 70,105,110,100,101,114,46,95,103,101,116,95,115,112,101,99, + 99,4,0,0,0,0,0,0,0,6,0,0,0,4,0,0, + 0,67,0,0,0,115,104,0,0,0,124,2,100,1,107,8, + 114,14,116,0,106,1,125,2,124,0,106,2,124,1,124,2, + 124,3,131,3,125,4,124,4,100,1,107,8,114,42,100,1, + 83,0,110,58,124,4,106,3,100,1,107,8,114,96,124,4, + 106,4,125,5,124,5,114,90,100,2,124,4,95,5,116,6, + 124,1,124,5,124,0,106,2,131,3,124,4,95,4,124,4, + 83,0,113,100,100,1,83,0,110,4,124,4,83,0,100,1, + 83,0,41,3,122,98,102,105,110,100,32,116,104,101,32,109, 111,100,117,108,101,32,111,110,32,115,121,115,46,112,97,116, 104,32,111,114,32,39,112,97,116,104,39,32,98,97,115,101, 100,32,111,110,32,115,121,115,46,112,97,116,104,95,104,111, @@ -2071,522 +1940,485 @@ 152,0,0,0,114,224,0,0,0,41,6,114,164,0,0,0, 114,119,0,0,0,114,35,0,0,0,114,174,0,0,0,114, 158,0,0,0,114,0,1,0,0,114,4,0,0,0,114,4, - 0,0,0,114,5,0,0,0,114,175,0,0,0,110,4,0, - 0,115,26,0,0,0,0,4,12,1,9,1,21,1,12,1, - 4,1,15,1,9,1,6,3,9,1,24,1,4,2,7,2, + 0,0,0,114,5,0,0,0,114,175,0,0,0,111,4,0, + 0,115,26,0,0,0,0,4,8,1,6,1,14,1,8,1, + 6,1,10,1,6,1,4,3,6,1,16,1,6,2,6,2, 122,20,80,97,116,104,70,105,110,100,101,114,46,102,105,110, 100,95,115,112,101,99,99,3,0,0,0,0,0,0,0,4, - 0,0,0,3,0,0,0,67,0,0,0,115,41,0,0,0, - 124,0,0,106,0,0,124,1,0,124,2,0,131,2,0,125, - 3,0,124,3,0,100,1,0,107,8,0,114,34,0,100,1, - 0,83,124,3,0,106,1,0,83,41,2,122,170,102,105,110, - 100,32,116,104,101,32,109,111,100,117,108,101,32,111,110,32, - 115,121,115,46,112,97,116,104,32,111,114,32,39,112,97,116, - 104,39,32,98,97,115,101,100,32,111,110,32,115,121,115,46, - 112,97,116,104,95,104,111,111,107,115,32,97,110,100,10,32, - 32,32,32,32,32,32,32,115,121,115,46,112,97,116,104,95, - 105,109,112,111,114,116,101,114,95,99,97,99,104,101,46,10, - 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, - 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, - 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, - 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, - 32,32,32,32,32,32,32,78,41,2,114,175,0,0,0,114, - 120,0,0,0,41,4,114,164,0,0,0,114,119,0,0,0, - 114,35,0,0,0,114,158,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,176,0,0,0,132,4, - 0,0,115,8,0,0,0,0,8,18,1,12,1,4,1,122, - 22,80,97,116,104,70,105,110,100,101,114,46,102,105,110,100, - 95,109,111,100,117,108,101,41,12,114,105,0,0,0,114,104, - 0,0,0,114,106,0,0,0,114,107,0,0,0,114,177,0, - 0,0,114,246,0,0,0,114,251,0,0,0,114,253,0,0, - 0,114,254,0,0,0,114,1,1,0,0,114,175,0,0,0, - 114,176,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,245,0,0,0,12,4, - 0,0,115,22,0,0,0,12,2,6,2,18,8,18,17,18, - 22,18,15,3,1,18,31,3,1,21,21,3,1,114,245,0, - 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,64,0,0,0,115,133,0,0,0,101,0,0,90, - 1,0,100,0,0,90,2,0,100,1,0,90,3,0,100,2, - 0,100,3,0,132,0,0,90,4,0,100,4,0,100,5,0, - 132,0,0,90,5,0,101,6,0,90,7,0,100,6,0,100, - 7,0,132,0,0,90,8,0,100,8,0,100,9,0,132,0, - 0,90,9,0,100,10,0,100,11,0,100,12,0,132,1,0, - 90,10,0,100,13,0,100,14,0,132,0,0,90,11,0,101, - 12,0,100,15,0,100,16,0,132,0,0,131,1,0,90,13, - 0,100,17,0,100,18,0,132,0,0,90,14,0,100,10,0, - 83,41,19,218,10,70,105,108,101,70,105,110,100,101,114,122, - 172,70,105,108,101,45,98,97,115,101,100,32,102,105,110,100, - 101,114,46,10,10,32,32,32,32,73,110,116,101,114,97,99, - 116,105,111,110,115,32,119,105,116,104,32,116,104,101,32,102, - 105,108,101,32,115,121,115,116,101,109,32,97,114,101,32,99, - 97,99,104,101,100,32,102,111,114,32,112,101,114,102,111,114, - 109,97,110,99,101,44,32,98,101,105,110,103,10,32,32,32, - 32,114,101,102,114,101,115,104,101,100,32,119,104,101,110,32, - 116,104,101,32,100,105,114,101,99,116,111,114,121,32,116,104, - 101,32,102,105,110,100,101,114,32,105,115,32,104,97,110,100, - 108,105,110,103,32,104,97,115,32,98,101,101,110,32,109,111, - 100,105,102,105,101,100,46,10,10,32,32,32,32,99,2,0, - 0,0,0,0,0,0,5,0,0,0,5,0,0,0,7,0, - 0,0,115,122,0,0,0,103,0,0,125,3,0,120,52,0, - 124,2,0,68,93,44,0,92,2,0,137,0,0,125,4,0, - 124,3,0,106,0,0,135,0,0,102,1,0,100,1,0,100, - 2,0,134,0,0,124,4,0,68,131,1,0,131,1,0,1, - 113,13,0,87,124,3,0,124,0,0,95,1,0,124,1,0, - 112,79,0,100,3,0,124,0,0,95,2,0,100,6,0,124, - 0,0,95,3,0,116,4,0,131,0,0,124,0,0,95,5, - 0,116,4,0,131,0,0,124,0,0,95,6,0,100,5,0, - 83,41,7,122,154,73,110,105,116,105,97,108,105,122,101,32, - 119,105,116,104,32,116,104,101,32,112,97,116,104,32,116,111, - 32,115,101,97,114,99,104,32,111,110,32,97,110,100,32,97, - 32,118,97,114,105,97,98,108,101,32,110,117,109,98,101,114, - 32,111,102,10,32,32,32,32,32,32,32,32,50,45,116,117, - 112,108,101,115,32,99,111,110,116,97,105,110,105,110,103,32, - 116,104,101,32,108,111,97,100,101,114,32,97,110,100,32,116, - 104,101,32,102,105,108,101,32,115,117,102,102,105,120,101,115, - 32,116,104,101,32,108,111,97,100,101,114,10,32,32,32,32, - 32,32,32,32,114,101,99,111,103,110,105,122,101,115,46,99, - 1,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 51,0,0,0,115,27,0,0,0,124,0,0,93,17,0,125, - 1,0,124,1,0,136,0,0,102,2,0,86,1,113,3,0, - 100,0,0,83,41,1,78,114,4,0,0,0,41,2,114,22, - 0,0,0,114,219,0,0,0,41,1,114,120,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,221,0,0,0,161,4, - 0,0,115,2,0,0,0,6,0,122,38,70,105,108,101,70, - 105,110,100,101,114,46,95,95,105,110,105,116,95,95,46,60, - 108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,114, - 62,114,58,0,0,0,114,29,0,0,0,78,114,87,0,0, - 0,41,7,114,143,0,0,0,218,8,95,108,111,97,100,101, - 114,115,114,35,0,0,0,218,11,95,112,97,116,104,95,109, - 116,105,109,101,218,3,115,101,116,218,11,95,112,97,116,104, - 95,99,97,99,104,101,218,19,95,114,101,108,97,120,101,100, - 95,112,97,116,104,95,99,97,99,104,101,41,5,114,100,0, - 0,0,114,35,0,0,0,218,14,108,111,97,100,101,114,95, - 100,101,116,97,105,108,115,90,7,108,111,97,100,101,114,115, - 114,160,0,0,0,114,4,0,0,0,41,1,114,120,0,0, - 0,114,5,0,0,0,114,179,0,0,0,155,4,0,0,115, - 16,0,0,0,0,4,6,1,19,1,36,1,9,2,15,1, - 9,1,12,1,122,19,70,105,108,101,70,105,110,100,101,114, - 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0, - 0,0,1,0,0,0,2,0,0,0,67,0,0,0,115,13, - 0,0,0,100,3,0,124,0,0,95,0,0,100,2,0,83, + 0,0,0,3,0,0,0,67,0,0,0,115,30,0,0,0, + 124,0,106,0,124,1,124,2,131,2,125,3,124,3,100,1, + 107,8,114,24,100,1,83,0,124,3,106,1,83,0,41,2, + 122,170,102,105,110,100,32,116,104,101,32,109,111,100,117,108, + 101,32,111,110,32,115,121,115,46,112,97,116,104,32,111,114, + 32,39,112,97,116,104,39,32,98,97,115,101,100,32,111,110, + 32,115,121,115,46,112,97,116,104,95,104,111,111,107,115,32, + 97,110,100,10,32,32,32,32,32,32,32,32,115,121,115,46, + 112,97,116,104,95,105,109,112,111,114,116,101,114,95,99,97, + 99,104,101,46,10,10,32,32,32,32,32,32,32,32,84,104, + 105,115,32,109,101,116,104,111,100,32,105,115,32,100,101,112, + 114,101,99,97,116,101,100,46,32,32,85,115,101,32,102,105, + 110,100,95,115,112,101,99,40,41,32,105,110,115,116,101,97, + 100,46,10,10,32,32,32,32,32,32,32,32,78,41,2,114, + 175,0,0,0,114,120,0,0,0,41,4,114,164,0,0,0, + 114,119,0,0,0,114,35,0,0,0,114,158,0,0,0,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,176, + 0,0,0,133,4,0,0,115,8,0,0,0,0,8,12,1, + 8,1,4,1,122,22,80,97,116,104,70,105,110,100,101,114, + 46,102,105,110,100,95,109,111,100,117,108,101,41,12,114,105, + 0,0,0,114,104,0,0,0,114,106,0,0,0,114,107,0, + 0,0,114,177,0,0,0,114,246,0,0,0,114,251,0,0, + 0,114,253,0,0,0,114,254,0,0,0,114,1,1,0,0, + 114,175,0,0,0,114,176,0,0,0,114,4,0,0,0,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,245, + 0,0,0,13,4,0,0,115,22,0,0,0,8,2,4,2, + 12,8,12,17,12,22,12,15,2,1,12,31,2,1,14,21, + 2,1,114,245,0,0,0,99,0,0,0,0,0,0,0,0, + 0,0,0,0,3,0,0,0,64,0,0,0,115,90,0,0, + 0,101,0,90,1,100,0,90,2,100,1,90,3,100,2,100, + 3,132,0,90,4,100,4,100,5,132,0,90,5,101,6,90, + 7,100,6,100,7,132,0,90,8,100,8,100,9,132,0,90, + 9,100,10,100,11,100,12,132,1,90,10,100,13,100,14,132, + 0,90,11,101,12,100,15,100,16,132,0,131,1,90,13,100, + 17,100,18,132,0,90,14,100,10,83,0,41,19,218,10,70, + 105,108,101,70,105,110,100,101,114,122,172,70,105,108,101,45, + 98,97,115,101,100,32,102,105,110,100,101,114,46,10,10,32, + 32,32,32,73,110,116,101,114,97,99,116,105,111,110,115,32, + 119,105,116,104,32,116,104,101,32,102,105,108,101,32,115,121, + 115,116,101,109,32,97,114,101,32,99,97,99,104,101,100,32, + 102,111,114,32,112,101,114,102,111,114,109,97,110,99,101,44, + 32,98,101,105,110,103,10,32,32,32,32,114,101,102,114,101, + 115,104,101,100,32,119,104,101,110,32,116,104,101,32,100,105, + 114,101,99,116,111,114,121,32,116,104,101,32,102,105,110,100, + 101,114,32,105,115,32,104,97,110,100,108,105,110,103,32,104, + 97,115,32,98,101,101,110,32,109,111,100,105,102,105,101,100, + 46,10,10,32,32,32,32,99,2,0,0,0,0,0,0,0, + 5,0,0,0,5,0,0,0,7,0,0,0,115,88,0,0, + 0,103,0,125,3,120,40,124,2,68,0,93,32,92,2,137, + 0,125,4,124,3,106,0,135,0,102,1,100,1,100,2,134, + 0,124,4,68,0,131,1,131,1,1,0,113,10,87,0,124, + 3,124,0,95,1,124,1,112,58,100,3,124,0,95,2,100, + 6,124,0,95,3,116,4,131,0,124,0,95,5,116,4,131, + 0,124,0,95,6,100,5,83,0,41,7,122,154,73,110,105, + 116,105,97,108,105,122,101,32,119,105,116,104,32,116,104,101, + 32,112,97,116,104,32,116,111,32,115,101,97,114,99,104,32, + 111,110,32,97,110,100,32,97,32,118,97,114,105,97,98,108, + 101,32,110,117,109,98,101,114,32,111,102,10,32,32,32,32, + 32,32,32,32,50,45,116,117,112,108,101,115,32,99,111,110, + 116,97,105,110,105,110,103,32,116,104,101,32,108,111,97,100, + 101,114,32,97,110,100,32,116,104,101,32,102,105,108,101,32, + 115,117,102,102,105,120,101,115,32,116,104,101,32,108,111,97, + 100,101,114,10,32,32,32,32,32,32,32,32,114,101,99,111, + 103,110,105,122,101,115,46,99,1,0,0,0,0,0,0,0, + 2,0,0,0,3,0,0,0,51,0,0,0,115,22,0,0, + 0,124,0,93,14,125,1,124,1,136,0,102,2,86,0,1, + 0,113,2,100,0,83,0,41,1,78,114,4,0,0,0,41, + 2,114,22,0,0,0,114,219,0,0,0,41,1,114,120,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,221,0,0, + 0,162,4,0,0,115,2,0,0,0,4,0,122,38,70,105, + 108,101,70,105,110,100,101,114,46,95,95,105,110,105,116,95, + 95,46,60,108,111,99,97,108,115,62,46,60,103,101,110,101, + 120,112,114,62,114,58,0,0,0,114,29,0,0,0,78,114, + 87,0,0,0,41,7,114,143,0,0,0,218,8,95,108,111, + 97,100,101,114,115,114,35,0,0,0,218,11,95,112,97,116, + 104,95,109,116,105,109,101,218,3,115,101,116,218,11,95,112, + 97,116,104,95,99,97,99,104,101,218,19,95,114,101,108,97, + 120,101,100,95,112,97,116,104,95,99,97,99,104,101,41,5, + 114,100,0,0,0,114,35,0,0,0,218,14,108,111,97,100, + 101,114,95,100,101,116,97,105,108,115,90,7,108,111,97,100, + 101,114,115,114,160,0,0,0,114,4,0,0,0,41,1,114, + 120,0,0,0,114,5,0,0,0,114,179,0,0,0,156,4, + 0,0,115,16,0,0,0,0,4,4,1,14,1,28,1,6, + 2,10,1,6,1,8,1,122,19,70,105,108,101,70,105,110, + 100,101,114,46,95,95,105,110,105,116,95,95,99,1,0,0, + 0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,0, + 0,115,10,0,0,0,100,3,124,0,95,0,100,2,83,0, 41,4,122,31,73,110,118,97,108,105,100,97,116,101,32,116, 104,101,32,100,105,114,101,99,116,111,114,121,32,109,116,105, 109,101,46,114,29,0,0,0,78,114,87,0,0,0,41,1, 114,4,1,0,0,41,1,114,100,0,0,0,114,4,0,0, 0,114,4,0,0,0,114,5,0,0,0,114,246,0,0,0, - 169,4,0,0,115,2,0,0,0,0,2,122,28,70,105,108, + 170,4,0,0,115,2,0,0,0,0,2,122,28,70,105,108, 101,70,105,110,100,101,114,46,105,110,118,97,108,105,100,97, 116,101,95,99,97,99,104,101,115,99,2,0,0,0,0,0, - 0,0,3,0,0,0,2,0,0,0,67,0,0,0,115,59, - 0,0,0,124,0,0,106,0,0,124,1,0,131,1,0,125, - 2,0,124,2,0,100,1,0,107,8,0,114,37,0,100,1, - 0,103,0,0,102,2,0,83,124,2,0,106,1,0,124,2, - 0,106,2,0,112,55,0,103,0,0,102,2,0,83,41,2, - 122,197,84,114,121,32,116,111,32,102,105,110,100,32,97,32, - 108,111,97,100,101,114,32,102,111,114,32,116,104,101,32,115, - 112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,44, - 32,111,114,32,116,104,101,32,110,97,109,101,115,112,97,99, - 101,10,32,32,32,32,32,32,32,32,112,97,99,107,97,103, - 101,32,112,111,114,116,105,111,110,115,46,32,82,101,116,117, - 114,110,115,32,40,108,111,97,100,101,114,44,32,108,105,115, - 116,45,111,102,45,112,111,114,116,105,111,110,115,41,46,10, - 10,32,32,32,32,32,32,32,32,84,104,105,115,32,109,101, - 116,104,111,100,32,105,115,32,100,101,112,114,101,99,97,116, - 101,100,46,32,32,85,115,101,32,102,105,110,100,95,115,112, - 101,99,40,41,32,105,110,115,116,101,97,100,46,10,10,32, - 32,32,32,32,32,32,32,78,41,3,114,175,0,0,0,114, - 120,0,0,0,114,150,0,0,0,41,3,114,100,0,0,0, - 114,119,0,0,0,114,158,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,117,0,0,0,175,4, - 0,0,115,8,0,0,0,0,7,15,1,12,1,10,1,122, - 22,70,105,108,101,70,105,110,100,101,114,46,102,105,110,100, - 95,108,111,97,100,101,114,99,6,0,0,0,0,0,0,0, - 7,0,0,0,7,0,0,0,67,0,0,0,115,40,0,0, - 0,124,1,0,124,2,0,124,3,0,131,2,0,125,6,0, - 116,0,0,124,2,0,124,3,0,100,1,0,124,6,0,100, - 2,0,124,4,0,131,2,2,83,41,3,78,114,120,0,0, - 0,114,150,0,0,0,41,1,114,161,0,0,0,41,7,114, - 100,0,0,0,114,159,0,0,0,114,119,0,0,0,114,35, - 0,0,0,90,4,115,109,115,108,114,174,0,0,0,114,120, - 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, - 0,0,114,1,1,0,0,187,4,0,0,115,6,0,0,0, - 0,1,15,1,18,1,122,20,70,105,108,101,70,105,110,100, - 101,114,46,95,103,101,116,95,115,112,101,99,78,99,3,0, - 0,0,0,0,0,0,14,0,0,0,15,0,0,0,67,0, - 0,0,115,228,1,0,0,100,1,0,125,3,0,124,1,0, - 106,0,0,100,2,0,131,1,0,100,3,0,25,125,4,0, - 121,34,0,116,1,0,124,0,0,106,2,0,112,49,0,116, - 3,0,106,4,0,131,0,0,131,1,0,106,5,0,125,5, - 0,87,110,24,0,4,116,6,0,107,10,0,114,85,0,1, - 1,1,100,10,0,125,5,0,89,110,1,0,88,124,5,0, - 124,0,0,106,7,0,107,3,0,114,120,0,124,0,0,106, - 8,0,131,0,0,1,124,5,0,124,0,0,95,7,0,116, - 9,0,131,0,0,114,153,0,124,0,0,106,10,0,125,6, - 0,124,4,0,106,11,0,131,0,0,125,7,0,110,15,0, - 124,0,0,106,12,0,125,6,0,124,4,0,125,7,0,124, - 7,0,124,6,0,107,6,0,114,45,1,116,13,0,124,0, - 0,106,2,0,124,4,0,131,2,0,125,8,0,120,100,0, - 124,0,0,106,14,0,68,93,77,0,92,2,0,125,9,0, - 125,10,0,100,5,0,124,9,0,23,125,11,0,116,13,0, - 124,8,0,124,11,0,131,2,0,125,12,0,116,15,0,124, - 12,0,131,1,0,114,208,0,124,0,0,106,16,0,124,10, - 0,124,1,0,124,12,0,124,8,0,103,1,0,124,2,0, - 131,5,0,83,113,208,0,87,116,17,0,124,8,0,131,1, - 0,125,3,0,120,120,0,124,0,0,106,14,0,68,93,109, - 0,92,2,0,125,9,0,125,10,0,116,13,0,124,0,0, - 106,2,0,124,4,0,124,9,0,23,131,2,0,125,12,0, - 116,18,0,106,19,0,100,6,0,124,12,0,100,7,0,100, - 3,0,131,2,1,1,124,7,0,124,9,0,23,124,6,0, - 107,6,0,114,55,1,116,15,0,124,12,0,131,1,0,114, - 55,1,124,0,0,106,16,0,124,10,0,124,1,0,124,12, - 0,100,8,0,124,2,0,131,5,0,83,113,55,1,87,124, - 3,0,114,224,1,116,18,0,106,19,0,100,9,0,124,8, - 0,131,2,0,1,116,18,0,106,20,0,124,1,0,100,8, - 0,131,2,0,125,13,0,124,8,0,103,1,0,124,13,0, - 95,21,0,124,13,0,83,100,8,0,83,41,11,122,125,84, - 114,121,32,116,111,32,102,105,110,100,32,97,32,108,111,97, - 100,101,114,32,102,111,114,32,116,104,101,32,115,112,101,99, - 105,102,105,101,100,32,109,111,100,117,108,101,44,32,111,114, - 32,116,104,101,32,110,97,109,101,115,112,97,99,101,10,32, - 32,32,32,32,32,32,32,112,97,99,107,97,103,101,32,112, - 111,114,116,105,111,110,115,46,32,82,101,116,117,114,110,115, - 32,40,108,111,97,100,101,114,44,32,108,105,115,116,45,111, - 102,45,112,111,114,116,105,111,110,115,41,46,70,114,58,0, - 0,0,114,56,0,0,0,114,29,0,0,0,114,179,0,0, - 0,122,9,116,114,121,105,110,103,32,123,125,90,9,118,101, - 114,98,111,115,105,116,121,78,122,25,112,111,115,115,105,98, - 108,101,32,110,97,109,101,115,112,97,99,101,32,102,111,114, - 32,123,125,114,87,0,0,0,41,22,114,32,0,0,0,114, - 39,0,0,0,114,35,0,0,0,114,3,0,0,0,114,45, - 0,0,0,114,213,0,0,0,114,40,0,0,0,114,4,1, - 0,0,218,11,95,102,105,108,108,95,99,97,99,104,101,114, - 6,0,0,0,114,7,1,0,0,114,88,0,0,0,114,6, - 1,0,0,114,28,0,0,0,114,3,1,0,0,114,44,0, - 0,0,114,1,1,0,0,114,46,0,0,0,114,114,0,0, - 0,114,129,0,0,0,114,154,0,0,0,114,150,0,0,0, - 41,14,114,100,0,0,0,114,119,0,0,0,114,174,0,0, - 0,90,12,105,115,95,110,97,109,101,115,112,97,99,101,90, - 11,116,97,105,108,95,109,111,100,117,108,101,114,126,0,0, - 0,90,5,99,97,99,104,101,90,12,99,97,99,104,101,95, - 109,111,100,117,108,101,90,9,98,97,115,101,95,112,97,116, - 104,114,219,0,0,0,114,159,0,0,0,90,13,105,110,105, - 116,95,102,105,108,101,110,97,109,101,90,9,102,117,108,108, - 95,112,97,116,104,114,158,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,175,0,0,0,192,4, - 0,0,115,70,0,0,0,0,3,6,1,19,1,3,1,34, - 1,13,1,11,1,15,1,10,1,9,2,9,1,9,1,15, - 2,9,1,6,2,12,1,18,1,22,1,10,1,15,1,12, - 1,32,4,12,2,22,1,22,1,22,1,16,1,12,1,15, - 1,14,1,6,1,16,1,18,1,12,1,4,1,122,20,70, - 105,108,101,70,105,110,100,101,114,46,102,105,110,100,95,115, - 112,101,99,99,1,0,0,0,0,0,0,0,9,0,0,0, - 13,0,0,0,67,0,0,0,115,11,1,0,0,124,0,0, - 106,0,0,125,1,0,121,31,0,116,1,0,106,2,0,124, - 1,0,112,33,0,116,1,0,106,3,0,131,0,0,131,1, - 0,125,2,0,87,110,33,0,4,116,4,0,116,5,0,116, - 6,0,102,3,0,107,10,0,114,75,0,1,1,1,103,0, - 0,125,2,0,89,110,1,0,88,116,7,0,106,8,0,106, - 9,0,100,1,0,131,1,0,115,112,0,116,10,0,124,2, - 0,131,1,0,124,0,0,95,11,0,110,111,0,116,10,0, - 131,0,0,125,3,0,120,90,0,124,2,0,68,93,82,0, - 125,4,0,124,4,0,106,12,0,100,2,0,131,1,0,92, - 3,0,125,5,0,125,6,0,125,7,0,124,6,0,114,191, - 0,100,3,0,106,13,0,124,5,0,124,7,0,106,14,0, - 131,0,0,131,2,0,125,8,0,110,6,0,124,5,0,125, - 8,0,124,3,0,106,15,0,124,8,0,131,1,0,1,113, - 128,0,87,124,3,0,124,0,0,95,11,0,116,7,0,106, - 8,0,106,9,0,116,16,0,131,1,0,114,7,1,100,4, - 0,100,5,0,132,0,0,124,2,0,68,131,1,0,124,0, - 0,95,17,0,100,6,0,83,41,7,122,68,70,105,108,108, - 32,116,104,101,32,99,97,99,104,101,32,111,102,32,112,111, - 116,101,110,116,105,97,108,32,109,111,100,117,108,101,115,32, - 97,110,100,32,112,97,99,107,97,103,101,115,32,102,111,114, - 32,116,104,105,115,32,100,105,114,101,99,116,111,114,121,46, - 114,0,0,0,0,114,58,0,0,0,122,5,123,125,46,123, - 125,99,1,0,0,0,0,0,0,0,2,0,0,0,3,0, - 0,0,83,0,0,0,115,28,0,0,0,104,0,0,124,0, - 0,93,18,0,125,1,0,124,1,0,106,0,0,131,0,0, - 146,2,0,113,6,0,83,114,4,0,0,0,41,1,114,88, - 0,0,0,41,2,114,22,0,0,0,90,2,102,110,114,4, - 0,0,0,114,4,0,0,0,114,5,0,0,0,250,9,60, - 115,101,116,99,111,109,112,62,11,5,0,0,115,2,0,0, - 0,9,0,122,41,70,105,108,101,70,105,110,100,101,114,46, - 95,102,105,108,108,95,99,97,99,104,101,46,60,108,111,99, - 97,108,115,62,46,60,115,101,116,99,111,109,112,62,78,41, - 18,114,35,0,0,0,114,3,0,0,0,90,7,108,105,115, - 116,100,105,114,114,45,0,0,0,114,252,0,0,0,218,15, - 80,101,114,109,105,115,115,105,111,110,69,114,114,111,114,218, - 18,78,111,116,65,68,105,114,101,99,116,111,114,121,69,114, - 114,111,114,114,7,0,0,0,114,8,0,0,0,114,9,0, - 0,0,114,5,1,0,0,114,6,1,0,0,114,83,0,0, - 0,114,47,0,0,0,114,88,0,0,0,218,3,97,100,100, - 114,10,0,0,0,114,7,1,0,0,41,9,114,100,0,0, - 0,114,35,0,0,0,90,8,99,111,110,116,101,110,116,115, - 90,21,108,111,119,101,114,95,115,117,102,102,105,120,95,99, - 111,110,116,101,110,116,115,114,241,0,0,0,114,98,0,0, - 0,114,231,0,0,0,114,219,0,0,0,90,8,110,101,119, - 95,110,97,109,101,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,114,9,1,0,0,238,4,0,0,115,34,0, - 0,0,0,2,9,1,3,1,31,1,22,3,11,3,18,1, - 18,7,9,1,13,1,24,1,6,1,27,2,6,1,17,1, - 9,1,18,1,122,22,70,105,108,101,70,105,110,100,101,114, - 46,95,102,105,108,108,95,99,97,99,104,101,99,1,0,0, - 0,0,0,0,0,3,0,0,0,3,0,0,0,7,0,0, - 0,115,25,0,0,0,135,0,0,135,1,0,102,2,0,100, - 1,0,100,2,0,134,0,0,125,2,0,124,2,0,83,41, - 3,97,20,1,0,0,65,32,99,108,97,115,115,32,109,101, - 116,104,111,100,32,119,104,105,99,104,32,114,101,116,117,114, - 110,115,32,97,32,99,108,111,115,117,114,101,32,116,111,32, - 117,115,101,32,111,110,32,115,121,115,46,112,97,116,104,95, - 104,111,111,107,10,32,32,32,32,32,32,32,32,119,104,105, - 99,104,32,119,105,108,108,32,114,101,116,117,114,110,32,97, - 110,32,105,110,115,116,97,110,99,101,32,117,115,105,110,103, - 32,116,104,101,32,115,112,101,99,105,102,105,101,100,32,108, - 111,97,100,101,114,115,32,97,110,100,32,116,104,101,32,112, - 97,116,104,10,32,32,32,32,32,32,32,32,99,97,108,108, - 101,100,32,111,110,32,116,104,101,32,99,108,111,115,117,114, - 101,46,10,10,32,32,32,32,32,32,32,32,73,102,32,116, - 104,101,32,112,97,116,104,32,99,97,108,108,101,100,32,111, - 110,32,116,104,101,32,99,108,111,115,117,114,101,32,105,115, - 32,110,111,116,32,97,32,100,105,114,101,99,116,111,114,121, - 44,32,73,109,112,111,114,116,69,114,114,111,114,32,105,115, - 10,32,32,32,32,32,32,32,32,114,97,105,115,101,100,46, - 10,10,32,32,32,32,32,32,32,32,99,1,0,0,0,0, - 0,0,0,1,0,0,0,4,0,0,0,19,0,0,0,115, - 43,0,0,0,116,0,0,124,0,0,131,1,0,115,30,0, - 116,1,0,100,1,0,100,2,0,124,0,0,131,1,1,130, - 1,0,136,0,0,124,0,0,136,1,0,140,1,0,83,41, - 3,122,45,80,97,116,104,32,104,111,111,107,32,102,111,114, - 32,105,109,112,111,114,116,108,105,98,46,109,97,99,104,105, - 110,101,114,121,46,70,105,108,101,70,105,110,100,101,114,46, - 122,30,111,110,108,121,32,100,105,114,101,99,116,111,114,105, - 101,115,32,97,114,101,32,115,117,112,112,111,114,116,101,100, - 114,35,0,0,0,41,2,114,46,0,0,0,114,99,0,0, - 0,41,1,114,35,0,0,0,41,2,114,164,0,0,0,114, - 8,1,0,0,114,4,0,0,0,114,5,0,0,0,218,24, - 112,97,116,104,95,104,111,111,107,95,102,111,114,95,70,105, - 108,101,70,105,110,100,101,114,23,5,0,0,115,6,0,0, - 0,0,2,12,1,18,1,122,54,70,105,108,101,70,105,110, - 100,101,114,46,112,97,116,104,95,104,111,111,107,46,60,108, - 111,99,97,108,115,62,46,112,97,116,104,95,104,111,111,107, - 95,102,111,114,95,70,105,108,101,70,105,110,100,101,114,114, - 4,0,0,0,41,3,114,164,0,0,0,114,8,1,0,0, - 114,14,1,0,0,114,4,0,0,0,41,2,114,164,0,0, - 0,114,8,1,0,0,114,5,0,0,0,218,9,112,97,116, - 104,95,104,111,111,107,13,5,0,0,115,4,0,0,0,0, - 10,21,6,122,20,70,105,108,101,70,105,110,100,101,114,46, - 112,97,116,104,95,104,111,111,107,99,1,0,0,0,0,0, - 0,0,1,0,0,0,2,0,0,0,67,0,0,0,115,16, - 0,0,0,100,1,0,106,0,0,124,0,0,106,1,0,131, - 1,0,83,41,2,78,122,16,70,105,108,101,70,105,110,100, - 101,114,40,123,33,114,125,41,41,2,114,47,0,0,0,114, - 35,0,0,0,41,1,114,100,0,0,0,114,4,0,0,0, - 114,4,0,0,0,114,5,0,0,0,114,240,0,0,0,31, - 5,0,0,115,2,0,0,0,0,1,122,19,70,105,108,101, - 70,105,110,100,101,114,46,95,95,114,101,112,114,95,95,41, - 15,114,105,0,0,0,114,104,0,0,0,114,106,0,0,0, - 114,107,0,0,0,114,179,0,0,0,114,246,0,0,0,114, - 123,0,0,0,114,176,0,0,0,114,117,0,0,0,114,1, - 1,0,0,114,175,0,0,0,114,9,1,0,0,114,177,0, - 0,0,114,15,1,0,0,114,240,0,0,0,114,4,0,0, - 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, - 114,2,1,0,0,146,4,0,0,115,20,0,0,0,12,7, - 6,2,12,14,12,4,6,2,12,12,12,5,15,46,12,31, - 18,18,114,2,1,0,0,99,4,0,0,0,0,0,0,0, - 6,0,0,0,11,0,0,0,67,0,0,0,115,195,0,0, - 0,124,0,0,106,0,0,100,1,0,131,1,0,125,4,0, - 124,0,0,106,0,0,100,2,0,131,1,0,125,5,0,124, - 4,0,115,99,0,124,5,0,114,54,0,124,5,0,106,1, - 0,125,4,0,110,45,0,124,2,0,124,3,0,107,2,0, - 114,84,0,116,2,0,124,1,0,124,2,0,131,2,0,125, - 4,0,110,15,0,116,3,0,124,1,0,124,2,0,131,2, - 0,125,4,0,124,5,0,115,126,0,116,4,0,124,1,0, - 124,2,0,100,3,0,124,4,0,131,2,1,125,5,0,121, - 44,0,124,5,0,124,0,0,100,2,0,60,124,4,0,124, - 0,0,100,1,0,60,124,2,0,124,0,0,100,4,0,60, - 124,3,0,124,0,0,100,5,0,60,87,110,18,0,4,116, - 5,0,107,10,0,114,190,0,1,1,1,89,110,1,0,88, - 100,0,0,83,41,6,78,218,10,95,95,108,111,97,100,101, - 114,95,95,218,8,95,95,115,112,101,99,95,95,114,120,0, - 0,0,90,8,95,95,102,105,108,101,95,95,90,10,95,95, - 99,97,99,104,101,100,95,95,41,6,218,3,103,101,116,114, - 120,0,0,0,114,217,0,0,0,114,212,0,0,0,114,161, - 0,0,0,218,9,69,120,99,101,112,116,105,111,110,41,6, - 90,2,110,115,114,98,0,0,0,90,8,112,97,116,104,110, - 97,109,101,90,9,99,112,97,116,104,110,97,109,101,114,120, - 0,0,0,114,158,0,0,0,114,4,0,0,0,114,4,0, - 0,0,114,5,0,0,0,218,14,95,102,105,120,95,117,112, - 95,109,111,100,117,108,101,37,5,0,0,115,34,0,0,0, - 0,2,15,1,15,1,6,1,6,1,12,1,12,1,18,2, - 15,1,6,1,21,1,3,1,10,1,10,1,10,1,14,1, - 13,2,114,20,1,0,0,99,0,0,0,0,0,0,0,0, - 3,0,0,0,3,0,0,0,67,0,0,0,115,55,0,0, - 0,116,0,0,116,1,0,106,2,0,131,0,0,102,2,0, - 125,0,0,116,3,0,116,4,0,102,2,0,125,1,0,116, - 5,0,116,6,0,102,2,0,125,2,0,124,0,0,124,1, - 0,124,2,0,103,3,0,83,41,1,122,95,82,101,116,117, - 114,110,115,32,97,32,108,105,115,116,32,111,102,32,102,105, - 108,101,45,98,97,115,101,100,32,109,111,100,117,108,101,32, - 108,111,97,100,101,114,115,46,10,10,32,32,32,32,69,97, - 99,104,32,105,116,101,109,32,105,115,32,97,32,116,117,112, - 108,101,32,40,108,111,97,100,101,114,44,32,115,117,102,102, - 105,120,101,115,41,46,10,32,32,32,32,41,7,114,218,0, - 0,0,114,139,0,0,0,218,18,101,120,116,101,110,115,105, - 111,110,95,115,117,102,102,105,120,101,115,114,212,0,0,0, - 114,84,0,0,0,114,217,0,0,0,114,74,0,0,0,41, - 3,90,10,101,120,116,101,110,115,105,111,110,115,90,6,115, - 111,117,114,99,101,90,8,98,121,116,101,99,111,100,101,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,155, - 0,0,0,60,5,0,0,115,8,0,0,0,0,5,18,1, - 12,1,12,1,114,155,0,0,0,99,1,0,0,0,0,0, - 0,0,12,0,0,0,12,0,0,0,67,0,0,0,115,70, - 2,0,0,124,0,0,97,0,0,116,0,0,106,1,0,97, - 1,0,116,0,0,106,2,0,97,2,0,116,1,0,106,3, - 0,116,4,0,25,125,1,0,120,76,0,100,26,0,68,93, - 68,0,125,2,0,124,2,0,116,1,0,106,3,0,107,7, - 0,114,83,0,116,0,0,106,5,0,124,2,0,131,1,0, - 125,3,0,110,13,0,116,1,0,106,3,0,124,2,0,25, - 125,3,0,116,6,0,124,1,0,124,2,0,124,3,0,131, - 3,0,1,113,44,0,87,100,5,0,100,6,0,103,1,0, - 102,2,0,100,7,0,100,8,0,100,6,0,103,2,0,102, - 2,0,102,2,0,125,4,0,120,149,0,124,4,0,68,93, - 129,0,92,2,0,125,5,0,125,6,0,116,7,0,100,9, - 0,100,10,0,132,0,0,124,6,0,68,131,1,0,131,1, - 0,115,199,0,116,8,0,130,1,0,124,6,0,100,11,0, - 25,125,7,0,124,5,0,116,1,0,106,3,0,107,6,0, - 114,241,0,116,1,0,106,3,0,124,5,0,25,125,8,0, - 80,113,156,0,121,20,0,116,0,0,106,5,0,124,5,0, - 131,1,0,125,8,0,80,87,113,156,0,4,116,9,0,107, - 10,0,114,28,1,1,1,1,119,156,0,89,113,156,0,88, - 113,156,0,87,116,9,0,100,12,0,131,1,0,130,1,0, - 116,6,0,124,1,0,100,13,0,124,8,0,131,3,0,1, - 116,6,0,124,1,0,100,14,0,124,7,0,131,3,0,1, - 116,6,0,124,1,0,100,15,0,100,16,0,106,10,0,124, - 6,0,131,1,0,131,3,0,1,121,19,0,116,0,0,106, - 5,0,100,17,0,131,1,0,125,9,0,87,110,24,0,4, - 116,9,0,107,10,0,114,147,1,1,1,1,100,18,0,125, - 9,0,89,110,1,0,88,116,6,0,124,1,0,100,17,0, - 124,9,0,131,3,0,1,116,0,0,106,5,0,100,19,0, - 131,1,0,125,10,0,116,6,0,124,1,0,100,19,0,124, - 10,0,131,3,0,1,124,5,0,100,7,0,107,2,0,114, - 238,1,116,0,0,106,5,0,100,20,0,131,1,0,125,11, - 0,116,6,0,124,1,0,100,21,0,124,11,0,131,3,0, - 1,116,6,0,124,1,0,100,22,0,116,11,0,131,0,0, - 131,3,0,1,116,12,0,106,13,0,116,2,0,106,14,0, - 131,0,0,131,1,0,1,124,5,0,100,7,0,107,2,0, - 114,66,2,116,15,0,106,16,0,100,23,0,131,1,0,1, - 100,24,0,116,12,0,107,6,0,114,66,2,100,25,0,116, - 17,0,95,18,0,100,18,0,83,41,27,122,205,83,101,116, - 117,112,32,116,104,101,32,112,97,116,104,45,98,97,115,101, - 100,32,105,109,112,111,114,116,101,114,115,32,102,111,114,32, - 105,109,112,111,114,116,108,105,98,32,98,121,32,105,109,112, - 111,114,116,105,110,103,32,110,101,101,100,101,100,10,32,32, - 32,32,98,117,105,108,116,45,105,110,32,109,111,100,117,108, - 101,115,32,97,110,100,32,105,110,106,101,99,116,105,110,103, - 32,116,104,101,109,32,105,110,116,111,32,116,104,101,32,103, - 108,111,98,97,108,32,110,97,109,101,115,112,97,99,101,46, - 10,10,32,32,32,32,79,116,104,101,114,32,99,111,109,112, - 111,110,101,110,116,115,32,97,114,101,32,101,120,116,114,97, - 99,116,101,100,32,102,114,111,109,32,116,104,101,32,99,111, - 114,101,32,98,111,111,116,115,116,114,97,112,32,109,111,100, - 117,108,101,46,10,10,32,32,32,32,114,49,0,0,0,114, - 60,0,0,0,218,8,98,117,105,108,116,105,110,115,114,136, - 0,0,0,90,5,112,111,115,105,120,250,1,47,218,2,110, - 116,250,1,92,99,1,0,0,0,0,0,0,0,2,0,0, - 0,3,0,0,0,115,0,0,0,115,33,0,0,0,124,0, - 0,93,23,0,125,1,0,116,0,0,124,1,0,131,1,0, - 100,0,0,107,2,0,86,1,113,3,0,100,1,0,83,41, - 2,114,29,0,0,0,78,41,1,114,31,0,0,0,41,2, - 114,22,0,0,0,114,77,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,221,0,0,0,96,5, - 0,0,115,2,0,0,0,6,0,122,25,95,115,101,116,117, - 112,46,60,108,111,99,97,108,115,62,46,60,103,101,110,101, - 120,112,114,62,114,59,0,0,0,122,30,105,109,112,111,114, - 116,108,105,98,32,114,101,113,117,105,114,101,115,32,112,111, - 115,105,120,32,111,114,32,110,116,114,3,0,0,0,114,25, - 0,0,0,114,21,0,0,0,114,30,0,0,0,90,7,95, - 116,104,114,101,97,100,78,90,8,95,119,101,97,107,114,101, - 102,90,6,119,105,110,114,101,103,114,163,0,0,0,114,6, - 0,0,0,122,4,46,112,121,119,122,6,95,100,46,112,121, - 100,84,41,4,122,3,95,105,111,122,9,95,119,97,114,110, - 105,110,103,115,122,8,98,117,105,108,116,105,110,115,122,7, - 109,97,114,115,104,97,108,41,19,114,114,0,0,0,114,7, - 0,0,0,114,139,0,0,0,114,233,0,0,0,114,105,0, - 0,0,90,18,95,98,117,105,108,116,105,110,95,102,114,111, - 109,95,110,97,109,101,114,109,0,0,0,218,3,97,108,108, - 218,14,65,115,115,101,114,116,105,111,110,69,114,114,111,114, - 114,99,0,0,0,114,26,0,0,0,114,11,0,0,0,114, - 223,0,0,0,114,143,0,0,0,114,21,1,0,0,114,84, - 0,0,0,114,157,0,0,0,114,162,0,0,0,114,167,0, - 0,0,41,12,218,17,95,98,111,111,116,115,116,114,97,112, - 95,109,111,100,117,108,101,90,11,115,101,108,102,95,109,111, - 100,117,108,101,90,12,98,117,105,108,116,105,110,95,110,97, - 109,101,90,14,98,117,105,108,116,105,110,95,109,111,100,117, - 108,101,90,10,111,115,95,100,101,116,97,105,108,115,90,10, - 98,117,105,108,116,105,110,95,111,115,114,21,0,0,0,114, - 25,0,0,0,90,9,111,115,95,109,111,100,117,108,101,90, - 13,116,104,114,101,97,100,95,109,111,100,117,108,101,90,14, - 119,101,97,107,114,101,102,95,109,111,100,117,108,101,90,13, - 119,105,110,114,101,103,95,109,111,100,117,108,101,114,4,0, - 0,0,114,4,0,0,0,114,5,0,0,0,218,6,95,115, - 101,116,117,112,71,5,0,0,115,82,0,0,0,0,8,6, - 1,9,1,9,3,13,1,13,1,15,1,18,2,13,1,20, - 3,33,1,19,2,31,1,10,1,15,1,13,1,4,2,3, - 1,15,1,5,1,13,1,12,2,12,1,16,1,16,1,25, - 3,3,1,19,1,13,2,11,1,16,3,15,1,16,3,12, - 1,15,1,16,3,19,1,19,1,12,1,13,1,12,1,114, - 29,1,0,0,99,1,0,0,0,0,0,0,0,2,0,0, - 0,3,0,0,0,67,0,0,0,115,116,0,0,0,116,0, - 0,124,0,0,131,1,0,1,116,1,0,131,0,0,125,1, - 0,116,2,0,106,3,0,106,4,0,116,5,0,106,6,0, - 124,1,0,140,0,0,103,1,0,131,1,0,1,116,7,0, - 106,8,0,100,1,0,107,2,0,114,78,0,116,2,0,106, - 9,0,106,10,0,116,11,0,131,1,0,1,116,2,0,106, - 9,0,106,10,0,116,12,0,131,1,0,1,116,5,0,124, - 0,0,95,5,0,116,13,0,124,0,0,95,13,0,100,2, - 0,83,41,3,122,41,73,110,115,116,97,108,108,32,116,104, - 101,32,112,97,116,104,45,98,97,115,101,100,32,105,109,112, - 111,114,116,32,99,111,109,112,111,110,101,110,116,115,46,114, - 24,1,0,0,78,41,14,114,29,1,0,0,114,155,0,0, - 0,114,7,0,0,0,114,250,0,0,0,114,143,0,0,0, - 114,2,1,0,0,114,15,1,0,0,114,3,0,0,0,114, - 105,0,0,0,218,9,109,101,116,97,95,112,97,116,104,114, - 157,0,0,0,114,162,0,0,0,114,245,0,0,0,114,212, - 0,0,0,41,2,114,28,1,0,0,90,17,115,117,112,112, - 111,114,116,101,100,95,108,111,97,100,101,114,115,114,4,0, - 0,0,114,4,0,0,0,114,5,0,0,0,218,8,95,105, - 110,115,116,97,108,108,139,5,0,0,115,16,0,0,0,0, - 2,10,1,9,1,28,1,15,1,16,1,16,4,9,1,114, - 31,1,0,0,41,3,122,3,119,105,110,114,1,0,0,0, - 114,2,0,0,0,41,56,114,107,0,0,0,114,10,0,0, - 0,114,11,0,0,0,114,17,0,0,0,114,19,0,0,0, - 114,28,0,0,0,114,38,0,0,0,114,39,0,0,0,114, - 43,0,0,0,114,44,0,0,0,114,46,0,0,0,114,55, - 0,0,0,218,4,116,121,112,101,218,8,95,95,99,111,100, - 101,95,95,114,138,0,0,0,114,15,0,0,0,114,128,0, - 0,0,114,14,0,0,0,114,18,0,0,0,90,17,95,82, - 65,87,95,77,65,71,73,67,95,78,85,77,66,69,82,114, - 73,0,0,0,114,72,0,0,0,114,84,0,0,0,114,74, - 0,0,0,90,23,68,69,66,85,71,95,66,89,84,69,67, - 79,68,69,95,83,85,70,70,73,88,69,83,90,27,79,80, - 84,73,77,73,90,69,68,95,66,89,84,69,67,79,68,69, - 95,83,85,70,70,73,88,69,83,114,79,0,0,0,114,85, - 0,0,0,114,91,0,0,0,114,95,0,0,0,114,97,0, - 0,0,114,116,0,0,0,114,123,0,0,0,114,135,0,0, - 0,114,141,0,0,0,114,144,0,0,0,114,149,0,0,0, - 218,6,111,98,106,101,99,116,114,156,0,0,0,114,161,0, - 0,0,114,162,0,0,0,114,178,0,0,0,114,188,0,0, - 0,114,204,0,0,0,114,212,0,0,0,114,217,0,0,0, - 114,223,0,0,0,114,218,0,0,0,114,224,0,0,0,114, - 243,0,0,0,114,245,0,0,0,114,2,1,0,0,114,20, - 1,0,0,114,155,0,0,0,114,29,1,0,0,114,31,1, - 0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,0, - 0,114,5,0,0,0,218,8,60,109,111,100,117,108,101,62, - 8,0,0,0,115,102,0,0,0,6,17,6,3,12,12,12, - 5,12,5,12,6,12,12,12,10,12,9,12,5,12,7,15, - 22,15,115,22,1,18,2,6,1,6,2,9,2,9,2,10, - 2,21,44,12,33,12,19,12,12,12,12,12,28,12,17,21, - 55,21,12,18,10,12,14,9,3,12,1,15,65,19,64,19, - 29,22,110,19,41,25,45,25,16,6,3,25,53,19,60,19, - 42,19,127,0,7,19,127,0,20,15,23,12,11,12,68, + 0,0,3,0,0,0,2,0,0,0,67,0,0,0,115,42, + 0,0,0,124,0,106,0,124,1,131,1,125,2,124,2,100, + 1,107,8,114,26,100,1,103,0,102,2,83,0,124,2,106, + 1,124,2,106,2,112,38,103,0,102,2,83,0,41,2,122, + 197,84,114,121,32,116,111,32,102,105,110,100,32,97,32,108, + 111,97,100,101,114,32,102,111,114,32,116,104,101,32,115,112, + 101,99,105,102,105,101,100,32,109,111,100,117,108,101,44,32, + 111,114,32,116,104,101,32,110,97,109,101,115,112,97,99,101, + 10,32,32,32,32,32,32,32,32,112,97,99,107,97,103,101, + 32,112,111,114,116,105,111,110,115,46,32,82,101,116,117,114, + 110,115,32,40,108,111,97,100,101,114,44,32,108,105,115,116, + 45,111,102,45,112,111,114,116,105,111,110,115,41,46,10,10, + 32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116, + 104,111,100,32,105,115,32,100,101,112,114,101,99,97,116,101, + 100,46,32,32,85,115,101,32,102,105,110,100,95,115,112,101, + 99,40,41,32,105,110,115,116,101,97,100,46,10,10,32,32, + 32,32,32,32,32,32,78,41,3,114,175,0,0,0,114,120, + 0,0,0,114,150,0,0,0,41,3,114,100,0,0,0,114, + 119,0,0,0,114,158,0,0,0,114,4,0,0,0,114,4, + 0,0,0,114,5,0,0,0,114,117,0,0,0,176,4,0, + 0,115,8,0,0,0,0,7,10,1,8,1,8,1,122,22, + 70,105,108,101,70,105,110,100,101,114,46,102,105,110,100,95, + 108,111,97,100,101,114,99,6,0,0,0,0,0,0,0,7, + 0,0,0,7,0,0,0,67,0,0,0,115,30,0,0,0, + 124,1,124,2,124,3,131,2,125,6,116,0,124,2,124,3, + 100,1,124,6,100,2,124,4,144,2,131,2,83,0,41,3, + 78,114,120,0,0,0,114,150,0,0,0,41,1,114,161,0, + 0,0,41,7,114,100,0,0,0,114,159,0,0,0,114,119, + 0,0,0,114,35,0,0,0,90,4,115,109,115,108,114,174, + 0,0,0,114,120,0,0,0,114,4,0,0,0,114,4,0, + 0,0,114,5,0,0,0,114,1,1,0,0,188,4,0,0, + 115,6,0,0,0,0,1,10,1,12,1,122,20,70,105,108, + 101,70,105,110,100,101,114,46,95,103,101,116,95,115,112,101, + 99,78,99,3,0,0,0,0,0,0,0,14,0,0,0,15, + 0,0,0,67,0,0,0,115,100,1,0,0,100,1,125,3, + 124,1,106,0,100,2,131,1,100,3,25,0,125,4,121,24, + 116,1,124,0,106,2,112,34,116,3,106,4,131,0,131,1, + 106,5,125,5,87,0,110,24,4,0,116,6,107,10,114,66, + 1,0,1,0,1,0,100,10,125,5,89,0,110,2,88,0, + 124,5,124,0,106,7,107,3,114,92,124,0,106,8,131,0, + 1,0,124,5,124,0,95,7,116,9,131,0,114,114,124,0, + 106,10,125,6,124,4,106,11,131,0,125,7,110,10,124,0, + 106,12,125,6,124,4,125,7,124,7,124,6,107,6,114,218, + 116,13,124,0,106,2,124,4,131,2,125,8,120,72,124,0, + 106,14,68,0,93,54,92,2,125,9,125,10,100,5,124,9, + 23,0,125,11,116,13,124,8,124,11,131,2,125,12,116,15, + 124,12,131,1,114,152,124,0,106,16,124,10,124,1,124,12, + 124,8,103,1,124,2,131,5,83,0,113,152,87,0,116,17, + 124,8,131,1,125,3,120,90,124,0,106,14,68,0,93,80, + 92,2,125,9,125,10,116,13,124,0,106,2,124,4,124,9, + 23,0,131,2,125,12,116,18,106,19,100,6,124,12,100,7, + 100,3,144,1,131,2,1,0,124,7,124,9,23,0,124,6, + 107,6,114,226,116,15,124,12,131,1,114,226,124,0,106,16, + 124,10,124,1,124,12,100,8,124,2,131,5,83,0,113,226, + 87,0,124,3,144,1,114,96,116,18,106,19,100,9,124,8, + 131,2,1,0,116,18,106,20,124,1,100,8,131,2,125,13, + 124,8,103,1,124,13,95,21,124,13,83,0,100,8,83,0, + 41,11,122,125,84,114,121,32,116,111,32,102,105,110,100,32, + 97,32,108,111,97,100,101,114,32,102,111,114,32,116,104,101, + 32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,108, + 101,44,32,111,114,32,116,104,101,32,110,97,109,101,115,112, + 97,99,101,10,32,32,32,32,32,32,32,32,112,97,99,107, + 97,103,101,32,112,111,114,116,105,111,110,115,46,32,82,101, + 116,117,114,110,115,32,40,108,111,97,100,101,114,44,32,108, + 105,115,116,45,111,102,45,112,111,114,116,105,111,110,115,41, + 46,70,114,58,0,0,0,114,56,0,0,0,114,29,0,0, + 0,114,179,0,0,0,122,9,116,114,121,105,110,103,32,123, + 125,90,9,118,101,114,98,111,115,105,116,121,78,122,25,112, + 111,115,115,105,98,108,101,32,110,97,109,101,115,112,97,99, + 101,32,102,111,114,32,123,125,114,87,0,0,0,41,22,114, + 32,0,0,0,114,39,0,0,0,114,35,0,0,0,114,3, + 0,0,0,114,45,0,0,0,114,213,0,0,0,114,40,0, + 0,0,114,4,1,0,0,218,11,95,102,105,108,108,95,99, + 97,99,104,101,114,6,0,0,0,114,7,1,0,0,114,88, + 0,0,0,114,6,1,0,0,114,28,0,0,0,114,3,1, + 0,0,114,44,0,0,0,114,1,1,0,0,114,46,0,0, + 0,114,114,0,0,0,114,129,0,0,0,114,154,0,0,0, + 114,150,0,0,0,41,14,114,100,0,0,0,114,119,0,0, + 0,114,174,0,0,0,90,12,105,115,95,110,97,109,101,115, + 112,97,99,101,90,11,116,97,105,108,95,109,111,100,117,108, + 101,114,126,0,0,0,90,5,99,97,99,104,101,90,12,99, + 97,99,104,101,95,109,111,100,117,108,101,90,9,98,97,115, + 101,95,112,97,116,104,114,219,0,0,0,114,159,0,0,0, + 90,13,105,110,105,116,95,102,105,108,101,110,97,109,101,90, + 9,102,117,108,108,95,112,97,116,104,114,158,0,0,0,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,175, + 0,0,0,193,4,0,0,115,70,0,0,0,0,3,4,1, + 14,1,2,1,24,1,14,1,10,1,10,1,8,1,6,2, + 6,1,6,1,10,2,6,1,4,2,8,1,12,1,16,1, + 8,1,10,1,8,1,24,4,8,2,16,1,16,1,18,1, + 12,1,8,1,10,1,12,1,6,1,12,1,12,1,8,1, + 4,1,122,20,70,105,108,101,70,105,110,100,101,114,46,102, + 105,110,100,95,115,112,101,99,99,1,0,0,0,0,0,0, + 0,9,0,0,0,13,0,0,0,67,0,0,0,115,194,0, + 0,0,124,0,106,0,125,1,121,22,116,1,106,2,124,1, + 112,22,116,1,106,3,131,0,131,1,125,2,87,0,110,30, + 4,0,116,4,116,5,116,6,102,3,107,10,114,58,1,0, + 1,0,1,0,103,0,125,2,89,0,110,2,88,0,116,7, + 106,8,106,9,100,1,131,1,115,84,116,10,124,2,131,1, + 124,0,95,11,110,78,116,10,131,0,125,3,120,64,124,2, + 68,0,93,56,125,4,124,4,106,12,100,2,131,1,92,3, + 125,5,125,6,125,7,124,6,114,138,100,3,106,13,124,5, + 124,7,106,14,131,0,131,2,125,8,110,4,124,5,125,8, + 124,3,106,15,124,8,131,1,1,0,113,96,87,0,124,3, + 124,0,95,11,116,7,106,8,106,9,116,16,131,1,114,190, + 100,4,100,5,132,0,124,2,68,0,131,1,124,0,95,17, + 100,6,83,0,41,7,122,68,70,105,108,108,32,116,104,101, + 32,99,97,99,104,101,32,111,102,32,112,111,116,101,110,116, + 105,97,108,32,109,111,100,117,108,101,115,32,97,110,100,32, + 112,97,99,107,97,103,101,115,32,102,111,114,32,116,104,105, + 115,32,100,105,114,101,99,116,111,114,121,46,114,0,0,0, + 0,114,58,0,0,0,122,5,123,125,46,123,125,99,1,0, + 0,0,0,0,0,0,2,0,0,0,3,0,0,0,83,0, + 0,0,115,20,0,0,0,104,0,124,0,93,12,125,1,124, + 1,106,0,131,0,146,2,113,4,83,0,114,4,0,0,0, + 41,1,114,88,0,0,0,41,2,114,22,0,0,0,90,2, + 102,110,114,4,0,0,0,114,4,0,0,0,114,5,0,0, + 0,250,9,60,115,101,116,99,111,109,112,62,12,5,0,0, + 115,2,0,0,0,6,0,122,41,70,105,108,101,70,105,110, + 100,101,114,46,95,102,105,108,108,95,99,97,99,104,101,46, + 60,108,111,99,97,108,115,62,46,60,115,101,116,99,111,109, + 112,62,78,41,18,114,35,0,0,0,114,3,0,0,0,90, + 7,108,105,115,116,100,105,114,114,45,0,0,0,114,252,0, + 0,0,218,15,80,101,114,109,105,115,115,105,111,110,69,114, + 114,111,114,218,18,78,111,116,65,68,105,114,101,99,116,111, + 114,121,69,114,114,111,114,114,7,0,0,0,114,8,0,0, + 0,114,9,0,0,0,114,5,1,0,0,114,6,1,0,0, + 114,83,0,0,0,114,47,0,0,0,114,88,0,0,0,218, + 3,97,100,100,114,10,0,0,0,114,7,1,0,0,41,9, + 114,100,0,0,0,114,35,0,0,0,90,8,99,111,110,116, + 101,110,116,115,90,21,108,111,119,101,114,95,115,117,102,102, + 105,120,95,99,111,110,116,101,110,116,115,114,241,0,0,0, + 114,98,0,0,0,114,231,0,0,0,114,219,0,0,0,90, + 8,110,101,119,95,110,97,109,101,114,4,0,0,0,114,4, + 0,0,0,114,5,0,0,0,114,9,1,0,0,239,4,0, + 0,115,34,0,0,0,0,2,6,1,2,1,22,1,20,3, + 10,3,12,1,12,7,6,1,10,1,16,1,4,1,18,2, + 4,1,14,1,6,1,12,1,122,22,70,105,108,101,70,105, + 110,100,101,114,46,95,102,105,108,108,95,99,97,99,104,101, + 99,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0, + 0,7,0,0,0,115,18,0,0,0,135,0,135,1,102,2, + 100,1,100,2,134,0,125,2,124,2,83,0,41,3,97,20, + 1,0,0,65,32,99,108,97,115,115,32,109,101,116,104,111, + 100,32,119,104,105,99,104,32,114,101,116,117,114,110,115,32, + 97,32,99,108,111,115,117,114,101,32,116,111,32,117,115,101, + 32,111,110,32,115,121,115,46,112,97,116,104,95,104,111,111, + 107,10,32,32,32,32,32,32,32,32,119,104,105,99,104,32, + 119,105,108,108,32,114,101,116,117,114,110,32,97,110,32,105, + 110,115,116,97,110,99,101,32,117,115,105,110,103,32,116,104, + 101,32,115,112,101,99,105,102,105,101,100,32,108,111,97,100, + 101,114,115,32,97,110,100,32,116,104,101,32,112,97,116,104, + 10,32,32,32,32,32,32,32,32,99,97,108,108,101,100,32, + 111,110,32,116,104,101,32,99,108,111,115,117,114,101,46,10, + 10,32,32,32,32,32,32,32,32,73,102,32,116,104,101,32, + 112,97,116,104,32,99,97,108,108,101,100,32,111,110,32,116, + 104,101,32,99,108,111,115,117,114,101,32,105,115,32,110,111, + 116,32,97,32,100,105,114,101,99,116,111,114,121,44,32,73, + 109,112,111,114,116,69,114,114,111,114,32,105,115,10,32,32, + 32,32,32,32,32,32,114,97,105,115,101,100,46,10,10,32, + 32,32,32,32,32,32,32,99,1,0,0,0,0,0,0,0, + 1,0,0,0,4,0,0,0,19,0,0,0,115,32,0,0, + 0,116,0,124,0,131,1,115,22,116,1,100,1,100,2,124, + 0,144,1,131,1,130,1,136,0,124,0,136,1,140,1,83, + 0,41,3,122,45,80,97,116,104,32,104,111,111,107,32,102, + 111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,99, + 104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,101, + 114,46,122,30,111,110,108,121,32,100,105,114,101,99,116,111, + 114,105,101,115,32,97,114,101,32,115,117,112,112,111,114,116, + 101,100,114,35,0,0,0,41,2,114,46,0,0,0,114,99, + 0,0,0,41,1,114,35,0,0,0,41,2,114,164,0,0, + 0,114,8,1,0,0,114,4,0,0,0,114,5,0,0,0, + 218,24,112,97,116,104,95,104,111,111,107,95,102,111,114,95, + 70,105,108,101,70,105,110,100,101,114,24,5,0,0,115,6, + 0,0,0,0,2,8,1,14,1,122,54,70,105,108,101,70, + 105,110,100,101,114,46,112,97,116,104,95,104,111,111,107,46, + 60,108,111,99,97,108,115,62,46,112,97,116,104,95,104,111, + 111,107,95,102,111,114,95,70,105,108,101,70,105,110,100,101, + 114,114,4,0,0,0,41,3,114,164,0,0,0,114,8,1, + 0,0,114,14,1,0,0,114,4,0,0,0,41,2,114,164, + 0,0,0,114,8,1,0,0,114,5,0,0,0,218,9,112, + 97,116,104,95,104,111,111,107,14,5,0,0,115,4,0,0, + 0,0,10,14,6,122,20,70,105,108,101,70,105,110,100,101, + 114,46,112,97,116,104,95,104,111,111,107,99,1,0,0,0, + 0,0,0,0,1,0,0,0,2,0,0,0,67,0,0,0, + 115,12,0,0,0,100,1,106,0,124,0,106,1,131,1,83, + 0,41,2,78,122,16,70,105,108,101,70,105,110,100,101,114, + 40,123,33,114,125,41,41,2,114,47,0,0,0,114,35,0, + 0,0,41,1,114,100,0,0,0,114,4,0,0,0,114,4, + 0,0,0,114,5,0,0,0,114,240,0,0,0,32,5,0, + 0,115,2,0,0,0,0,1,122,19,70,105,108,101,70,105, + 110,100,101,114,46,95,95,114,101,112,114,95,95,41,15,114, + 105,0,0,0,114,104,0,0,0,114,106,0,0,0,114,107, + 0,0,0,114,179,0,0,0,114,246,0,0,0,114,123,0, + 0,0,114,176,0,0,0,114,117,0,0,0,114,1,1,0, + 0,114,175,0,0,0,114,9,1,0,0,114,177,0,0,0, + 114,15,1,0,0,114,240,0,0,0,114,4,0,0,0,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,2, + 1,0,0,147,4,0,0,115,20,0,0,0,8,7,4,2, + 8,14,8,4,4,2,8,12,8,5,10,46,8,31,12,18, + 114,2,1,0,0,99,4,0,0,0,0,0,0,0,6,0, + 0,0,11,0,0,0,67,0,0,0,115,148,0,0,0,124, + 0,106,0,100,1,131,1,125,4,124,0,106,0,100,2,131, + 1,125,5,124,4,115,66,124,5,114,36,124,5,106,1,125, + 4,110,30,124,2,124,3,107,2,114,56,116,2,124,1,124, + 2,131,2,125,4,110,10,116,3,124,1,124,2,131,2,125, + 4,124,5,115,86,116,4,124,1,124,2,100,3,124,4,144, + 1,131,2,125,5,121,36,124,5,124,0,100,2,60,0,124, + 4,124,0,100,1,60,0,124,2,124,0,100,4,60,0,124, + 3,124,0,100,5,60,0,87,0,110,20,4,0,116,5,107, + 10,114,142,1,0,1,0,1,0,89,0,110,2,88,0,100, + 0,83,0,41,6,78,218,10,95,95,108,111,97,100,101,114, + 95,95,218,8,95,95,115,112,101,99,95,95,114,120,0,0, + 0,90,8,95,95,102,105,108,101,95,95,90,10,95,95,99, + 97,99,104,101,100,95,95,41,6,218,3,103,101,116,114,120, + 0,0,0,114,217,0,0,0,114,212,0,0,0,114,161,0, + 0,0,218,9,69,120,99,101,112,116,105,111,110,41,6,90, + 2,110,115,114,98,0,0,0,90,8,112,97,116,104,110,97, + 109,101,90,9,99,112,97,116,104,110,97,109,101,114,120,0, + 0,0,114,158,0,0,0,114,4,0,0,0,114,4,0,0, + 0,114,5,0,0,0,218,14,95,102,105,120,95,117,112,95, + 109,111,100,117,108,101,38,5,0,0,115,34,0,0,0,0, + 2,10,1,10,1,4,1,4,1,8,1,8,1,12,2,10, + 1,4,1,16,1,2,1,8,1,8,1,8,1,12,1,14, + 2,114,20,1,0,0,99,0,0,0,0,0,0,0,0,3, + 0,0,0,3,0,0,0,67,0,0,0,115,38,0,0,0, + 116,0,116,1,106,2,131,0,102,2,125,0,116,3,116,4, + 102,2,125,1,116,5,116,6,102,2,125,2,124,0,124,1, + 124,2,103,3,83,0,41,1,122,95,82,101,116,117,114,110, + 115,32,97,32,108,105,115,116,32,111,102,32,102,105,108,101, + 45,98,97,115,101,100,32,109,111,100,117,108,101,32,108,111, + 97,100,101,114,115,46,10,10,32,32,32,32,69,97,99,104, + 32,105,116,101,109,32,105,115,32,97,32,116,117,112,108,101, + 32,40,108,111,97,100,101,114,44,32,115,117,102,102,105,120, + 101,115,41,46,10,32,32,32,32,41,7,114,218,0,0,0, + 114,139,0,0,0,218,18,101,120,116,101,110,115,105,111,110, + 95,115,117,102,102,105,120,101,115,114,212,0,0,0,114,84, + 0,0,0,114,217,0,0,0,114,74,0,0,0,41,3,90, + 10,101,120,116,101,110,115,105,111,110,115,90,6,115,111,117, + 114,99,101,90,8,98,121,116,101,99,111,100,101,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,155,0,0, + 0,61,5,0,0,115,8,0,0,0,0,5,12,1,8,1, + 8,1,114,155,0,0,0,99,1,0,0,0,0,0,0,0, + 12,0,0,0,12,0,0,0,67,0,0,0,115,188,1,0, + 0,124,0,97,0,116,0,106,1,97,1,116,0,106,2,97, + 2,116,1,106,3,116,4,25,0,125,1,120,56,100,26,68, + 0,93,48,125,2,124,2,116,1,106,3,107,7,114,58,116, + 0,106,5,124,2,131,1,125,3,110,10,116,1,106,3,124, + 2,25,0,125,3,116,6,124,1,124,2,124,3,131,3,1, + 0,113,32,87,0,100,5,100,6,103,1,102,2,100,7,100, + 8,100,6,103,2,102,2,102,2,125,4,120,118,124,4,68, + 0,93,102,92,2,125,5,125,6,116,7,100,9,100,10,132, + 0,124,6,68,0,131,1,131,1,115,142,116,8,130,1,124, + 6,100,11,25,0,125,7,124,5,116,1,106,3,107,6,114, + 174,116,1,106,3,124,5,25,0,125,8,80,0,113,112,121, + 16,116,0,106,5,124,5,131,1,125,8,80,0,87,0,113, + 112,4,0,116,9,107,10,114,212,1,0,1,0,1,0,119, + 112,89,0,113,112,88,0,113,112,87,0,116,9,100,12,131, + 1,130,1,116,6,124,1,100,13,124,8,131,3,1,0,116, + 6,124,1,100,14,124,7,131,3,1,0,116,6,124,1,100, + 15,100,16,106,10,124,6,131,1,131,3,1,0,121,14,116, + 0,106,5,100,17,131,1,125,9,87,0,110,26,4,0,116, + 9,107,10,144,1,114,52,1,0,1,0,1,0,100,18,125, + 9,89,0,110,2,88,0,116,6,124,1,100,17,124,9,131, + 3,1,0,116,0,106,5,100,19,131,1,125,10,116,6,124, + 1,100,19,124,10,131,3,1,0,124,5,100,7,107,2,144, + 1,114,120,116,0,106,5,100,20,131,1,125,11,116,6,124, + 1,100,21,124,11,131,3,1,0,116,6,124,1,100,22,116, + 11,131,0,131,3,1,0,116,12,106,13,116,2,106,14,131, + 0,131,1,1,0,124,5,100,7,107,2,144,1,114,184,116, + 15,106,16,100,23,131,1,1,0,100,24,116,12,107,6,144, + 1,114,184,100,25,116,17,95,18,100,18,83,0,41,27,122, + 205,83,101,116,117,112,32,116,104,101,32,112,97,116,104,45, + 98,97,115,101,100,32,105,109,112,111,114,116,101,114,115,32, + 102,111,114,32,105,109,112,111,114,116,108,105,98,32,98,121, + 32,105,109,112,111,114,116,105,110,103,32,110,101,101,100,101, + 100,10,32,32,32,32,98,117,105,108,116,45,105,110,32,109, + 111,100,117,108,101,115,32,97,110,100,32,105,110,106,101,99, + 116,105,110,103,32,116,104,101,109,32,105,110,116,111,32,116, + 104,101,32,103,108,111,98,97,108,32,110,97,109,101,115,112, + 97,99,101,46,10,10,32,32,32,32,79,116,104,101,114,32, + 99,111,109,112,111,110,101,110,116,115,32,97,114,101,32,101, + 120,116,114,97,99,116,101,100,32,102,114,111,109,32,116,104, + 101,32,99,111,114,101,32,98,111,111,116,115,116,114,97,112, + 32,109,111,100,117,108,101,46,10,10,32,32,32,32,114,49, + 0,0,0,114,60,0,0,0,218,8,98,117,105,108,116,105, + 110,115,114,136,0,0,0,90,5,112,111,115,105,120,250,1, + 47,218,2,110,116,250,1,92,99,1,0,0,0,0,0,0, + 0,2,0,0,0,3,0,0,0,115,0,0,0,115,26,0, + 0,0,124,0,93,18,125,1,116,0,124,1,131,1,100,0, + 107,2,86,0,1,0,113,2,100,1,83,0,41,2,114,29, + 0,0,0,78,41,1,114,31,0,0,0,41,2,114,22,0, + 0,0,114,77,0,0,0,114,4,0,0,0,114,4,0,0, + 0,114,5,0,0,0,114,221,0,0,0,97,5,0,0,115, + 2,0,0,0,4,0,122,25,95,115,101,116,117,112,46,60, + 108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,114, + 62,114,59,0,0,0,122,30,105,109,112,111,114,116,108,105, + 98,32,114,101,113,117,105,114,101,115,32,112,111,115,105,120, + 32,111,114,32,110,116,114,3,0,0,0,114,25,0,0,0, + 114,21,0,0,0,114,30,0,0,0,90,7,95,116,104,114, + 101,97,100,78,90,8,95,119,101,97,107,114,101,102,90,6, + 119,105,110,114,101,103,114,163,0,0,0,114,6,0,0,0, + 122,4,46,112,121,119,122,6,95,100,46,112,121,100,84,41, + 4,122,3,95,105,111,122,9,95,119,97,114,110,105,110,103, + 115,122,8,98,117,105,108,116,105,110,115,122,7,109,97,114, + 115,104,97,108,41,19,114,114,0,0,0,114,7,0,0,0, + 114,139,0,0,0,114,233,0,0,0,114,105,0,0,0,90, + 18,95,98,117,105,108,116,105,110,95,102,114,111,109,95,110, + 97,109,101,114,109,0,0,0,218,3,97,108,108,218,14,65, + 115,115,101,114,116,105,111,110,69,114,114,111,114,114,99,0, + 0,0,114,26,0,0,0,114,11,0,0,0,114,223,0,0, + 0,114,143,0,0,0,114,21,1,0,0,114,84,0,0,0, + 114,157,0,0,0,114,162,0,0,0,114,167,0,0,0,41, + 12,218,17,95,98,111,111,116,115,116,114,97,112,95,109,111, + 100,117,108,101,90,11,115,101,108,102,95,109,111,100,117,108, + 101,90,12,98,117,105,108,116,105,110,95,110,97,109,101,90, + 14,98,117,105,108,116,105,110,95,109,111,100,117,108,101,90, + 10,111,115,95,100,101,116,97,105,108,115,90,10,98,117,105, + 108,116,105,110,95,111,115,114,21,0,0,0,114,25,0,0, + 0,90,9,111,115,95,109,111,100,117,108,101,90,13,116,104, + 114,101,97,100,95,109,111,100,117,108,101,90,14,119,101,97, + 107,114,101,102,95,109,111,100,117,108,101,90,13,119,105,110, + 114,101,103,95,109,111,100,117,108,101,114,4,0,0,0,114, + 4,0,0,0,114,5,0,0,0,218,6,95,115,101,116,117, + 112,72,5,0,0,115,82,0,0,0,0,8,4,1,6,1, + 6,3,10,1,10,1,10,1,12,2,10,1,16,3,22,1, + 14,2,22,1,8,1,10,1,10,1,4,2,2,1,10,1, + 6,1,14,1,12,2,8,1,12,1,12,1,18,3,2,1, + 14,1,16,2,10,1,12,3,10,1,12,3,10,1,10,1, + 12,3,14,1,14,1,10,1,10,1,10,1,114,29,1,0, + 0,99,1,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,67,0,0,0,115,84,0,0,0,116,0,124,0,131, + 1,1,0,116,1,131,0,125,1,116,2,106,3,106,4,116, + 5,106,6,124,1,140,0,103,1,131,1,1,0,116,7,106, + 8,100,1,107,2,114,56,116,2,106,9,106,10,116,11,131, + 1,1,0,116,2,106,9,106,10,116,12,131,1,1,0,116, + 5,124,0,95,5,116,13,124,0,95,13,100,2,83,0,41, + 3,122,41,73,110,115,116,97,108,108,32,116,104,101,32,112, + 97,116,104,45,98,97,115,101,100,32,105,109,112,111,114,116, + 32,99,111,109,112,111,110,101,110,116,115,46,114,24,1,0, + 0,78,41,14,114,29,1,0,0,114,155,0,0,0,114,7, + 0,0,0,114,250,0,0,0,114,143,0,0,0,114,2,1, + 0,0,114,15,1,0,0,114,3,0,0,0,114,105,0,0, + 0,218,9,109,101,116,97,95,112,97,116,104,114,157,0,0, + 0,114,162,0,0,0,114,245,0,0,0,114,212,0,0,0, + 41,2,114,28,1,0,0,90,17,115,117,112,112,111,114,116, + 101,100,95,108,111,97,100,101,114,115,114,4,0,0,0,114, + 4,0,0,0,114,5,0,0,0,218,8,95,105,110,115,116, + 97,108,108,140,5,0,0,115,16,0,0,0,0,2,8,1, + 6,1,20,1,10,1,12,1,12,4,6,1,114,31,1,0, + 0,41,3,122,3,119,105,110,114,1,0,0,0,114,2,0, + 0,0,41,56,114,107,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,17,0,0,0,114,19,0,0,0,114,28,0, + 0,0,114,38,0,0,0,114,39,0,0,0,114,43,0,0, + 0,114,44,0,0,0,114,46,0,0,0,114,55,0,0,0, + 218,4,116,121,112,101,218,8,95,95,99,111,100,101,95,95, + 114,138,0,0,0,114,15,0,0,0,114,128,0,0,0,114, + 14,0,0,0,114,18,0,0,0,90,17,95,82,65,87,95, + 77,65,71,73,67,95,78,85,77,66,69,82,114,73,0,0, + 0,114,72,0,0,0,114,84,0,0,0,114,74,0,0,0, + 90,23,68,69,66,85,71,95,66,89,84,69,67,79,68,69, + 95,83,85,70,70,73,88,69,83,90,27,79,80,84,73,77, + 73,90,69,68,95,66,89,84,69,67,79,68,69,95,83,85, + 70,70,73,88,69,83,114,79,0,0,0,114,85,0,0,0, + 114,91,0,0,0,114,95,0,0,0,114,97,0,0,0,114, + 116,0,0,0,114,123,0,0,0,114,135,0,0,0,114,141, + 0,0,0,114,144,0,0,0,114,149,0,0,0,218,6,111, + 98,106,101,99,116,114,156,0,0,0,114,161,0,0,0,114, + 162,0,0,0,114,178,0,0,0,114,188,0,0,0,114,204, + 0,0,0,114,212,0,0,0,114,217,0,0,0,114,223,0, + 0,0,114,218,0,0,0,114,224,0,0,0,114,243,0,0, + 0,114,245,0,0,0,114,2,1,0,0,114,20,1,0,0, + 114,155,0,0,0,114,29,1,0,0,114,31,1,0,0,114, + 4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, + 0,0,0,218,8,60,109,111,100,117,108,101,62,8,0,0, + 0,115,102,0,0,0,4,17,4,3,8,12,8,5,8,5, + 8,6,8,12,8,10,8,9,8,5,8,7,10,22,10,116, + 16,1,12,2,4,1,4,2,6,2,6,2,8,2,16,44, + 8,33,8,19,8,12,8,12,8,28,8,17,14,55,14,12, + 12,10,8,14,6,3,8,1,12,65,14,64,14,29,16,110, + 14,41,18,45,18,16,4,3,18,53,14,60,14,42,14,127, + 0,7,14,127,0,20,10,23,8,11,8,68, }; diff --git a/Python/peephole.c b/Python/peephole.c --- a/Python/peephole.c +++ b/Python/peephole.c @@ -8,8 +8,8 @@ #include "code.h" #include "symtable.h" #include "opcode.h" +#include "wordcode_helpers.h" -#define GETARG(arr, i) ((int)((arr[i+2]<<8) + arr[i+1])) #define UNCONDITIONAL_JUMP(op) (op==JUMP_ABSOLUTE || op==JUMP_FORWARD) #define CONDITIONAL_JUMP(op) (op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) @@ -17,22 +17,15 @@ || op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP) #define JUMPS_ON_TRUE(op) (op==POP_JUMP_IF_TRUE || op==JUMP_IF_TRUE_OR_POP) -#define GETJUMPTGT(arr, i) (GETARG(arr,i) + (ABSOLUTE_JUMP(arr[i]) ? 0 : i+3)) -#define SETARG(arr, i, val) do { \ - assert(0 <= val && val <= 0xffff); \ - arr[i+2] = (unsigned char)(((unsigned int)val)>>8); \ - arr[i+1] = (unsigned char)(((unsigned int)val) & 255); \ -} while(0) -#define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) -#define ISBASICBLOCK(blocks, start, bytes) \ - (blocks[start]==blocks[start+bytes-1]) +#define GETJUMPTGT(arr, i) (get_arg(arr, i) + (ABSOLUTE_JUMP(arr[i]) ? 0 : i+2)) +#define ISBASICBLOCK(blocks, start, end) \ + (blocks[start]==blocks[end]) #define CONST_STACK_CREATE() { \ const_stack_size = 256; \ const_stack = PyMem_New(PyObject *, const_stack_size); \ - load_const_stack = PyMem_New(Py_ssize_t, const_stack_size); \ - if (!const_stack || !load_const_stack) { \ + if (!const_stack) { \ PyErr_NoMemory(); \ goto exitError; \ } \ @@ -41,27 +34,23 @@ #define CONST_STACK_DELETE() do { \ if (const_stack) \ PyMem_Free(const_stack); \ - if (load_const_stack) \ - PyMem_Free(load_const_stack); \ } while(0) -#define CONST_STACK_LEN() (const_stack_top + 1) +#define CONST_STACK_LEN() ((unsigned)(const_stack_top + 1)) #define CONST_STACK_PUSH_OP(i) do { \ PyObject *_x; \ assert(codestr[i] == LOAD_CONST); \ - assert(PyList_GET_SIZE(consts) > GETARG(codestr, i)); \ - _x = PyList_GET_ITEM(consts, GETARG(codestr, i)); \ + assert(PyList_GET_SIZE(consts) > (Py_ssize_t)get_arg(codestr, i)); \ + _x = PyList_GET_ITEM(consts, get_arg(codestr, i)); \ if (++const_stack_top >= const_stack_size) { \ const_stack_size *= 2; \ PyMem_Resize(const_stack, PyObject *, const_stack_size); \ - PyMem_Resize(load_const_stack, Py_ssize_t, const_stack_size); \ - if (!const_stack || !load_const_stack) { \ + if (!const_stack) { \ PyErr_NoMemory(); \ goto exitError; \ } \ } \ - load_const_stack[const_stack_top] = i; \ const_stack[const_stack_top] = _x; \ in_consts = 1; \ } while(0) @@ -70,22 +59,108 @@ const_stack_top = -1; \ } while(0) -#define CONST_STACK_TOP() \ - const_stack[const_stack_top] - #define CONST_STACK_LASTN(i) \ - &const_stack[const_stack_top - i + 1] + &const_stack[CONST_STACK_LEN() - i] #define CONST_STACK_POP(i) do { \ - assert(const_stack_top + 1 >= i); \ + assert(CONST_STACK_LEN() >= i); \ const_stack_top -= i; \ } while(0) -#define CONST_STACK_OP_LASTN(i) \ - ((const_stack_top >= i - 1) ? load_const_stack[const_stack_top - i + 1] : -1) +/* Scans back N consecutive LOAD_CONST instructions, skipping NOPs, + returns index of the Nth last's LOAD_CONST's EXTENDED_ARG prefix. + Callers are responsible to check CONST_STACK_LEN beforehand. +*/ +static Py_ssize_t +lastn_const_start(unsigned char *codestr, Py_ssize_t i, Py_ssize_t n) +{ + assert(n > 0 && (i&1) == 0); + for (;;) { + i -= 2; + assert(i >= 0); + if (codestr[i] == LOAD_CONST) { + if (!--n) { + while (i > 0 && codestr[i-2] == EXTENDED_ARG) { + i -= 2; + } + return i; + } + } + else { + assert(codestr[i] == NOP || codestr[i] == EXTENDED_ARG); + } + } +} +/* Scans through EXTENDED ARGs, seeking the index of the effective opcode */ +static Py_ssize_t +find_op(unsigned char *codestr, Py_ssize_t i) +{ + assert((i&1) == 0); + while (codestr[i] == EXTENDED_ARG) { + i += 2; + } + return i; +} -/* Replace LOAD_CONST c1. LOAD_CONST c2 ... LOAD_CONST cn BUILD_TUPLE n +/* Given the index of the effective opcode, + scan back to construct the oparg with EXTENDED_ARG */ +static unsigned int +get_arg(unsigned char *codestr, Py_ssize_t i) +{ + unsigned int oparg = codestr[i+1]; + assert((i&1) == 0); + if (i >= 2 && codestr[i-2] == EXTENDED_ARG) { + oparg |= codestr[i-1] << 8; + if (i >= 4 && codestr[i-4] == EXTENDED_ARG) { + oparg |= codestr[i-3] << 16; + if (i >= 6 && codestr[i-6] == EXTENDED_ARG) { + oparg |= codestr[i-5] << 24; + } + } + } + return oparg; +} + +/* Given the index of the effective opcode, + attempt to replace the argument, taking into account EXTENDED_ARG. + Returns -1 on failure, or the new op index on success */ +static Py_ssize_t +set_arg(unsigned char *codestr, Py_ssize_t i, unsigned int oparg) +{ + unsigned int curarg = get_arg(codestr, i); + int curilen, newilen; + if (curarg == oparg) + return i; + curilen = instrsize(curarg); + newilen = instrsize(oparg); + if (curilen < newilen) { + return -1; + } + + write_op_arg(codestr + i + 2 - curilen, codestr[i], oparg, newilen); + memset(codestr + i + 2 - curilen + newilen, NOP, curilen - newilen); + return i-curilen+newilen; +} + +/* Attempt to write op/arg at end of specified region of memory. + Preceding memory in the region is overwritten with NOPs. + Returns -1 on failure, op index on success */ +static Py_ssize_t +copy_op_arg(unsigned char *codestr, Py_ssize_t i, unsigned char op, + unsigned int oparg, Py_ssize_t maxi) +{ + int ilen = instrsize(oparg); + assert((i&1) == 0); + if (i + ilen > maxi) { + return -1; + } + write_op_arg(codestr + maxi - ilen, op, oparg, ilen); + memset(codestr + i, NOP, maxi - i - ilen); + return maxi - 2; +} + +/* Replace LOAD_CONST c1, LOAD_CONST c2 ... LOAD_CONST cn, BUILD_TUPLE n with LOAD_CONST (c1, c2, ... cn). The consts table must still be in list form so that the new constant (c1, c2, ... cn) can be appended. @@ -94,9 +169,10 @@ Also works for BUILD_LIST and BUILT_SET when followed by an "in" or "not in" test; for BUILD_SET it assembles a frozenset rather than a tuple. */ -static int -tuple_of_constants(unsigned char *codestr, Py_ssize_t n, - PyObject *consts, PyObject **objs) +static Py_ssize_t +fold_tuple_on_constants(unsigned char *codestr, Py_ssize_t c_start, + Py_ssize_t opcode_end, unsigned char opcode, + PyObject *consts, PyObject **objs, int n) { PyObject *newconst, *constant; Py_ssize_t i, len_consts; @@ -106,9 +182,9 @@ /* Buildup new tuple of constants */ newconst = PyTuple_New(n); - if (newconst == NULL) - return 0; - len_consts = PyList_GET_SIZE(consts); + if (newconst == NULL) { + return -1; + } for (i=0 ; i 20) { Py_DECREF(newconst); - return 0; + return -1; } /* Append folded constant into consts table */ - len_consts = PyList_GET_SIZE(consts); if (PyList_Append(consts, newconst)) { Py_DECREF(newconst); - return 0; + return -1; } Py_DECREF(newconst); - /* Write NOP NOP NOP NOP LOAD_CONST newconst */ - codestr[-2] = LOAD_CONST; - SETARG(codestr, -2, len_consts); - return 1; + return copy_op_arg(codestr, c_start, LOAD_CONST, len_consts, opcode_end); } -static int -fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts, PyObject *v) +static Py_ssize_t +fold_unaryops_on_constants(unsigned char *codestr, Py_ssize_t c_start, + Py_ssize_t opcode_end, unsigned char opcode, + PyObject *consts, PyObject *v) { PyObject *newconst; Py_ssize_t len_consts; - int opcode; /* Pre-conditions */ assert(PyList_CheckExact(consts)); - assert(codestr[0] == LOAD_CONST); + len_consts = PyList_GET_SIZE(consts); /* Create new constant */ - opcode = codestr[3]; switch (opcode) { case UNARY_NEGATIVE: newconst = PyNumber_Negative(v); @@ -265,35 +338,31 @@ PyErr_Format(PyExc_SystemError, "unexpected unary operation %d on a constant", opcode); - return 0; + return -1; } if (newconst == NULL) { - if(!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt)) + if(!PyErr_ExceptionMatches(PyExc_KeyboardInterrupt)) { PyErr_Clear(); - return 0; + } + return -1; } /* Append folded constant into consts table */ - len_consts = PyList_GET_SIZE(consts); if (PyList_Append(consts, newconst)) { Py_DECREF(newconst); PyErr_Clear(); - return 0; + return -1; } Py_DECREF(newconst); - /* Write NOP LOAD_CONST newconst */ - codestr[0] = NOP; - codestr[1] = LOAD_CONST; - SETARG(codestr, 1, len_consts); - return 1; + return copy_op_arg(codestr, c_start, LOAD_CONST, len_consts, opcode_end); } static unsigned int * markblocks(unsigned char *code, Py_ssize_t len) { unsigned int *blocks = PyMem_New(unsigned int, len); - int i,j, opcode, blockcnt = 0; + int i, j, opcode, blockcnt = 0; if (blocks == NULL) { PyErr_NoMemory(); @@ -302,7 +371,7 @@ memset(blocks, 0, len*sizeof(int)); /* Mark labels in the first pass */ - for (i=0 ; i= 255. EXTENDED_ARG can - appear before MAKE_FUNCTION; in this case both opcodes are skipped. - EXTENDED_ARG preceding any other opcode causes the optimizer to bail. + To keep the optimizer simple, it bails when the lineno table has complex + encoding for gaps >= 255. Optimizations are restricted to simple transformations occuring within a single basic block. All transformations keep the code size the same or smaller. For those that reduce size, the gaps are initially filled with NOPs. Later those NOPs are removed and the jump addresses retargeted in - a single pass. Code offset is adjusted accordingly. */ + a single pass. */ PyObject * PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, PyObject *lnotab_obj) { - Py_ssize_t i, j, codelen; - int nops, h, adj; - int tgt, tgttgt, opcode; + Py_ssize_t h, i, nexti, op_start, codelen, tgt; + unsigned int j, nops; + unsigned char opcode, nextop; unsigned char *codestr = NULL; unsigned char *lnotab; - int *addrmap = NULL; - int cum_orig_offset, last_offset; + unsigned int cum_orig_offset, last_offset; Py_ssize_t tabsiz; PyObject **const_stack = NULL; - Py_ssize_t *load_const_stack = NULL; Py_ssize_t const_stack_top = -1; Py_ssize_t const_stack_size = 0; int in_consts = 0; /* whether we are in a LOAD_CONST sequence */ @@ -383,11 +446,9 @@ /* Note: -128 and 127 special values for line number delta are ok, the peephole optimizer doesn't modify line numbers. */ - /* Avoid situations where jump retargeting could overflow */ assert(PyBytes_Check(code)); codelen = PyBytes_GET_SIZE(code); - if (codelen > 32700) - goto exitUnchanged; + assert(codelen % 2 == 0); /* Make a modifiable copy of the code string */ codestr = (unsigned char *)PyMem_Malloc(codelen); @@ -398,21 +459,6 @@ codestr = (unsigned char *)memcpy(codestr, PyBytes_AS_STRING(code), codelen); - /* Verify that RETURN_VALUE terminates the codestring. This allows - the various transformation patterns to look ahead several - instructions without additional checks to make sure they are not - looking beyond the end of the code string. - */ - if (codestr[codelen-1] != RETURN_VALUE) - goto exitUnchanged; - - /* Mapping to new jump targets after NOPs are removed */ - addrmap = PyMem_New(int, codelen); - if (addrmap == NULL) { - PyErr_NoMemory(); - goto exitError; - } - blocks = markblocks(codestr, codelen); if (blocks == NULL) goto exitError; @@ -420,9 +466,17 @@ CONST_STACK_CREATE(); - for (i=0 ; i= 2 && codestr[op_start-2] == EXTENDED_ARG) { + op_start -= 2; + } + + nexti = i + 2; + while (nexti < codelen && codestr[nexti] == EXTENDED_ARG) + nexti += 2; + nextop = nexti < codelen ? codestr[nexti] : 0; if (!in_consts) { CONST_STACK_RESET(); @@ -433,14 +487,12 @@ /* Replace UNARY_NOT POP_JUMP_IF_FALSE with POP_JUMP_IF_TRUE */ case UNARY_NOT: - if (codestr[i+1] != POP_JUMP_IF_FALSE - || !ISBASICBLOCK(blocks,i,4)) - continue; - j = GETARG(codestr, i+1); - codestr[i] = POP_JUMP_IF_TRUE; - SETARG(codestr, i, j); - codestr[i+3] = NOP; - goto reoptimize_current; + if (nextop != POP_JUMP_IF_FALSE + || !ISBASICBLOCK(blocks, op_start, i+2)) + break; + memset(codestr + op_start, NOP, i - op_start + 2); + codestr[nexti] = POP_JUMP_IF_TRUE; + break; /* not a is b --> a is not b not a in b --> a not in b @@ -448,78 +500,79 @@ not a not in b --> a in b */ case COMPARE_OP: - j = GETARG(codestr, i); - if (j < 6 || j > 9 || - codestr[i+3] != UNARY_NOT || - !ISBASICBLOCK(blocks,i,4)) - continue; - SETARG(codestr, i, (j^1)); - codestr[i+3] = NOP; + j = get_arg(codestr, i); + if (j < 6 || j > 9 || + nextop != UNARY_NOT || + !ISBASICBLOCK(blocks, op_start, i + 2)) + break; + codestr[i+1] = (j^1); + memset(codestr + i + 2, NOP, nexti - i); break; /* Skip over LOAD_CONST trueconst - POP_JUMP_IF_FALSE xx. This improves - "while 1" performance. */ + POP_JUMP_IF_FALSE xx. This improves + "while 1" performance. */ case LOAD_CONST: CONST_STACK_PUSH_OP(i); - j = GETARG(codestr, i); - if (codestr[i+3] != POP_JUMP_IF_FALSE || - !ISBASICBLOCK(blocks,i,6) || - !PyObject_IsTrue(PyList_GET_ITEM(consts, j))) - continue; - memset(codestr+i, NOP, 6); - CONST_STACK_RESET(); + if (nextop != POP_JUMP_IF_FALSE || + !ISBASICBLOCK(blocks, op_start, i + 2) || + !PyObject_IsTrue(PyList_GET_ITEM(consts, get_arg(codestr, i)))) + break; + memset(codestr + op_start, NOP, nexti - op_start + 2); + CONST_STACK_POP(1); break; - /* Try to fold tuples of constants (includes a case for lists and sets - which are only used for "in" and "not in" tests). + /* Try to fold tuples of constants (includes a case for lists + and sets which are only used for "in" and "not in" tests). Skip over BUILD_SEQN 1 UNPACK_SEQN 1. Replace BUILD_SEQN 2 UNPACK_SEQN 2 with ROT2. Replace BUILD_SEQN 3 UNPACK_SEQN 3 with ROT3 ROT2. */ case BUILD_TUPLE: case BUILD_LIST: case BUILD_SET: - j = GETARG(codestr, i); - if (j == 0) + j = get_arg(codestr, i); + if (j > 0 && CONST_STACK_LEN() >= j) { + h = lastn_const_start(codestr, op_start, j); + if ((opcode == BUILD_TUPLE && + ISBASICBLOCK(blocks, h, op_start)) || + ((opcode == BUILD_LIST || opcode == BUILD_SET) && + ((nextop==COMPARE_OP && + (codestr[nexti+1]==6 || + codestr[nexti+1]==7)) || + nextop == GET_ITER) && ISBASICBLOCK(blocks, h, i + 2))) { + h = fold_tuple_on_constants(codestr, h, i+2, opcode, + consts, CONST_STACK_LASTN(j), j); + if (h >= 0) { + CONST_STACK_POP(j); + CONST_STACK_PUSH_OP(h); + } + break; + } + } + if (nextop != UNPACK_SEQUENCE || + !ISBASICBLOCK(blocks, op_start, i + 2) || + j != get_arg(codestr, nexti) || + opcode == BUILD_SET) break; - h = CONST_STACK_OP_LASTN(j); - assert((h >= 0 || CONST_STACK_LEN() < j)); - if (h >= 0 && j > 0 && j <= CONST_STACK_LEN() && - ((opcode == BUILD_TUPLE && - ISBASICBLOCK(blocks, h, i-h+3)) || - ((opcode == BUILD_LIST || opcode == BUILD_SET) && - codestr[i+3]==COMPARE_OP && - ISBASICBLOCK(blocks, h, i-h+6) && - (GETARG(codestr,i+3)==6 || - GETARG(codestr,i+3)==7))) && - tuple_of_constants(&codestr[i], j, consts, CONST_STACK_LASTN(j))) { - assert(codestr[i] == LOAD_CONST); - memset(&codestr[h], NOP, i - h); - CONST_STACK_POP(j); - CONST_STACK_PUSH_OP(i); - break; - } - if (codestr[i+3] != UNPACK_SEQUENCE || - !ISBASICBLOCK(blocks,i,6) || - j != GETARG(codestr, i+3) || - opcode == BUILD_SET) - continue; - if (j == 1) { - memset(codestr+i, NOP, 6); + if (j < 2) { + memset(codestr+op_start, NOP, nexti - op_start + 2); } else if (j == 2) { - codestr[i] = ROT_TWO; - memset(codestr+i+1, NOP, 5); + codestr[op_start] = ROT_TWO; + codestr[op_start + 1] = 0; + memset(codestr + op_start + 2, NOP, nexti - op_start); CONST_STACK_RESET(); } else if (j == 3) { - codestr[i] = ROT_THREE; - codestr[i+1] = ROT_TWO; - memset(codestr+i+2, NOP, 4); + codestr[op_start] = ROT_THREE; + codestr[op_start + 1] = 0; + codestr[op_start + 2] = ROT_TWO; + codestr[op_start + 3] = 0; + memset(codestr + op_start + 4, NOP, nexti - op_start - 2); CONST_STACK_RESET(); } break; /* Fold binary ops on constants. - LOAD_CONST c1 LOAD_CONST c2 BINOP --> LOAD_CONST binop(c1,c2) */ + LOAD_CONST c1 LOAD_CONST c2 BINOP --> LOAD_CONST binop(c1,c2) */ case BINARY_POWER: case BINARY_MULTIPLY: case BINARY_TRUE_DIVIDE: @@ -533,35 +586,34 @@ case BINARY_AND: case BINARY_XOR: case BINARY_OR: - /* NOTE: LOAD_CONST is saved at `i-2` since it has an arg - while BINOP hasn't */ - h = CONST_STACK_OP_LASTN(2); - assert((h >= 0 || CONST_STACK_LEN() < 2)); - if (h >= 0 && - ISBASICBLOCK(blocks, h, i-h+1) && - fold_binops_on_constants(&codestr[i], consts, CONST_STACK_LASTN(2))) { - i -= 2; - memset(&codestr[h], NOP, i - h); - assert(codestr[i] == LOAD_CONST); - CONST_STACK_POP(2); - CONST_STACK_PUSH_OP(i); + if (CONST_STACK_LEN() < 2) + break; + h = lastn_const_start(codestr, op_start, 2); + if (ISBASICBLOCK(blocks, h, op_start)) { + h = fold_binops_on_constants(codestr, h, i+2, opcode, + consts, CONST_STACK_LASTN(2)); + if (h >= 0) { + CONST_STACK_POP(2); + CONST_STACK_PUSH_OP(h); + } } break; /* Fold unary ops on constants. - LOAD_CONST c1 UNARY_OP --> LOAD_CONST unary_op(c) */ + LOAD_CONST c1 UNARY_OP --> LOAD_CONST unary_op(c) */ case UNARY_NEGATIVE: case UNARY_INVERT: case UNARY_POSITIVE: - h = CONST_STACK_OP_LASTN(1); - assert((h >= 0 || CONST_STACK_LEN() < 1)); - if (h >= 0 && - ISBASICBLOCK(blocks, h, i-h+1) && - fold_unaryops_on_constants(&codestr[i-3], consts, CONST_STACK_TOP())) { - i -= 2; - assert(codestr[i] == LOAD_CONST); - CONST_STACK_POP(1); - CONST_STACK_PUSH_OP(i); + if (CONST_STACK_LEN() < 1) + break; + h = lastn_const_start(codestr, op_start, 1); + if (ISBASICBLOCK(blocks, h, op_start)) { + h = fold_unaryops_on_constants(codestr, h, i+2, opcode, + consts, *CONST_STACK_LASTN(1)); + if (h >= 0) { + CONST_STACK_POP(1); + CONST_STACK_PUSH_OP(h); + } } break; @@ -576,25 +628,24 @@ x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_FALSE_OR_POP z --> x:JUMP_IF_FALSE_OR_POP z x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_TRUE_OR_POP z - --> x:POP_JUMP_IF_FALSE y+3 - where y+3 is the instruction following the second test. + --> x:POP_JUMP_IF_FALSE y+2 + where y+2 is the instruction following the second test. */ case JUMP_IF_FALSE_OR_POP: case JUMP_IF_TRUE_OR_POP: - tgt = GETJUMPTGT(codestr, i); + h = get_arg(codestr, i); + tgt = find_op(codestr, h); + j = codestr[tgt]; if (CONDITIONAL_JUMP(j)) { /* NOTE: all possible jumps here are absolute! */ if (JUMPS_ON_TRUE(j) == JUMPS_ON_TRUE(opcode)) { /* The second jump will be - taken iff the first is. */ - tgttgt = GETJUMPTGT(codestr, tgt); - /* The current opcode inherits - its target's stack behaviour */ - codestr[i] = j; - SETARG(codestr, i, tgttgt); - goto reoptimize_current; + taken iff the first is. + The current opcode inherits + its target's stack effect */ + h = set_arg(codestr, i, get_arg(codestr, tgt)); } else { /* The second jump is not taken if the first is (so jump past @@ -603,12 +654,15 @@ they're not taken (so change the first jump to pop its argument when it's taken). */ - if (JUMPS_ON_TRUE(opcode)) - codestr[i] = POP_JUMP_IF_TRUE; - else - codestr[i] = POP_JUMP_IF_FALSE; - SETARG(codestr, i, (tgt + 3)); - goto reoptimize_current; + h = set_arg(codestr, i, tgt + 2); + j = opcode == JUMP_IF_TRUE_OR_POP ? + POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE; + } + + if (h >= 0) { + nexti = h; + codestr[nexti] = j; + break; } } /* Intentional fallthrough */ @@ -625,76 +679,73 @@ case SETUP_FINALLY: case SETUP_WITH: case SETUP_ASYNC_WITH: - tgt = GETJUMPTGT(codestr, i); + h = GETJUMPTGT(codestr, i); + tgt = find_op(codestr, h); /* Replace JUMP_* to a RETURN into just a RETURN */ if (UNCONDITIONAL_JUMP(opcode) && codestr[tgt] == RETURN_VALUE) { - codestr[i] = RETURN_VALUE; - memset(codestr+i+1, NOP, 2); - continue; + codestr[op_start] = RETURN_VALUE; + codestr[op_start + 1] = 0; + memset(codestr + op_start + 2, NOP, i - op_start); + } else if (UNCONDITIONAL_JUMP(codestr[tgt])) { + j = GETJUMPTGT(codestr, tgt); + if (opcode == JUMP_FORWARD) { /* JMP_ABS can go backwards */ + opcode = JUMP_ABSOLUTE; + } else if (!ABSOLUTE_JUMP(opcode)) { + if ((Py_ssize_t)j < i + 2) { + break; /* No backward relative jumps */ + } + j -= i + 2; /* Calc relative jump addr */ + } + copy_op_arg(codestr, op_start, opcode, j, i+2); } - if (!UNCONDITIONAL_JUMP(codestr[tgt])) - continue; - tgttgt = GETJUMPTGT(codestr, tgt); - if (opcode == JUMP_FORWARD) /* JMP_ABS can go backwards */ - opcode = JUMP_ABSOLUTE; - if (!ABSOLUTE_JUMP(opcode)) - tgttgt -= i + 3; /* Calc relative jump addr */ - if (tgttgt < 0) /* No backward relative jumps */ - continue; - codestr[i] = opcode; - SETARG(codestr, i, tgttgt); break; - case EXTENDED_ARG: - if (codestr[i+3] != MAKE_FUNCTION) - goto exitUnchanged; - /* don't visit MAKE_FUNCTION as GETARG will be wrong */ - i += 3; - break; - - /* Replace RETURN LOAD_CONST None RETURN with just RETURN */ - /* Remove unreachable JUMPs after RETURN */ + /* Remove unreachable ops after RETURN */ case RETURN_VALUE: - if (i+4 >= codelen) - continue; - if (codestr[i+4] == RETURN_VALUE && - ISBASICBLOCK(blocks,i,5)) - memset(codestr+i+1, NOP, 4); - else if (UNCONDITIONAL_JUMP(codestr[i+1]) && - ISBASICBLOCK(blocks,i,4)) - memset(codestr+i+1, NOP, 3); + h = i + 2; + while (h + 2 < codelen && ISBASICBLOCK(blocks, i, h + 2)) { + h += 2; + } + if (h > i + 2) { + memset(codestr + i + 2, NOP, h - i); + nexti = find_op(codestr, h); + } break; } } /* Fixup lnotab */ - for (i=0, nops=0 ; i new code offset */ - addrmap[i] = (int)(i - nops); + blocks[i] = i - nops; if (codestr[i] == NOP) - nops++; + nops += 2; } cum_orig_offset = 0; last_offset = 0; for (i=0 ; i < tabsiz ; i+=2) { - int offset_delta, new_offset; + unsigned int offset_delta, new_offset; cum_orig_offset += lnotab[i]; - new_offset = addrmap[cum_orig_offset]; + assert((cum_orig_offset & 1) == 0); + new_offset = blocks[cum_orig_offset]; offset_delta = new_offset - last_offset; - assert(0 <= offset_delta && offset_delta <= 255); + assert(offset_delta <= 255); lnotab[i] = (unsigned char)offset_delta; last_offset = new_offset; } /* Remove NOPs and fixup jump targets */ - for (i=0, h=0 ; i nexti) + goto exitUnchanged; + /* If instrsize(j) < nexti, we'll emit EXTENDED_ARG 0 */ + write_op_arg(codestr + h, opcode, j, nexti); + h += nexti; } - assert(h + nops == codelen); + assert(h + (Py_ssize_t)nops == codelen); + CONST_STACK_DELETE(); + PyMem_Free(blocks); code = PyBytes_FromStringAndSize((char *)codestr, h); - CONST_STACK_DELETE(); - PyMem_Free(addrmap); PyMem_Free(codestr); - PyMem_Free(blocks); return code; exitError: code = NULL; exitUnchanged: + Py_XINCREF(code); CONST_STACK_DELETE(); PyMem_Free(blocks); - PyMem_Free(addrmap); PyMem_Free(codestr); - Py_XINCREF(code); return code; } diff --git a/Python/wordcode_helpers.h b/Python/wordcode_helpers.h new file mode 100644 --- /dev/null +++ b/Python/wordcode_helpers.h @@ -0,0 +1,38 @@ +/* This file contains code shared by the compiler and the peephole + optimizer. + */ + +/* Minimum number of bytes necessary to encode instruction with EXTENDED_ARGs */ +static int +instrsize(unsigned int oparg) +{ + return oparg <= 0xff ? 2 : + oparg <= 0xffff ? 4 : + oparg <= 0xffffff ? 6 : + 8; +} + +/* Spits out op/oparg pair using ilen bytes. codestr should be pointed at the + desired location of the first EXTENDED_ARG */ +static void +write_op_arg(unsigned char *codestr, unsigned char opcode, + unsigned int oparg, int ilen) +{ + switch (ilen) { + case 8: + *codestr++ = EXTENDED_ARG; + *codestr++ = (oparg >> 24) & 0xff; + case 6: + *codestr++ = EXTENDED_ARG; + *codestr++ = (oparg >> 16) & 0xff; + case 4: + *codestr++ = EXTENDED_ARG; + *codestr++ = (oparg >> 8) & 0xff; + case 2: + *codestr++ = opcode; + *codestr++ = oparg & 0xff; + break; + default: + assert(0); + } +} -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Tue May 24 04:53:09 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 24 May 2016 08:53:09 +0000 Subject: [Python-checkins] Daily reference leaks (6147a2c99db0): sum=0 Message-ID: <20160524085308.60981.55186.1E7427E4@psf.io> results for 6147a2c99db0 on branch "default" -------------------------------------------- test_collections leaked [0, -4, 0] memory blocks, sum=-4 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogNUblyH', '--timeout', '7200'] From lp_benchmark_robot at intel.com Tue May 24 07:32:37 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Tue, 24 May 2016 12:32:37 +0100 Subject: [Python-checkins] UGLY Benchmark Results for Python 2.7 2016-05-24 Message-ID: <2049a556-a8a7-4491-be36-2b0296de80b5@irsmsx103.ger.corp.intel.com> No new revisions. Here are the previous results: Results for project Python 2.7, build date 2016-05-24 02:46:33 +0000 commit: a873265366ba previous commit: 18c5e4d82d83 revision date: 2016-05-22 18:35:13 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.16% -1.73% 4.31% 5.77% :-) pybench 0.29% 0.15% 6.06% 4.70% :-( regex_v8 0.64% 0.23% -2.22% 10.48% :-) nbody 0.33% -0.46% 9.28% 1.54% :-| json_dump_v2 0.62% -0.40% 1.19% 12.14% :-( normal_startup 1.70% 1.56% -4.53% 1.72% :-) ssbench 0.17% -0.45% 2.29% 1.30% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/ugly-benchmark-results-for-python-2-7-2016-05-24/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Tue May 24 07:32:01 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Tue, 24 May 2016 12:32:01 +0100 Subject: [Python-checkins] GOOD Benchmark Results for Python Default 2016-05-24 Message-ID: <47a10964-0920-4fac-8772-c32955fec34a@irsmsx103.ger.corp.intel.com> Results for project Python default, build date 2016-05-24 02:02:17 +0000 commit: 6147a2c99db0 previous commit: 7eb20f06c6e9 revision date: 2016-05-23 05:42:09 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.45% -0.02% 9.70% 10.41% :-) pybench 0.15% -0.12% 2.41% 5.47% :-( regex_v8 2.84% 0.00% -2.16% 1.17% :-| nbody 0.09% -0.15% 0.10% 9.59% :-| json_dump_v2 0.29% 1.54% -1.40% 10.16% :-| normal_startup 0.72% 0.11% -0.29% 5.40% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/good-benchmark-results-for-python-default-2016-05-24/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From brett at snarky.ca Tue May 24 12:57:18 2016 From: brett at snarky.ca (Brett Cannon) Date: Tue, 24 May 2016 16:57:18 +0000 Subject: [Python-checkins] cpython: Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode. In-Reply-To: <20160524061542.28801.84595.29E5EEA7@psf.io> References: <20160524061542.28801.84595.29E5EEA7@psf.io> Message-ID: This probably deserves a "What's New" entry since it does break bytecode-inspecting code. On Mon, 23 May 2016 at 23:15 serhiy.storchaka wrote: > https://hg.python.org/cpython/rev/3a57eafd8401 > changeset: 101486:3a57eafd8401 > user: Serhiy Storchaka > date: Tue May 24 09:15:14 2016 +0300 > summary: > Issue #26647: Python interpreter now uses 16-bit wordcode instead of > bytecode. > Patch by Demur Rumed. > > files: > Doc/library/dis.rst | 9 +- > Lib/ctypes/test/test_values.py | 6 +- > Lib/dis.py | 35 +- > Lib/importlib/_bootstrap_external.py | 3 +- > Lib/test/test_dis.py | 512 +- > Misc/NEWS | 3 + > Objects/frameobject.c | 12 +- > Objects/genobject.c | 4 +- > PC/launcher.c | 2 +- > PCbuild/pythoncore.vcxproj | 1 + > PCbuild/pythoncore.vcxproj.filters | 3 + > Python/ceval.c | 133 +- > Python/compile.c | 81 +- > Python/frozen.c | 20 +- > Python/importlib.h | 3719 +++++----- > Python/importlib_external.h | 4612 ++++++------- > Python/peephole.c | 578 +- > Python/wordcode_helpers.h | 38 + > 18 files changed, 4748 insertions(+), 5023 deletions(-) > > > diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst > --- a/Doc/library/dis.rst > +++ b/Doc/library/dis.rst > @@ -31,9 +31,9 @@ > > >>> dis.dis(myfunc) > 2 0 LOAD_GLOBAL 0 (len) > - 3 LOAD_FAST 0 (alist) > - 6 CALL_FUNCTION 1 > - 9 RETURN_VALUE > + 2 LOAD_FAST 0 (alist) > + 4 CALL_FUNCTION 1 > + 6 RETURN_VALUE > > (The "2" is a line number). > > @@ -682,8 +682,7 @@ > .. XXX explain the WHY stuff! > > > -All of the following opcodes expect arguments. An argument is two bytes, > with > -the more significant byte last. > +All of the following opcodes use their arguments. > > .. opcode:: STORE_NAME (namei) > > diff --git a/Lib/ctypes/test/test_values.py > b/Lib/ctypes/test/test_values.py > --- a/Lib/ctypes/test/test_values.py > +++ b/Lib/ctypes/test/test_values.py > @@ -79,9 +79,9 @@ > continue > items.append((entry.name.decode("ascii"), entry.size)) > > - expected = [("__hello__", 161), > - ("__phello__", -161), > - ("__phello__.spam", 161), > + expected = [("__hello__", 139), > + ("__phello__", -139), > + ("__phello__.spam", 139), > ] > self.assertEqual(items, expected, "PyImport_FrozenModules example > " > "in Doc/library/ctypes.rst may be out of date") > diff --git a/Lib/dis.py b/Lib/dis.py > --- a/Lib/dis.py > +++ b/Lib/dis.py > @@ -285,7 +285,6 @@ > """ > labels = findlabels(code) > starts_line = None > - free = None > for offset, op, arg in _unpack_opargs(code): > if linestarts is not None: > starts_line = linestarts.get(offset, None) > @@ -296,7 +295,7 @@ > argrepr = '' > if arg is not None: > # Set argval to the dereferenced value of the argument when > - # availabe, and argrepr to the string representation of > argval. > + # available, and argrepr to the string representation of > argval. > # _disassemble_bytes needs the string repr of the > # raw name index for LOAD_GLOBAL, LOAD_CONST, etc. > argval = arg > @@ -305,7 +304,7 @@ > elif op in hasname: > argval, argrepr = _get_name_info(arg, names) > elif op in hasjrel: > - argval = offset + 3 + arg > + argval = offset + 2 + arg > argrepr = "to " + repr(argval) > elif op in haslocal: > argval, argrepr = _get_name_info(arg, varnames) > @@ -352,23 +351,15 @@ > disco = disassemble # XXX For backwards compatibility > > def _unpack_opargs(code): > - # enumerate() is not an option, since we sometimes process > - # multiple elements on a single pass through the loop > extended_arg = 0 > - n = len(code) > - i = 0 > - while i < n: > + for i in range(0, len(code), 2): > op = code[i] > - offset = i > - i = i+1 > - arg = None > if op >= HAVE_ARGUMENT: > - arg = code[i] + code[i+1]*256 + extended_arg > - extended_arg = 0 > - i = i+2 > - if op == EXTENDED_ARG: > - extended_arg = arg*65536 > - yield (offset, op, arg) > + arg = code[i+1] | extended_arg > + extended_arg = (arg << 8) if op == EXTENDED_ARG else 0 > + else: > + arg = None > + yield (i, op, arg) > > def findlabels(code): > """Detect all offsets in a byte code which are jump targets. > @@ -379,14 +370,14 @@ > labels = [] > for offset, op, arg in _unpack_opargs(code): > if arg is not None: > - label = -1 > if op in hasjrel: > - label = offset + 3 + arg > + label = offset + 2 + arg > elif op in hasjabs: > label = arg > - if label >= 0: > - if label not in labels: > - labels.append(label) > + else: > + continue > + if label not in labels: > + labels.append(label) > return labels > > def findlinestarts(code): > diff --git a/Lib/importlib/_bootstrap_external.py > b/Lib/importlib/_bootstrap_external.py > --- a/Lib/importlib/_bootstrap_external.py > +++ b/Lib/importlib/_bootstrap_external.py > @@ -225,6 +225,7 @@ > # Python 3.5b2 3350 (add GET_YIELD_FROM_ITER opcode #24400) > # Python 3.6a0 3360 (add FORMAT_VALUE opcode #25483 > # Python 3.6a0 3361 (lineno delta of code.co_lnotab becomes signed) > +# Python 3.6a0 3370 (16 bit wordcode) > # > # MAGIC must change whenever the bytecode emitted by the compiler may no > # longer be understood by older implementations of the eval loop (usually > @@ -233,7 +234,7 @@ > # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array > # in PC/launcher.c must also be updated. > > -MAGIC_NUMBER = (3361).to_bytes(2, 'little') + b'\r\n' > +MAGIC_NUMBER = (3370).to_bytes(2, 'little') + b'\r\n' > _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c > > _PYCACHE = '__pycache__' > diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py > --- a/Lib/test/test_dis.py > +++ b/Lib/test/test_dis.py > @@ -40,41 +40,41 @@ > > dis_c_instance_method = """\ > %3d 0 LOAD_FAST 1 (x) > - 3 LOAD_CONST 1 (1) > - 6 COMPARE_OP 2 (==) > - 9 LOAD_FAST 0 (self) > - 12 STORE_ATTR 0 (x) > - 15 LOAD_CONST 0 (None) > - 18 RETURN_VALUE > + 2 LOAD_CONST 1 (1) > + 4 COMPARE_OP 2 (==) > + 6 LOAD_FAST 0 (self) > + 8 STORE_ATTR 0 (x) > + 10 LOAD_CONST 0 (None) > + 12 RETURN_VALUE > """ % (_C.__init__.__code__.co_firstlineno + 1,) > > dis_c_instance_method_bytes = """\ > 0 LOAD_FAST 1 (1) > - 3 LOAD_CONST 1 (1) > - 6 COMPARE_OP 2 (==) > - 9 LOAD_FAST 0 (0) > - 12 STORE_ATTR 0 (0) > - 15 LOAD_CONST 0 (0) > - 18 RETURN_VALUE > + 2 LOAD_CONST 1 (1) > + 4 COMPARE_OP 2 (==) > + 6 LOAD_FAST 0 (0) > + 8 STORE_ATTR 0 (0) > + 10 LOAD_CONST 0 (0) > + 12 RETURN_VALUE > """ > > dis_c_class_method = """\ > %3d 0 LOAD_FAST 1 (x) > - 3 LOAD_CONST 1 (1) > - 6 COMPARE_OP 2 (==) > - 9 LOAD_FAST 0 (cls) > - 12 STORE_ATTR 0 (x) > - 15 LOAD_CONST 0 (None) > - 18 RETURN_VALUE > + 2 LOAD_CONST 1 (1) > + 4 COMPARE_OP 2 (==) > + 6 LOAD_FAST 0 (cls) > + 8 STORE_ATTR 0 (x) > + 10 LOAD_CONST 0 (None) > + 12 RETURN_VALUE > """ % (_C.cm.__code__.co_firstlineno + 2,) > > dis_c_static_method = """\ > %3d 0 LOAD_FAST 0 (x) > - 3 LOAD_CONST 1 (1) > - 6 COMPARE_OP 2 (==) > - 9 STORE_FAST 0 (x) > - 12 LOAD_CONST 0 (None) > - 15 RETURN_VALUE > + 2 LOAD_CONST 1 (1) > + 4 COMPARE_OP 2 (==) > + 6 STORE_FAST 0 (x) > + 8 LOAD_CONST 0 (None) > + 10 RETURN_VALUE > """ % (_C.sm.__code__.co_firstlineno + 2,) > > # Class disassembling info has an extra newline at end. > @@ -95,23 +95,23 @@ > > dis_f = """\ > %3d 0 LOAD_GLOBAL 0 (print) > - 3 LOAD_FAST 0 (a) > - 6 CALL_FUNCTION 1 (1 positional, 0 keyword pair) > - 9 POP_TOP > + 2 LOAD_FAST 0 (a) > + 4 CALL_FUNCTION 1 (1 positional, 0 keyword pair) > + 6 POP_TOP > > -%3d 10 LOAD_CONST 1 (1) > - 13 RETURN_VALUE > +%3d 8 LOAD_CONST 1 (1) > + 10 RETURN_VALUE > """ % (_f.__code__.co_firstlineno + 1, > _f.__code__.co_firstlineno + 2) > > > dis_f_co_code = """\ > 0 LOAD_GLOBAL 0 (0) > - 3 LOAD_FAST 0 (0) > - 6 CALL_FUNCTION 1 (1 positional, 0 keyword pair) > - 9 POP_TOP > - 10 LOAD_CONST 1 (1) > - 13 RETURN_VALUE > + 2 LOAD_FAST 0 (0) > + 4 CALL_FUNCTION 1 (1 positional, 0 keyword pair) > + 6 POP_TOP > + 8 LOAD_CONST 1 (1) > + 10 RETURN_VALUE > """ > > > @@ -121,20 +121,20 @@ > pass > > dis_bug708901 = """\ > -%3d 0 SETUP_LOOP 23 (to 26) > - 3 LOAD_GLOBAL 0 (range) > - 6 LOAD_CONST 1 (1) > +%3d 0 SETUP_LOOP 18 (to 20) > + 2 LOAD_GLOBAL 0 (range) > + 4 LOAD_CONST 1 (1) > > -%3d 9 LOAD_CONST 2 (10) > - 12 CALL_FUNCTION 2 (2 positional, 0 keyword pair) > - 15 GET_ITER > - >> 16 FOR_ITER 6 (to 25) > - 19 STORE_FAST 0 (res) > +%3d 6 LOAD_CONST 2 (10) > + 8 CALL_FUNCTION 2 (2 positional, 0 keyword pair) > + 10 GET_ITER > + >> 12 FOR_ITER 4 (to 18) > + 14 STORE_FAST 0 (res) > > -%3d 22 JUMP_ABSOLUTE 16 > - >> 25 POP_BLOCK > - >> 26 LOAD_CONST 0 (None) > - 29 RETURN_VALUE > +%3d 16 JUMP_ABSOLUTE 12 > + >> 18 POP_BLOCK > + >> 20 LOAD_CONST 0 (None) > + 22 RETURN_VALUE > """ % (bug708901.__code__.co_firstlineno + 1, > bug708901.__code__.co_firstlineno + 2, > bug708901.__code__.co_firstlineno + 3) > @@ -147,22 +147,22 @@ > > dis_bug1333982 = """\ > %3d 0 LOAD_CONST 1 (0) > - 3 POP_JUMP_IF_TRUE 35 > - 6 LOAD_GLOBAL 0 (AssertionError) > - 9 LOAD_CONST 2 ( at > 0x..., file "%s", line %d>) > - 12 LOAD_CONST 3 > ('bug1333982..') > - 15 MAKE_FUNCTION 0 > - 18 LOAD_FAST 0 (x) > - 21 GET_ITER > + 2 POP_JUMP_IF_TRUE 26 > + 4 LOAD_GLOBAL 0 (AssertionError) > + 6 LOAD_CONST 2 ( at > 0x..., file "%s", line %d>) > + 8 LOAD_CONST 3 > ('bug1333982..') > + 10 MAKE_FUNCTION 0 > + 12 LOAD_FAST 0 (x) > + 14 GET_ITER > + 16 CALL_FUNCTION 1 (1 positional, 0 keyword pair) > + > +%3d 18 LOAD_CONST 4 (1) > + 20 BINARY_ADD > 22 CALL_FUNCTION 1 (1 positional, 0 keyword pair) > + 24 RAISE_VARARGS 1 > > -%3d 25 LOAD_CONST 4 (1) > - 28 BINARY_ADD > - 29 CALL_FUNCTION 1 (1 positional, 0 keyword pair) > - 32 RAISE_VARARGS 1 > - > -%3d >> 35 LOAD_CONST 0 (None) > - 38 RETURN_VALUE > +%3d >> 26 LOAD_CONST 0 (None) > + 28 RETURN_VALUE > """ % (bug1333982.__code__.co_firstlineno + 1, > __file__, > bug1333982.__code__.co_firstlineno + 1, > @@ -171,19 +171,19 @@ > > _BIG_LINENO_FORMAT = """\ > %3d 0 LOAD_GLOBAL 0 (spam) > - 3 POP_TOP > + 2 POP_TOP > 4 LOAD_CONST 0 (None) > - 7 RETURN_VALUE > + 6 RETURN_VALUE > """ > > dis_module_expected_results = """\ > Disassembly of f: > 4 0 LOAD_CONST 0 (None) > - 3 RETURN_VALUE > + 2 RETURN_VALUE > > Disassembly of g: > 5 0 LOAD_CONST 0 (None) > - 3 RETURN_VALUE > + 2 RETURN_VALUE > > """ > > @@ -191,20 +191,20 @@ > > dis_expr_str = """\ > 1 0 LOAD_NAME 0 (x) > - 3 LOAD_CONST 0 (1) > - 6 BINARY_ADD > - 7 RETURN_VALUE > + 2 LOAD_CONST 0 (1) > + 4 BINARY_ADD > + 6 RETURN_VALUE > """ > > simple_stmt_str = "x = x + 1" > > dis_simple_stmt_str = """\ > 1 0 LOAD_NAME 0 (x) > - 3 LOAD_CONST 0 (1) > - 6 BINARY_ADD > - 7 STORE_NAME 0 (x) > - 10 LOAD_CONST 1 (None) > - 13 RETURN_VALUE > + 2 LOAD_CONST 0 (1) > + 4 BINARY_ADD > + 6 STORE_NAME 0 (x) > + 8 LOAD_CONST 1 (None) > + 10 RETURN_VALUE > """ > > compound_stmt_str = """\ > @@ -215,54 +215,54 @@ > > dis_compound_stmt_str = """\ > 1 0 LOAD_CONST 0 (0) > - 3 STORE_NAME 0 (x) > + 2 STORE_NAME 0 (x) > > - 2 6 SETUP_LOOP 14 (to 23) > + 2 4 SETUP_LOOP 12 (to 18) > > - 3 >> 9 LOAD_NAME 0 (x) > - 12 LOAD_CONST 1 (1) > - 15 INPLACE_ADD > - 16 STORE_NAME 0 (x) > - 19 JUMP_ABSOLUTE 9 > - 22 POP_BLOCK > - >> 23 LOAD_CONST 2 (None) > - 26 RETURN_VALUE > + 3 >> 6 LOAD_NAME 0 (x) > + 8 LOAD_CONST 1 (1) > + 10 INPLACE_ADD > + 12 STORE_NAME 0 (x) > + 14 JUMP_ABSOLUTE 6 > + 16 POP_BLOCK > + >> 18 LOAD_CONST 2 (None) > + 20 RETURN_VALUE > """ > > dis_traceback = """\ > -%3d 0 SETUP_EXCEPT 12 (to 15) > +%3d 0 SETUP_EXCEPT 12 (to 14) > > -%3d 3 LOAD_CONST 1 (1) > - 6 LOAD_CONST 2 (0) > - --> 9 BINARY_TRUE_DIVIDE > - 10 POP_TOP > - 11 POP_BLOCK > - 12 JUMP_FORWARD 46 (to 61) > +%3d 2 LOAD_CONST 1 (1) > + 4 LOAD_CONST 2 (0) > + --> 6 BINARY_TRUE_DIVIDE > + 8 POP_TOP > + 10 POP_BLOCK > + 12 JUMP_FORWARD 40 (to 54) > > -%3d >> 15 DUP_TOP > +%3d >> 14 DUP_TOP > 16 LOAD_GLOBAL 0 (Exception) > - 19 COMPARE_OP 10 (exception match) > - 22 POP_JUMP_IF_FALSE 60 > - 25 POP_TOP > - 26 STORE_FAST 0 (e) > - 29 POP_TOP > - 30 SETUP_FINALLY 14 (to 47) > + 18 COMPARE_OP 10 (exception match) > + 20 POP_JUMP_IF_FALSE 52 > + 22 POP_TOP > + 24 STORE_FAST 0 (e) > + 26 POP_TOP > + 28 SETUP_FINALLY 12 (to 42) > > -%3d 33 LOAD_FAST 0 (e) > - 36 LOAD_ATTR 1 (__traceback__) > - 39 STORE_FAST 1 (tb) > - 42 POP_BLOCK > - 43 POP_EXCEPT > - 44 LOAD_CONST 0 (None) > - >> 47 LOAD_CONST 0 (None) > - 50 STORE_FAST 0 (e) > - 53 DELETE_FAST 0 (e) > - 56 END_FINALLY > - 57 JUMP_FORWARD 1 (to 61) > - >> 60 END_FINALLY > +%3d 30 LOAD_FAST 0 (e) > + 32 LOAD_ATTR 1 (__traceback__) > + 34 STORE_FAST 1 (tb) > + 36 POP_BLOCK > + 38 POP_EXCEPT > + 40 LOAD_CONST 0 (None) > + >> 42 LOAD_CONST 0 (None) > + 44 STORE_FAST 0 (e) > + 46 DELETE_FAST 0 (e) > + 48 END_FINALLY > + 50 JUMP_FORWARD 2 (to 54) > + >> 52 END_FINALLY > > -%3d >> 61 LOAD_FAST 1 (tb) > - 64 RETURN_VALUE > +%3d >> 54 LOAD_FAST 1 (tb) > + 56 RETURN_VALUE > """ % (TRACEBACK_CODE.co_firstlineno + 1, > TRACEBACK_CODE.co_firstlineno + 2, > TRACEBACK_CODE.co_firstlineno + 3, > @@ -650,170 +650,170 @@ > Instruction = dis.Instruction > expected_opinfo_outer = [ > Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=3, > argrepr='3', offset=0, starts_line=2, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, > argrepr='4', offset=3, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='a', > argrepr='a', offset=6, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='b', > argrepr='b', offset=9, starts_line=None, is_jump_target=False), > - Instruction(opname='BUILD_TUPLE', opcode=102, arg=2, argval=2, > argrepr='', offset=12, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=3, > argval=code_object_f, argrepr=repr(code_object_f), offset=15, > starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=4, > argval='outer..f', argrepr="'outer..f'", offset=18, > starts_line=None, is_jump_target=False), > - Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, > argrepr='', offset=21, starts_line=None, is_jump_target=False), > - Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='f', > argrepr='f', offset=24, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', > argrepr='print', offset=27, starts_line=7, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', > argrepr='a', offset=30, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', > argrepr='b', offset=33, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval='', > argrepr="''", offset=36, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval=1, > argrepr='1', offset=39, starts_line=None, is_jump_target=False), > - Instruction(opname='BUILD_LIST', opcode=103, arg=0, argval=0, > argrepr='', offset=42, starts_line=None, is_jump_target=False), > - Instruction(opname='BUILD_MAP', opcode=105, arg=0, argval=0, > argrepr='', offset=45, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval='Hello > world!', argrepr="'Hello world!'", offset=48, starts_line=None, > is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=7, argval=7, > argrepr='7 positional, 0 keyword pair', offset=51, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=54, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', > argrepr='f', offset=55, starts_line=8, is_jump_target=False), > - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=58, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, > argrepr='4', offset=2, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='a', > argrepr='a', offset=4, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='b', > argrepr='b', offset=6, starts_line=None, is_jump_target=False), > + Instruction(opname='BUILD_TUPLE', opcode=102, arg=2, argval=2, > argrepr='', offset=8, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=3, > argval=code_object_f, argrepr=repr(code_object_f), offset=10, > starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=4, > argval='outer..f', argrepr="'outer..f'", offset=12, > starts_line=None, is_jump_target=False), > + Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, > argrepr='', offset=14, starts_line=None, is_jump_target=False), > + Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='f', > argrepr='f', offset=16, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', > argrepr='print', offset=18, starts_line=7, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', > argrepr='a', offset=20, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', > argrepr='b', offset=22, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval='', > argrepr="''", offset=24, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval=1, > argrepr='1', offset=26, starts_line=None, is_jump_target=False), > + Instruction(opname='BUILD_LIST', opcode=103, arg=0, argval=0, > argrepr='', offset=28, starts_line=None, is_jump_target=False), > + Instruction(opname='BUILD_MAP', opcode=105, arg=0, argval=0, > argrepr='', offset=30, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval='Hello > world!', argrepr="'Hello world!'", offset=32, starts_line=None, > is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=7, argval=7, > argrepr='7 positional, 0 keyword pair', offset=34, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=36, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', > argrepr='f', offset=38, starts_line=8, is_jump_target=False), > + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=40, starts_line=None, is_jump_target=False), > ] > > expected_opinfo_f = [ > Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=5, > argrepr='5', offset=0, starts_line=3, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=6, > argrepr='6', offset=3, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=2, argval='a', > argrepr='a', offset=6, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=3, argval='b', > argrepr='b', offset=9, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='c', > argrepr='c', offset=12, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='d', > argrepr='d', offset=15, starts_line=None, is_jump_target=False), > - Instruction(opname='BUILD_TUPLE', opcode=102, arg=4, argval=4, > argrepr='', offset=18, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=3, > argval=code_object_inner, argrepr=repr(code_object_inner), offset=21, > starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=4, > argval='outer..f..inner', > argrepr="'outer..f..inner'", offset=24, starts_line=None, > is_jump_target=False), > - Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, > argrepr='', offset=27, starts_line=None, is_jump_target=False), > - Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='inner', > argrepr='inner', offset=30, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', > argrepr='print', offset=33, starts_line=5, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='a', > argrepr='a', offset=36, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='b', > argrepr='b', offset=39, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='c', > argrepr='c', offset=42, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='d', > argrepr='d', offset=45, starts_line=None, is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=4, argval=4, > argrepr='4 positional, 0 keyword pair', offset=48, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=51, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', > argrepr='inner', offset=52, starts_line=6, is_jump_target=False), > - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=55, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=6, > argrepr='6', offset=2, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=2, argval='a', > argrepr='a', offset=4, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=3, argval='b', > argrepr='b', offset=6, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=0, argval='c', > argrepr='c', offset=8, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CLOSURE', opcode=135, arg=1, argval='d', > argrepr='d', offset=10, starts_line=None, is_jump_target=False), > + Instruction(opname='BUILD_TUPLE', opcode=102, arg=4, argval=4, > argrepr='', offset=12, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=3, > argval=code_object_inner, argrepr=repr(code_object_inner), offset=14, > starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=4, > argval='outer..f..inner', > argrepr="'outer..f..inner'", offset=16, starts_line=None, > is_jump_target=False), > + Instruction(opname='MAKE_CLOSURE', opcode=134, arg=2, argval=2, > argrepr='', offset=18, starts_line=None, is_jump_target=False), > + Instruction(opname='STORE_FAST', opcode=125, arg=2, argval='inner', > argrepr='inner', offset=20, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', > argrepr='print', offset=22, starts_line=5, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='a', > argrepr='a', offset=24, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='b', > argrepr='b', offset=26, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='c', > argrepr='c', offset=28, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='d', > argrepr='d', offset=30, starts_line=None, is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=4, argval=4, > argrepr='4 positional, 0 keyword pair', offset=32, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=34, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', > argrepr='inner', offset=36, starts_line=6, is_jump_target=False), > + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=38, starts_line=None, is_jump_target=False), > ] > > expected_opinfo_inner = [ > Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='print', > argrepr='print', offset=0, starts_line=4, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', > argrepr='a', offset=3, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', > argrepr='b', offset=6, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='c', > argrepr='c', offset=9, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='d', > argrepr='d', offset=12, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='e', > argrepr='e', offset=15, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=1, argval='f', > argrepr='f', offset=18, starts_line=None, is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=6, argval=6, > argrepr='6 positional, 0 keyword pair', offset=21, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=24, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=25, starts_line=None, is_jump_target=False), > - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=28, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=0, argval='a', > argrepr='a', offset=2, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=1, argval='b', > argrepr='b', offset=4, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=2, argval='c', > argrepr='c', offset=6, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_DEREF', opcode=136, arg=3, argval='d', > argrepr='d', offset=8, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='e', > argrepr='e', offset=10, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=1, argval='f', > argrepr='f', offset=12, starts_line=None, is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=6, argval=6, > argrepr='6 positional, 0 keyword pair', offset=14, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=16, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=18, starts_line=None, is_jump_target=False), > + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=20, starts_line=None, is_jump_target=False), > ] > > expected_opinfo_jumpy = [ > - Instruction(opname='SETUP_LOOP', opcode=120, arg=68, argval=71, > argrepr='to 71', offset=0, starts_line=3, is_jump_target=False), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='range', > argrepr='range', offset=3, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, > argrepr='10', offset=6, starts_line=None, is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=9, starts_line=None, > is_jump_target=False), > - Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, > argrepr='', offset=12, starts_line=None, is_jump_target=False), > - Instruction(opname='FOR_ITER', opcode=93, arg=44, argval=60, > argrepr='to 60', offset=13, starts_line=None, is_jump_target=True), > - Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', > argrepr='i', offset=16, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=19, starts_line=4, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=22, starts_line=None, is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=25, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=28, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=29, starts_line=5, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, > argrepr='4', offset=32, starts_line=None, is_jump_target=False), > - Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', > argrepr='<', offset=35, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=44, argval=44, > argrepr='', offset=38, starts_line=None, is_jump_target=False), > - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=13, argval=13, > argrepr='', offset=41, starts_line=6, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=44, starts_line=7, is_jump_target=True), > - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, > argrepr='6', offset=47, starts_line=None, is_jump_target=False), > - Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', > argrepr='>', offset=50, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=13, argval=13, > argrepr='', offset=53, starts_line=None, is_jump_target=False), > - Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, > argrepr='', offset=56, starts_line=8, is_jump_target=False), > - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=13, argval=13, > argrepr='', offset=57, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=60, starts_line=None, is_jump_target=True), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=61, starts_line=10, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz > else clause?', argrepr="'I can haz else clause?'", offset=64, > starts_line=None, is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=67, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=70, starts_line=None, is_jump_target=False), > - Instruction(opname='SETUP_LOOP', opcode=120, arg=68, argval=142, > argrepr='to 142', offset=71, starts_line=11, is_jump_target=True), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=74, starts_line=None, is_jump_target=True), > - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=131, > argval=131, argrepr='', offset=77, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=80, starts_line=12, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=83, starts_line=None, is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=86, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=89, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=90, starts_line=13, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, > argrepr='1', offset=93, starts_line=None, is_jump_target=False), > - Instruction(opname='INPLACE_SUBTRACT', opcode=56, arg=None, > argval=None, argrepr='', offset=96, starts_line=None, is_jump_target=False), > - Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', > argrepr='i', offset=97, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=100, starts_line=14, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, > argrepr='6', offset=103, starts_line=None, is_jump_target=False), > - Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', > argrepr='>', offset=106, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=115, > argval=115, argrepr='', offset=109, starts_line=None, is_jump_target=False), > - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=74, argval=74, > argrepr='', offset=112, starts_line=15, is_jump_target=False), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=115, starts_line=16, is_jump_target=True), > - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, > argrepr='4', offset=118, starts_line=None, is_jump_target=False), > - Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', > argrepr='<', offset=121, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=74, argval=74, > argrepr='', offset=124, starts_line=None, is_jump_target=False), > - Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, > argrepr='', offset=127, starts_line=17, is_jump_target=False), > - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=74, argval=74, > argrepr='', offset=128, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=131, starts_line=None, is_jump_target=True), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=132, starts_line=19, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let > lolcatz into this test suite?', argrepr="'Who let lolcatz into this test > suite?'", offset=135, starts_line=None, is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=138, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=141, starts_line=None, is_jump_target=False), > - Instruction(opname='SETUP_FINALLY', opcode=122, arg=73, argval=218, > argrepr='to 218', offset=142, starts_line=20, is_jump_target=True), > - Instruction(opname='SETUP_EXCEPT', opcode=121, arg=12, argval=160, > argrepr='to 160', offset=145, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, > argrepr='1', offset=148, starts_line=21, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, > argrepr='0', offset=151, starts_line=None, is_jump_target=False), > - Instruction(opname='BINARY_TRUE_DIVIDE', opcode=27, arg=None, > argval=None, argrepr='', offset=154, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=155, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=156, starts_line=None, is_jump_target=False), > - Instruction(opname='JUMP_FORWARD', opcode=110, arg=28, argval=188, > argrepr='to 188', offset=157, starts_line=None, is_jump_target=False), > - Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, > argrepr='', offset=160, starts_line=22, is_jump_target=True), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=2, > argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=161, > starts_line=None, is_jump_target=False), > - Instruction(opname='COMPARE_OP', opcode=107, arg=10, argval='exception > match', argrepr='exception match', offset=164, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=187, > argval=187, argrepr='', offset=167, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=170, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=171, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=172, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=173, starts_line=23, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Here we go, > here we go, here we go...', argrepr="'Here we go, here we go, here we > go...'", offset=176, starts_line=None, is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=179, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=182, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, > argrepr='', offset=183, starts_line=None, is_jump_target=False), > - Instruction(opname='JUMP_FORWARD', opcode=110, arg=27, argval=214, > argrepr='to 214', offset=184, starts_line=None, is_jump_target=False), > - Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, > argrepr='', offset=187, starts_line=None, is_jump_target=True), > - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=188, starts_line=25, is_jump_target=True), > - Instruction(opname='SETUP_WITH', opcode=143, arg=17, argval=211, > argrepr='to 211', offset=191, starts_line=None, is_jump_target=False), > - Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', > argrepr='dodgy', offset=194, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=197, starts_line=26, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Never reach > this', argrepr="'Never reach this'", offset=200, starts_line=None, > is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=203, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=206, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=207, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=208, starts_line=None, is_jump_target=False), > - Instruction(opname='WITH_CLEANUP_START', opcode=81, arg=None, > argval=None, argrepr='', offset=211, starts_line=None, is_jump_target=True), > - Instruction(opname='WITH_CLEANUP_FINISH', opcode=82, arg=None, > argval=None, argrepr='', offset=212, starts_line=None, > is_jump_target=False), > - Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, > argrepr='', offset=213, starts_line=None, is_jump_target=False), > - Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=214, starts_line=None, is_jump_target=True), > - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=215, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=218, starts_line=28, is_jump_target=True), > - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now > we're done", argrepr='"OK, now we\'re done"', offset=221, starts_line=None, > is_jump_target=False), > - Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=224, starts_line=None, > is_jump_target=False), > - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=227, starts_line=None, is_jump_target=False), > - Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, > argrepr='', offset=228, starts_line=None, is_jump_target=False), > - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=229, starts_line=None, is_jump_target=False), > - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=232, starts_line=None, is_jump_target=False), > + Instruction(opname='SETUP_LOOP', opcode=120, arg=52, argval=54, > argrepr='to 54', offset=0, starts_line=3, is_jump_target=False), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=0, argval='range', > argrepr='range', offset=2, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, > argrepr='10', offset=4, starts_line=None, is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=6, starts_line=None, > is_jump_target=False), > + Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, > argrepr='', offset=8, starts_line=None, is_jump_target=False), > + Instruction(opname='FOR_ITER', opcode=93, arg=32, argval=44, > argrepr='to 44', offset=10, starts_line=None, is_jump_target=True), > + Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', > argrepr='i', offset=12, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=14, starts_line=4, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=16, starts_line=None, is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=18, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=20, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=22, starts_line=5, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, > argrepr='4', offset=24, starts_line=None, is_jump_target=False), > + Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', > argrepr='<', offset=26, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=32, argval=32, > argrepr='', offset=28, starts_line=None, is_jump_target=False), > + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=10, argval=10, > argrepr='', offset=30, starts_line=6, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=32, starts_line=7, is_jump_target=True), > + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, > argrepr='6', offset=34, starts_line=None, is_jump_target=False), > + Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', > argrepr='>', offset=36, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=10, argval=10, > argrepr='', offset=38, starts_line=None, is_jump_target=False), > + Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, > argrepr='', offset=40, starts_line=8, is_jump_target=False), > + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=10, argval=10, > argrepr='', offset=42, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=44, starts_line=None, is_jump_target=True), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=46, starts_line=10, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz > else clause?', argrepr="'I can haz else clause?'", offset=48, > starts_line=None, is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=50, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=52, starts_line=None, is_jump_target=False), > + Instruction(opname='SETUP_LOOP', opcode=120, arg=52, argval=108, > argrepr='to 108', offset=54, starts_line=11, is_jump_target=True), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=56, starts_line=None, is_jump_target=True), > + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=98, argval=98, > argrepr='', offset=58, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=60, starts_line=12, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=62, starts_line=None, is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=64, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=66, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=68, starts_line=13, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, > argrepr='1', offset=70, starts_line=None, is_jump_target=False), > + Instruction(opname='INPLACE_SUBTRACT', opcode=56, arg=None, > argval=None, argrepr='', offset=72, starts_line=None, is_jump_target=False), > + Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', > argrepr='i', offset=74, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=76, starts_line=14, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, > argrepr='6', offset=78, starts_line=None, is_jump_target=False), > + Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', > argrepr='>', offset=80, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=86, argval=86, > argrepr='', offset=82, starts_line=None, is_jump_target=False), > + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=56, argval=56, > argrepr='', offset=84, starts_line=15, is_jump_target=False), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=86, starts_line=16, is_jump_target=True), > + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, > argrepr='4', offset=88, starts_line=None, is_jump_target=False), > + Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', > argrepr='<', offset=90, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=56, argval=56, > argrepr='', offset=92, starts_line=None, is_jump_target=False), > + Instruction(opname='BREAK_LOOP', opcode=80, arg=None, argval=None, > argrepr='', offset=94, starts_line=17, is_jump_target=False), > + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=56, argval=56, > argrepr='', offset=96, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=98, starts_line=None, is_jump_target=True), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=100, starts_line=19, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let > lolcatz into this test suite?', argrepr="'Who let lolcatz into this test > suite?'", offset=102, starts_line=None, is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=104, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=106, starts_line=None, is_jump_target=False), > + Instruction(opname='SETUP_FINALLY', opcode=122, arg=70, argval=180, > argrepr='to 180', offset=108, starts_line=20, is_jump_target=True), > + Instruction(opname='SETUP_EXCEPT', opcode=121, arg=12, argval=124, > argrepr='to 124', offset=110, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, > argrepr='1', offset=112, starts_line=21, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, > argrepr='0', offset=114, starts_line=None, is_jump_target=False), > + Instruction(opname='BINARY_TRUE_DIVIDE', opcode=27, arg=None, > argval=None, argrepr='', offset=116, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=118, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=120, starts_line=None, is_jump_target=False), > + Instruction(opname='JUMP_FORWARD', opcode=110, arg=28, argval=152, > argrepr='to 152', offset=122, starts_line=None, is_jump_target=False), > + Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, > argrepr='', offset=124, starts_line=22, is_jump_target=True), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=2, > argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=126, > starts_line=None, is_jump_target=False), > + Instruction(opname='COMPARE_OP', opcode=107, arg=10, argval='exception > match', argrepr='exception match', offset=128, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=150, > argval=150, argrepr='', offset=130, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=132, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=134, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=136, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=138, starts_line=23, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Here we go, > here we go, here we go...', argrepr="'Here we go, here we go, here we > go...'", offset=140, starts_line=None, is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=142, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=144, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, > argrepr='', offset=146, starts_line=None, is_jump_target=False), > + Instruction(opname='JUMP_FORWARD', opcode=110, arg=26, argval=176, > argrepr='to 176', offset=148, starts_line=None, is_jump_target=False), > + Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, > argrepr='', offset=150, starts_line=None, is_jump_target=True), > + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', > argrepr='i', offset=152, starts_line=25, is_jump_target=True), > + Instruction(opname='SETUP_WITH', opcode=143, arg=14, argval=170, > argrepr='to 170', offset=154, starts_line=None, is_jump_target=False), > + Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', > argrepr='dodgy', offset=156, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=158, starts_line=26, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Never reach > this', argrepr="'Never reach this'", offset=160, starts_line=None, > is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=162, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=164, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=166, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=168, starts_line=None, is_jump_target=False), > + Instruction(opname='WITH_CLEANUP_START', opcode=81, arg=None, > argval=None, argrepr='', offset=170, starts_line=None, is_jump_target=True), > + Instruction(opname='WITH_CLEANUP_FINISH', opcode=82, arg=None, > argval=None, argrepr='', offset=172, starts_line=None, > is_jump_target=False), > + Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, > argrepr='', offset=174, starts_line=None, is_jump_target=False), > + Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, > argrepr='', offset=176, starts_line=None, is_jump_target=True), > + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=178, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', > argrepr='print', offset=180, starts_line=28, is_jump_target=True), > + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now > we're done", argrepr='"OK, now we\'re done"', offset=182, starts_line=None, > is_jump_target=False), > + Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, > argrepr='1 positional, 0 keyword pair', offset=184, starts_line=None, > is_jump_target=False), > + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, > argrepr='', offset=186, starts_line=None, is_jump_target=False), > + Instruction(opname='END_FINALLY', opcode=88, arg=None, argval=None, > argrepr='', offset=188, starts_line=None, is_jump_target=False), > + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=190, starts_line=None, is_jump_target=False), > + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=192, starts_line=None, is_jump_target=False), > ] > > # One last piece of inspect fodder to check the default line number > handling > def simple(): pass > expected_opinfo_simple = [ > Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, > argrepr='None', offset=0, starts_line=simple.__code__.co_firstlineno, > is_jump_target=False), > - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=3, starts_line=None, is_jump_target=False) > + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, > argrepr='', offset=2, starts_line=None, is_jump_target=False) > ] > > > diff --git a/Misc/NEWS b/Misc/NEWS > --- a/Misc/NEWS > +++ b/Misc/NEWS > @@ -10,6 +10,9 @@ > Core and Builtins > ----------------- > > +- Issue #26647: Python interpreter now uses 16-bit wordcode instead of > bytecode. > + Patch by Demur Rumed. > + > - Issue #23275: Allow assigning to an empty target list in round brackets: > () = iterable. > > diff --git a/Objects/frameobject.c b/Objects/frameobject.c > --- a/Objects/frameobject.c > +++ b/Objects/frameobject.c > @@ -189,7 +189,7 @@ > memset(blockstack, '\0', sizeof(blockstack)); > memset(in_finally, '\0', sizeof(in_finally)); > blockstack_top = 0; > - for (addr = 0; addr < code_len; addr++) { > + for (addr = 0; addr < code_len; addr += 2) { > unsigned char op = code[addr]; > switch (op) { > case SETUP_LOOP: > @@ -251,10 +251,6 @@ > } > } > } > - > - if (op >= HAVE_ARGUMENT) { > - addr += 2; > - } > } > > /* Verify that the blockstack tracking code didn't get lost. */ > @@ -277,7 +273,7 @@ > * can tell whether the jump goes into any blocks without coming out > * again - in that case we raise an exception below. */ > delta_iblock = 0; > - for (addr = min_addr; addr < max_addr; addr++) { > + for (addr = min_addr; addr < max_addr; addr += 2) { > unsigned char op = code[addr]; > switch (op) { > case SETUP_LOOP: > @@ -294,10 +290,6 @@ > } > > min_delta_iblock = Py_MIN(min_delta_iblock, delta_iblock); > - > - if (op >= HAVE_ARGUMENT) { > - addr += 2; > - } > } > > /* Derive the absolute iblock values from the deltas. */ > diff --git a/Objects/genobject.c b/Objects/genobject.c > --- a/Objects/genobject.c > +++ b/Objects/genobject.c > @@ -277,7 +277,7 @@ > PyObject *bytecode = f->f_code->co_code; > unsigned char *code = (unsigned char > *)PyBytes_AS_STRING(bytecode); > > - if (code[f->f_lasti + 1] != YIELD_FROM) > + if (code[f->f_lasti + 2] != YIELD_FROM) > return NULL; > yf = f->f_stacktop[-1]; > Py_INCREF(yf); > @@ -376,7 +376,7 @@ > assert(ret == yf); > Py_DECREF(ret); > /* Termination repetition of YIELD_FROM */ > - gen->gi_frame->f_lasti++; > + gen->gi_frame->f_lasti += 2; > if (_PyGen_FetchStopIterationValue(&val) == 0) { > ret = gen_send_ex(gen, val, 0, 0); > Py_DECREF(val); > diff --git a/PC/launcher.c b/PC/launcher.c > --- a/PC/launcher.c > +++ b/PC/launcher.c > @@ -1089,7 +1089,7 @@ > { 3190, 3230, L"3.3" }, > { 3250, 3310, L"3.4" }, > { 3320, 3350, L"3.5" }, > - { 3360, 3361, L"3.6" }, > + { 3360, 3370, L"3.6" }, > { 0 } > }; > > diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj > --- a/PCbuild/pythoncore.vcxproj > +++ b/PCbuild/pythoncore.vcxproj > @@ -209,6 +209,7 @@ > > > > + > > > > diff --git a/PCbuild/pythoncore.vcxproj.filters > b/PCbuild/pythoncore.vcxproj.filters > --- a/PCbuild/pythoncore.vcxproj.filters > +++ b/PCbuild/pythoncore.vcxproj.filters > @@ -420,6 +420,9 @@ > > Python > > + > + Python > + > > Python > > diff --git a/Python/ceval.c b/Python/ceval.c > --- a/Python/ceval.c > +++ b/Python/ceval.c > @@ -886,24 +886,10 @@ > /* Import the static jump table */ > #include "opcode_targets.h" > > -/* This macro is used when several opcodes defer to the same > implementation > - (e.g. SETUP_LOOP, SETUP_FINALLY) */ > -#define TARGET_WITH_IMPL(op, impl) \ > - TARGET_##op: \ > - opcode = op; \ > - if (HAS_ARG(op)) \ > - oparg = NEXTARG(); \ > - case op: \ > - goto impl; \ > - > #define TARGET(op) \ > TARGET_##op: \ > - opcode = op; \ > - if (HAS_ARG(op)) \ > - oparg = NEXTARG(); \ > case op: > > - > #define DISPATCH() \ > { \ > if (!_Py_atomic_load_relaxed(&eval_breaker)) { \ > @@ -917,7 +903,9 @@ > { \ > if (!lltrace && !_Py_TracingPossible) { \ > f->f_lasti = INSTR_OFFSET(); \ > - goto *opcode_targets[*next_instr++]; \ > + opcode = NEXTOP(); \ > + oparg = NEXTARG(); \ > + goto *opcode_targets[opcode]; \ > } \ > goto fast_next_opcode; \ > } > @@ -926,7 +914,9 @@ > { \ > if (!_Py_TracingPossible) { \ > f->f_lasti = INSTR_OFFSET(); \ > - goto *opcode_targets[*next_instr++]; \ > + opcode = NEXTOP(); \ > + oparg = NEXTARG(); \ > + goto *opcode_targets[opcode]; \ > } \ > goto fast_next_opcode; \ > } > @@ -935,10 +925,7 @@ > #else > #define TARGET(op) \ > case op: > -#define TARGET_WITH_IMPL(op, impl) \ > - /* silence compiler warnings about `impl` unused */ \ > - if (0) goto impl; \ > - case op: > + > #define DISPATCH() continue > #define FAST_DISPATCH() goto fast_next_opcod -------------- next part -------------- An HTML attachment was scrubbed... URL: From python-checkins at python.org Tue May 24 14:55:45 2016 From: python-checkins at python.org (zach.ware) Date: Tue, 24 May 2016 18:55:45 +0000 Subject: [Python-checkins] =?utf-8?q?devguide=3A_Add_missing_word?= Message-ID: <20160524185442.1104.28224.EECDBC4F@psf.io> https://hg.python.org/devguide/rev/6b123eb03dba changeset: 804:6b123eb03dba user: Zachary Ware date: Tue May 24 13:54:33 2016 -0500 summary: Add missing word files: buildslave.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/buildslave.rst b/buildslave.rst --- a/buildslave.rst +++ b/buildslave.rst @@ -211,7 +211,7 @@ * Full region specification (such as ``us-west-2``) * AMI ID (such as ``ami-1234beef``) * An Access Key ID and Access Key. It is recommended to set up - a separate IAM user full access to EC2 and provide the access key + a separate IAM user with full access to EC2 and provide the access key information for that user rather than for your main account. The buildmaster cannot guarantee that it will always shut down your -- Repository URL: https://hg.python.org/devguide From python-checkins at python.org Tue May 24 15:20:06 2016 From: python-checkins at python.org (guido.van.rossum) Date: Tue, 24 May 2016 19:20:06 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Short_subsection_on_annotatin?= =?utf-8?q?g_coroutines_=28Ivan_L=2C_=23225=29=2E?= Message-ID: <20160524192004.14798.31017.1CC1E33A@psf.io> https://hg.python.org/peps/rev/50c3f5aefbb7 changeset: 6341:50c3f5aefbb7 user: Guido van Rossum date: Tue May 24 12:18:54 2016 -0700 summary: Short subsection on annotating coroutines (Ivan L, #225). files: pep-0484.txt | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/pep-0484.txt b/pep-0484.txt --- a/pep-0484.txt +++ b/pep-0484.txt @@ -1015,6 +1015,40 @@ ellipsis, i.e. the above example is literally what you would write. +Annotating generator functions and coroutines +--------------------------------------------- + +The return type of generator functions can be annotated by +the generic type ``Generator[yield_type, send_type, +return_type]`` provided by ``typing.py`` module:: + + def echo_round() -> Generator[int, float, str]: + res = yield + while res: + res = yield round(res) + return 'OK' + +Coroutines introduced in PEP 492 are annotated with the same syntax as +ordinary functions. However, the return type annotation corresponds to the +type of ``await`` expression, not to the coroutine type:: + + async def spam(ignored: int) -> str: + return 'spam' + + async def foo(): + bar = await spam(42) # type: str + +The ``typing.py`` module also provides generic ABCs ``Awaitable``, +``AsyncIterable``, and ``AsyncIterator`` for situations where more precise +types cannot be specified:: + + def op() -> typing.Awaitable[str]: + if cond: + return spam(42) + else: + return asyncio.Future(...) + + Compatibility with other uses of function annotations ===================================================== -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Tue May 24 18:43:28 2016 From: python-checkins at python.org (steve.dower) Date: Tue, 24 May 2016 22:43:28 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2323026=3A_winreg?= =?utf-8?q?=2EQueryValueEx=28=29_now_return_an_integer_for_REG=5FQWORD_typ?= =?utf-8?q?e=2E?= Message-ID: <20160524224323.26926.14969.DE99A85D@psf.io> https://hg.python.org/cpython/rev/ac2a2534f793 changeset: 101487:ac2a2534f793 user: Steve Dower date: Tue May 24 15:42:04 2016 -0700 summary: Issue #23026: winreg.QueryValueEx() now return an integer for REG_QWORD type. (Patch by hakril) files: Doc/library/winreg.rst | 10 ++++++++- Doc/whatsnew/3.6.rst | 8 +++++++ Lib/test/test_winreg.py | 1 + Misc/NEWS | 2 + PC/winreg.c | 32 +++++++++++++++++++++++++++- 5 files changed, 50 insertions(+), 3 deletions(-) diff --git a/Doc/library/winreg.rst b/Doc/library/winreg.rst --- a/Doc/library/winreg.rst +++ b/Doc/library/winreg.rst @@ -633,7 +633,7 @@ .. data:: REG_DWORD_LITTLE_ENDIAN - A 32-bit number in little-endian format. + A 32-bit number in little-endian format. Equivalent to :const:`REG_DWORD`. .. data:: REG_DWORD_BIG_ENDIAN @@ -657,6 +657,14 @@ No defined value type. +.. data:: REG_QWORD + + A 64-bit number. + +.. data:: REG_QWORD_LITTLE_ENDIAN + + A 64-bit number in little-endian format. Equivalent to :const:`REG_QWORD`. + .. data:: REG_RESOURCE_LIST A device-driver resource list. diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -421,6 +421,14 @@ :mod:`warnings` was already imported. +winreg +------ + +The :func:`QueryValueEx ` function now returns +integer values for registry type ``REG_QWORD``. +(Contributed by Clement Rouault in :issue:`23026`.) + + zipfile ------- diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -37,6 +37,7 @@ test_data = [ ("Int Value", 45, REG_DWORD), + ("Qword Value", 0x1122334455667788, REG_QWORD), ("String Val", "A string value", REG_SZ), ("StringExpand", "The path is %path%", REG_EXPAND_SZ), ("Multi-string", ["Lots", "of", "string", "values"], REG_MULTI_SZ), diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -19,6 +19,8 @@ Library ------- +- Issue #23026: winreg.QueryValueEx() now return an integer for REG_QWORD type. + - Issue #26741: subprocess.Popen destructor now emits a ResourceWarning warning if the child process is still running. diff --git a/PC/winreg.c b/PC/winreg.c --- a/PC/winreg.c +++ b/PC/winreg.c @@ -563,6 +563,24 @@ memcpy(*retDataBuf, &d, sizeof(DWORD)); } break; + case REG_QWORD: + if (value != Py_None && !PyLong_Check(value)) + return FALSE; + *retDataBuf = (BYTE *)PyMem_NEW(DWORD64, 1); + if (*retDataBuf==NULL){ + PyErr_NoMemory(); + return FALSE; + } + *retDataSize = sizeof(DWORD64); + if (value == Py_None) { + DWORD64 zero = 0; + memcpy(*retDataBuf, &zero, sizeof(DWORD64)); + } + else { + DWORD64 d = PyLong_AsUnsignedLongLong(value); + memcpy(*retDataBuf, &d, sizeof(DWORD64)); + } + break; case REG_SZ: case REG_EXPAND_SZ: { @@ -690,7 +708,13 @@ if (retDataSize == 0) obData = PyLong_FromUnsignedLong(0); else - obData = PyLong_FromUnsignedLong(*(int *)retDataBuf); + obData = PyLong_FromUnsignedLong(*(DWORD *)retDataBuf); + break; + case REG_QWORD: + if (retDataSize == 0) + obData = PyLong_FromUnsignedLongLong(0); + else + obData = PyLong_FromUnsignedLongLong(*(DWORD64 *)retDataBuf); break; case REG_SZ: case REG_EXPAND_SZ: @@ -1599,7 +1623,7 @@ An integer that specifies the type of the data, one of: REG_BINARY -- Binary data in any form. REG_DWORD -- A 32-bit number. - REG_DWORD_LITTLE_ENDIAN -- A 32-bit number in little-endian format. + REG_DWORD_LITTLE_ENDIAN -- A 32-bit number in little-endian format. Equivalent to REG_DWORD REG_DWORD_BIG_ENDIAN -- A 32-bit number in big-endian format. REG_EXPAND_SZ -- A null-terminated string that contains unexpanded references to environment variables (for example, @@ -1609,6 +1633,8 @@ by two null characters. Note that Python handles this termination automatically. REG_NONE -- No defined value type. + REG_QWORD -- A 64-bit number. + REG_QWORD_LITTLE_ENDIAN -- A 64-bit number in little-endian format. Equivalent to REG_QWORD. REG_RESOURCE_LIST -- A device-driver resource list. REG_SZ -- A null-terminated string. value: object @@ -1918,6 +1944,8 @@ ADD_INT(REG_DWORD); ADD_INT(REG_DWORD_LITTLE_ENDIAN); ADD_INT(REG_DWORD_BIG_ENDIAN); + ADD_INT(REG_QWORD); + ADD_INT(REG_QWORD_LITTLE_ENDIAN); ADD_INT(REG_LINK); ADD_INT(REG_MULTI_SZ); ADD_INT(REG_RESOURCE_LIST); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 24 19:39:43 2016 From: python-checkins at python.org (guido.van.rossum) Date: Tue, 24 May 2016 23:39:43 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Added_Type=5BC=5D_implementation_to_typing=2Epy=2E_=28Me?= =?utf-8?b?cmdlIDMuNS0+My42KQ==?= Message-ID: <20160524233943.17438.98552.EE78F15D@psf.io> https://hg.python.org/cpython/rev/b730baee0877 changeset: 101489:b730baee0877 parent: 101487:ac2a2534f793 parent: 101488:dd69d8491c8f user: Guido van Rossum date: Tue May 24 16:39:23 2016 -0700 summary: Added Type[C] implementation to typing.py. (Merge 3.5->3.6) files: Lib/test/test_typing.py | 28 +++++++++++++++++++++++ Lib/typing.py | 34 ++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -15,6 +15,7 @@ from typing import cast from typing import get_type_hints from typing import no_type_check, no_type_check_decorator +from typing import Type from typing import NamedTuple from typing import IO, TextIO, BinaryIO from typing import Pattern, Match @@ -1373,6 +1374,33 @@ self.assertNotIsInstance(42, typing.ContextManager) +class TypeTests(BaseTestCase): + + def test_type_basic(self): + + class User: pass + class BasicUser(User): pass + class ProUser(User): pass + + def new_user(user_class: Type[User]) -> User: + return user_class() + + joe = new_user(BasicUser) + + def test_type_typevar(self): + + class User: pass + class BasicUser(User): pass + class ProUser(User): pass + + U = TypeVar('U', bound=User) + + def new_user(user_class: Type[U]) -> U: + return user_class() + + joe = new_user(BasicUser) + + class NamedTupleTests(BaseTestCase): def test_basics(self): diff --git a/Lib/typing.py b/Lib/typing.py --- a/Lib/typing.py +++ b/Lib/typing.py @@ -19,9 +19,10 @@ 'Callable', 'Generic', 'Optional', + 'Tuple', + 'Type', 'TypeVar', 'Union', - 'Tuple', # ABCs (from collections.abc). 'AbstractSet', # collections.abc.Set. @@ -447,6 +448,7 @@ # Some unconstrained type variables. These are used by the container types. +# (These are not for export.) T = TypeVar('T') # Any type. KT = TypeVar('KT') # Key type. VT = TypeVar('VT') # Value type. @@ -456,6 +458,7 @@ T_contra = TypeVar('T_contra', contravariant=True) # Ditto contravariant. # A useful type variable with constraints. This represents string types. +# (This one *is* for export!) AnyStr = TypeVar('AnyStr', bytes, str) @@ -1572,6 +1575,35 @@ return super().__new__(cls, *args, **kwds) +# Internal type variable used for Type[]. +CT = TypeVar('CT', covariant=True, bound=type) + + +class Type(type, Generic[CT], extra=type): + """A generic type usable to annotate class objects. + + For example, suppose we have the following classes:: + + class User: ... # Abstract base for User classes + class BasicUser(User): ... + class ProUser(User): ... + class TeamUser(User): ... + + And a function that takes a class argument that's a subclass of + User and returns an instance of the corresponding class:: + + U = TypeVar('U', bound=User) + def new_user(user_class: Type[U]) -> U: + user = user_class() + # (Here we could write the user object to a database) + return user + + joe = new_user(BasicUser) + + At this point the type checker knows that joe has type BasicUser. + """ + + def NamedTuple(typename, fields): """Typed version of namedtuple. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 24 19:39:51 2016 From: python-checkins at python.org (guido.van.rossum) Date: Tue, 24 May 2016 23:39:51 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogQWRkZWQgVHlwZVtD?= =?utf-8?q?=5D_implementation_to_typing=2Epy=2E?= Message-ID: <20160524233942.71176.98679.110E3D2C@psf.io> https://hg.python.org/cpython/rev/dd69d8491c8f changeset: 101488:dd69d8491c8f branch: 3.5 parent: 101483:3732828f2835 user: Guido van Rossum date: Tue May 24 16:38:22 2016 -0700 summary: Added Type[C] implementation to typing.py. files: Lib/test/test_typing.py | 28 +++++++++++++++++++++++ Lib/typing.py | 34 ++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -15,6 +15,7 @@ from typing import cast from typing import get_type_hints from typing import no_type_check, no_type_check_decorator +from typing import Type from typing import NamedTuple from typing import IO, TextIO, BinaryIO from typing import Pattern, Match @@ -1373,6 +1374,33 @@ self.assertNotIsInstance(42, typing.ContextManager) +class TypeTests(BaseTestCase): + + def test_type_basic(self): + + class User: pass + class BasicUser(User): pass + class ProUser(User): pass + + def new_user(user_class: Type[User]) -> User: + return user_class() + + joe = new_user(BasicUser) + + def test_type_typevar(self): + + class User: pass + class BasicUser(User): pass + class ProUser(User): pass + + U = TypeVar('U', bound=User) + + def new_user(user_class: Type[U]) -> U: + return user_class() + + joe = new_user(BasicUser) + + class NamedTupleTests(BaseTestCase): def test_basics(self): diff --git a/Lib/typing.py b/Lib/typing.py --- a/Lib/typing.py +++ b/Lib/typing.py @@ -19,9 +19,10 @@ 'Callable', 'Generic', 'Optional', + 'Tuple', + 'Type', 'TypeVar', 'Union', - 'Tuple', # ABCs (from collections.abc). 'AbstractSet', # collections.abc.Set. @@ -447,6 +448,7 @@ # Some unconstrained type variables. These are used by the container types. +# (These are not for export.) T = TypeVar('T') # Any type. KT = TypeVar('KT') # Key type. VT = TypeVar('VT') # Value type. @@ -456,6 +458,7 @@ T_contra = TypeVar('T_contra', contravariant=True) # Ditto contravariant. # A useful type variable with constraints. This represents string types. +# (This one *is* for export!) AnyStr = TypeVar('AnyStr', bytes, str) @@ -1572,6 +1575,35 @@ return super().__new__(cls, *args, **kwds) +# Internal type variable used for Type[]. +CT = TypeVar('CT', covariant=True, bound=type) + + +class Type(type, Generic[CT], extra=type): + """A generic type usable to annotate class objects. + + For example, suppose we have the following classes:: + + class User: ... # Abstract base for User classes + class BasicUser(User): ... + class ProUser(User): ... + class TeamUser(User): ... + + And a function that takes a class argument that's a subclass of + User and returns an instance of the corresponding class:: + + U = TypeVar('U', bound=User) + def new_user(user_class: Type[U]) -> U: + user = user_class() + # (Here we could write the user object to a database) + return user + + joe = new_user(BasicUser) + + At this point the type checker knows that joe has type BasicUser. + """ + + def NamedTuple(typename, fields): """Typed version of namedtuple. -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Wed May 25 04:48:25 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Wed, 25 May 2016 08:48:25 +0000 Subject: [Python-checkins] Daily reference leaks (b730baee0877): sum=5 Message-ID: <20160525084822.31301.81725.1ADE426B@psf.io> results for b730baee0877 on branch "default" -------------------------------------------- test_collections leaked [4, -4, 0] memory blocks, sum=0 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [2, 0, -1] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogWXNuUr', '--timeout', '7200'] From lp_benchmark_robot at intel.com Wed May 25 08:17:38 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Wed, 25 May 2016 13:17:38 +0100 Subject: [Python-checkins] BAD Benchmark Results for Python 2.7 2016-05-25 Message-ID: Results for project Python 2.7, build date 2016-05-25 02:46:09 +0000 commit: f0438e1a4761 previous commit: a873265366ba revision date: 2016-05-24 05:47:50 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.15% -1.65% 2.73% 8.16% :-) pybench 0.20% -0.06% 6.00% 4.35% :-( regex_v8 0.64% -0.05% -2.27% 10.55% :-) nbody 0.13% 0.08% 9.35% 1.61% :-| json_dump_v2 0.53% 0.72% 1.91% 11.13% :-( normal_startup 1.81% -0.84% -5.40% 1.85% :-) ssbench 0.13% 0.09% 2.39% 1.71% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/bad-benchmark-results-for-python-2-7-2016-05-25/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Wed May 25 08:16:04 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Wed, 25 May 2016 13:16:04 +0100 Subject: [Python-checkins] UGLY Benchmark Results for Python Default 2016-05-25 Message-ID: Results for project Python default, build date 2016-05-25 02:02:56 +0000 commit: b730baee0877 previous commit: 6147a2c99db0 revision date: 2016-05-24 23:39:23 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.47% -2.07% 7.83% 18.45% :-) pybench 0.36% 2.84% 5.18% 6.54% :-| regex_v8 2.66% 0.58% -1.57% 3.63% :-) nbody 0.16% 3.98% 4.07% 10.72% :-) json_dump_v2 0.29% 3.36% 2.00% 11.76% :-| normal_startup 0.92% 0.31% 0.18% 5.54% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/ugly-benchmark-results-for-python-default-2016-05-25/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Wed May 25 09:15:27 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 25 May 2016 13:15:27 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327118=3A_Clean_up?= =?utf-8?q?_Py=5FXINCREF/Py=5FXDECREF_in_typeobject=2Ec=2E?= Message-ID: <20160525131522.17448.17453.9140A821@psf.io> https://hg.python.org/cpython/rev/3b4c3dda679a changeset: 101490:3b4c3dda679a user: Serhiy Storchaka date: Wed May 25 16:14:55 2016 +0300 summary: Issue #27118: Clean up Py_XINCREF/Py_XDECREF in typeobject.c. Patch by Xiang Zhang. files: Objects/typeobject.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Objects/typeobject.c b/Objects/typeobject.c --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -460,7 +460,7 @@ PyErr_Format(PyExc_AttributeError, "__module__"); return 0; } - Py_XINCREF(mod); + Py_INCREF(mod); return mod; } else { @@ -500,7 +500,7 @@ PyErr_SetObject(PyExc_AttributeError, message); return NULL; } - Py_XINCREF(mod); + Py_INCREF(mod); return mod; } @@ -1534,7 +1534,6 @@ PyObject *name = _PyObject_GetAttrId(cls, &PyId___name__); if (name == NULL) { PyErr_Clear(); - Py_XDECREF(name); name = PyObject_Repr(cls); } if (name == NULL) @@ -5776,8 +5775,8 @@ if (args != NULL) { PyTuple_SET_ITEM(args, 0, ival); retval = PyObject_Call(func, args, NULL); - Py_XDECREF(args); - Py_XDECREF(func); + Py_DECREF(args); + Py_DECREF(func); return retval; } } -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 25 13:02:56 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 25 May 2016 17:02:56 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327097=3A_Python_i?= =?utf-8?q?nterpreter_is_now_about_7=25_faster_due_to_optimized?= Message-ID: <20160525170249.31463.50040.7BC1539F@psf.io> https://hg.python.org/cpython/rev/eda3716d6425 changeset: 101491:eda3716d6425 user: Serhiy Storchaka date: Wed May 25 20:02:01 2016 +0300 summary: Issue #27097: Python interpreter is now about 7% faster due to optimized instruction decoding. Based on patch by Demur Rumed. files: Misc/NEWS | 3 + Python/ceval.c | 74 +++++++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 29 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #27097: Python interpreter is now about 7% faster due to optimized + instruction decoding. Based on patch by Demur Rumed. + - Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode. Patch by Demur Rumed. diff --git a/Python/ceval.c b/Python/ceval.c --- a/Python/ceval.c +++ b/Python/ceval.c @@ -144,7 +144,7 @@ static void format_exc_check_arg(PyObject *, const char *, PyObject *); static void format_exc_unbound(PyCodeObject *co, int oparg); static PyObject * unicode_concatenate(PyObject *, PyObject *, - PyFrameObject *, unsigned char *); + PyFrameObject *, const unsigned short *); static PyObject * special_lookup(PyObject *, _Py_Identifier *); #define NAME_ERROR_MSG \ @@ -800,7 +800,7 @@ int lastopcode = 0; #endif PyObject **stack_pointer; /* Next free slot in value stack */ - unsigned char *next_instr; + const unsigned short *next_instr; int opcode; /* Current opcode */ int oparg; /* Current opcode argument, if any */ enum why_code why; /* Reason for block stack unwind */ @@ -818,7 +818,7 @@ time it is tested. */ int instr_ub = -1, instr_lb = 0, instr_prev = -1; - unsigned char *first_instr; + const unsigned short *first_instr; PyObject *names; PyObject *consts; @@ -903,8 +903,7 @@ { \ if (!lltrace && !_Py_TracingPossible) { \ f->f_lasti = INSTR_OFFSET(); \ - opcode = NEXTOP(); \ - oparg = NEXTARG(); \ + NEXTOPARG(); \ goto *opcode_targets[opcode]; \ } \ goto fast_next_opcode; \ @@ -914,8 +913,7 @@ { \ if (!_Py_TracingPossible) { \ f->f_lasti = INSTR_OFFSET(); \ - opcode = NEXTOP(); \ - oparg = NEXTARG(); \ + NEXTOPARG(); \ goto *opcode_targets[opcode]; \ } \ goto fast_next_opcode; \ @@ -981,12 +979,23 @@ /* Code access macros */ -#define INSTR_OFFSET() ((int)(next_instr - first_instr)) -#define NEXTOP() (next_instr+=2, next_instr[-2]) -#define NEXTARG() (next_instr[-1]) -#define PEEKARG() (next_instr[1]) -#define JUMPTO(x) (next_instr = first_instr + (x)) -#define JUMPBY(x) (next_instr += (x)) +#ifdef WORDS_BIGENDIAN + #define OPCODE(word) ((word) >> 8) + #define OPARG(word) ((word) & 255) +#else + #define OPCODE(word) ((word) & 255) + #define OPARG(word) ((word) >> 8) +#endif +/* The integer overflow is checked by an assertion below. */ +#define INSTR_OFFSET() (2*(int)(next_instr - first_instr)) +#define NEXTOPARG() do { \ + unsigned short word = *next_instr; \ + opcode = OPCODE(word); \ + oparg = OPARG(word); \ + next_instr++; \ + } while (0) +#define JUMPTO(x) (next_instr = first_instr + (x)/2) +#define JUMPBY(x) (next_instr += (x)/2) /* OpCode prediction macros Some opcodes tend to come in pairs thus making it possible to @@ -1020,10 +1029,11 @@ #else #define PREDICT(op) \ do{ \ - if (*next_instr == op){ \ - opcode = op; \ - oparg = PEEKARG(); \ - next_instr += 2; \ + unsigned short word = *next_instr; \ + opcode = OPCODE(word); \ + if (opcode == op){ \ + oparg = OPARG(word); \ + next_instr++; \ goto PRED_##op; \ } \ } while(0) @@ -1157,7 +1167,11 @@ consts = co->co_consts; fastlocals = f->f_localsplus; freevars = f->f_localsplus + co->co_nlocals; - first_instr = (unsigned char*) PyBytes_AS_STRING(co->co_code); + assert(PyBytes_Check(co->co_code)); + assert(PyBytes_GET_SIZE(co->co_code) <= INT_MAX); + assert(PyBytes_GET_SIZE(co->co_code) % 2 == 0); + assert(_Py_IS_ALIGNED(PyBytes_AS_STRING(co->co_code), unsigned short)); + first_instr = (unsigned short*) PyBytes_AS_STRING(co->co_code); /* f->f_lasti refers to the index of the last instruction, unless it's -1 in which case next_instr should be first_instr. @@ -1175,7 +1189,8 @@ */ next_instr = first_instr; if (f->f_lasti >= 0) { - next_instr += f->f_lasti + 2; + assert(f->f_lasti % 2 == 0); + next_instr += f->f_lasti/2 + 1; } stack_pointer = f->f_stacktop; assert(stack_pointer != NULL); @@ -1240,7 +1255,7 @@ Py_MakePendingCalls() above. */ if (_Py_atomic_load_relaxed(&eval_breaker)) { - if (*next_instr == SETUP_FINALLY) { + if (OPCODE(*next_instr) == SETUP_FINALLY) { /* Make the last opcode before a try: finally: block uninterruptible. */ goto fast_next_opcode; @@ -1313,8 +1328,7 @@ /* Extract opcode and argument */ - opcode = NEXTOP(); - oparg = NEXTARG(); + NEXTOPARG(); dispatch_opcode: #ifdef DYNAMIC_EXECUTION_PROFILE #ifdef DXPAIRS @@ -3432,8 +3446,9 @@ } TARGET(EXTENDED_ARG) { - opcode = NEXTOP(); - oparg = oparg<<8 | NEXTARG(); + int oldoparg = oparg; + NEXTOPARG(); + oparg |= oldoparg << 8; goto dispatch_opcode; } @@ -5288,7 +5303,7 @@ static PyObject * unicode_concatenate(PyObject *v, PyObject *w, - PyFrameObject *f, unsigned char *next_instr) + PyFrameObject *f, const unsigned short *next_instr) { PyObject *res; if (Py_REFCNT(v) == 2) { @@ -5298,10 +5313,11 @@ * 'variable'. We try to delete the variable now to reduce * the refcnt to 1. */ - switch (*next_instr) { + int opcode, oparg; + NEXTOPARG(); + switch (opcode) { case STORE_FAST: { - int oparg = PEEKARG(); PyObject **fastlocals = f->f_localsplus; if (GETLOCAL(oparg) == v) SETLOCAL(oparg, NULL); @@ -5311,7 +5327,7 @@ { PyObject **freevars = (f->f_localsplus + f->f_code->co_nlocals); - PyObject *c = freevars[PEEKARG()]; + PyObject *c = freevars[oparg]; if (PyCell_GET(c) == v) PyCell_Set(c, NULL); break; @@ -5319,7 +5335,7 @@ case STORE_NAME: { PyObject *names = f->f_code->co_names; - PyObject *name = GETITEM(names, PEEKARG()); + PyObject *name = GETITEM(names, oparg); PyObject *locals = f->f_locals; if (PyDict_CheckExact(locals) && PyDict_GetItem(locals, name) == v) { -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 25 13:36:11 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Wed, 25 May 2016 17:36:11 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Fixed_the_use_of_=5FPy=5FI?= =?utf-8?q?S=5FALIGNED_=28issue_=2327097=29=2E?= Message-ID: <20160525173604.71178.1003.F98A6146@psf.io> https://hg.python.org/cpython/rev/b26d07812a8e changeset: 101492:b26d07812a8e user: Serhiy Storchaka date: Wed May 25 20:35:44 2016 +0300 summary: Fixed the use of _Py_IS_ALIGNED (issue #27097). files: Python/ceval.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Python/ceval.c b/Python/ceval.c --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1170,7 +1170,7 @@ assert(PyBytes_Check(co->co_code)); assert(PyBytes_GET_SIZE(co->co_code) <= INT_MAX); assert(PyBytes_GET_SIZE(co->co_code) % 2 == 0); - assert(_Py_IS_ALIGNED(PyBytes_AS_STRING(co->co_code), unsigned short)); + assert(_Py_IS_ALIGNED(PyBytes_AS_STRING(co->co_code), 2)); first_instr = (unsigned short*) PyBytes_AS_STRING(co->co_code); /* f->f_lasti refers to the index of the last instruction, -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Wed May 25 14:26:35 2016 From: python-checkins at python.org (steve.dower) Date: Wed, 25 May 2016 18:26:35 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Closes_=2323026=3A_Documen?= =?utf-8?q?tation_improvements_and_code_formatting?= Message-ID: <20160525182620.17454.40319.DEE8D835@psf.io> https://hg.python.org/cpython/rev/ed4eec682199 changeset: 101493:ed4eec682199 user: Steve Dower date: Wed May 25 11:26:07 2016 -0700 summary: Closes #23026: Documentation improvements and code formatting files: Doc/library/winreg.rst | 4 ++++ Doc/whatsnew/3.6.rst | 3 +-- PC/winreg.c | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Doc/library/winreg.rst b/Doc/library/winreg.rst --- a/Doc/library/winreg.rst +++ b/Doc/library/winreg.rst @@ -661,10 +661,14 @@ A 64-bit number. + .. versionadded:: 3.6 + .. data:: REG_QWORD_LITTLE_ENDIAN A 64-bit number in little-endian format. Equivalent to :const:`REG_QWORD`. + .. versionadded:: 3.6 + .. data:: REG_RESOURCE_LIST A device-driver resource list. diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -424,8 +424,7 @@ winreg ------ -The :func:`QueryValueEx ` function now returns -integer values for registry type ``REG_QWORD``. +Added the 64-bit integer type :data:`REG_QWORD `. (Contributed by Clement Rouault in :issue:`23026`.) diff --git a/PC/winreg.c b/PC/winreg.c --- a/PC/winreg.c +++ b/PC/winreg.c @@ -549,7 +549,7 @@ if (value != Py_None && !PyLong_Check(value)) return FALSE; *retDataBuf = (BYTE *)PyMem_NEW(DWORD, 1); - if (*retDataBuf==NULL){ + if (*retDataBuf == NULL){ PyErr_NoMemory(); return FALSE; } @@ -567,7 +567,7 @@ if (value != Py_None && !PyLong_Check(value)) return FALSE; *retDataBuf = (BYTE *)PyMem_NEW(DWORD64, 1); - if (*retDataBuf==NULL){ + if (*retDataBuf == NULL){ PyErr_NoMemory(); return FALSE; } @@ -637,7 +637,7 @@ *retDataSize = size + 2; *retDataBuf = (BYTE *)PyMem_NEW(char, *retDataSize); - if (*retDataBuf==NULL){ + if (*retDataBuf == NULL){ PyErr_NoMemory(); return FALSE; } @@ -683,7 +683,7 @@ return FALSE; *retDataBuf = (BYTE *)PyMem_NEW(char, view.len); - if (*retDataBuf==NULL){ + if (*retDataBuf == NULL){ PyBuffer_Release(&view); PyErr_NoMemory(); return FALSE; -- Repository URL: https://hg.python.org/cpython From brett at snarky.ca Wed May 25 13:45:55 2016 From: brett at snarky.ca (Brett Cannon) Date: Wed, 25 May 2016 17:45:55 +0000 Subject: [Python-checkins] peps: Short subsection on annotating coroutines (Ivan L, #225). In-Reply-To: <20160524192004.14798.31017.1CC1E33A@psf.io> References: <20160524192004.14798.31017.1CC1E33A@psf.io> Message-ID: On Tue, 24 May 2016 at 12:20 guido.van.rossum wrote: > https://hg.python.org/peps/rev/50c3f5aefbb7 > changeset: 6341:50c3f5aefbb7 > user: Guido van Rossum > date: Tue May 24 12:18:54 2016 -0700 > summary: > Short subsection on annotating coroutines (Ivan L, #225). > > files: > pep-0484.txt | 34 ++++++++++++++++++++++++++++++++++ > 1 files changed, 34 insertions(+), 0 deletions(-) > > > diff --git a/pep-0484.txt b/pep-0484.txt > --- a/pep-0484.txt > +++ b/pep-0484.txt > @@ -1015,6 +1015,40 @@ > ellipsis, i.e. the above example is literally what you would write. > > > +Annotating generator functions and coroutines > +--------------------------------------------- > + > +The return type of generator functions can be annotated by > +the generic type ``Generator[yield_type, send_type, > +return_type]`` provided by ``typing.py`` module:: > + > + def echo_round() -> Generator[int, float, str]: > + res = yield > + while res: > + res = yield round(res) > + return 'OK' > + > +Coroutines introduced in PEP 492 are annotated with the same syntax as > +ordinary functions. However, the return type annotation corresponds to the > +type of ``await`` expression, not to the coroutine type:: > + > + async def spam(ignored: int) -> str: > + return 'spam' > + > + async def foo(): > + bar = await spam(42) # type: str > If the coroutine has multiple await expressions that return different types then do you simply use a Union to express that? -Brett > + > +The ``typing.py`` module also provides generic ABCs ``Awaitable``, > +``AsyncIterable``, and ``AsyncIterator`` for situations where more precise > +types cannot be specified:: > + > + def op() -> typing.Awaitable[str]: > + if cond: > + return spam(42) > + else: > + return asyncio.Future(...) > + > + > Compatibility with other uses of function annotations > ===================================================== > > > -- > Repository URL: https://hg.python.org/peps > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > https://mail.python.org/mailman/listinfo/python-checkins > -------------- next part -------------- An HTML attachment was scrubbed... URL: From python-checkins at python.org Thu May 26 02:29:26 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:26 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogIzU0ODY6IHR5cG9z?= =?utf-8?q?=2E?= Message-ID: <20160526062925.121374.9459.4D1B69BD@psf.io> https://hg.python.org/cpython/rev/00f379f33a3e changeset: 101496:00f379f33a3e branch: 2.7 user: Georg Brandl date: Fri Mar 13 19:04:40 2009 +0000 summary: #5486: typos. files: Doc/library/cgi.rst | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst --- a/Doc/library/cgi.rst +++ b/Doc/library/cgi.rst @@ -295,12 +295,12 @@ .. function:: parse_qs(qs[, keep_blank_values[, strict_parsing]]) This function is deprecated in this module. Use :func:`urlparse.parse_qs` - instead. It is maintained here only for backward compatiblity. + instead. It is maintained here only for backward compatibility. .. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing]]) This function is deprecated in this module. Use :func:`urlparse.parse_qsl` - instead. It is maintained here only for backward compatiblity. + instead. It is maintained here only for backward compatibility. .. function:: parse_multipart(fp, pdict) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 02:29:26 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:26 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Nits?= Message-ID: <20160526062925.120013.15630.D900A080@psf.io> https://hg.python.org/cpython/rev/b93ee751f2bd changeset: 101497:b93ee751f2bd branch: 2.7 user: Raymond Hettinger date: Thu Dec 16 00:30:53 2010 +0000 summary: Nits files: Misc/NEWS | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -5706,7 +5706,7 @@ unittest.TestCase.assertSequenceEqual are no longer included in failure reports. -- Issue #8899: time.struct_time now has class and atribute docstrings. +- Issue #8899: time.struct_time now has class and attribute docstrings. - Issue #4487: email now accepts as charset aliases all codec aliases accepted by the codecs module. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 02:29:26 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:26 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogIzk5MTE6IGRvYyBj?= =?utf-8?q?opyedits=2E?= Message-ID: <20160526062925.120009.27191.52F0D675@psf.io> https://hg.python.org/cpython/rev/90b49a29fe0c changeset: 101495:90b49a29fe0c branch: 2.7 user: Georg Brandl date: Tue Sep 21 14:48:28 2010 +0000 summary: #9911: doc copyedits. files: Doc/library/_winreg.rst | 2 +- Doc/library/cookie.rst | 2 +- Doc/library/tix.rst | 2 +- Doc/library/urlparse.rst | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/_winreg.rst b/Doc/library/_winreg.rst --- a/Doc/library/_winreg.rst +++ b/Doc/library/_winreg.rst @@ -577,7 +577,7 @@ 64-bit Specific *************** -For more information, see `Accesing an Alternate Registry View +For more information, see `Accessing an Alternate Registry View `__. .. data:: KEY_WOW64_64KEY diff --git a/Doc/library/cookie.rst b/Doc/library/cookie.rst --- a/Doc/library/cookie.rst +++ b/Doc/library/cookie.rst @@ -173,7 +173,7 @@ * ``version`` * ``httponly`` - The attribute :attr:`httponly` specifies that the cookie is only transfered + The attribute :attr:`httponly` specifies that the cookie is only transferred in HTTP requests, and is not accessible through JavaScript. This is intended to mitigate some forms of cross-site scripting. diff --git a/Doc/library/tix.rst b/Doc/library/tix.rst --- a/Doc/library/tix.rst +++ b/Doc/library/tix.rst @@ -127,7 +127,7 @@ The `ComboBox `_ widget is similar to the combo box control in MS Windows. The user can select a - choice by either typing in the entry subwdget or selecting from the listbox + choice by either typing in the entry subwidget or selecting from the listbox subwidget. .. Python Demo of: diff --git a/Doc/library/urlparse.rst b/Doc/library/urlparse.rst --- a/Doc/library/urlparse.rst +++ b/Doc/library/urlparse.rst @@ -279,7 +279,7 @@ :rfc:`3986` - Uniform Resource Identifiers This is the current standard (STD66). Any changes to urlparse module should conform to this. Certain deviations could be observed, which are - mostly due backward compatiblity purposes and for certain de-facto + mostly for backward compatibility purposes and for certain de-facto parsing requirements as commonly observed in major browsers. :rfc:`2732` - Format for Literal IPv6 Addresses in URL's. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 02:29:26 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:26 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Fix_typo_in_li?= =?utf-8?q?brary/ipc=2Erst?= Message-ID: <20160526062924.100136.94488.6A691D6D@psf.io> https://hg.python.org/cpython/rev/5ca5975dbc51 changeset: 101494:5ca5975dbc51 branch: 2.7 parent: 101484:f0438e1a4761 user: Eli Bendersky date: Sun Feb 09 05:54:13 2014 -0800 summary: Fix typo in library/ipc.rst files: Doc/library/ipc.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Doc/library/ipc.rst b/Doc/library/ipc.rst --- a/Doc/library/ipc.rst +++ b/Doc/library/ipc.rst @@ -10,7 +10,7 @@ Some modules only work for two processes that are on the same machine, e.g. :mod:`signal` and :mod:`subprocess`. Other modules support networking protocols -that two or more processes can used to communicate across machines. +that two or more processes can use to communicate across machines. The list of modules described in this chapter is: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 02:29:26 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:26 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogRml4IElzc3VlICMy?= =?utf-8?q?1528_-_Fix_documentation_typos?= Message-ID: <20160526062925.89166.48881.6C9B8907@psf.io> https://hg.python.org/cpython/rev/33f6e360826e changeset: 101498:33f6e360826e branch: 2.7 user: Donald Stufft date: Tue May 20 12:58:38 2014 -0400 summary: Fix Issue #21528 - Fix documentation typos files: Doc/distutils/apiref.rst | 4 ++-- Doc/distutils/builtdist.rst | 2 +- Doc/howto/sockets.rst | 2 +- Doc/library/argparse.rst | 2 +- Doc/library/collections.rst | 4 ++-- Doc/library/resource.rst | 2 +- Doc/library/xml.dom.rst | 2 +- Doc/whatsnew/2.1.rst | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -1106,13 +1106,13 @@ during the build of Python), not the OS version of the current system. For universal binary builds on Mac OS X the architecture value reflects - the univeral binary status instead of the architecture of the current + the universal binary status instead of the architecture of the current processor. For 32-bit universal binaries the architecture is ``fat``, for 64-bit universal binaries the architecture is ``fat64``, and for 4-way universal binaries the architecture is ``universal``. Starting from Python 2.7 and Python 3.2 the architecture ``fat3`` is used for a 3-way universal build (ppc, i386, x86_64) and ``intel`` is used for - a univeral build with the i386 and x86_64 architectures + a universal build with the i386 and x86_64 architectures Examples of returned values on Mac OS X: diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst --- a/Doc/distutils/builtdist.rst +++ b/Doc/distutils/builtdist.rst @@ -355,7 +355,7 @@ would create a 64bit installation executable on your 32bit version of Windows. To cross-compile, you must download the Python source code and cross-compile -Python itself for the platform you are targetting - it is not possible from a +Python itself for the platform you are targeting - it is not possible from a binary installation of Python (as the .lib etc file for other platforms are not included.) In practice, this means the user of a 32 bit operating system will need to use Visual Studio 2008 to open the diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst --- a/Doc/howto/sockets.rst +++ b/Doc/howto/sockets.rst @@ -237,7 +237,7 @@ following message. You'll need to put that aside and hold onto it, until it's needed. -Prefixing the message with it's length (say, as 5 numeric characters) gets more +Prefixing the message with its length (say, as 5 numeric characters) gets more complex, because (believe it or not), you may not get all 5 characters in one ``recv``. In playing around, you'll get away with it; but in high network loads, your code will very quickly break unless you use two ``recv`` loops - the first diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1873,7 +1873,7 @@ Arguments that are read from a file (see the *fromfile_prefix_chars* keyword argument to the :class:`ArgumentParser` constructor) are read one - argument per line. :meth:`convert_arg_line_to_args` can be overriden for + argument per line. :meth:`convert_arg_line_to_args` can be overridden for fancier reading. This method takes a single argument *arg_line* which is a string read from diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -835,7 +835,7 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Since an ordered dictionary remembers its insertion order, it can be used -in conjuction with sorting to make a sorted dictionary:: +in conjunction with sorting to make a sorted dictionary:: >>> # regular unsorted dictionary >>> d = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2} @@ -1037,7 +1037,7 @@ (3) The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash value for the set; however, :meth:`__hash__` is not defined because not all sets - are hashable or immutable. To add set hashabilty using mixins, + are hashable or immutable. To add set hashability using mixins, inherit from both :meth:`Set` and :meth:`Hashable`, then define ``__hash__ = Set._hash``. diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst --- a/Doc/library/resource.rst +++ b/Doc/library/resource.rst @@ -44,7 +44,7 @@ .. data:: RLIM_INFINITY - Constant used to represent the the limit for an unlimited resource. + Constant used to represent the limit for an unlimited resource. .. function:: getrlimit(resource) diff --git a/Doc/library/xml.dom.rst b/Doc/library/xml.dom.rst --- a/Doc/library/xml.dom.rst +++ b/Doc/library/xml.dom.rst @@ -431,7 +431,7 @@ .. method:: NodeList.item(i) Return the *i*'th item from the sequence, if there is one, or ``None``. The - index *i* is not allowed to be less then zero or greater than or equal to the + index *i* is not allowed to be less than zero or greater than or equal to the length of the sequence. diff --git a/Doc/whatsnew/2.1.rst b/Doc/whatsnew/2.1.rst --- a/Doc/whatsnew/2.1.rst +++ b/Doc/whatsnew/2.1.rst @@ -219,7 +219,7 @@ .. seealso:: - :pep:`207` - Rich Comparisions + :pep:`207` - Rich Comparisons Written by Guido van Rossum, heavily based on earlier work by David Ascher, and implemented by Guido van Rossum. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 02:29:48 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:48 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327076=3A_More_doc?= =?utf-8?q?_and_comment_spelling_fixes_for_3=2E6=2C_by_Ville_Skytt=C3=A4?= Message-ID: <20160526062926.631.3874.E4DE1808@psf.io> https://hg.python.org/cpython/rev/d3d8faaaaade changeset: 101501:d3d8faaaaade user: Martin Panter date: Thu May 26 06:03:33 2016 +0000 summary: Issue #27076: More doc and comment spelling fixes for 3.6, by Ville Skytt? files: Doc/library/datetime.rst | 2 +- Doc/library/imaplib.rst | 2 +- Lib/statistics.py | 4 ++-- Lib/test/test_itertools.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -2079,7 +2079,7 @@ Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the day of the week and the ISO year (``%G``) are specified in a :meth:`strptime` format string. Also note that ``%G`` and ``%Y`` are not - interchangable. + interchangeable. .. rubric:: Footnotes diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -507,7 +507,7 @@ allowed creation of such tags, and popular IMAP servers, such as Gmail, accept and produce such flags. There are non-Python programs which also create such tags. Although it is an RFC violation and IMAP clients and - servers are supposed to be strict, imaplib nontheless continues to allow + servers are supposed to be strict, imaplib nonetheless continues to allow such tags to be created for backward compatibility reasons, and as of python 3.6, handles them if they are sent from the server, since this improves real-world compatibility. diff --git a/Lib/statistics.py b/Lib/statistics.py --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -430,9 +430,9 @@ L = float(x) - float(interval)/2 # Uses bisection search to search for x in data with log(n) time complexity - # Find the position of leftmost occurence of x in data + # Find the position of leftmost occurrence of x in data l1 = _find_lteq(data, x) - # Find the position of rightmost occurence of x in data[l1...len(data)] + # Find the position of rightmost occurrence of x in data[l1...len(data)] # Assuming always l1 <= l2 l2 = _find_rteq(data, l1, x) cf = l1 diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -635,7 +635,7 @@ # Mode 0 is efficient. It uses an incompletely consumed input # iterator to build a cycle object and then passes in state with # a list of previously consumed values. There is no data - # overlap bewteen the two. + # overlap between the two. c = cycle('defg') c.__setstate__((list('abc'), 0)) self.assertEqual(take(20, c), list('defgabcdefgabcdefgab')) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 02:29:48 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:48 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI3MDc2?= =?utf-8?q?=3A_Doc=2C_comment_and_test_function_name_spelling_fixes?= Message-ID: <20160526062927.22431.77089.C5AB3620@psf.io> https://hg.python.org/cpython/rev/1e80e53ce20d changeset: 101502:1e80e53ce20d branch: 2.7 parent: 101498:33f6e360826e user: Martin Panter date: Thu May 26 05:28:50 2016 +0000 summary: Issue #27076: Doc, comment and test function name spelling fixes Most fixes to Doc/ and Lib/ directories by Ville Skytt?. files: Demo/tkinter/matt/canvas-with-scrollbars.py | 4 ++-- Lib/_osx_support.py | 2 +- Lib/bsddb/test/test_lock.py | 4 ++-- Lib/cgi.py | 2 +- Lib/collections.py | 2 +- Lib/distutils/msvc9compiler.py | 2 +- Lib/distutils/tests/test_unixccompiler.py | 2 +- Lib/email/parser.py | 2 +- Lib/encodings/utf_32.py | 2 +- Lib/lib-tk/ttk.py | 2 +- Lib/lib2to3/btm_utils.py | 2 +- Lib/lib2to3/fixes/fix_metaclass.py | 2 +- Lib/lib2to3/patcomp.py | 2 +- Lib/locale.py | 2 +- Lib/msilib/schema.py | 2 +- Lib/mutex.py | 2 +- Lib/pstats.py | 2 +- Lib/test/test_cookielib.py | 2 +- Lib/test/test_datetime.py | 4 ++-- Lib/test/test_doctest.py | 2 +- Lib/test/test_generators.py | 2 +- Lib/test/test_hashlib.py | 2 +- Lib/test/test_set.py | 2 +- Lib/test/test_socket.py | 2 +- Lib/test/test_telnetlib.py | 4 ++-- Lib/test/test_winsound.py | 2 +- Lib/test/test_zipfile.py | 2 +- Lib/unittest/result.py | 2 +- Lib/wsgiref/headers.py | 2 +- Mac/README | 2 +- Makefile.pre.in | 2 +- Misc/ACKS | 1 + Misc/HISTORY | 6 +++--- Misc/NEWS | 2 +- Modules/datetimemodule.c | 2 +- Modules/sha256module.c | 2 +- Modules/sha512module.c | 2 +- Objects/stringobject.c | 2 +- Python/peephole.c | 2 +- Python/pythonrun.c | 2 +- Tools/compiler/astgen.py | 2 +- Tools/msi/schema.py | 2 +- Tools/msi/uisample.py | 2 +- configure | 2 +- configure.ac | 2 +- 45 files changed, 51 insertions(+), 50 deletions(-) diff --git a/Demo/tkinter/matt/canvas-with-scrollbars.py b/Demo/tkinter/matt/canvas-with-scrollbars.py --- a/Demo/tkinter/matt/canvas-with-scrollbars.py +++ b/Demo/tkinter/matt/canvas-with-scrollbars.py @@ -1,7 +1,7 @@ from Tkinter import * -# This example program creates a scroling canvas, and demonstrates -# how to tie scrollbars and canvses together. The mechanism +# This example program creates a scrolling canvas, and demonstrates +# how to tie scrollbars and canvases together. The mechanism # is analogus for listboxes and other widgets with # "xscroll" and "yscroll" configuration options. diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -151,7 +151,7 @@ # can only be found inside Xcode.app if the "Command Line Tools" # are not installed. # - # Futhermore, the compiler that can be used varies between + # Furthermore, the compiler that can be used varies between # Xcode releases. Up to Xcode 4 it was possible to use 'gcc-4.2' # as the compiler, after that 'clang' should be used because # gcc-4.2 is either not present, or a copy of 'llvm-gcc' that diff --git a/Lib/bsddb/test/test_lock.py b/Lib/bsddb/test/test_lock.py --- a/Lib/bsddb/test/test_lock.py +++ b/Lib/bsddb/test/test_lock.py @@ -41,7 +41,7 @@ print "locker ID: %s" % anID lock = self.env.lock_get(anID, "some locked thing", db.DB_LOCK_WRITE) if verbose: - print "Aquired lock: %s" % lock + print "Acquired lock: %s" % lock self.env.lock_put(lock) if verbose: print "Released lock: %s" % lock @@ -158,7 +158,7 @@ for i in xrange(1000) : lock = self.env.lock_get(anID, "some locked thing", lockType) if verbose: - print "%s: Aquired %s lock: %s" % (name, lt, lock) + print "%s: Acquired %s lock: %s" % (name, lt, lock) self.env.lock_put(lock) if verbose: diff --git a/Lib/cgi.py b/Lib/cgi.py --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -175,7 +175,7 @@ # parse query string function called from urlparse, -# this is done in order to maintain backward compatiblity. +# this is done in order to maintain backward compatibility. def parse_qs(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" diff --git a/Lib/collections.py b/Lib/collections.py --- a/Lib/collections.py +++ b/Lib/collections.py @@ -314,7 +314,7 @@ >>> x, y = p # unpack like a regular tuple >>> x, y (11, 22) - >>> p.x + p.y # fields also accessable by name + >>> p.x + p.y # fields also accessible by name 33 >>> d = p._asdict() # convert to a dictionary >>> d['x'] diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py --- a/Lib/distutils/msvc9compiler.py +++ b/Lib/distutils/msvc9compiler.py @@ -54,7 +54,7 @@ # A map keyed by get_platform() return values to values accepted by # 'vcvarsall.bat'. Note a cross-compile may combine these (eg, 'x86_amd64' is -# the param to cross-compile on x86 targetting amd64.) +# the param to cross-compile on x86 targeting amd64.) PLAT_TO_VCVARS = { 'win32' : 'x86', 'win-amd64' : 'amd64', diff --git a/Lib/distutils/tests/test_unixccompiler.py b/Lib/distutils/tests/test_unixccompiler.py --- a/Lib/distutils/tests/test_unixccompiler.py +++ b/Lib/distutils/tests/test_unixccompiler.py @@ -135,7 +135,7 @@ self.assertEqual(self.cc.linker_so[0], 'my_cc') @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for OS X') - def test_osx_explict_ldshared(self): + def test_osx_explicit_ldshared(self): # Issue #18080: # ensure that setting CC env variable does not change # explicit LDSHARED setting for linker diff --git a/Lib/email/parser.py b/Lib/email/parser.py --- a/Lib/email/parser.py +++ b/Lib/email/parser.py @@ -23,7 +23,7 @@ textual representation of the message. The string must be formatted as a block of RFC 2822 headers and header - continuation lines, optionally preceeded by a `Unix-from' header. The + continuation lines, optionally preceded by a `Unix-from' header. The header block is terminated either by the end of the string or by a blank line. diff --git a/Lib/encodings/utf_32.py b/Lib/encodings/utf_32.py --- a/Lib/encodings/utf_32.py +++ b/Lib/encodings/utf_32.py @@ -68,7 +68,7 @@ self.decoder = None def getstate(self): - # additonal state info from the base class must be None here, + # additional state info from the base class must be None here, # as it isn't passed along to the caller state = codecs.BufferedIncrementalDecoder.getstate(self)[0] # additional state info we pass to the caller: diff --git a/Lib/lib-tk/ttk.py b/Lib/lib-tk/ttk.py --- a/Lib/lib-tk/ttk.py +++ b/Lib/lib-tk/ttk.py @@ -1014,7 +1014,7 @@ """Begin autoincrement mode: schedules a recurring timer event that calls method step every interval milliseconds. - interval defaults to 50 milliseconds (20 steps/second) if ommited.""" + interval defaults to 50 milliseconds (20 steps/second) if omitted.""" self.tk.call(self._w, "start", interval) diff --git a/Lib/lib2to3/btm_utils.py b/Lib/lib2to3/btm_utils.py --- a/Lib/lib2to3/btm_utils.py +++ b/Lib/lib2to3/btm_utils.py @@ -216,7 +216,7 @@ #reduce to None new_node = None elif repeater_node.children[0].value == '+': - #reduce to a single occurence i.e. do nothing + #reduce to a single occurrence i.e. do nothing pass else: #TODO: handle {min, max} repeaters diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py --- a/Lib/lib2to3/fixes/fix_metaclass.py +++ b/Lib/lib2to3/fixes/fix_metaclass.py @@ -25,7 +25,7 @@ def has_metaclass(parent): """ we have to check the cls_node without changing it. - There are two possiblities: + There are two possibilities: 1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta') 2) clsdef => simple_stmt => expr_stmt => Leaf('__meta') """ diff --git a/Lib/lib2to3/patcomp.py b/Lib/lib2to3/patcomp.py --- a/Lib/lib2to3/patcomp.py +++ b/Lib/lib2to3/patcomp.py @@ -3,7 +3,7 @@ """Pattern compiler. -The grammer is taken from PatternGrammar.txt. +The grammar is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. """ diff --git a/Lib/locale.py b/Lib/locale.py --- a/Lib/locale.py +++ b/Lib/locale.py @@ -1835,7 +1835,7 @@ 0x1809: "en_IE", # English - Ireland 0x1c09: "en_ZA", # English - South Africa 0x2009: "en_JA", # English - Jamaica - 0x2409: "en_CB", # English - Carribbean + 0x2409: "en_CB", # English - Caribbean 0x2809: "en_BZ", # English - Belize 0x2c09: "en_TT", # English - Trinidad 0x3009: "en_ZW", # English - Zimbabwe diff --git a/Lib/msilib/schema.py b/Lib/msilib/schema.py --- a/Lib/msilib/schema.py +++ b/Lib/msilib/schema.py @@ -731,7 +731,7 @@ (u'CustomAction',u'Type',u'N',1,16383,None, None, None, None, u'The numeric custom action type, consisting of source location, code type, entry, option flags.',), (u'CustomAction',u'Action',u'N',None, None, None, None, u'Identifier',None, u'Primary key, name of action, normally appears in sequence table unless private use.',), (u'CustomAction',u'Source',u'Y',None, None, None, None, u'CustomSource',None, u'The table reference of the source of the code.',), -(u'CustomAction',u'Target',u'Y',None, None, None, None, u'Formatted',None, u'Excecution parameter, depends on the type of custom action',), +(u'CustomAction',u'Target',u'Y',None, None, None, None, u'Formatted',None, u'Execution parameter, depends on the type of custom action',), (u'DrLocator',u'Signature_',u'N',None, None, None, None, u'Identifier',None, u'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',), (u'DrLocator',u'Path',u'Y',None, None, None, None, u'AnyPath',None, u'The path on the user system. This is a either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',), (u'DrLocator',u'Depth',u'Y',0,32767,None, None, None, None, u'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',), diff --git a/Lib/mutex.py b/Lib/mutex.py --- a/Lib/mutex.py +++ b/Lib/mutex.py @@ -9,7 +9,7 @@ implying it now has the lock. Of course, no multi-threading is implied -- hence the funny interface -for lock, where a function is called once the lock is aquired. +for lock, where a function is called once the lock is acquired. """ from warnings import warnpy3k warnpy3k("the mutex module has been removed in Python 3.0", stacklevel=2) diff --git a/Lib/pstats.py b/Lib/pstats.py --- a/Lib/pstats.py +++ b/Lib/pstats.py @@ -60,7 +60,7 @@ """ def __init__(self, *args, **kwds): - # I can't figure out how to explictly specify a stream keyword arg + # I can't figure out how to explicitly specify a stream keyword arg # with *args: # def __init__(self, *args, stream=sys.stdout): ... # so I use **kwds and sqauwk if something unexpected is passed in. diff --git a/Lib/test/test_cookielib.py b/Lib/test/test_cookielib.py --- a/Lib/test/test_cookielib.py +++ b/Lib/test/test_cookielib.py @@ -1760,7 +1760,7 @@ key = "%s_after" % cookie.value counter[key] = counter[key] + 1 - # a permanent cookie got lost accidently + # a permanent cookie got lost accidentally self.assertEqual(counter["perm_after"], counter["perm_before"]) # a session cookie hasn't been cleared self.assertEqual(counter["session_after"], 0) diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -882,7 +882,7 @@ #self.assertRaises(ValueError, t.strftime, "%#") #oh well, some systems just ignore those invalid ones. - #at least, excercise them to make sure that no crashes + #at least, exercise them to make sure that no crashes #are generated for f in ["%e", "%", "%#"]: try: @@ -1992,7 +1992,7 @@ hour_byte + base[1:]) # A mixin for classes with a tzinfo= argument. Subclasses must define -# theclass as a class atribute, and theclass(1, 1, 1, tzinfo=whatever) +# theclass as a class attribute, and theclass(1, 1, 1, tzinfo=whatever) # must be legit (which is true for time and datetime). class TZInfoBase: diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -322,7 +322,7 @@ >>> test.lineno + e2.lineno 26 -If the docstring contains inconsistant leading whitespace in the +If the docstring contains inconsistent leading whitespace in the expected output of an example, then `DocTest` will raise a ValueError: >>> docstring = r''' diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1094,7 +1094,7 @@ # For each square, compute a bit vector of the columns and # diagonals it covers, and for each row compute a function that - # generates the possiblities for the columns in that row. + # generates the possibilities for the columns in that row. self.rowgenerators = [] for i in rangen: rowuses = [(1L << j) | # column ordinal diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -408,7 +408,7 @@ pbkdf2_results = { "sha1": [ - # offical test vectors from RFC 6070 + # official test vectors from RFC 6070 (unhexlify('0c60c80f961f0e71f3a9b524af6012062fe037a6'), None), (unhexlify('ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957'), None), (unhexlify('4b007901b765489abead49d926f721d065a429c1'), None), diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -1740,7 +1740,7 @@ # http://en.wikipedia.org/wiki/Cuboctahedron # 8 triangular faces and 6 square faces - # 12 indentical vertices each connecting a triangle and square + # 12 identical vertices each connecting a triangle and square g = cube(3) cuboctahedron = linegraph(g) # V( --> {V1, V2, V3, V4} diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -86,7 +86,7 @@ clientTearDown () Any new test functions within the class must then define - tests in pairs, where the test name is preceeded with a + tests in pairs, where the test name is preceded with a '_' to indicate the client portion of the test. Ex: def testFoo(self): diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -248,8 +248,8 @@ func = getattr(telnet, func_name) self.assertRaises(EOFError, func) - # read_eager and read_very_eager make the same gaurantees - # (they behave differently but we only test the gaurantees) + # read_eager and read_very_eager make the same guarantees + # (they behave differently but we only test the guarantees) def test_read_very_eager_A(self): self._test_read_any_eager_A('read_very_eager') def test_read_very_eager_B(self): diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -159,7 +159,7 @@ ) def test_alias_fallback(self): - # In the absense of the ability to tell if a sound was actually + # In the absence of the ability to tell if a sound was actually # played, this test has two acceptable outcomes: success (no error, # sound was theoretically played; although as issue #19987 shows # a box without a soundcard can "succeed") or RuntimeError. Any diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -184,7 +184,7 @@ for f in (TESTFN2, TemporaryFile(), StringIO()): self.zip_random_open_test(f, zipfile.ZIP_STORED) - def test_univeral_readaheads(self): + def test_universal_readaheads(self): f = StringIO() data = 'a\r\n' * 16 * 1024 diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py --- a/Lib/unittest/result.py +++ b/Lib/unittest/result.py @@ -132,7 +132,7 @@ self.skipped.append((test, reason)) def addExpectedFailure(self, test, err): - """Called when an expected failure/error occured.""" + """Called when an expected failure/error occurred.""" self.expectedFailures.append( (test, self._exc_info_to_string(err, test))) diff --git a/Lib/wsgiref/headers.py b/Lib/wsgiref/headers.py --- a/Lib/wsgiref/headers.py +++ b/Lib/wsgiref/headers.py @@ -59,7 +59,7 @@ Return None if the header is missing instead of raising an exception. Note that if the header appeared multiple times, the first exactly which - occurrance gets returned is undefined. Use getall() to get all + occurrence gets returned is undefined. Use getall() to get all the values matching a header field name. """ return self.get(name) diff --git a/Mac/README b/Mac/README --- a/Mac/README +++ b/Mac/README @@ -54,7 +54,7 @@ See the section _`Building and using a universal binary of Python on Mac OS X` for more information. -* ``--with-univeral-archs=VALUE`` +* ``--with-universal-archs=VALUE`` Specify the kind of universal binary that should be created. This option is only valid when ``--enable-universalsdk`` is specified. diff --git a/Makefile.pre.in b/Makefile.pre.in --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1273,7 +1273,7 @@ # the Makefile in Mac # # -# This target is here for backward compatiblity, previous versions of Python +# This target is here for backward compatibility, previous versions of Python # hadn't integrated framework installation in the normal install process. frameworkinstall: install diff --git a/Misc/ACKS b/Misc/ACKS --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1290,6 +1290,7 @@ George Sipe J. Sipprell Kragen Sitaker +Ville Skytt? Michael Sloan Nick Sloan V?clav ?milauer diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -15887,7 +15887,7 @@ python parser. Corresponding standard library modules token and symbol defines the numeric values of tokens and non-terminal symbols. -* The posix module has aquired new functions setuid(), setgid(), +* The posix module has acquired new functions setuid(), setgid(), execve(), and exec() has been renamed to execv(). * The array module is extended with 8-byte object swaps, the 'i' @@ -15901,7 +15901,7 @@ * For select.select(), a timeout (4th) argument of None means the same as leaving the timeout argument out. -* Module strop (and hence standard library module string) has aquired +* Module strop (and hence standard library module string) has acquired a new function: rindex(). Thanks to Amrit Prem! * Module regex defines a new function symcomp() which uses an extended @@ -17047,7 +17047,7 @@ to give more useful results for negative operands - Changed/added range checks for long/plain integer shifts - Options found after "-c command" are now passed to the command in sys.argv - (note subtle incompatiblity with "python -c command -- -options"!) + (note subtle incompatibility with "python -c command -- -options"!) - Module stdwin is better protected against touching objects after they've been closed; menus can now also be closed explicitly - Stdwin now uses its own exception (stdwin.error) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -2970,7 +2970,7 @@ - Issue #17073: Fix some integer overflows in sqlite3 module. -- Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple +- Issue #6083: Fix multiple segmentation faults occurred when PyArg_ParseTuple parses nested mutating sequence. - Issue #5289: Fix ctypes.util.find_library on Solaris. diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c --- a/Modules/datetimemodule.c +++ b/Modules/datetimemodule.c @@ -197,7 +197,7 @@ return _days_in_month[month]; } -/* year, month -> number of days in year preceeding first day of month */ +/* year, month -> number of days in year preceding first day of month */ static int days_before_month(int year, int month) { diff --git a/Modules/sha256module.c b/Modules/sha256module.c --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -101,7 +101,7 @@ * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express - * gurantee it works. + * guarantee it works. * * Tom St Denis, tomstdenis at iahu.ca, http://libtomcrypt.org */ diff --git a/Modules/sha512module.c b/Modules/sha512module.c --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -111,7 +111,7 @@ * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express - * gurantee it works. + * guarantee it works. * * Tom St Denis, tomstdenis at iahu.ca, http://libtomcrypt.org */ diff --git a/Objects/stringobject.c b/Objects/stringobject.c --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -1627,7 +1627,7 @@ #ifdef Py_USING_UNICODE if (PyUnicode_Check(item)) { /* Defer to Unicode join. - * CAUTION: There's no gurantee that the + * CAUTION: There's no guarantee that the * original sequence can be iterated over * again, so we must pass seq here. */ diff --git a/Python/peephole.c b/Python/peephole.c --- a/Python/peephole.c +++ b/Python/peephole.c @@ -289,7 +289,7 @@ allows us to avoid overflow and sign issues. Likewise, it bails when the lineno table has complex encoding for gaps >= 255. - Optimizations are restricted to simple transformations occuring within a + Optimizations are restricted to simple transformations occurring within a single basic block. All transformations keep the code size the same or smaller. For those that reduce size, the gaps are initially filled with NOPs. Later those NOPs are removed and the jump addresses retargeted in diff --git a/Python/pythonrun.c b/Python/pythonrun.c --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1919,7 +1919,7 @@ #endif } -/* Deprecated C API functions still provided for binary compatiblity */ +/* Deprecated C API functions still provided for binary compatibility */ #undef PyParser_SimpleParseFile PyAPI_FUNC(node *) diff --git a/Tools/compiler/astgen.py b/Tools/compiler/astgen.py --- a/Tools/compiler/astgen.py +++ b/Tools/compiler/astgen.py @@ -1,7 +1,7 @@ """Generate ast module from specification This script generates the ast module from a simple specification, -which makes it easy to accomodate changes in the grammar. This +which makes it easy to accommodate changes in the grammar. This approach would be quite reasonable if the grammar changed often. Instead, it is rather complex to generate the appropriate code. And the Node interface has changed more often than the grammar. diff --git a/Tools/msi/schema.py b/Tools/msi/schema.py --- a/Tools/msi/schema.py +++ b/Tools/msi/schema.py @@ -731,7 +731,7 @@ (u'CustomAction',u'Type',u'N',1,16383,None, None, None, None, u'The numeric custom action type, consisting of source location, code type, entry, option flags.',), (u'CustomAction',u'Action',u'N',None, None, None, None, u'Identifier',None, u'Primary key, name of action, normally appears in sequence table unless private use.',), (u'CustomAction',u'Source',u'Y',None, None, None, None, u'CustomSource',None, u'The table reference of the source of the code.',), -(u'CustomAction',u'Target',u'Y',None, None, None, None, u'Formatted',None, u'Excecution parameter, depends on the type of custom action',), +(u'CustomAction',u'Target',u'Y',None, None, None, None, u'Formatted',None, u'Execution parameter, depends on the type of custom action',), (u'DrLocator',u'Signature_',u'N',None, None, None, None, u'Identifier',None, u'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',), (u'DrLocator',u'Path',u'Y',None, None, None, None, u'AnyPath',None, u'The path on the user system. This is a either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',), (u'DrLocator',u'Depth',u'Y',0,32767,None, None, None, None, u'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',), diff --git a/Tools/msi/uisample.py b/Tools/msi/uisample.py --- a/Tools/msi/uisample.py +++ b/Tools/msi/uisample.py @@ -996,7 +996,7 @@ (u'CustomAction', u'Type', u'N', 1, 16383, None, None, None, None, u'The numeric custom action type, consisting of source location, code type, entry, option flags.'), (u'CustomAction', u'Action', u'N', None, None, None, None, u'Identifier', None, u'Primary key, name of action, normally appears in sequence table unless private use.'), (u'CustomAction', u'Source', u'Y', None, None, None, None, u'CustomSource', None, u'The table reference of the source of the code.'), -(u'CustomAction', u'Target', u'Y', None, None, None, None, u'Formatted', None, u'Excecution parameter, depends on the type of custom action'), +(u'CustomAction', u'Target', u'Y', None, None, None, None, u'Formatted', None, u'Execution parameter, depends on the type of custom action'), (u'DrLocator', u'Signature_', u'N', None, None, None, None, u'Identifier', None, u'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.'), (u'DrLocator', u'Path', u'Y', None, None, None, None, u'AnyPath', None, u'The path on the user system. This is a either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.'), (u'DrLocator', u'Depth', u'Y', 0, 32767, None, None, None, None, u'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.'), diff --git a/configure b/configure --- a/configure +++ b/configure @@ -3378,7 +3378,7 @@ # # SGI compilers allow the specification of the both the ABI and the # ISA on the command line. Depending on the values of these switches, -# different and often incompatable code will be generated. +# different and often incompatible code will be generated. # # The SGI_ABI variable can be used to modify the CC and LDFLAGS and # thus supply support for various ABI/ISA combinations. The MACHDEP diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -479,7 +479,7 @@ # # SGI compilers allow the specification of the both the ABI and the # ISA on the command line. Depending on the values of these switches, -# different and often incompatable code will be generated. +# different and often incompatible code will be generated. # # The SGI_ABI variable can be used to modify the CC and LDFLAGS and # thus supply support for various ABI/ISA combinations. The MACHDEP -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 02:29:48 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:48 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327076=3A_Merge_spelling_from_3=2E5?= Message-ID: <20160526062926.24277.27583.5CA81293@psf.io> https://hg.python.org/cpython/rev/5d254703bd84 changeset: 101500:5d254703bd84 parent: 101493:ed4eec682199 parent: 101499:a3a64b85883f user: Martin Panter date: Thu May 26 06:03:19 2016 +0000 summary: Issue #27076: Merge spelling from 3.5 files: Doc/glossary.rst | 2 +- Lib/_osx_support.py | 2 +- Lib/asyncio/sslproto.py | 2 +- Lib/cgi.py | 2 +- Lib/collections/__init__.py | 2 +- Lib/distutils/msvc9compiler.py | 2 +- Lib/distutils/tests/test_unixccompiler.py | 2 +- Lib/email/_header_value_parser.py | 2 +- Lib/email/parser.py | 4 +- Lib/encodings/utf_16.py | 2 +- Lib/encodings/utf_32.py | 2 +- Lib/html/parser.py | 2 +- Lib/http/cookies.py | 2 +- Lib/importlib/_bootstrap.py | 2 +- Lib/lib2to3/btm_utils.py | 2 +- Lib/lib2to3/fixes/fix_metaclass.py | 2 +- Lib/lib2to3/patcomp.py | 2 +- Lib/locale.py | 2 +- Lib/msilib/schema.py | 2 +- Lib/pdb.py | 2 +- Lib/pickle.py | 2 +- Lib/test/cfgparser.2 | 2 +- Lib/test/datetimetester.py | 4 +- Lib/test/test_asyncio/test_subprocess.py | 2 +- Lib/test/test_capi.py | 2 +- Lib/test/test_concurrent_futures.py | 4 +- Lib/test/test_crypt.py | 2 +- Lib/test/test_doctest.py | 2 +- Lib/test/test_email/test__header_value_parser.py | 2 +- Lib/test/test_email/test_contentmanager.py | 2 +- Lib/test/test_functools.py | 2 +- Lib/test/test_generators.py | 2 +- Lib/test/test_hashlib.py | 2 +- Lib/test/test_http_cookiejar.py | 2 +- Lib/test/test_httpservers.py | 2 +- Lib/test/test_linecache.py | 2 +- Lib/test/test_lzma.py | 2 +- Lib/test/test_memoryio.py | 2 +- Lib/test/test_pdb.py | 2 +- Lib/test/test_pydoc.py | 4 +- Lib/test/test_set.py | 2 +- Lib/test/test_socket.py | 4 +- Lib/test/test_telnetlib.py | 4 +- Lib/test/test_winsound.py | 2 +- Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt | 2 +- Lib/threading.py | 2 +- Lib/tkinter/ttk.py | 2 +- Lib/traceback.py | 10 +- Lib/unittest/loader.py | 2 +- Lib/unittest/result.py | 2 +- Lib/wsgiref/headers.py | 2 +- Mac/README | 2 +- Makefile.pre.in | 2 +- Misc/HISTORY | 6 +- Misc/NEWS | 4 +- Modules/_datetimemodule.c | 2 +- Modules/_pickle.c | 12 +- Modules/clinic/_pickle.c.h | 8 +- Modules/sha256module.c | 2 +- Modules/sha512module.c | 2 +- Python/fileutils.c | 2 +- Python/importlib.h | 292 +++++----- Python/peephole.c | 2 +- Python/pythonrun.c | 2 +- configure | 2 +- configure.ac | 2 +- 66 files changed, 232 insertions(+), 232 deletions(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -177,7 +177,7 @@ A buffer is considered contiguous exactly if it is either *C-contiguous* or *Fortran contiguous*. Zero-dimensional buffers are C and Fortran contiguous. In one-dimensional arrays, the items - must be layed out in memory next to each other, in order of + must be laid out in memory next to each other, in order of increasing indexes starting from zero. In multidimensional C-contiguous arrays, the last index varies the fastest when visiting items in order of memory address. However, in diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -151,7 +151,7 @@ # can only be found inside Xcode.app if the "Command Line Tools" # are not installed. # - # Futhermore, the compiler that can be used varies between + # Furthermore, the compiler that can be used varies between # Xcode releases. Up to Xcode 4 it was possible to use 'gcc-4.2' # as the compiler, after that 'clang' should be used because # gcc-4.2 is either not present, or a copy of 'llvm-gcc' that diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -604,7 +604,7 @@ self._wakeup_waiter() self._session_established = True # In case transport.write() was already called. Don't call - # immediatly _process_write_backlog(), but schedule it: + # immediately _process_write_backlog(), but schedule it: # _on_handshake_complete() can be called indirectly from # _process_write_backlog(), and _process_write_backlog() is not # reentrant. diff --git a/Lib/cgi.py b/Lib/cgi.py --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -184,7 +184,7 @@ # parse query string function called from urlparse, -# this is done in order to maintain backward compatiblity. +# this is done in order to maintain backward compatibility. def parse_qs(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -365,7 +365,7 @@ >>> x, y = p # unpack like a regular tuple >>> x, y (11, 22) - >>> p.x + p.y # fields also accessable by name + >>> p.x + p.y # fields also accessible by name 33 >>> d = p._asdict() # convert to a dictionary >>> d['x'] diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py --- a/Lib/distutils/msvc9compiler.py +++ b/Lib/distutils/msvc9compiler.py @@ -51,7 +51,7 @@ # A map keyed by get_platform() return values to values accepted by # 'vcvarsall.bat'. Note a cross-compile may combine these (eg, 'x86_amd64' is -# the param to cross-compile on x86 targetting amd64.) +# the param to cross-compile on x86 targeting amd64.) PLAT_TO_VCVARS = { 'win32' : 'x86', 'win-amd64' : 'amd64', diff --git a/Lib/distutils/tests/test_unixccompiler.py b/Lib/distutils/tests/test_unixccompiler.py --- a/Lib/distutils/tests/test_unixccompiler.py +++ b/Lib/distutils/tests/test_unixccompiler.py @@ -126,7 +126,7 @@ self.assertEqual(self.cc.linker_so[0], 'my_cc') @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for OS X') - def test_osx_explict_ldshared(self): + def test_osx_explicit_ldshared(self): # Issue #18080: # ensure that setting CC env variable does not change # explicit LDSHARED setting for linker diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py --- a/Lib/email/_header_value_parser.py +++ b/Lib/email/_header_value_parser.py @@ -2872,7 +2872,7 @@ _find_mime_parameters(ctype, value) return ctype ctype.append(token) - # XXX: If we really want to follow the formal grammer we should make + # XXX: If we really want to follow the formal grammar we should make # mantype and subtype specialized TokenLists here. Probably not worth it. if not value or value[0] != '/': ctype.defects.append(errors.InvalidHeaderDefect( diff --git a/Lib/email/parser.py b/Lib/email/parser.py --- a/Lib/email/parser.py +++ b/Lib/email/parser.py @@ -23,7 +23,7 @@ textual representation of the message. The string must be formatted as a block of RFC 2822 headers and header - continuation lines, optionally preceeded by a `Unix-from' header. The + continuation lines, optionally preceded by a `Unix-from' header. The header block is terminated either by the end of the string or by a blank line. @@ -87,7 +87,7 @@ textual representation of the message. The input must be formatted as a block of RFC 2822 headers and header - continuation lines, optionally preceeded by a `Unix-from' header. The + continuation lines, optionally preceded by a `Unix-from' header. The header block is terminated either by the end of the input or by a blank line. diff --git a/Lib/encodings/utf_16.py b/Lib/encodings/utf_16.py --- a/Lib/encodings/utf_16.py +++ b/Lib/encodings/utf_16.py @@ -73,7 +73,7 @@ self.decoder = None def getstate(self): - # additonal state info from the base class must be None here, + # additional state info from the base class must be None here, # as it isn't passed along to the caller state = codecs.BufferedIncrementalDecoder.getstate(self)[0] # additional state info we pass to the caller: diff --git a/Lib/encodings/utf_32.py b/Lib/encodings/utf_32.py --- a/Lib/encodings/utf_32.py +++ b/Lib/encodings/utf_32.py @@ -68,7 +68,7 @@ self.decoder = None def getstate(self): - # additonal state info from the base class must be None here, + # additional state info from the base class must be None here, # as it isn't passed along to the caller state = codecs.BufferedIncrementalDecoder.getstate(self)[0] # additional state info we pass to the caller: diff --git a/Lib/html/parser.py b/Lib/html/parser.py --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -143,7 +143,7 @@ # or there's more text incoming. If the latter is True, # we can't pass the text to handle_data in case we have # a charref cut in half at end. Try to determine if - # this is the case before proceding by looking for an + # this is the case before proceeding by looking for an # & near the end and see if it's followed by a space or ;. amppos = rawdata.rfind('&', max(i, n-34)) if (amppos >= 0 and diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py --- a/Lib/http/cookies.py +++ b/Lib/http/cookies.py @@ -156,7 +156,7 @@ # a two-way quoting algorithm. Any non-text character is translated # into a 4 character sequence: a forward-slash followed by the # three-digit octal equivalent of the character. Any '\' or '"' is -# quoted with a preceeding '\' slash. +# quoted with a preceding '\' slash. # Because of the way browsers really handle cookies (as opposed to what # the RFC says) we also encode "," and ";". # diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -1065,7 +1065,7 @@ def __import__(name, globals=None, locals=None, fromlist=(), level=0): """Import a module. - The 'globals' argument is used to infer where the import is occuring from + The 'globals' argument is used to infer where the import is occurring from to handle relative imports. The 'locals' argument is ignored. The 'fromlist' argument specifies what should exist as attributes on the module being imported (e.g. ``from module import ``). The 'level' diff --git a/Lib/lib2to3/btm_utils.py b/Lib/lib2to3/btm_utils.py --- a/Lib/lib2to3/btm_utils.py +++ b/Lib/lib2to3/btm_utils.py @@ -215,7 +215,7 @@ #reduce to None new_node = None elif repeater_node.children[0].value == '+': - #reduce to a single occurence i.e. do nothing + #reduce to a single occurrence i.e. do nothing pass else: #TODO: handle {min, max} repeaters diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py --- a/Lib/lib2to3/fixes/fix_metaclass.py +++ b/Lib/lib2to3/fixes/fix_metaclass.py @@ -25,7 +25,7 @@ def has_metaclass(parent): """ we have to check the cls_node without changing it. - There are two possiblities: + There are two possibilities: 1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta') 2) clsdef => simple_stmt => expr_stmt => Leaf('__meta') """ diff --git a/Lib/lib2to3/patcomp.py b/Lib/lib2to3/patcomp.py --- a/Lib/lib2to3/patcomp.py +++ b/Lib/lib2to3/patcomp.py @@ -3,7 +3,7 @@ """Pattern compiler. -The grammer is taken from PatternGrammar.txt. +The grammar is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. """ diff --git a/Lib/locale.py b/Lib/locale.py --- a/Lib/locale.py +++ b/Lib/locale.py @@ -1455,7 +1455,7 @@ 0x1809: "en_IE", # English - Ireland 0x1c09: "en_ZA", # English - South Africa 0x2009: "en_JA", # English - Jamaica - 0x2409: "en_CB", # English - Carribbean + 0x2409: "en_CB", # English - Caribbean 0x2809: "en_BZ", # English - Belize 0x2c09: "en_TT", # English - Trinidad 0x3009: "en_ZW", # English - Zimbabwe diff --git a/Lib/msilib/schema.py b/Lib/msilib/schema.py --- a/Lib/msilib/schema.py +++ b/Lib/msilib/schema.py @@ -731,7 +731,7 @@ ('CustomAction','Type','N',1,16383,None, None, None, None, 'The numeric custom action type, consisting of source location, code type, entry, option flags.',), ('CustomAction','Action','N',None, None, None, None, 'Identifier',None, 'Primary key, name of action, normally appears in sequence table unless private use.',), ('CustomAction','Source','Y',None, None, None, None, 'CustomSource',None, 'The table reference of the source of the code.',), -('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Excecution parameter, depends on the type of custom action',), +('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Execution parameter, depends on the type of custom action',), ('DrLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',), ('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',), ('DrLocator','Depth','Y',0,32767,None, None, None, None, 'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',), diff --git a/Lib/pdb.py b/Lib/pdb.py --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -300,7 +300,7 @@ # An 'Internal StopIteration' exception is an exception debug event # issued by the interpreter when handling a subgenerator run with - # 'yield from' or a generator controled by a for loop. No exception has + # 'yield from' or a generator controlled by a for loop. No exception has # actually occurred in this case. The debugger uses this debug event to # stop when the debuggee is returning from such generators. prefix = 'Internal ' if (not exc_traceback diff --git a/Lib/pickle.py b/Lib/pickle.py --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -1002,7 +1002,7 @@ meets this interface. Optional keyword arguments are *fix_imports*, *encoding* and - *errors*, which are used to control compatiblity support for + *errors*, which are used to control compatibility support for pickle stream generated by Python 2. If *fix_imports* is True, pickle will try to map the old Python 2 names to the new names used in Python 3. The *encoding* and *errors* tell pickle how diff --git a/Lib/test/cfgparser.2 b/Lib/test/cfgparser.2 --- a/Lib/test/cfgparser.2 +++ b/Lib/test/cfgparser.2 @@ -282,7 +282,7 @@ # either /etc/hosts OR DNS or NIS depending on the settings of # /etc/host.config, /etc/nsswitch.conf # and the /etc/resolv.conf file. "host" therefore is system -# configuration dependant. This parameter is most often of use to +# configuration dependent. This parameter is most often of use to # prevent DNS lookups # in order to resolve NetBIOS names to IP Addresses. Use with care! # The example below excludes use of name resolution for machines that diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1228,7 +1228,7 @@ #self.assertRaises(ValueError, t.strftime, "%#") #oh well, some systems just ignore those invalid ones. - #at least, excercise them to make sure that no crashes + #at least, exercise them to make sure that no crashes #are generated for f in ["%e", "%", "%#"]: try: @@ -2513,7 +2513,7 @@ self.theclass(bytes([1] * len(base)), 'EST') # A mixin for classes with a tzinfo= argument. Subclasses must define -# theclass as a class atribute, and theclass(1, 1, 1, tzinfo=whatever) +# theclass as a class attribute, and theclass(1, 1, 1, tzinfo=whatever) # must be legit (which is true for time and datetime). class TZInfoBase: diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -407,7 +407,7 @@ transport, protocol = yield from create proc = transport.get_extra_info('subprocess') - # kill the process (but asyncio is not notified immediatly) + # kill the process (but asyncio is not notified immediately) proc.kill() proc.wait() diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -464,7 +464,7 @@ test and not for the other, there's a mismatch, and the test fails. ** Some format units have special funny semantics and it would - be difficult to accomodate them here. Since these are all + be difficult to accommodate them here. Since these are all well-established and properly skipped in skipitem() we can get away with not testing them--this test is really intended to catch *new* format units. diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -676,7 +676,7 @@ self.assertEqual(SUCCESSFUL_FUTURE.result(timeout=0), 42) def test_result_with_success(self): - # TODO(brian at sweetapp.com): This test is timing dependant. + # TODO(brian at sweetapp.com): This test is timing dependent. def notification(): # Wait until the main thread is waiting for the result. time.sleep(1) @@ -689,7 +689,7 @@ self.assertEqual(f1.result(timeout=5), 42) def test_result_with_cancel(self): - # TODO(brian at sweetapp.com): This test is timing dependant. + # TODO(brian at sweetapp.com): This test is timing dependent. def notification(): # Wait until the main thread is waiting for the result. time.sleep(1) diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py --- a/Lib/test/test_crypt.py +++ b/Lib/test/test_crypt.py @@ -25,7 +25,7 @@ self.assertEqual(len(pw), method.total_size) def test_methods(self): - # Gurantee that METHOD_CRYPT is the last method in crypt.methods. + # Guarantee that METHOD_CRYPT is the last method in crypt.methods. self.assertTrue(len(crypt.methods) >= 1) self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1]) diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -324,7 +324,7 @@ >>> test.lineno + e2.lineno 26 -If the docstring contains inconsistant leading whitespace in the +If the docstring contains inconsistent leading whitespace in the expected output of an example, then `DocTest` will raise a ValueError: >>> docstring = r''' diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py --- a/Lib/test/test_email/test__header_value_parser.py +++ b/Lib/test/test_email/test__header_value_parser.py @@ -2498,7 +2498,7 @@ # Note that it is undefined what we should do for error recovery when # there are duplicate parameter names or duplicate parts in a split # part. We choose to ignore all duplicate parameters after the first - # and to take duplicate or missing rfc 2231 parts in apperance order. + # and to take duplicate or missing rfc 2231 parts in appearance order. # This is backward compatible with get_param's behavior, but the # decisions are arbitrary. diff --git a/Lib/test/test_email/test_contentmanager.py b/Lib/test/test_email/test_contentmanager.py --- a/Lib/test/test_email/test_contentmanager.py +++ b/Lib/test/test_email/test_contentmanager.py @@ -621,7 +621,7 @@ self.assertEqual(m.get_content(), content) def test_set_application_octet_stream_with_8bit_cte(self): - # In 8bit mode, univeral line end logic applies. It is up to the + # In 8bit mode, universal line end logic applies. It is up to the # application to make sure the lines are short enough; we don't check. m = self._make_message() content = b'b\xFFgus\tcon\nt\rent\n' + b'z'*60 + b'\n' diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -1506,7 +1506,7 @@ object]) # MutableSequence below is registered directly on D. In other words, it - # preceeds MutableMapping which means single dispatch will always + # precedes MutableMapping which means single dispatch will always # choose MutableSequence here. class D(c.defaultdict): pass diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1351,7 +1351,7 @@ # For each square, compute a bit vector of the columns and # diagonals it covers, and for each row compute a function that - # generates the possiblities for the columns in that row. + # generates the possibilities for the columns in that row. self.rowgenerators = [] for i in rangen: rowuses = [(1 << j) | # column ordinal diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -449,7 +449,7 @@ pbkdf2_results = { "sha1": [ - # offical test vectors from RFC 6070 + # official test vectors from RFC 6070 (bytes.fromhex('0c60c80f961f0e71f3a9b524af6012062fe037a6'), None), (bytes.fromhex('ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957'), None), (bytes.fromhex('4b007901b765489abead49d926f721d065a429c1'), None), diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -1729,7 +1729,7 @@ key = "%s_after" % cookie.value counter[key] = counter[key] + 1 - # a permanent cookie got lost accidently + # a permanent cookie got lost accidentally self.assertEqual(counter["perm_after"], counter["perm_before"]) # a session cookie hasn't been cleared self.assertEqual(counter["session_after"], 0) diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -100,7 +100,7 @@ def do_EXPLAINERROR(self): self.send_error(999, "Short Message", - "This is a long \n explaination") + "This is a long \n explanation") def do_CUSTOM(self): self.send_response(999) diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py --- a/Lib/test/test_linecache.py +++ b/Lib/test/test_linecache.py @@ -192,7 +192,7 @@ self.assertEqual( True, linecache.lazycache(NONEXISTENT_FILENAME, globals())) self.assertEqual(1, len(linecache.cache[NONEXISTENT_FILENAME])) - # Note here that we're looking up a non existant filename with no + # Note here that we're looking up a nonexistent filename with no # globals: this would error if the lazy value wasn't resolved. self.assertEqual(lines, linecache.getlines(NONEXISTENT_FILENAME)) diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py --- a/Lib/test/test_lzma.py +++ b/Lib/test/test_lzma.py @@ -1211,7 +1211,7 @@ self.assertEqual(f.read(), uncompressed) def test_encoding_error_handler(self): - # Test wih non-default encoding error handler. + # Test with non-default encoding error handler. with BytesIO(lzma.compress(b"foo\xffbar")) as bio: with lzma.open(bio, "rt", encoding="ascii", errors="ignore") as f: self.assertEqual(f.read(), "foobar") diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -376,7 +376,7 @@ # Pickle expects the class to be on the module level. Here we use a # little hack to allow the PickleTestMemIO class to derive from - # self.ioclass without having to define all combinations explictly on + # self.ioclass without having to define all combinations explicitly on # the module-level. import __main__ PickleTestMemIO.__module__ = '__main__' diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -823,7 +823,7 @@ """ def test_pdb_next_command_in_generator_for_loop(): - """The next command on returning from a generator controled by a for loop. + """The next command on returning from a generator controlled by a for loop. >>> def test_gen(): ... yield 0 diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -734,7 +734,7 @@ finally: sys.path[:] = saved_paths - @unittest.skip('causes undesireable side-effects (#20128)') + @unittest.skip('causes undesirable side-effects (#20128)') def test_modules(self): # See Helper.listmodules(). num_header_lines = 2 @@ -750,7 +750,7 @@ self.assertGreaterEqual(num_lines, expected) - @unittest.skip('causes undesireable side-effects (#20128)') + @unittest.skip('causes undesirable side-effects (#20128)') def test_modules_search(self): # See Helper.listmodules(). expected = 'pydoc - ' diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -1859,7 +1859,7 @@ # http://en.wikipedia.org/wiki/Cuboctahedron # 8 triangular faces and 6 square faces - # 12 indentical vertices each connecting a triangle and square + # 12 identical vertices each connecting a triangle and square g = cube(3) cuboctahedron = linegraph(g) # V( --> {V1, V2, V3, V4} diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -198,7 +198,7 @@ clientTearDown () Any new test functions within the class must then define - tests in pairs, where the test name is preceeded with a + tests in pairs, where the test name is preceded with a '_' to indicate the client portion of the test. Ex: def testFoo(self): @@ -4999,7 +4999,7 @@ def compareSockets(self, org, other): # socket sharing is expected to work only for blocking socket - # since the internal python timout value isn't transfered. + # since the internal python timeout value isn't transferred. self.assertEqual(org.gettimeout(), None) self.assertEqual(org.gettimeout(), other.gettimeout()) diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -241,8 +241,8 @@ self.assertEqual(data, want) def test_read_eager(self): - # read_eager and read_very_eager make the same gaurantees - # (they behave differently but we only test the gaurantees) + # read_eager and read_very_eager make the same guarantees + # (they behave differently but we only test the guarantees) self._read_eager('read_eager') self._read_eager('read_very_eager') # NB -- we need to test the IAC block which is mentioned in the diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -158,7 +158,7 @@ ) def test_alias_fallback(self): - # In the absense of the ability to tell if a sound was actually + # In the absence of the ability to tell if a sound was actually # played, this test has two acceptable outcomes: success (no error, # sound was theoretically played; although as issue #19987 shows # a box without a soundcard can "succeed") or RuntimeError. Any diff --git a/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt b/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt --- a/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt +++ b/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt @@ -2,7 +2,7 @@ # IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf' # at the start of it. Make sure this is preserved if any changes # are made! Also note that the coding cookie above conflicts with -# the presense of a utf-8 BOM signature -- this is intended. +# the presence of a utf-8 BOM signature -- this is intended. # Arbitrary encoded utf-8 text (stolen from test_doctest2.py). x = '?????' diff --git a/Lib/threading.py b/Lib/threading.py --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1063,7 +1063,7 @@ # Issue #18808: wait for the thread state to be gone. # At the end of the thread's life, after all knowledge of the thread # is removed from C data structures, C code releases our _tstate_lock. - # This method passes its arguments to _tstate_lock.aquire(). + # This method passes its arguments to _tstate_lock.acquire(). # If the lock is acquired, the C code is done, and self._stop() is # called. That sets ._is_stopped to True, and ._tstate_lock to None. lock = self._tstate_lock diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py --- a/Lib/tkinter/ttk.py +++ b/Lib/tkinter/ttk.py @@ -1016,7 +1016,7 @@ """Begin autoincrement mode: schedules a recurring timer event that calls method step every interval milliseconds. - interval defaults to 50 milliseconds (20 steps/second) if ommited.""" + interval defaults to 50 milliseconds (20 steps/second) if omitted.""" self.tk.call(self._w, "start", interval) diff --git a/Lib/traceback.py b/Lib/traceback.py --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -136,7 +136,7 @@ return list(TracebackException(etype, value, None).format_exception_only()) -# -- not offical API but folk probably use these two functions. +# -- not official API but folk probably use these two functions. def _format_final_exc_line(etype, value): valuestr = _some_str(value) @@ -418,13 +418,13 @@ - :attr:`stack` A `StackSummary` representing the traceback. - :attr:`exc_type` The class of the original traceback. - :attr:`filename` For syntax errors - the filename where the error - occured. + occurred. - :attr:`lineno` For syntax errors - the linenumber where the error - occured. + occurred. - :attr:`text` For syntax errors - the text where the error - occured. + occurred. - :attr:`offset` For syntax errors - the offset into the text where the - error occured. + error occurred. - :attr:`msg` For syntax errors - the compiler error message. """ diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py @@ -387,7 +387,7 @@ if tests is not None: yield tests if not should_recurse: - # Either an error occured, or load_tests was used by the + # Either an error occurred, or load_tests was used by the # package. return # Handle the contents. diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py --- a/Lib/unittest/result.py +++ b/Lib/unittest/result.py @@ -148,7 +148,7 @@ self.skipped.append((test, reason)) def addExpectedFailure(self, test, err): - """Called when an expected failure/error occured.""" + """Called when an expected failure/error occurred.""" self.expectedFailures.append( (test, self._exc_info_to_string(err, test))) diff --git a/Lib/wsgiref/headers.py b/Lib/wsgiref/headers.py --- a/Lib/wsgiref/headers.py +++ b/Lib/wsgiref/headers.py @@ -69,7 +69,7 @@ Return None if the header is missing instead of raising an exception. Note that if the header appeared multiple times, the first exactly which - occurrance gets returned is undefined. Use getall() to get all + occurrence gets returned is undefined. Use getall() to get all the values matching a header field name. """ return self.get(name) diff --git a/Mac/README b/Mac/README --- a/Mac/README +++ b/Mac/README @@ -56,7 +56,7 @@ See the section _`Building and using a universal binary of Python on Mac OS X` for more information. -* ``--with-univeral-archs=VALUE`` +* ``--with-universal-archs=VALUE`` Specify the kind of universal binary that should be created. This option is only valid when ``--enable-universalsdk`` is specified. The default is diff --git a/Makefile.pre.in b/Makefile.pre.in --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1453,7 +1453,7 @@ # the Makefile in Mac # # -# This target is here for backward compatiblity, previous versions of Python +# This target is here for backward compatibility, previous versions of Python # hadn't integrated framework installation in the normal install process. frameworkinstall: install diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -26799,7 +26799,7 @@ python parser. Corresponding standard library modules token and symbol defines the numeric values of tokens and non-terminal symbols. -* The posix module has aquired new functions setuid(), setgid(), +* The posix module has acquired new functions setuid(), setgid(), execve(), and exec() has been renamed to execv(). * The array module is extended with 8-byte object swaps, the 'i' @@ -26813,7 +26813,7 @@ * For select.select(), a timeout (4th) argument of None means the same as leaving the timeout argument out. -* Module strop (and hence standard library module string) has aquired +* Module strop (and hence standard library module string) has acquired a new function: rindex(). Thanks to Amrit Prem! * Module regex defines a new function symcomp() which uses an extended @@ -27959,7 +27959,7 @@ to give more useful results for negative operands - Changed/added range checks for long/plain integer shifts - Options found after "-c command" are now passed to the command in sys.argv - (note subtle incompatiblity with "python -c command -- -options"!) + (note subtle incompatibility with "python -c command -- -options"!) - Module stdwin is better protected against touching objects after they've been closed; menus can now also be closed explicitly - Stdwin now uses its own exception (stdwin.error) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -2818,7 +2818,7 @@ - Issue #23704: collections.deque() objects now support methods for index(), insert(), and copy(). This allows deques to be registered as a - MutableSequence and it improves their substitutablity for lists. + MutableSequence and it improves their substitutability for lists. - Issue #23715: :func:`signal.sigwaitinfo` and :func:`signal.sigtimedwait` are now retried when interrupted by a signal not in the *sigset* parameter, if @@ -8055,7 +8055,7 @@ internal XML encoding is not UTF-8 or US-ASCII. It also now accepts bytes and strings larger than 2 GiB. -- Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple +- Issue #6083: Fix multiple segmentation faults occurred when PyArg_ParseTuple parses nested mutating sequence. - Issue #5289: Fix ctypes.util.find_library on Solaris. diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -219,7 +219,7 @@ return _days_in_month[month]; } -/* year, month -> number of days in year preceeding first day of month */ +/* year, month -> number of days in year preceding first day of month */ static int days_before_month(int year, int month) { diff --git a/Modules/_pickle.c b/Modules/_pickle.c --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6614,7 +6614,7 @@ other custom object that meets this interface. Optional keyword arguments are *fix_imports*, *encoding* and *errors*, -which are used to control compatiblity support for pickle stream +which are used to control compatibility support for pickle stream generated by Python 2. If *fix_imports* is True, pickle will try to map the old Python 2 names to the new names used in Python 3. The *encoding* and *errors* tell pickle how to decode 8-bit string @@ -6627,7 +6627,7 @@ _pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: output=e2c8ce748edc57b0 input=04ece661aa884837]*/ +/*[clinic end generated code: output=e2c8ce748edc57b0 input=f9b7da04f5f4f335]*/ { _Py_IDENTIFIER(persistent_load); @@ -7156,7 +7156,7 @@ other custom object that meets this interface. Optional keyword arguments are *fix_imports*, *encoding* and *errors*, -which are used to control compatiblity support for pickle stream +which are used to control compatibility support for pickle stream generated by Python 2. If *fix_imports* is True, pickle will try to map the old Python 2 names to the new names used in Python 3. The *encoding* and *errors* tell pickle how to decode 8-bit string @@ -7168,7 +7168,7 @@ static PyObject * _pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: output=798f1c57cb2b4eb1 input=2df7c7a1e6742204]*/ +/*[clinic end generated code: output=798f1c57cb2b4eb1 input=01b44dd3fc07afa7]*/ { PyObject *result; UnpicklerObject *unpickler = _Unpickler_New(); @@ -7210,7 +7210,7 @@ representation are ignored. Optional keyword arguments are *fix_imports*, *encoding* and *errors*, -which are used to control compatiblity support for pickle stream +which are used to control compatibility support for pickle stream generated by Python 2. If *fix_imports* is True, pickle will try to map the old Python 2 names to the new names used in Python 3. The *encoding* and *errors* tell pickle how to decode 8-bit string @@ -7222,7 +7222,7 @@ static PyObject * _pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: output=61e9cdb01e36a736 input=f57f0fdaa2b4cb8b]*/ +/*[clinic end generated code: output=61e9cdb01e36a736 input=70605948a719feb9]*/ { PyObject *result; UnpicklerObject *unpickler = _Unpickler_New(); diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -264,7 +264,7 @@ "other custom object that meets this interface.\n" "\n" "Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" -"which are used to control compatiblity support for pickle stream\n" +"which are used to control compatibility support for pickle stream\n" "generated by Python 2. If *fix_imports* is True, pickle will try to\n" "map the old Python 2 names to the new names used in Python 3. The\n" "*encoding* and *errors* tell pickle how to decode 8-bit string\n" @@ -466,7 +466,7 @@ "other custom object that meets this interface.\n" "\n" "Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" -"which are used to control compatiblity support for pickle stream\n" +"which are used to control compatibility support for pickle stream\n" "generated by Python 2. If *fix_imports* is True, pickle will try to\n" "map the old Python 2 names to the new names used in Python 3. The\n" "*encoding* and *errors* tell pickle how to decode 8-bit string\n" @@ -512,7 +512,7 @@ "representation are ignored.\n" "\n" "Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" -"which are used to control compatiblity support for pickle stream\n" +"which are used to control compatibility support for pickle stream\n" "generated by Python 2. If *fix_imports* is True, pickle will try to\n" "map the old Python 2 names to the new names used in Python 3. The\n" "*encoding* and *errors* tell pickle how to decode 8-bit string\n" @@ -545,4 +545,4 @@ exit: return return_value; } -/*[clinic end generated code: output=aecd61660d1cf31d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a7169d4fbbeef827 input=a9049054013a1b77]*/ diff --git a/Modules/sha256module.c b/Modules/sha256module.c --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -100,7 +100,7 @@ * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express - * gurantee it works. + * guarantee it works. * * Tom St Denis, tomstdenis at iahu.ca, http://libtom.org */ diff --git a/Modules/sha512module.c b/Modules/sha512module.c --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -111,7 +111,7 @@ * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express - * gurantee it works. + * guarantee it works. * * Tom St Denis, tomstdenis at iahu.ca, http://libtom.org */ diff --git a/Python/fileutils.c b/Python/fileutils.c --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -176,7 +176,7 @@ #endif error: - /* if an error occured, force the ASCII encoding */ + /* if an error occurred, force the ASCII encoding */ return 1; } diff --git a/Python/importlib.h b/Python/importlib.h --- a/Python/importlib.h +++ b/Python/importlib.h [stripped] diff --git a/Python/peephole.c b/Python/peephole.c --- a/Python/peephole.c +++ b/Python/peephole.c @@ -407,7 +407,7 @@ To keep the optimizer simple, it bails when the lineno table has complex encoding for gaps >= 255. - Optimizations are restricted to simple transformations occuring within a + Optimizations are restricted to simple transformations occurring within a single basic block. All transformations keep the code size the same or smaller. For those that reduce size, the gaps are initially filled with NOPs. Later those NOPs are removed and the jump addresses retargeted in diff --git a/Python/pythonrun.c b/Python/pythonrun.c --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1425,7 +1425,7 @@ #endif /* USE_STACKCHECK */ -/* Deprecated C API functions still provided for binary compatiblity */ +/* Deprecated C API functions still provided for binary compatibility */ #undef PyParser_SimpleParseFile PyAPI_FUNC(node *) diff --git a/configure b/configure --- a/configure +++ b/configure @@ -3496,7 +3496,7 @@ # # SGI compilers allow the specification of the both the ABI and the # ISA on the command line. Depending on the values of these switches, -# different and often incompatable code will be generated. +# different and often incompatible code will be generated. # # The SGI_ABI variable can be used to modify the CC and LDFLAGS and # thus supply support for various ABI/ISA combinations. The MACHDEP diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -542,7 +542,7 @@ # # SGI compilers allow the specification of the both the ABI and the # ISA on the command line. Depending on the values of these switches, -# different and often incompatable code will be generated. +# different and often incompatible code will be generated. # # The SGI_ABI variable can be used to modify the CC and LDFLAGS and # thus supply support for various ABI/ISA combinations. The MACHDEP -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 02:29:48 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 06:29:48 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MDc2?= =?utf-8?q?=3A_Doc=2C_comment_and_tests_spelling_fixes?= Message-ID: <20160526062926.22449.91740.AC6A6E37@psf.io> https://hg.python.org/cpython/rev/a3a64b85883f changeset: 101499:a3a64b85883f branch: 3.5 parent: 101488:dd69d8491c8f user: Martin Panter date: Thu May 26 05:35:26 2016 +0000 summary: Issue #27076: Doc, comment and tests spelling fixes Most fixes to Doc/ and Lib/ directories by Ville Skytt?. files: Doc/glossary.rst | 2 +- Lib/_osx_support.py | 2 +- Lib/asyncio/sslproto.py | 2 +- Lib/cgi.py | 2 +- Lib/collections/__init__.py | 2 +- Lib/dis.py | 2 +- Lib/distutils/msvc9compiler.py | 2 +- Lib/distutils/tests/test_unixccompiler.py | 2 +- Lib/email/_header_value_parser.py | 2 +- Lib/email/parser.py | 4 +- Lib/encodings/utf_16.py | 2 +- Lib/encodings/utf_32.py | 2 +- Lib/html/parser.py | 2 +- Lib/http/cookies.py | 2 +- Lib/importlib/_bootstrap.py | 2 +- Lib/lib2to3/btm_utils.py | 2 +- Lib/lib2to3/fixes/fix_metaclass.py | 2 +- Lib/lib2to3/patcomp.py | 2 +- Lib/locale.py | 2 +- Lib/msilib/schema.py | 2 +- Lib/pdb.py | 2 +- Lib/pickle.py | 2 +- Lib/test/cfgparser.2 | 2 +- Lib/test/datetimetester.py | 4 +- Lib/test/test_asyncio/test_subprocess.py | 2 +- Lib/test/test_capi.py | 2 +- Lib/test/test_concurrent_futures.py | 4 +- Lib/test/test_crypt.py | 2 +- Lib/test/test_doctest.py | 2 +- Lib/test/test_email/test__header_value_parser.py | 2 +- Lib/test/test_email/test_contentmanager.py | 2 +- Lib/test/test_functools.py | 2 +- Lib/test/test_generators.py | 2 +- Lib/test/test_hashlib.py | 2 +- Lib/test/test_http_cookiejar.py | 2 +- Lib/test/test_httpservers.py | 2 +- Lib/test/test_linecache.py | 2 +- Lib/test/test_lzma.py | 2 +- Lib/test/test_memoryio.py | 2 +- Lib/test/test_pdb.py | 2 +- Lib/test/test_pydoc.py | 4 +- Lib/test/test_set.py | 2 +- Lib/test/test_socket.py | 4 +- Lib/test/test_telnetlib.py | 4 +- Lib/test/test_winsound.py | 2 +- Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt | 2 +- Lib/threading.py | 2 +- Lib/tkinter/ttk.py | 2 +- Lib/traceback.py | 10 +- Lib/unittest/loader.py | 2 +- Lib/unittest/result.py | 2 +- Lib/wsgiref/headers.py | 2 +- Mac/README | 2 +- Makefile.pre.in | 2 +- Misc/HISTORY | 6 +- Misc/NEWS | 4 +- Modules/_datetimemodule.c | 2 +- Modules/_pickle.c | 12 +- Modules/clinic/_pickle.c.h | 8 +- Modules/sha256module.c | 2 +- Modules/sha512module.c | 2 +- Python/fileutils.c | 2 +- Python/importlib.h | 308 +++++----- Python/peephole.c | 2 +- Python/pythonrun.c | 2 +- configure | 2 +- configure.ac | 2 +- 67 files changed, 241 insertions(+), 241 deletions(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -177,7 +177,7 @@ A buffer is considered contiguous exactly if it is either *C-contiguous* or *Fortran contiguous*. Zero-dimensional buffers are C and Fortran contiguous. In one-dimensional arrays, the items - must be layed out in memory next to each other, in order of + must be laid out in memory next to each other, in order of increasing indexes starting from zero. In multidimensional C-contiguous arrays, the last index varies the fastest when visiting items in order of memory address. However, in diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -151,7 +151,7 @@ # can only be found inside Xcode.app if the "Command Line Tools" # are not installed. # - # Futhermore, the compiler that can be used varies between + # Furthermore, the compiler that can be used varies between # Xcode releases. Up to Xcode 4 it was possible to use 'gcc-4.2' # as the compiler, after that 'clang' should be used because # gcc-4.2 is either not present, or a copy of 'llvm-gcc' that diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -603,7 +603,7 @@ self._wakeup_waiter() self._session_established = True # In case transport.write() was already called. Don't call - # immediatly _process_write_backlog(), but schedule it: + # immediately _process_write_backlog(), but schedule it: # _on_handshake_complete() can be called indirectly from # _process_write_backlog(), and _process_write_backlog() is not # reentrant. diff --git a/Lib/cgi.py b/Lib/cgi.py --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -184,7 +184,7 @@ # parse query string function called from urlparse, -# this is done in order to maintain backward compatiblity. +# this is done in order to maintain backward compatibility. def parse_qs(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -365,7 +365,7 @@ >>> x, y = p # unpack like a regular tuple >>> x, y (11, 22) - >>> p.x + p.y # fields also accessable by name + >>> p.x + p.y # fields also accessible by name 33 >>> d = p._asdict() # convert to a dictionary >>> d['x'] diff --git a/Lib/dis.py b/Lib/dis.py --- a/Lib/dis.py +++ b/Lib/dis.py @@ -287,7 +287,7 @@ argrepr = '' if arg is not None: # Set argval to the dereferenced value of the argument when - # availabe, and argrepr to the string representation of argval. + # available, and argrepr to the string representation of argval. # _disassemble_bytes needs the string repr of the # raw name index for LOAD_GLOBAL, LOAD_CONST, etc. argval = arg diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py --- a/Lib/distutils/msvc9compiler.py +++ b/Lib/distutils/msvc9compiler.py @@ -51,7 +51,7 @@ # A map keyed by get_platform() return values to values accepted by # 'vcvarsall.bat'. Note a cross-compile may combine these (eg, 'x86_amd64' is -# the param to cross-compile on x86 targetting amd64.) +# the param to cross-compile on x86 targeting amd64.) PLAT_TO_VCVARS = { 'win32' : 'x86', 'win-amd64' : 'amd64', diff --git a/Lib/distutils/tests/test_unixccompiler.py b/Lib/distutils/tests/test_unixccompiler.py --- a/Lib/distutils/tests/test_unixccompiler.py +++ b/Lib/distutils/tests/test_unixccompiler.py @@ -127,7 +127,7 @@ self.assertEqual(self.cc.linker_so[0], 'my_cc') @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for OS X') - def test_osx_explict_ldshared(self): + def test_osx_explicit_ldshared(self): # Issue #18080: # ensure that setting CC env variable does not change # explicit LDSHARED setting for linker diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py --- a/Lib/email/_header_value_parser.py +++ b/Lib/email/_header_value_parser.py @@ -2872,7 +2872,7 @@ _find_mime_parameters(ctype, value) return ctype ctype.append(token) - # XXX: If we really want to follow the formal grammer we should make + # XXX: If we really want to follow the formal grammar we should make # mantype and subtype specialized TokenLists here. Probably not worth it. if not value or value[0] != '/': ctype.defects.append(errors.InvalidHeaderDefect( diff --git a/Lib/email/parser.py b/Lib/email/parser.py --- a/Lib/email/parser.py +++ b/Lib/email/parser.py @@ -23,7 +23,7 @@ textual representation of the message. The string must be formatted as a block of RFC 2822 headers and header - continuation lines, optionally preceeded by a `Unix-from' header. The + continuation lines, optionally preceded by a `Unix-from' header. The header block is terminated either by the end of the string or by a blank line. @@ -87,7 +87,7 @@ textual representation of the message. The input must be formatted as a block of RFC 2822 headers and header - continuation lines, optionally preceeded by a `Unix-from' header. The + continuation lines, optionally preceded by a `Unix-from' header. The header block is terminated either by the end of the input or by a blank line. diff --git a/Lib/encodings/utf_16.py b/Lib/encodings/utf_16.py --- a/Lib/encodings/utf_16.py +++ b/Lib/encodings/utf_16.py @@ -73,7 +73,7 @@ self.decoder = None def getstate(self): - # additonal state info from the base class must be None here, + # additional state info from the base class must be None here, # as it isn't passed along to the caller state = codecs.BufferedIncrementalDecoder.getstate(self)[0] # additional state info we pass to the caller: diff --git a/Lib/encodings/utf_32.py b/Lib/encodings/utf_32.py --- a/Lib/encodings/utf_32.py +++ b/Lib/encodings/utf_32.py @@ -68,7 +68,7 @@ self.decoder = None def getstate(self): - # additonal state info from the base class must be None here, + # additional state info from the base class must be None here, # as it isn't passed along to the caller state = codecs.BufferedIncrementalDecoder.getstate(self)[0] # additional state info we pass to the caller: diff --git a/Lib/html/parser.py b/Lib/html/parser.py --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -143,7 +143,7 @@ # or there's more text incoming. If the latter is True, # we can't pass the text to handle_data in case we have # a charref cut in half at end. Try to determine if - # this is the case before proceding by looking for an + # this is the case before proceeding by looking for an # & near the end and see if it's followed by a space or ;. amppos = rawdata.rfind('&', max(i, n-34)) if (amppos >= 0 and diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py --- a/Lib/http/cookies.py +++ b/Lib/http/cookies.py @@ -156,7 +156,7 @@ # a two-way quoting algorithm. Any non-text character is translated # into a 4 character sequence: a forward-slash followed by the # three-digit octal equivalent of the character. Any '\' or '"' is -# quoted with a preceeding '\' slash. +# quoted with a preceding '\' slash. # Because of the way browsers really handle cookies (as opposed to what # the RFC says) we also encode "," and ";". # diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -1043,7 +1043,7 @@ def __import__(name, globals=None, locals=None, fromlist=(), level=0): """Import a module. - The 'globals' argument is used to infer where the import is occuring from + The 'globals' argument is used to infer where the import is occurring from to handle relative imports. The 'locals' argument is ignored. The 'fromlist' argument specifies what should exist as attributes on the module being imported (e.g. ``from module import ``). The 'level' diff --git a/Lib/lib2to3/btm_utils.py b/Lib/lib2to3/btm_utils.py --- a/Lib/lib2to3/btm_utils.py +++ b/Lib/lib2to3/btm_utils.py @@ -215,7 +215,7 @@ #reduce to None new_node = None elif repeater_node.children[0].value == '+': - #reduce to a single occurence i.e. do nothing + #reduce to a single occurrence i.e. do nothing pass else: #TODO: handle {min, max} repeaters diff --git a/Lib/lib2to3/fixes/fix_metaclass.py b/Lib/lib2to3/fixes/fix_metaclass.py --- a/Lib/lib2to3/fixes/fix_metaclass.py +++ b/Lib/lib2to3/fixes/fix_metaclass.py @@ -25,7 +25,7 @@ def has_metaclass(parent): """ we have to check the cls_node without changing it. - There are two possiblities: + There are two possibilities: 1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta') 2) clsdef => simple_stmt => expr_stmt => Leaf('__meta') """ diff --git a/Lib/lib2to3/patcomp.py b/Lib/lib2to3/patcomp.py --- a/Lib/lib2to3/patcomp.py +++ b/Lib/lib2to3/patcomp.py @@ -3,7 +3,7 @@ """Pattern compiler. -The grammer is taken from PatternGrammar.txt. +The grammar is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. """ diff --git a/Lib/locale.py b/Lib/locale.py --- a/Lib/locale.py +++ b/Lib/locale.py @@ -1451,7 +1451,7 @@ 0x1809: "en_IE", # English - Ireland 0x1c09: "en_ZA", # English - South Africa 0x2009: "en_JA", # English - Jamaica - 0x2409: "en_CB", # English - Carribbean + 0x2409: "en_CB", # English - Caribbean 0x2809: "en_BZ", # English - Belize 0x2c09: "en_TT", # English - Trinidad 0x3009: "en_ZW", # English - Zimbabwe diff --git a/Lib/msilib/schema.py b/Lib/msilib/schema.py --- a/Lib/msilib/schema.py +++ b/Lib/msilib/schema.py @@ -731,7 +731,7 @@ ('CustomAction','Type','N',1,16383,None, None, None, None, 'The numeric custom action type, consisting of source location, code type, entry, option flags.',), ('CustomAction','Action','N',None, None, None, None, 'Identifier',None, 'Primary key, name of action, normally appears in sequence table unless private use.',), ('CustomAction','Source','Y',None, None, None, None, 'CustomSource',None, 'The table reference of the source of the code.',), -('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Excecution parameter, depends on the type of custom action',), +('CustomAction','Target','Y',None, None, None, None, 'Formatted',None, 'Execution parameter, depends on the type of custom action',), ('DrLocator','Signature_','N',None, None, None, None, 'Identifier',None, 'The Signature_ represents a unique file signature and is also the foreign key in the Signature table.',), ('DrLocator','Path','Y',None, None, None, None, 'AnyPath',None, 'The path on the user system. This is either a subpath below the value of the Parent or a full path. The path may contain properties enclosed within [ ] that will be expanded.',), ('DrLocator','Depth','Y',0,32767,None, None, None, None, 'The depth below the path to which the Signature_ is recursively searched. If absent, the depth is assumed to be 0.',), diff --git a/Lib/pdb.py b/Lib/pdb.py --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -300,7 +300,7 @@ # An 'Internal StopIteration' exception is an exception debug event # issued by the interpreter when handling a subgenerator run with - # 'yield from' or a generator controled by a for loop. No exception has + # 'yield from' or a generator controlled by a for loop. No exception has # actually occurred in this case. The debugger uses this debug event to # stop when the debuggee is returning from such generators. prefix = 'Internal ' if (not exc_traceback diff --git a/Lib/pickle.py b/Lib/pickle.py --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -995,7 +995,7 @@ meets this interface. Optional keyword arguments are *fix_imports*, *encoding* and - *errors*, which are used to control compatiblity support for + *errors*, which are used to control compatibility support for pickle stream generated by Python 2. If *fix_imports* is True, pickle will try to map the old Python 2 names to the new names used in Python 3. The *encoding* and *errors* tell pickle how diff --git a/Lib/test/cfgparser.2 b/Lib/test/cfgparser.2 --- a/Lib/test/cfgparser.2 +++ b/Lib/test/cfgparser.2 @@ -282,7 +282,7 @@ # either /etc/hosts OR DNS or NIS depending on the settings of # /etc/host.config, /etc/nsswitch.conf # and the /etc/resolv.conf file. "host" therefore is system -# configuration dependant. This parameter is most often of use to +# configuration dependent. This parameter is most often of use to # prevent DNS lookups # in order to resolve NetBIOS names to IP Addresses. Use with care! # The example below excludes use of name resolution for machines that diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -1227,7 +1227,7 @@ #self.assertRaises(ValueError, t.strftime, "%#") #oh well, some systems just ignore those invalid ones. - #at least, excercise them to make sure that no crashes + #at least, exercise them to make sure that no crashes #are generated for f in ["%e", "%", "%#"]: try: @@ -2476,7 +2476,7 @@ self.theclass(bytes([1] * len(base)), 'EST') # A mixin for classes with a tzinfo= argument. Subclasses must define -# theclass as a class atribute, and theclass(1, 1, 1, tzinfo=whatever) +# theclass as a class attribute, and theclass(1, 1, 1, tzinfo=whatever) # must be legit (which is true for time and datetime). class TZInfoBase: diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -407,7 +407,7 @@ transport, protocol = yield from create proc = transport.get_extra_info('subprocess') - # kill the process (but asyncio is not notified immediatly) + # kill the process (but asyncio is not notified immediately) proc.kill() proc.wait() diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -461,7 +461,7 @@ test and not for the other, there's a mismatch, and the test fails. ** Some format units have special funny semantics and it would - be difficult to accomodate them here. Since these are all + be difficult to accommodate them here. Since these are all well-established and properly skipped in skipitem() we can get away with not testing them--this test is really intended to catch *new* format units. diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -676,7 +676,7 @@ self.assertEqual(SUCCESSFUL_FUTURE.result(timeout=0), 42) def test_result_with_success(self): - # TODO(brian at sweetapp.com): This test is timing dependant. + # TODO(brian at sweetapp.com): This test is timing dependent. def notification(): # Wait until the main thread is waiting for the result. time.sleep(1) @@ -689,7 +689,7 @@ self.assertEqual(f1.result(timeout=5), 42) def test_result_with_cancel(self): - # TODO(brian at sweetapp.com): This test is timing dependant. + # TODO(brian at sweetapp.com): This test is timing dependent. def notification(): # Wait until the main thread is waiting for the result. time.sleep(1) diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py --- a/Lib/test/test_crypt.py +++ b/Lib/test/test_crypt.py @@ -25,7 +25,7 @@ self.assertEqual(len(pw), method.total_size) def test_methods(self): - # Gurantee that METHOD_CRYPT is the last method in crypt.methods. + # Guarantee that METHOD_CRYPT is the last method in crypt.methods. self.assertTrue(len(crypt.methods) >= 1) self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1]) diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -324,7 +324,7 @@ >>> test.lineno + e2.lineno 26 -If the docstring contains inconsistant leading whitespace in the +If the docstring contains inconsistent leading whitespace in the expected output of an example, then `DocTest` will raise a ValueError: >>> docstring = r''' diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py --- a/Lib/test/test_email/test__header_value_parser.py +++ b/Lib/test/test_email/test__header_value_parser.py @@ -2498,7 +2498,7 @@ # Note that it is undefined what we should do for error recovery when # there are duplicate parameter names or duplicate parts in a split # part. We choose to ignore all duplicate parameters after the first - # and to take duplicate or missing rfc 2231 parts in apperance order. + # and to take duplicate or missing rfc 2231 parts in appearance order. # This is backward compatible with get_param's behavior, but the # decisions are arbitrary. diff --git a/Lib/test/test_email/test_contentmanager.py b/Lib/test/test_email/test_contentmanager.py --- a/Lib/test/test_email/test_contentmanager.py +++ b/Lib/test/test_email/test_contentmanager.py @@ -621,7 +621,7 @@ self.assertEqual(m.get_content(), content) def test_set_application_octet_stream_with_8bit_cte(self): - # In 8bit mode, univeral line end logic applies. It is up to the + # In 8bit mode, universal line end logic applies. It is up to the # application to make sure the lines are short enough; we don't check. m = self._make_message() content = b'b\xFFgus\tcon\nt\rent\n' + b'z'*60 + b'\n' diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -1506,7 +1506,7 @@ object]) # MutableSequence below is registered directly on D. In other words, it - # preceeds MutableMapping which means single dispatch will always + # precedes MutableMapping which means single dispatch will always # choose MutableSequence here. class D(c.defaultdict): pass diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1351,7 +1351,7 @@ # For each square, compute a bit vector of the columns and # diagonals it covers, and for each row compute a function that - # generates the possiblities for the columns in that row. + # generates the possibilities for the columns in that row. self.rowgenerators = [] for i in rangen: rowuses = [(1 << j) | # column ordinal diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -449,7 +449,7 @@ pbkdf2_results = { "sha1": [ - # offical test vectors from RFC 6070 + # official test vectors from RFC 6070 (bytes.fromhex('0c60c80f961f0e71f3a9b524af6012062fe037a6'), None), (bytes.fromhex('ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957'), None), (bytes.fromhex('4b007901b765489abead49d926f721d065a429c1'), None), diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -1729,7 +1729,7 @@ key = "%s_after" % cookie.value counter[key] = counter[key] + 1 - # a permanent cookie got lost accidently + # a permanent cookie got lost accidentally self.assertEqual(counter["perm_after"], counter["perm_before"]) # a session cookie hasn't been cleared self.assertEqual(counter["session_after"], 0) diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -99,7 +99,7 @@ def do_EXPLAINERROR(self): self.send_error(999, "Short Message", - "This is a long \n explaination") + "This is a long \n explanation") def do_CUSTOM(self): self.send_response(999) diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py --- a/Lib/test/test_linecache.py +++ b/Lib/test/test_linecache.py @@ -139,7 +139,7 @@ self.assertEqual( True, linecache.lazycache(NONEXISTENT_FILENAME, globals())) self.assertEqual(1, len(linecache.cache[NONEXISTENT_FILENAME])) - # Note here that we're looking up a non existant filename with no + # Note here that we're looking up a nonexistent filename with no # globals: this would error if the lazy value wasn't resolved. self.assertEqual(lines, linecache.getlines(NONEXISTENT_FILENAME)) diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py --- a/Lib/test/test_lzma.py +++ b/Lib/test/test_lzma.py @@ -1211,7 +1211,7 @@ self.assertEqual(f.read(), uncompressed) def test_encoding_error_handler(self): - # Test wih non-default encoding error handler. + # Test with non-default encoding error handler. with BytesIO(lzma.compress(b"foo\xffbar")) as bio: with lzma.open(bio, "rt", encoding="ascii", errors="ignore") as f: self.assertEqual(f.read(), "foobar") diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -376,7 +376,7 @@ # Pickle expects the class to be on the module level. Here we use a # little hack to allow the PickleTestMemIO class to derive from - # self.ioclass without having to define all combinations explictly on + # self.ioclass without having to define all combinations explicitly on # the module-level. import __main__ PickleTestMemIO.__module__ = '__main__' diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -824,7 +824,7 @@ """ def test_pdb_next_command_in_generator_for_loop(): - """The next command on returning from a generator controled by a for loop. + """The next command on returning from a generator controlled by a for loop. >>> def test_gen(): ... yield 0 diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -734,7 +734,7 @@ finally: sys.path[:] = saved_paths - @unittest.skip('causes undesireable side-effects (#20128)') + @unittest.skip('causes undesirable side-effects (#20128)') def test_modules(self): # See Helper.listmodules(). num_header_lines = 2 @@ -750,7 +750,7 @@ self.assertGreaterEqual(num_lines, expected) - @unittest.skip('causes undesireable side-effects (#20128)') + @unittest.skip('causes undesirable side-effects (#20128)') def test_modules_search(self): # See Helper.listmodules(). expected = 'pydoc - ' diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -1836,7 +1836,7 @@ # http://en.wikipedia.org/wiki/Cuboctahedron # 8 triangular faces and 6 square faces - # 12 indentical vertices each connecting a triangle and square + # 12 identical vertices each connecting a triangle and square g = cube(3) cuboctahedron = linegraph(g) # V( --> {V1, V2, V3, V4} diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -199,7 +199,7 @@ clientTearDown () Any new test functions within the class must then define - tests in pairs, where the test name is preceeded with a + tests in pairs, where the test name is preceded with a '_' to indicate the client portion of the test. Ex: def testFoo(self): @@ -4988,7 +4988,7 @@ def compareSockets(self, org, other): # socket sharing is expected to work only for blocking socket - # since the internal python timout value isn't transfered. + # since the internal python timeout value isn't transferred. self.assertEqual(org.gettimeout(), None) self.assertEqual(org.gettimeout(), other.gettimeout()) diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -237,8 +237,8 @@ self.assertEqual(data, want) def test_read_eager(self): - # read_eager and read_very_eager make the same gaurantees - # (they behave differently but we only test the gaurantees) + # read_eager and read_very_eager make the same guarantees + # (they behave differently but we only test the guarantees) self._read_eager('read_eager') self._read_eager('read_very_eager') # NB -- we need to test the IAC block which is mentioned in the diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -158,7 +158,7 @@ ) def test_alias_fallback(self): - # In the absense of the ability to tell if a sound was actually + # In the absence of the ability to tell if a sound was actually # played, this test has two acceptable outcomes: success (no error, # sound was theoretically played; although as issue #19987 shows # a box without a soundcard can "succeed") or RuntimeError. Any diff --git a/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt b/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt --- a/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt +++ b/Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt @@ -2,7 +2,7 @@ # IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf' # at the start of it. Make sure this is preserved if any changes # are made! Also note that the coding cookie above conflicts with -# the presense of a utf-8 BOM signature -- this is intended. +# the presence of a utf-8 BOM signature -- this is intended. # Arbitrary encoded utf-8 text (stolen from test_doctest2.py). x = '?????' diff --git a/Lib/threading.py b/Lib/threading.py --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1061,7 +1061,7 @@ # Issue #18808: wait for the thread state to be gone. # At the end of the thread's life, after all knowledge of the thread # is removed from C data structures, C code releases our _tstate_lock. - # This method passes its arguments to _tstate_lock.aquire(). + # This method passes its arguments to _tstate_lock.acquire(). # If the lock is acquired, the C code is done, and self._stop() is # called. That sets ._is_stopped to True, and ._tstate_lock to None. lock = self._tstate_lock diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py --- a/Lib/tkinter/ttk.py +++ b/Lib/tkinter/ttk.py @@ -1012,7 +1012,7 @@ """Begin autoincrement mode: schedules a recurring timer event that calls method step every interval milliseconds. - interval defaults to 50 milliseconds (20 steps/second) if ommited.""" + interval defaults to 50 milliseconds (20 steps/second) if omitted.""" self.tk.call(self._w, "start", interval) diff --git a/Lib/traceback.py b/Lib/traceback.py --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -136,7 +136,7 @@ return list(TracebackException(etype, value, None).format_exception_only()) -# -- not offical API but folk probably use these two functions. +# -- not official API but folk probably use these two functions. def _format_final_exc_line(etype, value): valuestr = _some_str(value) @@ -418,13 +418,13 @@ - :attr:`stack` A `StackSummary` representing the traceback. - :attr:`exc_type` The class of the original traceback. - :attr:`filename` For syntax errors - the filename where the error - occured. + occurred. - :attr:`lineno` For syntax errors - the linenumber where the error - occured. + occurred. - :attr:`text` For syntax errors - the text where the error - occured. + occurred. - :attr:`offset` For syntax errors - the offset into the text where the - error occured. + error occurred. - :attr:`msg` For syntax errors - the compiler error message. """ diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py @@ -387,7 +387,7 @@ if tests is not None: yield tests if not should_recurse: - # Either an error occured, or load_tests was used by the + # Either an error occurred, or load_tests was used by the # package. return # Handle the contents. diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py --- a/Lib/unittest/result.py +++ b/Lib/unittest/result.py @@ -148,7 +148,7 @@ self.skipped.append((test, reason)) def addExpectedFailure(self, test, err): - """Called when an expected failure/error occured.""" + """Called when an expected failure/error occurred.""" self.expectedFailures.append( (test, self._exc_info_to_string(err, test))) diff --git a/Lib/wsgiref/headers.py b/Lib/wsgiref/headers.py --- a/Lib/wsgiref/headers.py +++ b/Lib/wsgiref/headers.py @@ -69,7 +69,7 @@ Return None if the header is missing instead of raising an exception. Note that if the header appeared multiple times, the first exactly which - occurrance gets returned is undefined. Use getall() to get all + occurrence gets returned is undefined. Use getall() to get all the values matching a header field name. """ return self.get(name) diff --git a/Mac/README b/Mac/README --- a/Mac/README +++ b/Mac/README @@ -56,7 +56,7 @@ See the section _`Building and using a universal binary of Python on Mac OS X` for more information. -* ``--with-univeral-archs=VALUE`` +* ``--with-universal-archs=VALUE`` Specify the kind of universal binary that should be created. This option is only valid when ``--enable-universalsdk`` is specified. The default is diff --git a/Makefile.pre.in b/Makefile.pre.in --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1452,7 +1452,7 @@ # the Makefile in Mac # # -# This target is here for backward compatiblity, previous versions of Python +# This target is here for backward compatibility, previous versions of Python # hadn't integrated framework installation in the normal install process. frameworkinstall: install diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -26799,7 +26799,7 @@ python parser. Corresponding standard library modules token and symbol defines the numeric values of tokens and non-terminal symbols. -* The posix module has aquired new functions setuid(), setgid(), +* The posix module has acquired new functions setuid(), setgid(), execve(), and exec() has been renamed to execv(). * The array module is extended with 8-byte object swaps, the 'i' @@ -26813,7 +26813,7 @@ * For select.select(), a timeout (4th) argument of None means the same as leaving the timeout argument out. -* Module strop (and hence standard library module string) has aquired +* Module strop (and hence standard library module string) has acquired a new function: rindex(). Thanks to Amrit Prem! * Module regex defines a new function symcomp() which uses an extended @@ -27959,7 +27959,7 @@ to give more useful results for negative operands - Changed/added range checks for long/plain integer shifts - Options found after "-c command" are now passed to the command in sys.argv - (note subtle incompatiblity with "python -c command -- -options"!) + (note subtle incompatibility with "python -c command -- -options"!) - Module stdwin is better protected against touching objects after they've been closed; menus can now also be closed explicitly - Stdwin now uses its own exception (stdwin.error) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -2105,7 +2105,7 @@ - Issue #23704: collections.deque() objects now support methods for index(), insert(), and copy(). This allows deques to be registered as a - MutableSequence and it improves their substitutablity for lists. + MutableSequence and it improves their substitutability for lists. - Issue #23715: :func:`signal.sigwaitinfo` and :func:`signal.sigtimedwait` are now retried when interrupted by a signal not in the *sigset* parameter, if @@ -7342,7 +7342,7 @@ internal XML encoding is not UTF-8 or US-ASCII. It also now accepts bytes and strings larger than 2 GiB. -- Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple +- Issue #6083: Fix multiple segmentation faults occurred when PyArg_ParseTuple parses nested mutating sequence. - Issue #5289: Fix ctypes.util.find_library on Solaris. diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -219,7 +219,7 @@ return _days_in_month[month]; } -/* year, month -> number of days in year preceeding first day of month */ +/* year, month -> number of days in year preceding first day of month */ static int days_before_month(int year, int month) { diff --git a/Modules/_pickle.c b/Modules/_pickle.c --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6520,7 +6520,7 @@ other custom object that meets this interface. Optional keyword arguments are *fix_imports*, *encoding* and *errors*, -which are used to control compatiblity support for pickle stream +which are used to control compatibility support for pickle stream generated by Python 2. If *fix_imports* is True, pickle will try to map the old Python 2 names to the new names used in Python 3. The *encoding* and *errors* tell pickle how to decode 8-bit string @@ -6533,7 +6533,7 @@ _pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: output=e2c8ce748edc57b0 input=04ece661aa884837]*/ +/*[clinic end generated code: output=e2c8ce748edc57b0 input=f9b7da04f5f4f335]*/ { _Py_IDENTIFIER(persistent_load); @@ -7066,7 +7066,7 @@ other custom object that meets this interface. Optional keyword arguments are *fix_imports*, *encoding* and *errors*, -which are used to control compatiblity support for pickle stream +which are used to control compatibility support for pickle stream generated by Python 2. If *fix_imports* is True, pickle will try to map the old Python 2 names to the new names used in Python 3. The *encoding* and *errors* tell pickle how to decode 8-bit string @@ -7078,7 +7078,7 @@ static PyObject * _pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: output=798f1c57cb2b4eb1 input=2df7c7a1e6742204]*/ +/*[clinic end generated code: output=798f1c57cb2b4eb1 input=01b44dd3fc07afa7]*/ { PyObject *result; UnpicklerObject *unpickler = _Unpickler_New(); @@ -7120,7 +7120,7 @@ representation are ignored. Optional keyword arguments are *fix_imports*, *encoding* and *errors*, -which are used to control compatiblity support for pickle stream +which are used to control compatibility support for pickle stream generated by Python 2. If *fix_imports* is True, pickle will try to map the old Python 2 names to the new names used in Python 3. The *encoding* and *errors* tell pickle how to decode 8-bit string @@ -7132,7 +7132,7 @@ static PyObject * _pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports, const char *encoding, const char *errors) -/*[clinic end generated code: output=61e9cdb01e36a736 input=f57f0fdaa2b4cb8b]*/ +/*[clinic end generated code: output=61e9cdb01e36a736 input=70605948a719feb9]*/ { PyObject *result; UnpicklerObject *unpickler = _Unpickler_New(); diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -264,7 +264,7 @@ "other custom object that meets this interface.\n" "\n" "Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" -"which are used to control compatiblity support for pickle stream\n" +"which are used to control compatibility support for pickle stream\n" "generated by Python 2. If *fix_imports* is True, pickle will try to\n" "map the old Python 2 names to the new names used in Python 3. The\n" "*encoding* and *errors* tell pickle how to decode 8-bit string\n" @@ -466,7 +466,7 @@ "other custom object that meets this interface.\n" "\n" "Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" -"which are used to control compatiblity support for pickle stream\n" +"which are used to control compatibility support for pickle stream\n" "generated by Python 2. If *fix_imports* is True, pickle will try to\n" "map the old Python 2 names to the new names used in Python 3. The\n" "*encoding* and *errors* tell pickle how to decode 8-bit string\n" @@ -512,7 +512,7 @@ "representation are ignored.\n" "\n" "Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" -"which are used to control compatiblity support for pickle stream\n" +"which are used to control compatibility support for pickle stream\n" "generated by Python 2. If *fix_imports* is True, pickle will try to\n" "map the old Python 2 names to the new names used in Python 3. The\n" "*encoding* and *errors* tell pickle how to decode 8-bit string\n" @@ -545,4 +545,4 @@ exit: return return_value; } -/*[clinic end generated code: output=aecd61660d1cf31d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a7169d4fbbeef827 input=a9049054013a1b77]*/ diff --git a/Modules/sha256module.c b/Modules/sha256module.c --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -100,7 +100,7 @@ * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express - * gurantee it works. + * guarantee it works. * * Tom St Denis, tomstdenis at iahu.ca, http://libtom.org */ diff --git a/Modules/sha512module.c b/Modules/sha512module.c --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -111,7 +111,7 @@ * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express - * gurantee it works. + * guarantee it works. * * Tom St Denis, tomstdenis at iahu.ca, http://libtom.org */ diff --git a/Python/fileutils.c b/Python/fileutils.c --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -176,7 +176,7 @@ #endif error: - /* if an error occured, force the ASCII encoding */ + /* if an error occurred, force the ASCII encoding */ return 1; } diff --git a/Python/importlib.h b/Python/importlib.h --- a/Python/importlib.h +++ b/Python/importlib.h [stripped] diff --git a/Python/peephole.c b/Python/peephole.c --- a/Python/peephole.c +++ b/Python/peephole.c @@ -344,7 +344,7 @@ appear before MAKE_FUNCTION; in this case both opcodes are skipped. EXTENDED_ARG preceding any other opcode causes the optimizer to bail. - Optimizations are restricted to simple transformations occuring within a + Optimizations are restricted to simple transformations occurring within a single basic block. All transformations keep the code size the same or smaller. For those that reduce size, the gaps are initially filled with NOPs. Later those NOPs are removed and the jump addresses retargeted in diff --git a/Python/pythonrun.c b/Python/pythonrun.c --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1425,7 +1425,7 @@ #endif /* USE_STACKCHECK */ -/* Deprecated C API functions still provided for binary compatiblity */ +/* Deprecated C API functions still provided for binary compatibility */ #undef PyParser_SimpleParseFile PyAPI_FUNC(node *) diff --git a/configure b/configure --- a/configure +++ b/configure @@ -3496,7 +3496,7 @@ # # SGI compilers allow the specification of the both the ABI and the # ISA on the command line. Depending on the values of these switches, -# different and often incompatable code will be generated. +# different and often incompatible code will be generated. # # The SGI_ABI variable can be used to modify the CC and LDFLAGS and # thus supply support for various ABI/ISA combinations. The MACHDEP diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -542,7 +542,7 @@ # # SGI compilers allow the specification of the both the ABI and the # ISA on the command line. Depending on the values of these switches, -# different and often incompatable code will be generated. +# different and often incompatible code will be generated. # # The SGI_ABI variable can be used to modify the CC and LDFLAGS and # thus supply support for various ABI/ISA combinations. The MACHDEP -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 06:26:56 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 10:26:56 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2318383=3A_Merge_warnings_fix_from_3=2E5?= Message-ID: <20160526102655.127599.26993.14C5606D@psf.io> https://hg.python.org/cpython/rev/90bb91be6f3b changeset: 101504:90bb91be6f3b parent: 101501:d3d8faaaaade parent: 101503:f57f4e33ba5e user: Martin Panter date: Thu May 26 09:39:41 2016 +0000 summary: Issue #18383: Merge warnings fix from 3.5 files: Lib/test/test_warnings/__init__.py | 47 ++++++++++++++++++ Lib/warnings.py | 26 +++++---- Misc/NEWS | 3 + 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -267,6 +267,53 @@ self.module.warn_explicit(UserWarning("b"), None, "f.py", 42) self.assertEqual(str(w[-1].message), "b") + def test_filterwarnings_duplicate_filters(self): + with original_warnings.catch_warnings(module=self.module): + self.module.resetwarnings() + self.module.filterwarnings("error", category=UserWarning) + self.assertEqual(len(self.module.filters), 1) + self.module.filterwarnings("ignore", category=UserWarning) + self.module.filterwarnings("error", category=UserWarning) + self.assertEqual( + len(self.module.filters), 2, + "filterwarnings inserted duplicate filter" + ) + self.assertEqual( + self.module.filters[0][0], "error", + "filterwarnings did not promote filter to " + "the beginning of list" + ) + + def test_simplefilter_duplicate_filters(self): + with original_warnings.catch_warnings(module=self.module): + self.module.resetwarnings() + self.module.simplefilter("error", category=UserWarning) + self.assertEqual(len(self.module.filters), 1) + self.module.simplefilter("ignore", category=UserWarning) + self.module.simplefilter("error", category=UserWarning) + self.assertEqual( + len(self.module.filters), 2, + "simplefilter inserted duplicate filter" + ) + self.assertEqual( + self.module.filters[0][0], "error", + "simplefilter did not promote filter to the beginning of list" + ) + def test_append_duplicate(self): + with original_warnings.catch_warnings(module=self.module, + record=True) as w: + self.module.resetwarnings() + self.module.simplefilter("ignore") + self.module.simplefilter("error", append=True) + self.module.simplefilter("ignore", append=True) + self.module.warn("test_append_duplicate", category=UserWarning) + self.assertEqual(len(self.module.filters), 2, + "simplefilter inserted duplicate filter" + ) + self.assertEqual(len(w), 0, + "appended duplicate changed order of filters" + ) + class CFilterTests(FilterTests, unittest.TestCase): module = c_warnings diff --git a/Lib/warnings.py b/Lib/warnings.py --- a/Lib/warnings.py +++ b/Lib/warnings.py @@ -129,13 +129,8 @@ assert isinstance(module, str), "module must be a string" assert isinstance(lineno, int) and lineno >= 0, \ "lineno must be an int >= 0" - item = (action, re.compile(message, re.I), category, - re.compile(module), lineno) - if append: - filters.append(item) - else: - filters.insert(0, item) - _filters_mutated() + _add_filter(action, re.compile(message, re.I), category, + re.compile(module), lineno, append=append) def simplefilter(action, category=Warning, lineno=0, append=False): """Insert a simple entry into the list of warnings filters (at the front). @@ -151,11 +146,20 @@ "once"), "invalid action: %r" % (action,) assert isinstance(lineno, int) and lineno >= 0, \ "lineno must be an int >= 0" - item = (action, None, category, None, lineno) - if append: - filters.append(item) + _add_filter(action, None, category, None, lineno, append=append) + +def _add_filter(*item, append): + # Remove possible duplicate filters, so new one will be placed + # in correct place. If append=True and duplicate exists, do nothing. + if not append: + try: + filters.remove(item) + except ValueError: + pass + filters.insert(0, item) else: - filters.insert(0, item) + if item not in filters: + filters.append(item) _filters_mutated() def resetwarnings(): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -22,6 +22,9 @@ Library ------- +- Issue #18383: Avoid creating duplicate filters when using filterwarnings + and simplefilter. Based on patch by Alex Shkop. + - Issue #23026: winreg.QueryValueEx() now return an integer for REG_QWORD type. - Issue #26741: subprocess.Popen destructor now emits a ResourceWarning warning -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 06:26:56 2016 From: python-checkins at python.org (martin.panter) Date: Thu, 26 May 2016 10:26:56 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzE4Mzgz?= =?utf-8?q?=3A_Avoid_adding_duplicate_filters_when_warnings_is_reloaded?= Message-ID: <20160526102654.121314.34077.1F414F6F@psf.io> https://hg.python.org/cpython/rev/f57f4e33ba5e changeset: 101503:f57f4e33ba5e branch: 3.5 parent: 101499:a3a64b85883f user: Martin Panter date: Thu May 26 09:10:55 2016 +0000 summary: Issue #18383: Avoid adding duplicate filters when warnings is reloaded Based on patch by Alex Shkop. files: Lib/test/test_warnings/__init__.py | 47 ++++++++++++++++++ Lib/warnings.py | 26 +++++---- Misc/NEWS | 3 + 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -265,6 +265,53 @@ self.module.warn_explicit(UserWarning("b"), None, "f.py", 42) self.assertEqual(str(w[-1].message), "b") + def test_filterwarnings_duplicate_filters(self): + with original_warnings.catch_warnings(module=self.module): + self.module.resetwarnings() + self.module.filterwarnings("error", category=UserWarning) + self.assertEqual(len(self.module.filters), 1) + self.module.filterwarnings("ignore", category=UserWarning) + self.module.filterwarnings("error", category=UserWarning) + self.assertEqual( + len(self.module.filters), 2, + "filterwarnings inserted duplicate filter" + ) + self.assertEqual( + self.module.filters[0][0], "error", + "filterwarnings did not promote filter to " + "the beginning of list" + ) + + def test_simplefilter_duplicate_filters(self): + with original_warnings.catch_warnings(module=self.module): + self.module.resetwarnings() + self.module.simplefilter("error", category=UserWarning) + self.assertEqual(len(self.module.filters), 1) + self.module.simplefilter("ignore", category=UserWarning) + self.module.simplefilter("error", category=UserWarning) + self.assertEqual( + len(self.module.filters), 2, + "simplefilter inserted duplicate filter" + ) + self.assertEqual( + self.module.filters[0][0], "error", + "simplefilter did not promote filter to the beginning of list" + ) + def test_append_duplicate(self): + with original_warnings.catch_warnings(module=self.module, + record=True) as w: + self.module.resetwarnings() + self.module.simplefilter("ignore") + self.module.simplefilter("error", append=True) + self.module.simplefilter("ignore", append=True) + self.module.warn("test_append_duplicate", category=UserWarning) + self.assertEqual(len(self.module.filters), 2, + "simplefilter inserted duplicate filter" + ) + self.assertEqual(len(w), 0, + "appended duplicate changed order of filters" + ) + class CFilterTests(FilterTests, unittest.TestCase): module = c_warnings diff --git a/Lib/warnings.py b/Lib/warnings.py --- a/Lib/warnings.py +++ b/Lib/warnings.py @@ -56,13 +56,8 @@ assert isinstance(module, str), "module must be a string" assert isinstance(lineno, int) and lineno >= 0, \ "lineno must be an int >= 0" - item = (action, re.compile(message, re.I), category, - re.compile(module), lineno) - if append: - filters.append(item) - else: - filters.insert(0, item) - _filters_mutated() + _add_filter(action, re.compile(message, re.I), category, + re.compile(module), lineno, append=append) def simplefilter(action, category=Warning, lineno=0, append=False): """Insert a simple entry into the list of warnings filters (at the front). @@ -78,11 +73,20 @@ "once"), "invalid action: %r" % (action,) assert isinstance(lineno, int) and lineno >= 0, \ "lineno must be an int >= 0" - item = (action, None, category, None, lineno) - if append: - filters.append(item) + _add_filter(action, None, category, None, lineno, append=append) + +def _add_filter(*item, append): + # Remove possible duplicate filters, so new one will be placed + # in correct place. If append=True and duplicate exists, do nothing. + if not append: + try: + filters.remove(item) + except ValueError: + pass + filters.insert(0, item) else: - filters.insert(0, item) + if item not in filters: + filters.append(item) _filters_mutated() def resetwarnings(): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -126,6 +126,9 @@ Library ------- +- Issue #18383: Avoid creating duplicate filters when using filterwarnings + and simplefilter. Based on patch by Alex Shkop. + - Issue #27057: Fix os.set_inheritable() on Android, ioctl() is blocked by SELinux and fails with EACCESS. The function now falls back to fcntl(). Patch written by Micha? Bednarski. -- Repository URL: https://hg.python.org/cpython From lp_benchmark_robot at intel.com Thu May 26 08:29:59 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Thu, 26 May 2016 13:29:59 +0100 Subject: [Python-checkins] UGLY Benchmark Results for Python Default 2016-05-26 Message-ID: Results for project Python default, build date 2016-05-26 02:01:57 +0000 commit: ed4eec682199 previous commit: b730baee0877 revision date: 2016-05-25 18:26:07 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.28% 2.34% 9.99% 17.57% :-( pybench 0.44% -3.79% 1.58% 8.29% :-( regex_v8 2.74% -0.68% -2.26% 4.41% :-( nbody 0.11% -4.11% 0.13% 11.52% :-| json_dump_v2 0.29% -1.39% 0.64% 10.84% :-| normal_startup 0.89% -0.49% -0.61% 6.23% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/ugly-benchmark-results-for-python-default-2016-05-26/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Thu May 26 08:30:34 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Thu, 26 May 2016 13:30:34 +0100 Subject: [Python-checkins] BAD Benchmark Results for Python 2.7 2016-05-26 Message-ID: <898ffd80-a45c-48cd-aeca-88df616f7854@irsmsx105.ger.corp.intel.com> No new revisions. Here are the previous results: Results for project Python 2.7, build date 2016-05-26 02:45:35 +0000 commit: f0438e1a4761 previous commit: a873265366ba revision date: 2016-05-24 05:47:50 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.15% -1.65% 2.73% 8.16% :-) pybench 0.20% -0.06% 6.00% 4.35% :-( regex_v8 0.64% -0.05% -2.27% 10.55% :-) nbody 0.13% 0.08% 9.35% 1.61% :-| json_dump_v2 0.53% 0.72% 1.91% 11.13% :-( normal_startup 1.81% -0.84% -5.40% 1.85% :-) ssbench 0.13% 0.09% 2.39% 1.71% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/bad-benchmark-results-for-python-2-7-2016-05-26/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Thu May 26 09:22:29 2016 From: python-checkins at python.org (victor.stinner) Date: Thu, 26 May 2016 13:22:29 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogdGVzdF93YXJuaW5n?= =?utf-8?q?s=3A_catch_stderr_and_check_warning?= Message-ID: <20160526132227.30326.16763.E4B4ACE7@psf.io> https://hg.python.org/cpython/rev/371fe8b36f4a changeset: 101505:371fe8b36f4a branch: 3.5 parent: 101503:f57f4e33ba5e user: Victor Stinner date: Thu May 26 15:21:25 2016 +0200 summary: test_warnings: catch stderr and check warning Check the user warning in test_error_after_default() to not pollute the output, and check the warning logged into stderr. files: Lib/test/test_warnings/__init__.py | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -104,7 +104,15 @@ message = "FilterTests.test_ignore_after_default" def f(): self.module.warn(message, UserWarning) - f() + + with support.captured_stderr() as stderr: + f() + stderr = stderr.getvalue() + self.assertIn("UserWarning: FilterTests.test_ignore_after_default", + stderr) + self.assertIn("self.module.warn(message, UserWarning)", + stderr) + self.module.filterwarnings("error", category=UserWarning) self.assertRaises(UserWarning, f) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 09:22:38 2016 From: python-checkins at python.org (victor.stinner) Date: Thu, 26 May 2016 13:22:38 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Merge_3=2E5_=28test=5Fwarnings=29?= Message-ID: <20160526132234.24024.64488.09021217@psf.io> https://hg.python.org/cpython/rev/a0db0c573c94 changeset: 101506:a0db0c573c94 parent: 101504:90bb91be6f3b parent: 101505:371fe8b36f4a user: Victor Stinner date: Thu May 26 15:22:14 2016 +0200 summary: Merge 3.5 (test_warnings) files: Lib/test/test_warnings/__init__.py | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -106,7 +106,15 @@ message = "FilterTests.test_ignore_after_default" def f(): self.module.warn(message, UserWarning) - f() + + with support.captured_stderr() as stderr: + f() + stderr = stderr.getvalue() + self.assertIn("UserWarning: FilterTests.test_ignore_after_default", + stderr) + self.assertIn("self.module.warn(message, UserWarning)", + stderr) + self.module.filterwarnings("error", category=UserWarning) self.assertRaises(UserWarning, f) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 12:21:22 2016 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 26 May 2016 16:21:22 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Add_annotation_to_async_def_e?= =?utf-8?q?xample=2E?= Message-ID: <20160526162055.13623.82036.55232CEC@psf.io> https://hg.python.org/peps/rev/5dc974539542 changeset: 6342:5dc974539542 user: Guido van Rossum date: Thu May 26 09:20:48 2016 -0700 summary: Add annotation to async def example. files: pep-0484.txt | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pep-0484.txt b/pep-0484.txt --- a/pep-0484.txt +++ b/pep-0484.txt @@ -1035,8 +1035,8 @@ async def spam(ignored: int) -> str: return 'spam' - async def foo(): - bar = await spam(42) # type: str + async def foo() -> None: + bar = await spam(42) # type: str The ``typing.py`` module also provides generic ABCs ``Awaitable``, ``AsyncIterable``, and ``AsyncIterator`` for situations where more precise -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Thu May 26 14:37:42 2016 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 26 May 2016 18:37:42 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Comment/docstr?= =?utf-8?q?ing_tweaks_for_typing=2Epy=2E?= Message-ID: <20160526165657.17436.4843.B2A65DB3@psf.io> https://hg.python.org/cpython/rev/da0c848b9bae changeset: 101507:da0c848b9bae branch: 3.5 parent: 101505:371fe8b36f4a user: Guido van Rossum date: Thu May 26 09:56:19 2016 -0700 summary: Comment/docstring tweaks for typing.py. files: Lib/typing.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/Lib/typing.py b/Lib/typing.py --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1579,8 +1579,9 @@ CT = TypeVar('CT', covariant=True, bound=type) +# This is not a real generic class. Don't use outside annotations. class Type(type, Generic[CT], extra=type): - """A generic type usable to annotate class objects. + """A special construct usable to annotate class objects. For example, suppose we have the following classes:: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 14:37:42 2016 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 26 May 2016 18:37:42 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Comment/docstring_tweaks_for_typing=2Epy=2E_=28Merge_3?= =?utf-8?b?LjUtPjMuNik=?= Message-ID: <20160526165657.17432.4949.987D7823@psf.io> https://hg.python.org/cpython/rev/20d515982b43 changeset: 101508:20d515982b43 parent: 101506:a0db0c573c94 parent: 101507:da0c848b9bae user: Guido van Rossum date: Thu May 26 09:56:46 2016 -0700 summary: Comment/docstring tweaks for typing.py. (Merge 3.5->3.6) files: Lib/typing.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/Lib/typing.py b/Lib/typing.py --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1579,8 +1579,9 @@ CT = TypeVar('CT', covariant=True, bound=type) +# This is not a real generic class. Don't use outside annotations. class Type(type, Generic[CT], extra=type): - """A generic type usable to annotate class objects. + """A special construct usable to annotate class objects. For example, suppose we have the following classes:: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 15:20:13 2016 From: python-checkins at python.org (steve.dower) Date: Thu, 26 May 2016 19:20:13 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327114=3A_Fix_SSLContext=2E=5Fload=5Fwindows=5Fs?= =?utf-8?q?tore=5Fcerts_fails_with?= Message-ID: <20160526192006.17446.46256.5003DEA8@psf.io> https://hg.python.org/cpython/rev/eaee5aed6fbc changeset: 101511:eaee5aed6fbc parent: 101508:20d515982b43 parent: 101510:29f163db229e user: Steve Dower date: Thu May 26 12:19:42 2016 -0700 summary: Issue #27114: Fix SSLContext._load_windows_store_certs fails with PermissionError files: Lib/ssl.py | 14 +++++++++----- Misc/NEWS | 3 +++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Lib/ssl.py b/Lib/ssl.py --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -145,6 +145,7 @@ from socket import SOL_SOCKET, SO_TYPE import base64 # for DER-to-PEM translation import errno +import warnings socket_error = OSError # keep that public name in module namespace @@ -405,11 +406,14 @@ def _load_windows_store_certs(self, storename, purpose): certs = bytearray() - for cert, encoding, trust in enum_certificates(storename): - # CA certs are never PKCS#7 encoded - if encoding == "x509_asn": - if trust is True or purpose.oid in trust: - certs.extend(cert) + try: + for cert, encoding, trust in enum_certificates(storename): + # CA certs are never PKCS#7 encoded + if encoding == "x509_asn": + if trust is True or purpose.oid in trust: + certs.extend(cert) + except PermissionError: + warnings.warn("unable to enumerate Windows certificate store") if certs: self.load_verify_locations(cadata=certs) return certs diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -22,6 +22,9 @@ Library ------- +- Issue #27114: Fix SSLContext._load_windows_store_certs fails with + PermissionError + - Issue #18383: Avoid creating duplicate filters when using filterwarnings and simplefilter. Based on patch by Alex Shkop. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 15:20:13 2016 From: python-checkins at python.org (steve.dower) Date: Thu, 26 May 2016 19:20:13 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MTE0?= =?utf-8?q?=3A_Fix_SSLContext=2E=5Fload=5Fwindows=5Fstore=5Fcerts_fails_wi?= =?utf-8?q?th?= Message-ID: <20160526192006.16136.51581.8EF7B7FF@psf.io> https://hg.python.org/cpython/rev/29f163db229e changeset: 101510:29f163db229e branch: 3.5 parent: 101507:da0c848b9bae user: Steve Dower date: Thu May 26 12:18:12 2016 -0700 summary: Issue #27114: Fix SSLContext._load_windows_store_certs fails with PermissionError files: Lib/ssl.py | 14 +++++++++----- Misc/NEWS | 3 +++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Lib/ssl.py b/Lib/ssl.py --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -145,6 +145,7 @@ from socket import SOL_SOCKET, SO_TYPE import base64 # for DER-to-PEM translation import errno +import warnings socket_error = OSError # keep that public name in module namespace @@ -405,11 +406,14 @@ def _load_windows_store_certs(self, storename, purpose): certs = bytearray() - for cert, encoding, trust in enum_certificates(storename): - # CA certs are never PKCS#7 encoded - if encoding == "x509_asn": - if trust is True or purpose.oid in trust: - certs.extend(cert) + try: + for cert, encoding, trust in enum_certificates(storename): + # CA certs are never PKCS#7 encoded + if encoding == "x509_asn": + if trust is True or purpose.oid in trust: + certs.extend(cert) + except PermissionError: + warnings.warn("unable to enumerate Windows certificate store") if certs: self.load_verify_locations(cadata=certs) return certs diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -126,6 +126,9 @@ Library ------- +- Issue #27114: Fix SSLContext._load_windows_store_certs fails with + PermissionError + - Issue #18383: Avoid creating duplicate filters when using filterwarnings and simplefilter. Based on patch by Alex Shkop. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Thu May 26 15:20:14 2016 From: python-checkins at python.org (steve.dower) Date: Thu, 26 May 2016 19:20:14 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI3MTE0?= =?utf-8?q?=3A_Fix_SSLContext=2E=5Fload=5Fwindows=5Fstore=5Fcerts_fails_wi?= =?utf-8?q?th?= Message-ID: <20160526191813.647.13329.DF5A0090@psf.io> https://hg.python.org/cpython/rev/40f3f2b27112 changeset: 101509:40f3f2b27112 branch: 2.7 parent: 101502:1e80e53ce20d user: Steve Dower date: Thu May 26 12:17:21 2016 -0700 summary: Issue #27114: Fix SSLContext._load_windows_store_certs fails with PermissionError files: Lib/ssl.py | 14 +++++++++----- Misc/NEWS | 3 +++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Lib/ssl.py b/Lib/ssl.py --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -141,6 +141,7 @@ from socket import SOL_SOCKET, SO_TYPE import base64 # for DER-to-PEM translation import errno +import warnings if _ssl.HAS_TLS_UNIQUE: CHANNEL_BINDING_TYPES = ['tls-unique'] @@ -375,11 +376,14 @@ def _load_windows_store_certs(self, storename, purpose): certs = bytearray() - for cert, encoding, trust in enum_certificates(storename): - # CA certs are never PKCS#7 encoded - if encoding == "x509_asn": - if trust is True or purpose.oid in trust: - certs.extend(cert) + try: + for cert, encoding, trust in enum_certificates(storename): + # CA certs are never PKCS#7 encoded + if encoding == "x509_asn": + if trust is True or purpose.oid in trust: + certs.extend(cert) + except OSError: + warnings.warn("unable to enumerate Windows certificate store") if certs: self.load_verify_locations(cadata=certs) return certs diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -83,6 +83,9 @@ Library ------- +- Issue #27114: Fix SSLContext._load_windows_store_certs fails with + PermissionError + - Issue #14132: Fix urllib.request redirect handling when the target only has a query string. Fix by J?n Janech. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 01:51:52 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 05:51:52 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogbWVyZ2UgMy41?= Message-ID: <20160527055152.13751.58313.A7CBFE3D@psf.io> https://hg.python.org/cpython/rev/09d6232e4705 changeset: 101514:09d6232e4705 parent: 101511:eaee5aed6fbc parent: 101512:bb007a5a7291 user: Benjamin Peterson date: Thu May 26 22:51:44 2016 -0700 summary: merge 3.5 files: Doc/faq/programming.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1201,7 +1201,7 @@ w, h = 2, 3 A = [[None] * w for i in range(h)] -Or, you can use an extension that provides a matrix datatype; `Numeric Python +Or, you can use an extension that provides a matrix datatype; `NumPy `_ is the best known. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 01:51:57 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 05:51:57 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogIk51bWVyaWMgUHl0?= =?utf-8?b?aG9uIiAtPiAiTnVtUHki?= Message-ID: <20160527055152.121218.46703.477F5AF1@psf.io> https://hg.python.org/cpython/rev/2eb8bf8b1f78 changeset: 101513:2eb8bf8b1f78 branch: 2.7 parent: 101509:40f3f2b27112 user: Benjamin Peterson date: Thu May 26 22:51:32 2016 -0700 summary: "Numeric Python" -> "NumPy" files: Doc/faq/programming.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1317,7 +1317,7 @@ w, h = 2, 3 A = [[None] * w for i in range(h)] -Or, you can use an extension that provides a matrix datatype; `Numeric Python +Or, you can use an extension that provides a matrix datatype; `NumPy `_ is the best known. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 01:51:57 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 05:51:57 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogIk51bWVyaWMgUHl0?= =?utf-8?b?aG9uIiAtPiAiTnVtUHki?= Message-ID: <20160527055151.9148.33665.FABD226B@psf.io> https://hg.python.org/cpython/rev/bb007a5a7291 changeset: 101512:bb007a5a7291 branch: 3.5 parent: 101510:29f163db229e user: Benjamin Peterson date: Thu May 26 22:51:32 2016 -0700 summary: "Numeric Python" -> "NumPy" files: Doc/faq/programming.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1200,7 +1200,7 @@ w, h = 2, 3 A = [[None] * w for i in range(h)] -Or, you can use an extension that provides a matrix datatype; `Numeric Python +Or, you can use an extension that provides a matrix datatype; `NumPy `_ is the best known. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 01:56:59 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 05:56:59 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_remove_cruft_f?= =?utf-8?q?rom_Schwarzian_transform_section?= Message-ID: <20160527055659.13746.24202.E0686289@psf.io> https://hg.python.org/cpython/rev/aafd73775bc5 changeset: 101516:aafd73775bc5 branch: 2.7 parent: 101513:2eb8bf8b1f78 user: Benjamin Peterson date: Thu May 26 22:55:49 2016 -0700 summary: remove cruft from Schwarzian transform section files: Doc/faq/programming.rst | 31 +---------------------------- 1 files changed, 1 insertions(+), 30 deletions(-) diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1460,40 +1460,11 @@ The technique, attributed to Randal Schwartz of the Perl community, sorts the elements of a list by a metric which maps each element to its "sort value". In -Python, just use the ``key`` argument for the ``sort()`` method:: +Python, use the ``key`` argument for the :func:`sort()` function:: Isorted = L[:] Isorted.sort(key=lambda s: int(s[10:15])) -The ``key`` argument is new in Python 2.4, for older versions this kind of -sorting is quite simple to do with list comprehensions. To sort a list of -strings by their uppercase values:: - - tmp1 = [(x.upper(), x) for x in L] # Schwartzian transform - tmp1.sort() - Usorted = [x[1] for x in tmp1] - -To sort by the integer value of a subfield extending from positions 10-15 in -each string:: - - tmp2 = [(int(s[10:15]), s) for s in L] # Schwartzian transform - tmp2.sort() - Isorted = [x[1] for x in tmp2] - -Note that Isorted may also be computed by :: - - def intfield(s): - return int(s[10:15]) - - def Icmp(s1, s2): - return cmp(intfield(s1), intfield(s2)) - - Isorted = L[:] - Isorted.sort(Icmp) - -but since this method calls ``intfield()`` many times for each element of L, it -is slower than the Schwartzian Transform. - How can I sort one list by values from another list? ---------------------------------------------------- -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 01:57:07 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 05:57:07 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogbWVyZ2UgMy41?= Message-ID: <20160527055659.122365.1001.4587F6B3@psf.io> https://hg.python.org/cpython/rev/d63632b00b6e changeset: 101517:d63632b00b6e parent: 101514:09d6232e4705 parent: 101515:f4c5f63801c3 user: Benjamin Peterson date: Thu May 26 22:56:51 2016 -0700 summary: merge 3.5 files: Doc/faq/programming.rst | 31 +---------------------------- 1 files changed, 1 insertions(+), 30 deletions(-) diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1313,40 +1313,11 @@ The technique, attributed to Randal Schwartz of the Perl community, sorts the elements of a list by a metric which maps each element to its "sort value". In -Python, just use the ``key`` argument for the ``sort()`` method:: +Python, use the ``key`` argument for the :func:`sort()` function:: Isorted = L[:] Isorted.sort(key=lambda s: int(s[10:15])) -The ``key`` argument is new in Python 2.4, for older versions this kind of -sorting is quite simple to do with list comprehensions. To sort a list of -strings by their uppercase values:: - - tmp1 = [(x.upper(), x) for x in L] # Schwartzian transform - tmp1.sort() - Usorted = [x[1] for x in tmp1] - -To sort by the integer value of a subfield extending from positions 10-15 in -each string:: - - tmp2 = [(int(s[10:15]), s) for s in L] # Schwartzian transform - tmp2.sort() - Isorted = [x[1] for x in tmp2] - -For versions prior to 3.0, Isorted may also be computed by :: - - def intfield(s): - return int(s[10:15]) - - def Icmp(s1, s2): - return cmp(intfield(s1), intfield(s2)) - - Isorted = L[:] - Isorted.sort(Icmp) - -but since this method calls ``intfield()`` many times for each element of L, it -is slower than the Schwartzian Transform. - How can I sort one list by values from another list? ---------------------------------------------------- -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 01:57:07 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 05:57:07 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_remove_cruft_f?= =?utf-8?q?rom_Schwarzian_transform_section?= Message-ID: <20160527055658.9150.56769.28222CCF@psf.io> https://hg.python.org/cpython/rev/f4c5f63801c3 changeset: 101515:f4c5f63801c3 branch: 3.5 parent: 101512:bb007a5a7291 user: Benjamin Peterson date: Thu May 26 22:55:49 2016 -0700 summary: remove cruft from Schwarzian transform section files: Doc/faq/programming.rst | 31 +---------------------------- 1 files changed, 1 insertions(+), 30 deletions(-) diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1312,40 +1312,11 @@ The technique, attributed to Randal Schwartz of the Perl community, sorts the elements of a list by a metric which maps each element to its "sort value". In -Python, just use the ``key`` argument for the ``sort()`` method:: +Python, use the ``key`` argument for the :func:`sort()` function:: Isorted = L[:] Isorted.sort(key=lambda s: int(s[10:15])) -The ``key`` argument is new in Python 2.4, for older versions this kind of -sorting is quite simple to do with list comprehensions. To sort a list of -strings by their uppercase values:: - - tmp1 = [(x.upper(), x) for x in L] # Schwartzian transform - tmp1.sort() - Usorted = [x[1] for x in tmp1] - -To sort by the integer value of a subfield extending from positions 10-15 in -each string:: - - tmp2 = [(int(s[10:15]), s) for s in L] # Schwartzian transform - tmp2.sort() - Isorted = [x[1] for x in tmp2] - -For versions prior to 3.0, Isorted may also be computed by :: - - def intfield(s): - return int(s[10:15]) - - def Icmp(s1, s2): - return cmp(intfield(s1), intfield(s2)) - - Isorted = L[:] - Isorted.sort(Icmp) - -but since this method calls ``intfield()`` many times for each element of L, it -is slower than the Schwartzian Transform. - How can I sort one list by values from another list? ---------------------------------------------------- -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 02:19:10 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 06:19:10 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_stop_talking_a?= =?utf-8?q?bout_svn?= Message-ID: <20160527061910.32583.80824.D9ED6D89@psf.io> https://hg.python.org/cpython/rev/2399affebe37 changeset: 101519:2399affebe37 branch: 2.7 parent: 101516:aafd73775bc5 user: Benjamin Peterson date: Thu May 26 23:18:51 2016 -0700 summary: stop talking about svn files: Doc/faq/general.rst | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -146,10 +146,9 @@ 2.0cN, and *those* precede 2.0. You may also find version numbers with a "+" suffix, e.g. "2.2+". These are -unreleased versions, built directly from the Subversion trunk. In practice, -after a final minor release is made, the Subversion trunk is incremented to the -next minor version, which becomes the "a0" version, -e.g. "2.4a0". +unreleased versions, built directly from the CPython development repository. In +practice, after a final minor release is made, the version is incremented to the +next minor version, which becomes the "a0" version, e.g. "2.4a0". See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, and :data:`sys.version_info`. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 02:19:10 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 06:19:10 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_stop_talking_a?= =?utf-8?q?bout_svn?= Message-ID: <20160527061910.32425.4697.D62C54AA@psf.io> https://hg.python.org/cpython/rev/26362d042087 changeset: 101518:26362d042087 branch: 3.5 parent: 101515:f4c5f63801c3 user: Benjamin Peterson date: Thu May 26 23:18:51 2016 -0700 summary: stop talking about svn files: Doc/faq/general.rst | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -146,10 +146,9 @@ 2.0cN, and *those* precede 2.0. You may also find version numbers with a "+" suffix, e.g. "2.2+". These are -unreleased versions, built directly from the Subversion trunk. In practice, -after a final minor release is made, the Subversion trunk is incremented to the -next minor version, which becomes the "a0" version, -e.g. "2.4a0". +unreleased versions, built directly from the CPython development repository. In +practice, after a final minor release is made, the version is incremented to the +next minor version, which becomes the "a0" version, e.g. "2.4a0". See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, and :data:`sys.version_info`. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 02:20:38 2016 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 27 May 2016 06:20:38 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogbWVyZ2UgMy41?= Message-ID: <20160527061910.121387.97634.2A0CB2DF@psf.io> https://hg.python.org/cpython/rev/5789cee8811c changeset: 101520:5789cee8811c parent: 101517:d63632b00b6e parent: 101518:26362d042087 user: Benjamin Peterson date: Thu May 26 23:19:02 2016 -0700 summary: merge 3.5 files: Doc/faq/general.rst | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst --- a/Doc/faq/general.rst +++ b/Doc/faq/general.rst @@ -146,10 +146,9 @@ 2.0cN, and *those* precede 2.0. You may also find version numbers with a "+" suffix, e.g. "2.2+". These are -unreleased versions, built directly from the Subversion trunk. In practice, -after a final minor release is made, the Subversion trunk is incremented to the -next minor version, which becomes the "a0" version, -e.g. "2.4a0". +unreleased versions, built directly from the CPython development repository. In +practice, after a final minor release is made, the version is incremented to the +next minor version, which becomes the "a0" version, e.g. "2.4a0". See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, and :data:`sys.version_info`. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 04:45:54 2016 From: python-checkins at python.org (martin.panter) Date: Fri, 27 May 2016 08:45:54 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzU3ODQ6?= =?utf-8?q?_Expand_documentation_and_tests_for_zlib_wbits_parameter?= Message-ID: <20160527084553.10324.74684.C6962848@psf.io> https://hg.python.org/cpython/rev/e5fc74588cea changeset: 101523:e5fc74588cea branch: 2.7 parent: 101519:2399affebe37 user: Martin Panter date: Fri May 27 07:32:11 2016 +0000 summary: Issue #5784: Expand documentation and tests for zlib wbits parameter Based on documentation by AM Kuchling. files: Doc/library/zlib.rst | 66 +++++++++++++++++++++++------- Lib/test/test_zlib.py | 43 ++++++++++++++++++++ Modules/zlibmodule.c | 8 +- 3 files changed, 98 insertions(+), 19 deletions(-) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -81,9 +81,23 @@ *method* is the compression algorithm. Currently, the only supported value is ``DEFLATED``. - *wbits* is the base two logarithm of the size of the window buffer. This - should be an integer from ``8`` to ``15``. Higher values give better - compression, but use more memory. The default is 15. + The *wbits* argument controls the size of the history buffer (or the + "window size") used when compressing data, and whether a header and + trailer is included in the output. It can take several ranges of values. + The default is 15. + + * +9 to +15: The base-two logarithm of the window size, which + therefore ranges between 512 and 32768. Larger values produce + better compression at the expense of greater memory usage. The + resulting output will include a zlib-specific header and trailer. + + * ?9 to ?15: Uses the absolute value of *wbits* as the + window size logarithm, while producing a raw output stream with no + header or trailing checksum. + + * +25 to +31 = 16 + (9 to 15): Uses the low 4 bits of the value as the + window size logarithm, while including a basic :program:`gzip` header + and trailing checksum in the output. *memlevel* controls the amount of memory used for internal compression state. Valid values range from ``1`` to ``9``. Higher values using more memory, @@ -130,20 +144,39 @@ .. function:: decompress(string[, wbits[, bufsize]]) Decompresses the data in *string*, returning a string containing the - uncompressed data. The *wbits* parameter controls the size of the window - buffer, and is discussed further below. + uncompressed data. The *wbits* parameter depends on + the format of *string*, and is discussed further below. If *bufsize* is given, it is used as the initial size of the output buffer. Raises the :exc:`error` exception if any error occurs. - The absolute value of *wbits* is the base two logarithm of the size of the - history buffer (the "window size") used when compressing data. Its absolute - value should be between 8 and 15 for the most recent versions of the zlib - library, larger values resulting in better compression at the expense of greater - memory usage. When decompressing a stream, *wbits* must not be smaller + .. _decompress-wbits: + + The *wbits* parameter controls the size of the history buffer + (or "window size"), and what header and trailer format is expected. + It is similar to the parameter for :func:`compressobj`, but accepts + more ranges of values: + + * +8 to +15: The base-two logarithm of the window size. The input + must include a zlib header and trailer. + + * 0: Automatically determine the window size from the zlib header. + + * ?8 to ?15: Uses the absolute value of *wbits* as the window size + logarithm. The input must be a raw stream with no header or trailer. + + * +24 to +31 = 16 + (8 to 15): Uses the low 4 bits of the value as + the window size logarithm. The input must include a gzip header and + trailer. + + * +40 to +47 = 32 + (8 to 15): Uses the low 4 bits of the value as + the window size logarithm, and automatically accepts either + the zlib or gzip format. + + When decompressing a stream, the window size must not be smaller than the size originally used to compress the stream; using a too-small - value will result in an exception. The default value is therefore the - highest value, 15. When *wbits* is negative, the standard - :program:`gzip` header is suppressed. + value may result in an :exc:`error` exception. The default *wbits* value + is 15, which corresponds to the largest window size and requires a zlib + header and trailer to be included. *bufsize* is the initial size of the buffer used to hold decompressed data. If more space is required, the buffer size will be increased as needed, so you @@ -154,8 +187,11 @@ .. function:: decompressobj([wbits]) Returns a decompression object, to be used for decompressing data streams that - won't fit into memory at once. The *wbits* parameter controls the size of the - window buffer. + won't fit into memory at once. + + The *wbits* parameter controls the size of the history buffer (or the + "window size"), and what header and trailer format is expected. It has + the same meaning as `described for decompress() <#decompress-wbits>`__. Compression objects support the following methods: diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -527,6 +527,49 @@ decompress = lambda s: d.decompress(s) + d.flush() self.check_big_decompress_buffer(size, decompress) + def test_wbits(self): + co = zlib.compressobj(1, zlib.DEFLATED, 15) + zlib15 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(zlib15, 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib15, 0), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib15, 32 + 15), HAMLET_SCENE) + with self.assertRaisesRegexp(zlib.error, 'invalid window size'): + zlib.decompress(zlib15, 14) + dco = zlib.decompressobj(32 + 15) + self.assertEqual(dco.decompress(zlib15), HAMLET_SCENE) + dco = zlib.decompressobj(14) + with self.assertRaisesRegexp(zlib.error, 'invalid window size'): + dco.decompress(zlib15) + + co = zlib.compressobj(1, zlib.DEFLATED, 9) + zlib9 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(zlib9, 9), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 0), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 32 + 9), HAMLET_SCENE) + dco = zlib.decompressobj(32 + 9) + self.assertEqual(dco.decompress(zlib9), HAMLET_SCENE) + + co = zlib.compressobj(1, zlib.DEFLATED, -15) + deflate15 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(deflate15, -15), HAMLET_SCENE) + dco = zlib.decompressobj(-15) + self.assertEqual(dco.decompress(deflate15), HAMLET_SCENE) + + co = zlib.compressobj(1, zlib.DEFLATED, -9) + deflate9 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(deflate9, -9), HAMLET_SCENE) + self.assertEqual(zlib.decompress(deflate9, -15), HAMLET_SCENE) + dco = zlib.decompressobj(-9) + self.assertEqual(dco.decompress(deflate9), HAMLET_SCENE) + + co = zlib.compressobj(1, zlib.DEFLATED, 16 + 15) + gzip = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(gzip, 16 + 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(gzip, 32 + 15), HAMLET_SCENE) + dco = zlib.decompressobj(32 + 15) + self.assertEqual(dco.decompress(gzip), HAMLET_SCENE) + def genblock(seed, length, step=1024, generator=random): """length-byte stream of random data from a seed (in step-byte blocks).""" diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -106,7 +106,7 @@ PyDoc_STRVAR(decompressobj__doc__, "decompressobj([wbits]) -- Return a decompressor object.\n" "\n" -"Optional arg wbits is the window buffer size."); +"Optional arg wbits indicates the window buffer size and container format."); static compobject * newcompobject(PyTypeObject *type) @@ -208,8 +208,8 @@ PyDoc_STRVAR(decompress__doc__, "decompress(string[, wbits[, bufsize]]) -- Return decompressed string.\n" "\n" -"Optional arg wbits is the window buffer size. Optional arg bufsize is\n" -"the initial output buffer size."); +"Optional arg wbits indicates the window buffer size and container format.\n" +"Optional arg bufsize is the initial output buffer size."); static PyObject * PyZlib_decompress(PyObject *self, PyObject *args) @@ -1039,7 +1039,7 @@ "decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n" "decompressobj([wbits]) -- Return a decompressor object.\n" "\n" -"'wbits' is window buffer size.\n" +"'wbits' is window buffer size and container format.\n" "Compressor objects support compress() and flush() methods; decompressor\n" "objects support decompress() and flush()."); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 04:45:54 2016 From: python-checkins at python.org (martin.panter) Date: Fri, 27 May 2016 08:45:54 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzU3ODQ6?= =?utf-8?q?_Expand_documentation_and_tests_for_zlib_wbits_parameter?= Message-ID: <20160527084552.13742.21033.FB053B9D@psf.io> https://hg.python.org/cpython/rev/4c88d6d18e85 changeset: 101521:4c88d6d18e85 branch: 3.5 parent: 101518:26362d042087 user: Martin Panter date: Fri May 27 07:32:11 2016 +0000 summary: Issue #5784: Expand documentation and tests for zlib wbits parameter Based on documentation by AM Kuchling. files: Doc/library/zlib.rst | 62 +++++++++++++++++----- Lib/test/test_zlib.py | 43 +++++++++++++++ Modules/clinic/zlibmodule.c.h | 11 ++- Modules/zlibmodule.c | 17 +++-- 4 files changed, 108 insertions(+), 25 deletions(-) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -69,9 +69,22 @@ *method* is the compression algorithm. Currently, the only supported value is ``DEFLATED``. - *wbits* is the base two logarithm of the size of the window buffer. This - should be an integer from ``8`` to ``15``. Higher values give better - compression, but use more memory. + The *wbits* argument controls the size of the history buffer (or the + "window size") used when compressing data, and whether a header and + trailer is included in the output. It can take several ranges of values: + + * +9 to +15: The base-two logarithm of the window size, which + therefore ranges between 512 and 32768. Larger values produce + better compression at the expense of greater memory usage. The + resulting output will include a zlib-specific header and trailer. + + * ?9 to ?15: Uses the absolute value of *wbits* as the + window size logarithm, while producing a raw output stream with no + header or trailing checksum. + + * +25 to +31 = 16 + (9 to 15): Uses the low 4 bits of the value as the + window size logarithm, while including a basic :program:`gzip` header + and trailing checksum in the output. The *memLevel* argument controls the amount of memory used for the internal compression state. Valid values range from ``1`` to ``9``. @@ -113,20 +126,39 @@ .. function:: decompress(data[, wbits[, bufsize]]) Decompresses the bytes in *data*, returning a bytes object containing the - uncompressed data. The *wbits* parameter controls the size of the window - buffer, and is discussed further below. + uncompressed data. The *wbits* parameter depends on + the format of *data*, and is discussed further below. If *bufsize* is given, it is used as the initial size of the output buffer. Raises the :exc:`error` exception if any error occurs. - The absolute value of *wbits* is the base two logarithm of the size of the - history buffer (the "window size") used when compressing data. Its absolute - value should be between 8 and 15 for the most recent versions of the zlib - library, larger values resulting in better compression at the expense of greater - memory usage. When decompressing a stream, *wbits* must not be smaller + .. _decompress-wbits: + + The *wbits* parameter controls the size of the history buffer + (or "window size"), and what header and trailer format is expected. + It is similar to the parameter for :func:`compressobj`, but accepts + more ranges of values: + + * +8 to +15: The base-two logarithm of the window size. The input + must include a zlib header and trailer. + + * 0: Automatically determine the window size from the zlib header. + + * ?8 to ?15: Uses the absolute value of *wbits* as the window size + logarithm. The input must be a raw stream with no header or trailer. + + * +24 to +31 = 16 + (8 to 15): Uses the low 4 bits of the value as + the window size logarithm. The input must include a gzip header and + trailer. + + * +40 to +47 = 32 + (8 to 15): Uses the low 4 bits of the value as + the window size logarithm, and automatically accepts either + the zlib or gzip format. + + When decompressing a stream, the window size must not be smaller than the size originally used to compress the stream; using a too-small - value will result in an exception. The default value is therefore the - highest value, 15. When *wbits* is negative, the standard - :program:`gzip` header is suppressed. + value may result in an :exc:`error` exception. The default *wbits* value + is 15, which corresponds to the largest window size and requires a zlib + header and trailer to be included. *bufsize* is the initial size of the buffer used to hold decompressed data. If more space is required, the buffer size will be increased as needed, so you @@ -139,7 +171,9 @@ Returns a decompression object, to be used for decompressing data streams that won't fit into memory at once. - The *wbits* parameter controls the size of the window buffer. + The *wbits* parameter controls the size of the history buffer (or the + "window size"), and what header and trailer format is expected. It has + the same meaning as `described for decompress() <#decompress-wbits>`__. The *zdict* parameter specifies a predefined compression dictionary. If provided, this must be the same dictionary as was used by the compressor that diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -680,6 +680,49 @@ finally: data = None + def test_wbits(self): + co = zlib.compressobj(level=1, wbits=15) + zlib15 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(zlib15, 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib15, 0), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib15, 32 + 15), HAMLET_SCENE) + with self.assertRaisesRegex(zlib.error, 'invalid window size'): + zlib.decompress(zlib15, 14) + dco = zlib.decompressobj(wbits=32 + 15) + self.assertEqual(dco.decompress(zlib15), HAMLET_SCENE) + dco = zlib.decompressobj(wbits=14) + with self.assertRaisesRegex(zlib.error, 'invalid window size'): + dco.decompress(zlib15) + + co = zlib.compressobj(level=1, wbits=9) + zlib9 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(zlib9, 9), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 0), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 32 + 9), HAMLET_SCENE) + dco = zlib.decompressobj(wbits=32 + 9) + self.assertEqual(dco.decompress(zlib9), HAMLET_SCENE) + + co = zlib.compressobj(level=1, wbits=-15) + deflate15 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(deflate15, -15), HAMLET_SCENE) + dco = zlib.decompressobj(wbits=-15) + self.assertEqual(dco.decompress(deflate15), HAMLET_SCENE) + + co = zlib.compressobj(level=1, wbits=-9) + deflate9 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(deflate9, -9), HAMLET_SCENE) + self.assertEqual(zlib.decompress(deflate9, -15), HAMLET_SCENE) + dco = zlib.decompressobj(wbits=-9) + self.assertEqual(dco.decompress(deflate9), HAMLET_SCENE) + + co = zlib.compressobj(level=1, wbits=16 + 15) + gzip = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(gzip, 16 + 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(gzip, 32 + 15), HAMLET_SCENE) + dco = zlib.decompressobj(32 + 15) + self.assertEqual(dco.decompress(gzip), HAMLET_SCENE) + def genblock(seed, length, step=1024, generator=random): """length-byte stream of random data from a seed (in step-byte blocks).""" diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -48,7 +48,7 @@ " data\n" " Compressed data.\n" " wbits\n" -" The window buffer size.\n" +" The window buffer size and container format.\n" " bufsize\n" " The initial output buffer size."); @@ -95,7 +95,10 @@ " method\n" " The compression algorithm. If given, this must be DEFLATED.\n" " wbits\n" -" The base two logarithm of the window size (range: 8..15).\n" +" +9 to +15: The base-two logarithm of the window size. Include a zlib\n" +" container.\n" +" -9 to -15: Generate a raw stream.\n" +" +25 to +31: Include a gzip container.\n" " memLevel\n" " Controls the amount of memory used for internal compression state.\n" " Valid values range from 1 to 9. Higher values result in higher memory\n" @@ -146,7 +149,7 @@ "Return a decompressor object.\n" "\n" " wbits\n" -" The window buffer size.\n" +" The window buffer size and container format.\n" " zdict\n" " The predefined compression dictionary. This must be the same\n" " dictionary as used by the compressor that produced the input data."); @@ -439,4 +442,4 @@ #ifndef ZLIB_COMPRESS_COPY_METHODDEF #define ZLIB_COMPRESS_COPY_METHODDEF #endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */ -/*[clinic end generated code: output=cf81e1deae3af0ce input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f31627b314a7bd2f input=a9049054013a1b77]*/ diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -271,7 +271,7 @@ data: Py_buffer Compressed data. wbits: int(c_default="MAX_WBITS") = MAX_WBITS - The window buffer size. + The window buffer size and container format. bufsize: capped_uint(c_default="DEF_BUF_SIZE") = DEF_BUF_SIZE The initial output buffer size. / @@ -282,7 +282,7 @@ static PyObject * zlib_decompress_impl(PyModuleDef *module, Py_buffer *data, int wbits, unsigned int bufsize) -/*[clinic end generated code: output=444d0987f3429574 input=da095118b3243b27]*/ +/*[clinic end generated code: output=444d0987f3429574 input=75123b0d4ff0541d]*/ { PyObject *result_str = NULL; Byte *input; @@ -396,7 +396,10 @@ method: int(c_default="DEFLATED") = DEFLATED The compression algorithm. If given, this must be DEFLATED. wbits: int(c_default="MAX_WBITS") = MAX_WBITS - The base two logarithm of the window size (range: 8..15). + +9 to +15: The base-two logarithm of the window size. Include a zlib + container. + -9 to -15: Generate a raw stream. + +25 to +31: Include a gzip container. memLevel: int(c_default="DEF_MEM_LEVEL") = DEF_MEM_LEVEL Controls the amount of memory used for internal compression state. Valid values range from 1 to 9. Higher values result in higher memory @@ -414,7 +417,7 @@ static PyObject * zlib_compressobj_impl(PyModuleDef *module, int level, int method, int wbits, int memLevel, int strategy, Py_buffer *zdict) -/*[clinic end generated code: output=2949bbb9a5723ccd input=de2ffab6e910cd8b]*/ +/*[clinic end generated code: output=2949bbb9a5723ccd input=2fa3d026f90ab8d5]*/ { compobject *self = NULL; int err; @@ -475,7 +478,7 @@ zlib.decompressobj wbits: int(c_default="MAX_WBITS") = MAX_WBITS - The window buffer size. + The window buffer size and container format. zdict: object(c_default="NULL") = b'' The predefined compression dictionary. This must be the same dictionary as used by the compressor that produced the input data. @@ -485,7 +488,7 @@ static PyObject * zlib_decompressobj_impl(PyModuleDef *module, int wbits, PyObject *zdict) -/*[clinic end generated code: output=8ccd583fbd631798 input=67f05145a6920127]*/ +/*[clinic end generated code: output=8ccd583fbd631798 input=d3832b8511fc977b]*/ { int err; compobject *self; @@ -1329,7 +1332,7 @@ "decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n" "decompressobj([wbits[, zdict]]]) -- Return a decompressor object.\n" "\n" -"'wbits' is window buffer size.\n" +"'wbits' is window buffer size and container format.\n" "Compressor objects support compress() and flush() methods; decompressor\n" "objects support decompress() and flush()."); -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 04:45:59 2016 From: python-checkins at python.org (martin.panter) Date: Fri, 27 May 2016 08:45:59 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=235784=3A_Merge_zlib_from_3=2E5?= Message-ID: <20160527084553.108021.1095.87EBDB86@psf.io> https://hg.python.org/cpython/rev/4d4f27fc70d5 changeset: 101522:4d4f27fc70d5 parent: 101520:5789cee8811c parent: 101521:4c88d6d18e85 user: Martin Panter date: Fri May 27 08:00:24 2016 +0000 summary: Issue #5784: Merge zlib from 3.5 files: Doc/library/zlib.rst | 62 +++++++++++++++++----- Lib/test/test_zlib.py | 43 +++++++++++++++ Modules/clinic/zlibmodule.c.h | 11 ++- Modules/zlibmodule.c | 17 +++-- 4 files changed, 108 insertions(+), 25 deletions(-) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -74,9 +74,22 @@ *method* is the compression algorithm. Currently, the only supported value is ``DEFLATED``. - *wbits* is the base two logarithm of the size of the window buffer. This - should be an integer from ``8`` to ``15``. Higher values give better - compression, but use more memory. + The *wbits* argument controls the size of the history buffer (or the + "window size") used when compressing data, and whether a header and + trailer is included in the output. It can take several ranges of values: + + * +9 to +15: The base-two logarithm of the window size, which + therefore ranges between 512 and 32768. Larger values produce + better compression at the expense of greater memory usage. The + resulting output will include a zlib-specific header and trailer. + + * ?9 to ?15: Uses the absolute value of *wbits* as the + window size logarithm, while producing a raw output stream with no + header or trailing checksum. + + * +25 to +31 = 16 + (9 to 15): Uses the low 4 bits of the value as the + window size logarithm, while including a basic :program:`gzip` header + and trailing checksum in the output. The *memLevel* argument controls the amount of memory used for the internal compression state. Valid values range from ``1`` to ``9``. @@ -118,20 +131,39 @@ .. function:: decompress(data[, wbits[, bufsize]]) Decompresses the bytes in *data*, returning a bytes object containing the - uncompressed data. The *wbits* parameter controls the size of the window - buffer, and is discussed further below. + uncompressed data. The *wbits* parameter depends on + the format of *data*, and is discussed further below. If *bufsize* is given, it is used as the initial size of the output buffer. Raises the :exc:`error` exception if any error occurs. - The absolute value of *wbits* is the base two logarithm of the size of the - history buffer (the "window size") used when compressing data. Its absolute - value should be between 8 and 15 for the most recent versions of the zlib - library, larger values resulting in better compression at the expense of greater - memory usage. When decompressing a stream, *wbits* must not be smaller + .. _decompress-wbits: + + The *wbits* parameter controls the size of the history buffer + (or "window size"), and what header and trailer format is expected. + It is similar to the parameter for :func:`compressobj`, but accepts + more ranges of values: + + * +8 to +15: The base-two logarithm of the window size. The input + must include a zlib header and trailer. + + * 0: Automatically determine the window size from the zlib header. + + * ?8 to ?15: Uses the absolute value of *wbits* as the window size + logarithm. The input must be a raw stream with no header or trailer. + + * +24 to +31 = 16 + (8 to 15): Uses the low 4 bits of the value as + the window size logarithm. The input must include a gzip header and + trailer. + + * +40 to +47 = 32 + (8 to 15): Uses the low 4 bits of the value as + the window size logarithm, and automatically accepts either + the zlib or gzip format. + + When decompressing a stream, the window size must not be smaller than the size originally used to compress the stream; using a too-small - value will result in an exception. The default value is therefore the - highest value, 15. When *wbits* is negative, the standard - :program:`gzip` header is suppressed. + value may result in an :exc:`error` exception. The default *wbits* value + is 15, which corresponds to the largest window size and requires a zlib + header and trailer to be included. *bufsize* is the initial size of the buffer used to hold decompressed data. If more space is required, the buffer size will be increased as needed, so you @@ -144,7 +176,9 @@ Returns a decompression object, to be used for decompressing data streams that won't fit into memory at once. - The *wbits* parameter controls the size of the window buffer. + The *wbits* parameter controls the size of the history buffer (or the + "window size"), and what header and trailer format is expected. It has + the same meaning as `described for decompress() <#decompress-wbits>`__. The *zdict* parameter specifies a predefined compression dictionary. If provided, this must be the same dictionary as was used by the compressor that diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -684,6 +684,49 @@ finally: data = None + def test_wbits(self): + co = zlib.compressobj(level=1, wbits=15) + zlib15 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(zlib15, 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib15, 0), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib15, 32 + 15), HAMLET_SCENE) + with self.assertRaisesRegex(zlib.error, 'invalid window size'): + zlib.decompress(zlib15, 14) + dco = zlib.decompressobj(wbits=32 + 15) + self.assertEqual(dco.decompress(zlib15), HAMLET_SCENE) + dco = zlib.decompressobj(wbits=14) + with self.assertRaisesRegex(zlib.error, 'invalid window size'): + dco.decompress(zlib15) + + co = zlib.compressobj(level=1, wbits=9) + zlib9 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(zlib9, 9), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 0), HAMLET_SCENE) + self.assertEqual(zlib.decompress(zlib9, 32 + 9), HAMLET_SCENE) + dco = zlib.decompressobj(wbits=32 + 9) + self.assertEqual(dco.decompress(zlib9), HAMLET_SCENE) + + co = zlib.compressobj(level=1, wbits=-15) + deflate15 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(deflate15, -15), HAMLET_SCENE) + dco = zlib.decompressobj(wbits=-15) + self.assertEqual(dco.decompress(deflate15), HAMLET_SCENE) + + co = zlib.compressobj(level=1, wbits=-9) + deflate9 = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(deflate9, -9), HAMLET_SCENE) + self.assertEqual(zlib.decompress(deflate9, -15), HAMLET_SCENE) + dco = zlib.decompressobj(wbits=-9) + self.assertEqual(dco.decompress(deflate9), HAMLET_SCENE) + + co = zlib.compressobj(level=1, wbits=16 + 15) + gzip = co.compress(HAMLET_SCENE) + co.flush() + self.assertEqual(zlib.decompress(gzip, 16 + 15), HAMLET_SCENE) + self.assertEqual(zlib.decompress(gzip, 32 + 15), HAMLET_SCENE) + dco = zlib.decompressobj(32 + 15) + self.assertEqual(dco.decompress(gzip), HAMLET_SCENE) + def genblock(seed, length, step=1024, generator=random): """length-byte stream of random data from a seed (in step-byte blocks).""" diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -49,7 +49,7 @@ " data\n" " Compressed data.\n" " wbits\n" -" The window buffer size.\n" +" The window buffer size and container format.\n" " bufsize\n" " The initial output buffer size."); @@ -96,7 +96,10 @@ " method\n" " The compression algorithm. If given, this must be DEFLATED.\n" " wbits\n" -" The base two logarithm of the window size (range: 8..15).\n" +" +9 to +15: The base-two logarithm of the window size. Include a zlib\n" +" container.\n" +" -9 to -15: Generate a raw stream.\n" +" +25 to +31: Include a gzip container.\n" " memLevel\n" " Controls the amount of memory used for internal compression state.\n" " Valid values range from 1 to 9. Higher values result in higher memory\n" @@ -147,7 +150,7 @@ "Return a decompressor object.\n" "\n" " wbits\n" -" The window buffer size.\n" +" The window buffer size and container format.\n" " zdict\n" " The predefined compression dictionary. This must be the same\n" " dictionary as used by the compressor that produced the input data."); @@ -440,4 +443,4 @@ #ifndef ZLIB_COMPRESS_COPY_METHODDEF #define ZLIB_COMPRESS_COPY_METHODDEF #endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */ -/*[clinic end generated code: output=e6f3b79e051ecc35 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8669ba9266c78433 input=a9049054013a1b77]*/ diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -270,7 +270,7 @@ data: Py_buffer Compressed data. wbits: int(c_default="MAX_WBITS") = MAX_WBITS - The window buffer size. + The window buffer size and container format. bufsize: capped_uint(c_default="DEF_BUF_SIZE") = DEF_BUF_SIZE The initial output buffer size. / @@ -281,7 +281,7 @@ static PyObject * zlib_decompress_impl(PyModuleDef *module, Py_buffer *data, int wbits, unsigned int bufsize) -/*[clinic end generated code: output=444d0987f3429574 input=da095118b3243b27]*/ +/*[clinic end generated code: output=444d0987f3429574 input=75123b0d4ff0541d]*/ { PyObject *result_str = NULL; Byte *input; @@ -395,7 +395,10 @@ method: int(c_default="DEFLATED") = DEFLATED The compression algorithm. If given, this must be DEFLATED. wbits: int(c_default="MAX_WBITS") = MAX_WBITS - The base two logarithm of the window size (range: 8..15). + +9 to +15: The base-two logarithm of the window size. Include a zlib + container. + -9 to -15: Generate a raw stream. + +25 to +31: Include a gzip container. memLevel: int(c_default="DEF_MEM_LEVEL") = DEF_MEM_LEVEL Controls the amount of memory used for internal compression state. Valid values range from 1 to 9. Higher values result in higher memory @@ -413,7 +416,7 @@ static PyObject * zlib_compressobj_impl(PyModuleDef *module, int level, int method, int wbits, int memLevel, int strategy, Py_buffer *zdict) -/*[clinic end generated code: output=2949bbb9a5723ccd input=de2ffab6e910cd8b]*/ +/*[clinic end generated code: output=2949bbb9a5723ccd input=2fa3d026f90ab8d5]*/ { compobject *self = NULL; int err; @@ -474,7 +477,7 @@ zlib.decompressobj wbits: int(c_default="MAX_WBITS") = MAX_WBITS - The window buffer size. + The window buffer size and container format. zdict: object(c_default="NULL") = b'' The predefined compression dictionary. This must be the same dictionary as used by the compressor that produced the input data. @@ -484,7 +487,7 @@ static PyObject * zlib_decompressobj_impl(PyModuleDef *module, int wbits, PyObject *zdict) -/*[clinic end generated code: output=8ccd583fbd631798 input=67f05145a6920127]*/ +/*[clinic end generated code: output=8ccd583fbd631798 input=d3832b8511fc977b]*/ { int err; compobject *self; @@ -1328,7 +1331,7 @@ "decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n" "decompressobj([wbits[, zdict]]]) -- Return a decompressor object.\n" "\n" -"'wbits' is window buffer size.\n" +"'wbits' is window buffer size and container format.\n" "Compressor objects support compress() and flush() methods; decompressor\n" "objects support decompress() and flush()."); -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Fri May 27 04:52:16 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Fri, 27 May 2016 08:52:16 +0000 Subject: [Python-checkins] Daily reference leaks (eaee5aed6fbc): sum=3 Message-ID: <20160527085115.121234.32741.E70C5D7C@psf.io> results for eaee5aed6fbc on branch "default" -------------------------------------------- test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [0, -2, 1] memory blocks, sum=-1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogryAU_1', '--timeout', '7200'] From lp_benchmark_robot at intel.com Fri May 27 07:20:18 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Fri, 27 May 2016 12:20:18 +0100 Subject: [Python-checkins] BAD Benchmark Results for Python Default 2016-05-27 Message-ID: <9b8cb982-c292-4277-8661-01cd9452a554@irsmsx106.ger.corp.intel.com> Results for project Python default, build date 2016-05-27 02:02:25 +0000 commit: eaee5aed6fbc previous commit: ed4eec682199 revision date: 2016-05-26 19:19:42 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.26% -1.78% 8.39% 17.76% :-| pybench 0.32% -0.34% 1.25% 7.93% :-( regex_v8 2.72% 0.07% -2.19% 4.68% :-| nbody 0.12% -0.01% 0.12% 8.40% :-| json_dump_v2 0.28% -0.46% 0.18% 11.82% :-| normal_startup 0.66% 0.23% -0.20% 5.77% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/bad-benchmark-results-for-python-default-2016-05-27/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Fri May 27 07:20:47 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Fri, 27 May 2016 12:20:47 +0100 Subject: [Python-checkins] GOOD Benchmark Results for Python 2.7 2016-05-27 Message-ID: <891d8011-049a-4797-8e94-07f95f33bc3d@irsmsx106.ger.corp.intel.com> Results for project Python 2.7, build date 2016-05-27 02:46:19 +0000 commit: 40f3f2b27112 previous commit: f0438e1a4761 revision date: 2016-05-26 19:17:21 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.15% 2.32% 4.99% 8.38% :-) pybench 0.21% 0.08% 6.08% 4.47% :-( regex_v8 0.65% -0.04% -2.31% 10.69% :-) nbody 0.17% 0.00% 9.35% 2.71% :-| json_dump_v2 0.48% 0.06% 1.97% 10.82% :-( normal_startup 1.64% 0.04% -5.36% 2.03% :-) ssbench 0.19% 0.04% 2.43% 1.58% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/good-benchmark-results-for-python-2-7-2016-05-27/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Fri May 27 07:33:21 2016 From: python-checkins at python.org (martin.panter) Date: Fri, 27 May 2016 11:33:21 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=235784=3A_Merge_zlib_from_3=2E5?= Message-ID: <20160527113321.32443.42648.C8D9260D@psf.io> https://hg.python.org/cpython/rev/1771f0ac9fc2 changeset: 101525:1771f0ac9fc2 parent: 101522:4d4f27fc70d5 parent: 101524:ca49614989dd user: Martin Panter date: Fri May 27 11:30:59 2016 +0000 summary: Issue #5784: Merge zlib from 3.5 files: Doc/library/zlib.rst | 1 + Lib/test/test_zlib.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -147,6 +147,7 @@ must include a zlib header and trailer. * 0: Automatically determine the window size from the zlib header. + Only supported since zlib 1.2.3.5. * ?8 to ?15: Uses the absolute value of *wbits* as the window size logarithm. The input must be a raw stream with no header or trailer. diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -685,10 +685,18 @@ data = None def test_wbits(self): + # wbits=0 only supported since zlib v1.2.3.5 + # Register "1.2.3" as "1.2.3.0" + v = (zlib.ZLIB_RUNTIME_VERSION + ".0").split(".", 4) + supports_wbits_0 = int(v[0]) > 1 or int(v[0]) == 1 \ + and (int(v[1]) > 2 or int(v[1]) == 2 + and (int(v[2]) > 3 or int(v[2]) == 3 and int(v[3]) >= 5)) + co = zlib.compressobj(level=1, wbits=15) zlib15 = co.compress(HAMLET_SCENE) + co.flush() self.assertEqual(zlib.decompress(zlib15, 15), HAMLET_SCENE) - self.assertEqual(zlib.decompress(zlib15, 0), HAMLET_SCENE) + if supports_wbits_0: + self.assertEqual(zlib.decompress(zlib15, 0), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib15, 32 + 15), HAMLET_SCENE) with self.assertRaisesRegex(zlib.error, 'invalid window size'): zlib.decompress(zlib15, 14) @@ -702,7 +710,8 @@ zlib9 = co.compress(HAMLET_SCENE) + co.flush() self.assertEqual(zlib.decompress(zlib9, 9), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib9, 15), HAMLET_SCENE) - self.assertEqual(zlib.decompress(zlib9, 0), HAMLET_SCENE) + if supports_wbits_0: + self.assertEqual(zlib.decompress(zlib9, 0), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib9, 32 + 9), HAMLET_SCENE) dco = zlib.decompressobj(wbits=32 + 9) self.assertEqual(dco.decompress(zlib9), HAMLET_SCENE) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 07:33:21 2016 From: python-checkins at python.org (martin.panter) Date: Fri, 27 May 2016 11:33:21 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzU3ODQ6?= =?utf-8?q?_wbits=3D0_apparently_added_in_zlib_v1=2E2=2E3=2E5?= Message-ID: <20160527113320.30691.88786.C1AD25D7@psf.io> https://hg.python.org/cpython/rev/ca49614989dd changeset: 101524:ca49614989dd branch: 3.5 parent: 101521:4c88d6d18e85 user: Martin Panter date: Fri May 27 11:20:21 2016 +0000 summary: Issue #5784: wbits=0 apparently added in zlib v1.2.3.5 files: Doc/library/zlib.rst | 1 + Lib/test/test_zlib.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -142,6 +142,7 @@ must include a zlib header and trailer. * 0: Automatically determine the window size from the zlib header. + Only supported since zlib 1.2.3.5. * ?8 to ?15: Uses the absolute value of *wbits* as the window size logarithm. The input must be a raw stream with no header or trailer. diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -681,10 +681,18 @@ data = None def test_wbits(self): + # wbits=0 only supported since zlib v1.2.3.5 + # Register "1.2.3" as "1.2.3.0" + v = (zlib.ZLIB_RUNTIME_VERSION + ".0").split(".", 4) + supports_wbits_0 = int(v[0]) > 1 or int(v[0]) == 1 \ + and (int(v[1]) > 2 or int(v[1]) == 2 + and (int(v[2]) > 3 or int(v[2]) == 3 and int(v[3]) >= 5)) + co = zlib.compressobj(level=1, wbits=15) zlib15 = co.compress(HAMLET_SCENE) + co.flush() self.assertEqual(zlib.decompress(zlib15, 15), HAMLET_SCENE) - self.assertEqual(zlib.decompress(zlib15, 0), HAMLET_SCENE) + if supports_wbits_0: + self.assertEqual(zlib.decompress(zlib15, 0), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib15, 32 + 15), HAMLET_SCENE) with self.assertRaisesRegex(zlib.error, 'invalid window size'): zlib.decompress(zlib15, 14) @@ -698,7 +706,8 @@ zlib9 = co.compress(HAMLET_SCENE) + co.flush() self.assertEqual(zlib.decompress(zlib9, 9), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib9, 15), HAMLET_SCENE) - self.assertEqual(zlib.decompress(zlib9, 0), HAMLET_SCENE) + if supports_wbits_0: + self.assertEqual(zlib.decompress(zlib9, 0), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib9, 32 + 9), HAMLET_SCENE) dco = zlib.decompressobj(wbits=32 + 9) self.assertEqual(dco.decompress(zlib9), HAMLET_SCENE) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 09:47:37 2016 From: python-checkins at python.org (martin.panter) Date: Fri, 27 May 2016 13:47:37 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzU3ODQ6?= =?utf-8?q?_Cannot_test_wbits=3D0_unless_we_know_we_have_zlib_v1=2E2=2E3?= =?utf-8?q?=2E5?= Message-ID: <20160527134735.13759.84254.A2216175@psf.io> https://hg.python.org/cpython/rev/0df93ab07a8f changeset: 101526:0df93ab07a8f branch: 2.7 parent: 101523:e5fc74588cea user: Martin Panter date: Fri May 27 11:20:21 2016 +0000 summary: Issue #5784: Cannot test wbits=0 unless we know we have zlib v1.2.3.5 files: Doc/library/zlib.rst | 1 + Lib/test/test_zlib.py | 2 -- 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -160,6 +160,7 @@ must include a zlib header and trailer. * 0: Automatically determine the window size from the zlib header. + Only supported since zlib 1.2.3.5. * ?8 to ?15: Uses the absolute value of *wbits* as the window size logarithm. The input must be a raw stream with no header or trailer. diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -531,7 +531,6 @@ co = zlib.compressobj(1, zlib.DEFLATED, 15) zlib15 = co.compress(HAMLET_SCENE) + co.flush() self.assertEqual(zlib.decompress(zlib15, 15), HAMLET_SCENE) - self.assertEqual(zlib.decompress(zlib15, 0), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib15, 32 + 15), HAMLET_SCENE) with self.assertRaisesRegexp(zlib.error, 'invalid window size'): zlib.decompress(zlib15, 14) @@ -545,7 +544,6 @@ zlib9 = co.compress(HAMLET_SCENE) + co.flush() self.assertEqual(zlib.decompress(zlib9, 9), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib9, 15), HAMLET_SCENE) - self.assertEqual(zlib.decompress(zlib9, 0), HAMLET_SCENE) self.assertEqual(zlib.decompress(zlib9, 32 + 9), HAMLET_SCENE) dco = zlib.decompressobj(32 + 9) self.assertEqual(dco.decompress(zlib9), HAMLET_SCENE) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 14:37:16 2016 From: python-checkins at python.org (eric.snow) Date: Fri, 27 May 2016 18:37:16 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MTM4?= =?utf-8?q?=3A_Fix_the_doc_comment_for_FileFinder=2Efind=5Fspec=28=29=2E?= Message-ID: <20160527183712.121230.44447.DBE5A785@psf.io> https://hg.python.org/cpython/rev/ac9c1aeecfb4 changeset: 101527:ac9c1aeecfb4 branch: 3.5 parent: 101524:ca49614989dd user: Eric Snow date: Fri May 27 12:36:28 2016 -0600 summary: Issue #27138: Fix the doc comment for FileFinder.find_spec(). files: Lib/importlib/_bootstrap_external.py | 4 ++-- Misc/NEWS | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -1213,8 +1213,8 @@ submodule_search_locations=smsl) def find_spec(self, fullname, target=None): - """Try to find a loader for the specified module, or the namespace - package portions. Returns (loader, list-of-portions).""" + """Try to find a spec for the specified module. Returns the + matching spec, or None if not found.""" is_namespace = False tail_module = fullname.rpartition('.')[2] try: diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -61,6 +61,8 @@ (*) unpacking in function calls. Based on patch by Hagen F?rstenau and Daniel Urban. +- Issue #27138: Fix the doc comment for FileFinder.find_spec(). + - Issue #26154: Add a new private _PyThreadState_UncheckedGet() function to get the current Python thread state, but don't issue a fatal error if it is NULL. This new function must be used instead of accessing directly the -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 14:56:56 2016 From: python-checkins at python.org (eric.snow) Date: Fri, 27 May 2016 18:56:56 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327138=3A_Fix_the_doc_comment_for_FileFinder=2Ef?= =?utf-8?b?aW5kX3NwZWMoKS4=?= Message-ID: <20160527185650.121234.34868.4A41C7B0@psf.io> https://hg.python.org/cpython/rev/4348fb8cae27 changeset: 101528:4348fb8cae27 parent: 101525:1771f0ac9fc2 parent: 101527:ac9c1aeecfb4 user: Eric Snow date: Fri May 27 12:56:41 2016 -0600 summary: Issue #27138: Fix the doc comment for FileFinder.find_spec(). files: Lib/importlib/_bootstrap_external.py | 4 ++-- Misc/NEWS | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -1215,8 +1215,8 @@ submodule_search_locations=smsl) def find_spec(self, fullname, target=None): - """Try to find a loader for the specified module, or the namespace - package portions. Returns (loader, list-of-portions).""" + """Try to find a spec for the specified module. Returns the + matching spec, or None if not found.""" is_namespace = False tail_module = fullname.rpartition('.')[2] try: diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -103,6 +103,8 @@ - Issue #26718: super.__init__ no longer leaks memory if called multiple times. NOTE: A direct call of super.__init__ is not endorsed! +- Issue #27138: Fix the doc comment for FileFinder.find_spec(). + - Issue #25339: PYTHONIOENCODING now has priority over locale in setting the error handler for stdin and stdout. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 15:01:36 2016 From: python-checkins at python.org (guido.van.rossum) Date: Fri, 27 May 2016 19:01:36 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Add_Type_and_ContextManager_t?= =?utf-8?q?o_list_of_everything_in_typing=2Epy=2E?= Message-ID: <20160527190129.121222.72582.5A154522@psf.io> https://hg.python.org/peps/rev/6c90e361daca changeset: 6343:6c90e361daca user: Guido van Rossum date: Fri May 27 12:01:20 2016 -0700 summary: Add Type and ContextManager to list of everything in typing.py. files: pep-0484.txt | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/pep-0484.txt b/pep-0484.txt --- a/pep-0484.txt +++ b/pep-0484.txt @@ -1454,6 +1454,8 @@ * Generic, used to create user-defined generic classes +* Type, used to annotate class objects + Generic variants of builtin collections: * Dict, used as ``Dict[key_type, value_type]`` @@ -1487,6 +1489,8 @@ * Container +* ContextManager + * Generator, used as ``Generator[yield_type, send_type, return_type]``. This represents the return value of generator functions. It is a subtype of ``Iterable`` and it has additional -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Fri May 27 21:35:47 2016 From: python-checkins at python.org (martin.panter) Date: Sat, 28 May 2016 01:35:47 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzIwNjk5?= =?utf-8?q?=3A_Document_that_=E2=80=9Cio=E2=80=9D_methods_accept_bytes-lik?= =?utf-8?q?e_objects?= Message-ID: <20160528013545.13765.75510.BA444ABC@psf.io> https://hg.python.org/cpython/rev/bd41151a7429 changeset: 101529:bd41151a7429 branch: 3.5 parent: 101527:ac9c1aeecfb4 user: Martin Panter date: Sat May 28 00:41:57 2016 +0000 summary: Issue #20699: Document that ?io? methods accept bytes-like objects This matches the usage of ZipFile and BufferedWriter. This still requires return values to be bytes() objects. Also document and test that the write() methods should only access their argument before they return. files: Doc/library/io.rst | 43 +++++++---- Lib/_pyio.py | 26 +++--- Lib/test/test_io.py | 80 +++++++++++++++++---- Lib/test/test_memoryio.py | 23 ++--- Modules/_io/bufferedio.c | 4 +- Modules/_io/bytesio.c | 4 +- Modules/_io/clinic/bytesio.c.h | 4 +- Modules/_io/clinic/fileio.c.h | 4 +- Modules/_io/fileio.c | 4 +- Modules/_io/iobase.c | 5 +- 10 files changed, 129 insertions(+), 68 deletions(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -66,7 +66,8 @@ Binary I/O ^^^^^^^^^^ -Binary I/O (also called *buffered I/O*) expects and produces :class:`bytes` +Binary I/O (also called *buffered I/O*) expects +:term:`bytes-like objects ` and produces :class:`bytes` objects. No encoding, decoding, or newline translation is performed. This category of streams can be used for all kinds of non-text data, and also when manual control over the handling of text data is desired. @@ -227,9 +228,10 @@ when operations they do not support are called. The basic type used for binary data read from or written to a file is - :class:`bytes`. :class:`bytearray`\s are accepted too, and in some cases - (such as :meth:`readinto`) required. Text I/O classes work with - :class:`str` data. + :class:`bytes`. Other :term:`bytes-like objects ` are + accepted as method arguments too. In some cases, such as + :meth:`~RawIOBase.readinto`, a writable object such as :class:`bytearray` + is required. Text I/O classes work with :class:`str` data. Note that calling any method (even inquiries) on a closed stream is undefined. Implementations may raise :exc:`ValueError` in this case. @@ -393,18 +395,22 @@ .. method:: readinto(b) - Read up to ``len(b)`` bytes into :class:`bytearray` *b* and return the + Read bytes into a pre-allocated, writable + :term:`bytes-like object` *b*, and return the number of bytes read. If the object is in non-blocking mode and no bytes are available, ``None`` is returned. .. method:: write(b) - Write the given :class:`bytes` or :class:`bytearray` object, *b*, to the - underlying raw stream and return the number of bytes written. This can - be less than ``len(b)``, depending on specifics of the underlying raw + Write the given :term:`bytes-like object`, *b*, to the + underlying raw stream, and return the number of + bytes written. This can be less than the length of *b* in + bytes, depending on specifics of the underlying raw stream, and especially if it is in non-blocking mode. ``None`` is returned if the raw stream is set not to block and no single byte could - be readily written to it. + be readily written to it. The caller may release or mutate *b* after + this method returns, so the implementation should only access *b* + during the method call. .. class:: BufferedIOBase @@ -476,8 +482,8 @@ .. method:: readinto(b) - Read up to ``len(b)`` bytes into bytearray *b* and return the number of - bytes read. + Read bytes into a pre-allocated, writable + :term:`bytes-like object` *b* and return the number of bytes read. Like :meth:`read`, multiple reads may be issued to the underlying raw stream, unless the latter is interactive. @@ -487,7 +493,8 @@ .. method:: readinto1(b) - Read up to ``len(b)`` bytes into bytearray *b*, using at most one call to + Read bytes into a pre-allocated, writable + :term:`bytes-like object` *b*, using at most one call to the underlying raw stream's :meth:`~RawIOBase.read` (or :meth:`~RawIOBase.readinto`) method. Return the number of bytes read. @@ -498,8 +505,8 @@ .. method:: write(b) - Write the given :class:`bytes` or :class:`bytearray` object, *b* and - return the number of bytes written (never less than ``len(b)``, since if + Write the given :term:`bytes-like object`, *b*, and return the number + of bytes written (always equal to the length of *b* in bytes, since if the write fails an :exc:`OSError` will be raised). Depending on the actual implementation, these bytes may be readily written to the underlying stream, or held in a buffer for performance and latency @@ -509,6 +516,9 @@ data needed to be written to the raw stream but it couldn't accept all the data without blocking. + The caller may release or mutate *b* after this method returns, + so the implementation should only access *b* during the method call. + Raw File I/O ^^^^^^^^^^^^ @@ -584,7 +594,8 @@ :class:`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` method is called. - The argument *initial_bytes* contains optional initial :class:`bytes` data. + The optional argument *initial_bytes* is a :term:`bytes-like object` that + contains initial data. :class:`BytesIO` provides or overrides these methods in addition to those from :class:`BufferedIOBase` and :class:`IOBase`: @@ -682,7 +693,7 @@ .. method:: write(b) - Write the :class:`bytes` or :class:`bytearray` object, *b* and return the + Write the :term:`bytes-like object`, *b*, and return the number of bytes written. When in non-blocking mode, a :exc:`BlockingIOError` is raised if the buffer needs to be written out but the raw stream blocks. diff --git a/Lib/_pyio.py b/Lib/_pyio.py --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -296,8 +296,9 @@ called. The basic type used for binary data read from or written to a file is - bytes. bytearrays are accepted too, and in some cases (such as - readinto) needed. Text I/O classes work with str data. + bytes. Other bytes-like objects are accepted as method arguments too. In + some cases (such as readinto), a writable object is required. Text I/O + classes work with str data. Note that calling any method (even inquiries) on a closed stream is undefined. Implementations may raise OSError in this case. @@ -596,7 +597,7 @@ return data def readinto(self, b): - """Read up to len(b) bytes into bytearray b. + """Read bytes into a pre-allocated bytes-like object b. Returns an int representing the number of bytes read (0 for EOF), or None if the object is set not to block and has no data to read. @@ -606,7 +607,8 @@ def write(self, b): """Write the given buffer to the IO stream. - Returns the number of bytes written, which may be less than len(b). + Returns the number of bytes written, which may be less than the + length of b in bytes. """ self._unsupported("write") @@ -659,7 +661,7 @@ self._unsupported("read1") def readinto(self, b): - """Read up to len(b) bytes into bytearray b. + """Read bytes into a pre-allocated bytes-like object b. Like read(), this may issue multiple reads to the underlying raw stream, unless the latter is 'interactive'. @@ -673,7 +675,7 @@ return self._readinto(b, read1=False) def readinto1(self, b): - """Read up to len(b) bytes into *b*, using at most one system call + """Read bytes into buffer *b*, using at most one system call Returns an int representing the number of bytes read (0 for EOF). @@ -701,8 +703,8 @@ def write(self, b): """Write the given bytes buffer to the IO stream. - Return the number of bytes written, which is never less than - len(b). + Return the number of bytes written, which is always the length of b + in bytes. Raises BlockingIOError if the buffer is full and the underlying raw stream cannot accept more data at the moment. @@ -884,7 +886,8 @@ raise ValueError("write to closed file") if isinstance(b, str): raise TypeError("can't write str to binary stream") - n = len(b) + with memoryview(b) as view: + n = view.nbytes # Size of any bytes-like object if n == 0: return 0 pos = self._pos @@ -1090,14 +1093,13 @@ def _readinto(self, buf, read1): """Read data into *buf* with at most one system call.""" - if len(buf) == 0: - return 0 - # Need to create a memoryview object of type 'b', otherwise # we may not be able to assign bytes to it, and slicing it # would create a new object. if not isinstance(buf, memoryview): buf = memoryview(buf) + if buf.nbytes == 0: + return 0 buf = buf.cast('B') written = 0 diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -45,6 +45,22 @@ except ImportError: threading = None +try: + import ctypes +except ImportError: + def byteslike(*pos, **kw): + return array.array("b", bytes(*pos, **kw)) +else: + def byteslike(*pos, **kw): + """Create a bytes-like object having no string or sequence methods""" + data = bytes(*pos, **kw) + obj = EmptyStruct() + ctypes.resize(obj, len(data)) + memoryview(obj).cast("B")[:] = data + return obj + class EmptyStruct(ctypes.Structure): + pass + def _default_chunk_size(): """Get the default TextIOWrapper chunk size""" with open(__file__, "r", encoding="latin-1") as f: @@ -284,7 +300,9 @@ self.assertEqual(f.tell(), 6) self.assertEqual(f.seek(-1, 1), 5) self.assertEqual(f.tell(), 5) - self.assertEqual(f.write(bytearray(b" world\n\n\n")), 9) + buffer = bytearray(b" world\n\n\n") + self.assertEqual(f.write(buffer), 9) + buffer[:] = b"*" * 9 # Overwrite our copy of the data self.assertEqual(f.seek(0), 0) self.assertEqual(f.write(b"h"), 1) self.assertEqual(f.seek(-1, 2), 13) @@ -297,20 +315,21 @@ def read_ops(self, f, buffered=False): data = f.read(5) self.assertEqual(data, b"hello") - data = bytearray(data) + data = byteslike(data) self.assertEqual(f.readinto(data), 5) - self.assertEqual(data, b" worl") + self.assertEqual(bytes(data), b" worl") + data = bytearray(5) self.assertEqual(f.readinto(data), 2) self.assertEqual(len(data), 5) self.assertEqual(data[:2], b"d\n") self.assertEqual(f.seek(0), 0) self.assertEqual(f.read(20), b"hello world\n") self.assertEqual(f.read(1), b"") - self.assertEqual(f.readinto(bytearray(b"x")), 0) + self.assertEqual(f.readinto(byteslike(b"x")), 0) self.assertEqual(f.seek(-6, 2), 6) self.assertEqual(f.read(5), b"world") self.assertEqual(f.read(0), b"") - self.assertEqual(f.readinto(bytearray()), 0) + self.assertEqual(f.readinto(byteslike()), 0) self.assertEqual(f.seek(-6, 1), 5) self.assertEqual(f.read(5), b" worl") self.assertEqual(f.tell(), 10) @@ -321,6 +340,10 @@ f.seek(6) self.assertEqual(f.read(), b"world\n") self.assertEqual(f.read(), b"") + f.seek(0) + data = byteslike(5) + self.assertEqual(f.readinto1(data), 5) + self.assertEqual(bytes(data), b"hello") LARGE = 2**31 @@ -637,10 +660,15 @@ def test_array_writes(self): a = array.array('i', range(10)) n = len(a.tobytes()) - with self.open(support.TESTFN, "wb", 0) as f: - self.assertEqual(f.write(a), n) - with self.open(support.TESTFN, "wb") as f: - self.assertEqual(f.write(a), n) + def check(f): + with f: + self.assertEqual(f.write(a), n) + f.writelines((a,)) + check(self.BytesIO()) + check(self.FileIO(support.TESTFN, "w")) + check(self.BufferedWriter(self.MockRawIO())) + check(self.BufferedRandom(self.MockRawIO())) + check(self.BufferedRWPair(self.MockRawIO(), self.MockRawIO())) def test_closefd(self): self.assertRaises(ValueError, self.open, support.TESTFN, 'w', @@ -799,6 +827,19 @@ with self.assertRaises(ValueError): self.open(support.TESTFN, 'w', newline='invalid') + def test_buffered_readinto_mixin(self): + # Test the implementation provided by BufferedIOBase + class Stream(self.BufferedIOBase): + def read(self, size): + return b"12345" + read1 = read + stream = Stream() + for method in ("readinto", "readinto1"): + with self.subTest(method): + buffer = byteslike(5) + self.assertEqual(getattr(stream, method)(buffer), 5) + self.assertEqual(bytes(buffer), b"12345") + class CIOTest(IOTest): @@ -1390,6 +1431,11 @@ bufio = self.tp(writer, 8) bufio.write(b"abc") self.assertFalse(writer._write_stack) + buffer = bytearray(b"def") + bufio.write(buffer) + buffer[:] = b"***" # Overwrite our copy of the data + bufio.flush() + self.assertEqual(b"".join(writer._write_stack), b"abcdef") def test_write_overflow(self): writer = self.MockRawIO() @@ -1716,11 +1762,13 @@ self.assertEqual(pair.read1(3), b"abc") def test_readinto(self): - pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO()) - - data = bytearray(5) - self.assertEqual(pair.readinto(data), 5) - self.assertEqual(data, b"abcde") + for method in ("readinto", "readinto1"): + with self.subTest(method): + pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO()) + + data = byteslike(5) + self.assertEqual(getattr(pair, method)(data), 5) + self.assertEqual(bytes(data), b"abcde") def test_write(self): w = self.MockRawIO() @@ -1728,7 +1776,9 @@ pair.write(b"abc") pair.flush() - pair.write(b"def") + buffer = bytearray(b"def") + pair.write(buffer) + buffer[:] = b"***" # Overwrite our copy of the data pair.flush() self.assertEqual(w._write_stack, [b"abc", b"def"]) diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -399,7 +399,16 @@ del __main__.PickleTestMemIO -class BytesIOMixin: +class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): + # Test _pyio.BytesIO; class also inherited for testing C implementation + + UnsupportedOperation = pyio.UnsupportedOperation + + @staticmethod + def buftype(s): + return s.encode("ascii") + ioclass = pyio.BytesIO + EOF = b"" def test_getbuffer(self): memio = self.ioclass(b"1234567890") @@ -426,18 +435,6 @@ memio.close() self.assertRaises(ValueError, memio.getbuffer) - -class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, - BytesIOMixin, unittest.TestCase): - - UnsupportedOperation = pyio.UnsupportedOperation - - @staticmethod - def buftype(s): - return s.encode("ascii") - ioclass = pyio.BytesIO - EOF = b"" - def test_read1(self): buf = self.buftype("1234567890") memio = self.ioclass(buf) diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -190,8 +190,8 @@ PyDoc_STRVAR(bufferediobase_write_doc, "Write the given buffer to the IO stream.\n" "\n" - "Returns the number of bytes written, which is never less than\n" - "len(b).\n" + "Returns the number of bytes written, which is always the length of b\n" + "in bytes.\n" "\n" "Raises BlockingIOError if the buffer is full and the\n" "underlying raw stream cannot accept more data at the moment.\n"); diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -548,7 +548,7 @@ buffer: Py_buffer(accept={rwbuffer}) / -Read up to len(buffer) bytes into buffer. +Read bytes into buffer. Returns number of bytes read (0 for EOF), or None if the object is set not to block and has no data to read. @@ -556,7 +556,7 @@ static PyObject * _io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer) -/*[clinic end generated code: output=a5d407217dcf0639 input=b52a8782706f0037]*/ +/*[clinic end generated code: output=a5d407217dcf0639 input=1424d0fdce857919]*/ { Py_ssize_t len, n; diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -259,7 +259,7 @@ "readinto($self, buffer, /)\n" "--\n" "\n" -"Read up to len(buffer) bytes into buffer.\n" +"Read bytes into buffer.\n" "\n" "Returns number of bytes read (0 for EOF), or None if the object\n" "is set not to block and has no data to read."); @@ -419,4 +419,4 @@ exit: return return_value; } -/*[clinic end generated code: output=164cf0e4117dadbe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=60ce2c6272718431 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -222,7 +222,7 @@ "write($self, b, /)\n" "--\n" "\n" -"Write bytes b to file, return number written.\n" +"Write buffer b to file, return number of bytes written.\n" "\n" "Only makes one system call, so not all of the data may be written.\n" "The number of bytes actually written is returned. In non-blocking mode,\n" @@ -364,4 +364,4 @@ #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=b1a20b10c81add64 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dcbc39b466598492 input=a9049054013a1b77]*/ diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -836,7 +836,7 @@ b: Py_buffer / -Write bytes b to file, return number written. +Write buffer b to file, return number of bytes written. Only makes one system call, so not all of the data may be written. The number of bytes actually written is returned. In non-blocking mode, @@ -845,7 +845,7 @@ static PyObject * _io_FileIO_write_impl(fileio *self, Py_buffer *b) -/*[clinic end generated code: output=b4059db3d363a2f7 input=ffbd8834f447ac31]*/ +/*[clinic end generated code: output=b4059db3d363a2f7 input=6e7908b36f0ce74f]*/ { Py_ssize_t n; int err; diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -53,8 +53,9 @@ "called.\n" "\n" "The basic type used for binary data read from or written to a file is\n" - "bytes. bytearrays are accepted too, and in some cases (such as\n" - "readinto) needed. Text I/O classes work with str data.\n" + "bytes. Other bytes-like objects are accepted as method arguments too.\n" + "In some cases (such as readinto), a writable object is required. Text\n" + "I/O classes work with str data.\n" "\n" "Note that calling any method (except additional calls to close(),\n" "which are ignored) on a closed stream should raise a ValueError.\n" -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 21:35:46 2016 From: python-checkins at python.org (martin.panter) Date: Sat, 28 May 2016 01:35:46 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2320699=3A_Merge_io_bytes-like_fixes_from_3=2E5?= Message-ID: <20160528013545.10658.65648.EF1546CD@psf.io> https://hg.python.org/cpython/rev/c1b40a29dc7a changeset: 101530:c1b40a29dc7a parent: 101528:4348fb8cae27 parent: 101529:bd41151a7429 user: Martin Panter date: Sat May 28 01:07:08 2016 +0000 summary: Issue #20699: Merge io bytes-like fixes from 3.5 files: Doc/library/io.rst | 43 +++++++---- Lib/_pyio.py | 26 +++--- Lib/test/test_io.py | 80 +++++++++++++++++---- Lib/test/test_memoryio.py | 23 ++--- Modules/_io/bufferedio.c | 4 +- Modules/_io/bytesio.c | 4 +- Modules/_io/clinic/bytesio.c.h | 4 +- Modules/_io/clinic/fileio.c.h | 4 +- Modules/_io/fileio.c | 4 +- Modules/_io/iobase.c | 5 +- 10 files changed, 129 insertions(+), 68 deletions(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -66,7 +66,8 @@ Binary I/O ^^^^^^^^^^ -Binary I/O (also called *buffered I/O*) expects and produces :class:`bytes` +Binary I/O (also called *buffered I/O*) expects +:term:`bytes-like objects ` and produces :class:`bytes` objects. No encoding, decoding, or newline translation is performed. This category of streams can be used for all kinds of non-text data, and also when manual control over the handling of text data is desired. @@ -227,9 +228,10 @@ when operations they do not support are called. The basic type used for binary data read from or written to a file is - :class:`bytes`. :class:`bytearray`\s are accepted too, and in some cases - (such as :meth:`readinto`) required. Text I/O classes work with - :class:`str` data. + :class:`bytes`. Other :term:`bytes-like objects ` are + accepted as method arguments too. In some cases, such as + :meth:`~RawIOBase.readinto`, a writable object such as :class:`bytearray` + is required. Text I/O classes work with :class:`str` data. Note that calling any method (even inquiries) on a closed stream is undefined. Implementations may raise :exc:`ValueError` in this case. @@ -393,18 +395,22 @@ .. method:: readinto(b) - Read up to ``len(b)`` bytes into :class:`bytearray` *b* and return the + Read bytes into a pre-allocated, writable + :term:`bytes-like object` *b*, and return the number of bytes read. If the object is in non-blocking mode and no bytes are available, ``None`` is returned. .. method:: write(b) - Write the given :class:`bytes` or :class:`bytearray` object, *b*, to the - underlying raw stream and return the number of bytes written. This can - be less than ``len(b)``, depending on specifics of the underlying raw + Write the given :term:`bytes-like object`, *b*, to the + underlying raw stream, and return the number of + bytes written. This can be less than the length of *b* in + bytes, depending on specifics of the underlying raw stream, and especially if it is in non-blocking mode. ``None`` is returned if the raw stream is set not to block and no single byte could - be readily written to it. + be readily written to it. The caller may release or mutate *b* after + this method returns, so the implementation should only access *b* + during the method call. .. class:: BufferedIOBase @@ -476,8 +482,8 @@ .. method:: readinto(b) - Read up to ``len(b)`` bytes into bytearray *b* and return the number of - bytes read. + Read bytes into a pre-allocated, writable + :term:`bytes-like object` *b* and return the number of bytes read. Like :meth:`read`, multiple reads may be issued to the underlying raw stream, unless the latter is interactive. @@ -487,7 +493,8 @@ .. method:: readinto1(b) - Read up to ``len(b)`` bytes into bytearray *b*, using at most one call to + Read bytes into a pre-allocated, writable + :term:`bytes-like object` *b*, using at most one call to the underlying raw stream's :meth:`~RawIOBase.read` (or :meth:`~RawIOBase.readinto`) method. Return the number of bytes read. @@ -498,8 +505,8 @@ .. method:: write(b) - Write the given :class:`bytes` or :class:`bytearray` object, *b* and - return the number of bytes written (never less than ``len(b)``, since if + Write the given :term:`bytes-like object`, *b*, and return the number + of bytes written (always equal to the length of *b* in bytes, since if the write fails an :exc:`OSError` will be raised). Depending on the actual implementation, these bytes may be readily written to the underlying stream, or held in a buffer for performance and latency @@ -509,6 +516,9 @@ data needed to be written to the raw stream but it couldn't accept all the data without blocking. + The caller may release or mutate *b* after this method returns, + so the implementation should only access *b* during the method call. + Raw File I/O ^^^^^^^^^^^^ @@ -584,7 +594,8 @@ :class:`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` method is called. - The argument *initial_bytes* contains optional initial :class:`bytes` data. + The optional argument *initial_bytes* is a :term:`bytes-like object` that + contains initial data. :class:`BytesIO` provides or overrides these methods in addition to those from :class:`BufferedIOBase` and :class:`IOBase`: @@ -682,7 +693,7 @@ .. method:: write(b) - Write the :class:`bytes` or :class:`bytearray` object, *b* and return the + Write the :term:`bytes-like object`, *b*, and return the number of bytes written. When in non-blocking mode, a :exc:`BlockingIOError` is raised if the buffer needs to be written out but the raw stream blocks. diff --git a/Lib/_pyio.py b/Lib/_pyio.py --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -296,8 +296,9 @@ called. The basic type used for binary data read from or written to a file is - bytes. bytearrays are accepted too, and in some cases (such as - readinto) needed. Text I/O classes work with str data. + bytes. Other bytes-like objects are accepted as method arguments too. In + some cases (such as readinto), a writable object is required. Text I/O + classes work with str data. Note that calling any method (even inquiries) on a closed stream is undefined. Implementations may raise OSError in this case. @@ -596,7 +597,7 @@ return data def readinto(self, b): - """Read up to len(b) bytes into bytearray b. + """Read bytes into a pre-allocated bytes-like object b. Returns an int representing the number of bytes read (0 for EOF), or None if the object is set not to block and has no data to read. @@ -606,7 +607,8 @@ def write(self, b): """Write the given buffer to the IO stream. - Returns the number of bytes written, which may be less than len(b). + Returns the number of bytes written, which may be less than the + length of b in bytes. """ self._unsupported("write") @@ -659,7 +661,7 @@ self._unsupported("read1") def readinto(self, b): - """Read up to len(b) bytes into bytearray b. + """Read bytes into a pre-allocated bytes-like object b. Like read(), this may issue multiple reads to the underlying raw stream, unless the latter is 'interactive'. @@ -673,7 +675,7 @@ return self._readinto(b, read1=False) def readinto1(self, b): - """Read up to len(b) bytes into *b*, using at most one system call + """Read bytes into buffer *b*, using at most one system call Returns an int representing the number of bytes read (0 for EOF). @@ -701,8 +703,8 @@ def write(self, b): """Write the given bytes buffer to the IO stream. - Return the number of bytes written, which is never less than - len(b). + Return the number of bytes written, which is always the length of b + in bytes. Raises BlockingIOError if the buffer is full and the underlying raw stream cannot accept more data at the moment. @@ -884,7 +886,8 @@ raise ValueError("write to closed file") if isinstance(b, str): raise TypeError("can't write str to binary stream") - n = len(b) + with memoryview(b) as view: + n = view.nbytes # Size of any bytes-like object if n == 0: return 0 pos = self._pos @@ -1090,14 +1093,13 @@ def _readinto(self, buf, read1): """Read data into *buf* with at most one system call.""" - if len(buf) == 0: - return 0 - # Need to create a memoryview object of type 'b', otherwise # we may not be able to assign bytes to it, and slicing it # would create a new object. if not isinstance(buf, memoryview): buf = memoryview(buf) + if buf.nbytes == 0: + return 0 buf = buf.cast('B') written = 0 diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -45,6 +45,22 @@ except ImportError: threading = None +try: + import ctypes +except ImportError: + def byteslike(*pos, **kw): + return array.array("b", bytes(*pos, **kw)) +else: + def byteslike(*pos, **kw): + """Create a bytes-like object having no string or sequence methods""" + data = bytes(*pos, **kw) + obj = EmptyStruct() + ctypes.resize(obj, len(data)) + memoryview(obj).cast("B")[:] = data + return obj + class EmptyStruct(ctypes.Structure): + pass + def _default_chunk_size(): """Get the default TextIOWrapper chunk size""" with open(__file__, "r", encoding="latin-1") as f: @@ -284,7 +300,9 @@ self.assertEqual(f.tell(), 6) self.assertEqual(f.seek(-1, 1), 5) self.assertEqual(f.tell(), 5) - self.assertEqual(f.write(bytearray(b" world\n\n\n")), 9) + buffer = bytearray(b" world\n\n\n") + self.assertEqual(f.write(buffer), 9) + buffer[:] = b"*" * 9 # Overwrite our copy of the data self.assertEqual(f.seek(0), 0) self.assertEqual(f.write(b"h"), 1) self.assertEqual(f.seek(-1, 2), 13) @@ -297,20 +315,21 @@ def read_ops(self, f, buffered=False): data = f.read(5) self.assertEqual(data, b"hello") - data = bytearray(data) + data = byteslike(data) self.assertEqual(f.readinto(data), 5) - self.assertEqual(data, b" worl") + self.assertEqual(bytes(data), b" worl") + data = bytearray(5) self.assertEqual(f.readinto(data), 2) self.assertEqual(len(data), 5) self.assertEqual(data[:2], b"d\n") self.assertEqual(f.seek(0), 0) self.assertEqual(f.read(20), b"hello world\n") self.assertEqual(f.read(1), b"") - self.assertEqual(f.readinto(bytearray(b"x")), 0) + self.assertEqual(f.readinto(byteslike(b"x")), 0) self.assertEqual(f.seek(-6, 2), 6) self.assertEqual(f.read(5), b"world") self.assertEqual(f.read(0), b"") - self.assertEqual(f.readinto(bytearray()), 0) + self.assertEqual(f.readinto(byteslike()), 0) self.assertEqual(f.seek(-6, 1), 5) self.assertEqual(f.read(5), b" worl") self.assertEqual(f.tell(), 10) @@ -321,6 +340,10 @@ f.seek(6) self.assertEqual(f.read(), b"world\n") self.assertEqual(f.read(), b"") + f.seek(0) + data = byteslike(5) + self.assertEqual(f.readinto1(data), 5) + self.assertEqual(bytes(data), b"hello") LARGE = 2**31 @@ -641,10 +664,15 @@ def test_array_writes(self): a = array.array('i', range(10)) n = len(a.tobytes()) - with self.open(support.TESTFN, "wb", 0) as f: - self.assertEqual(f.write(a), n) - with self.open(support.TESTFN, "wb") as f: - self.assertEqual(f.write(a), n) + def check(f): + with f: + self.assertEqual(f.write(a), n) + f.writelines((a,)) + check(self.BytesIO()) + check(self.FileIO(support.TESTFN, "w")) + check(self.BufferedWriter(self.MockRawIO())) + check(self.BufferedRandom(self.MockRawIO())) + check(self.BufferedRWPair(self.MockRawIO(), self.MockRawIO())) def test_closefd(self): self.assertRaises(ValueError, self.open, support.TESTFN, 'w', @@ -803,6 +831,19 @@ with self.assertRaises(ValueError): self.open(support.TESTFN, 'w', newline='invalid') + def test_buffered_readinto_mixin(self): + # Test the implementation provided by BufferedIOBase + class Stream(self.BufferedIOBase): + def read(self, size): + return b"12345" + read1 = read + stream = Stream() + for method in ("readinto", "readinto1"): + with self.subTest(method): + buffer = byteslike(5) + self.assertEqual(getattr(stream, method)(buffer), 5) + self.assertEqual(bytes(buffer), b"12345") + class CIOTest(IOTest): @@ -1394,6 +1435,11 @@ bufio = self.tp(writer, 8) bufio.write(b"abc") self.assertFalse(writer._write_stack) + buffer = bytearray(b"def") + bufio.write(buffer) + buffer[:] = b"***" # Overwrite our copy of the data + bufio.flush() + self.assertEqual(b"".join(writer._write_stack), b"abcdef") def test_write_overflow(self): writer = self.MockRawIO() @@ -1720,11 +1766,13 @@ self.assertEqual(pair.read1(3), b"abc") def test_readinto(self): - pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO()) - - data = bytearray(5) - self.assertEqual(pair.readinto(data), 5) - self.assertEqual(data, b"abcde") + for method in ("readinto", "readinto1"): + with self.subTest(method): + pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO()) + + data = byteslike(5) + self.assertEqual(getattr(pair, method)(data), 5) + self.assertEqual(bytes(data), b"abcde") def test_write(self): w = self.MockRawIO() @@ -1732,7 +1780,9 @@ pair.write(b"abc") pair.flush() - pair.write(b"def") + buffer = bytearray(b"def") + pair.write(buffer) + buffer[:] = b"***" # Overwrite our copy of the data pair.flush() self.assertEqual(w._write_stack, [b"abc", b"def"]) diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -399,7 +399,16 @@ del __main__.PickleTestMemIO -class BytesIOMixin: +class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): + # Test _pyio.BytesIO; class also inherited for testing C implementation + + UnsupportedOperation = pyio.UnsupportedOperation + + @staticmethod + def buftype(s): + return s.encode("ascii") + ioclass = pyio.BytesIO + EOF = b"" def test_getbuffer(self): memio = self.ioclass(b"1234567890") @@ -426,18 +435,6 @@ memio.close() self.assertRaises(ValueError, memio.getbuffer) - -class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, - BytesIOMixin, unittest.TestCase): - - UnsupportedOperation = pyio.UnsupportedOperation - - @staticmethod - def buftype(s): - return s.encode("ascii") - ioclass = pyio.BytesIO - EOF = b"" - def test_read1(self): buf = self.buftype("1234567890") memio = self.ioclass(buf) diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -190,8 +190,8 @@ PyDoc_STRVAR(bufferediobase_write_doc, "Write the given buffer to the IO stream.\n" "\n" - "Returns the number of bytes written, which is never less than\n" - "len(b).\n" + "Returns the number of bytes written, which is always the length of b\n" + "in bytes.\n" "\n" "Raises BlockingIOError if the buffer is full and the\n" "underlying raw stream cannot accept more data at the moment.\n"); diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -546,7 +546,7 @@ buffer: Py_buffer(accept={rwbuffer}) / -Read up to len(buffer) bytes into buffer. +Read bytes into buffer. Returns number of bytes read (0 for EOF), or None if the object is set not to block and has no data to read. @@ -554,7 +554,7 @@ static PyObject * _io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer) -/*[clinic end generated code: output=a5d407217dcf0639 input=b52a8782706f0037]*/ +/*[clinic end generated code: output=a5d407217dcf0639 input=1424d0fdce857919]*/ { Py_ssize_t len, n; diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -259,7 +259,7 @@ "readinto($self, buffer, /)\n" "--\n" "\n" -"Read up to len(buffer) bytes into buffer.\n" +"Read bytes into buffer.\n" "\n" "Returns number of bytes read (0 for EOF), or None if the object\n" "is set not to block and has no data to read."); @@ -419,4 +419,4 @@ exit: return return_value; } -/*[clinic end generated code: output=164cf0e4117dadbe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=60ce2c6272718431 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -222,7 +222,7 @@ "write($self, b, /)\n" "--\n" "\n" -"Write bytes b to file, return number written.\n" +"Write buffer b to file, return number of bytes written.\n" "\n" "Only makes one system call, so not all of the data may be written.\n" "The number of bytes actually written is returned. In non-blocking mode,\n" @@ -364,4 +364,4 @@ #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=b1a20b10c81add64 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dcbc39b466598492 input=a9049054013a1b77]*/ diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -835,7 +835,7 @@ b: Py_buffer / -Write bytes b to file, return number written. +Write buffer b to file, return number of bytes written. Only makes one system call, so not all of the data may be written. The number of bytes actually written is returned. In non-blocking mode, @@ -844,7 +844,7 @@ static PyObject * _io_FileIO_write_impl(fileio *self, Py_buffer *b) -/*[clinic end generated code: output=b4059db3d363a2f7 input=ffbd8834f447ac31]*/ +/*[clinic end generated code: output=b4059db3d363a2f7 input=6e7908b36f0ce74f]*/ { Py_ssize_t n; int err; diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -53,8 +53,9 @@ "called.\n" "\n" "The basic type used for binary data read from or written to a file is\n" - "bytes. bytearrays are accepted too, and in some cases (such as\n" - "readinto) needed. Text I/O classes work with str data.\n" + "bytes. Other bytes-like objects are accepted as method arguments too.\n" + "In some cases (such as readinto), a writable object is required. Text\n" + "I/O classes work with str data.\n" "\n" "Note that calling any method (except additional calls to close(),\n" "which are ignored) on a closed stream should raise a ValueError.\n" -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 22:35:34 2016 From: python-checkins at python.org (martin.panter) Date: Sat, 28 May 2016 02:35:34 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2326553=3A_Merge_capitalization_from_3=2E5?= Message-ID: <20160528023534.13905.93863.F5454425@psf.io> https://hg.python.org/cpython/rev/8c92ebcca83f changeset: 101532:8c92ebcca83f parent: 101530:c1b40a29dc7a parent: 101531:4275181c4229 user: Martin Panter date: Sat May 28 02:25:07 2016 +0000 summary: Issue #26553: Merge capitalization from 3.5 files: Doc/library/concurrent.futures.rst | 2 +- Doc/library/ftplib.rst | 2 +- Doc/library/http.client.rst | 2 +- Doc/library/urllib.parse.rst | 2 +- Doc/library/urllib.request.rst | 14 +++++++------- Doc/library/xmlrpc.client.rst | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst --- a/Doc/library/concurrent.futures.rst +++ b/Doc/library/concurrent.futures.rst @@ -153,7 +153,7 @@ 'http://www.bbc.co.uk/', 'http://some-made-up-domain.com/'] - # Retrieve a single page and report the url and contents + # Retrieve a single page and report the URL and contents def load_url(url, timeout): with urllib.request.urlopen(url, timeout=timeout) as conn: return conn.read() diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst --- a/Doc/library/ftplib.rst +++ b/Doc/library/ftplib.rst @@ -16,7 +16,7 @@ This module defines the class :class:`FTP` and a few related items. The :class:`FTP` class implements the client side of the FTP protocol. You can use this to write Python programs that perform a variety of automated FTP jobs, such -as mirroring other ftp servers. It is also used by the module +as mirroring other FTP servers. It is also used by the module :mod:`urllib.request` to handle URLs that use FTP. For more information on FTP (File Transfer Protocol), see Internet :rfc:`959`. diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst --- a/Doc/library/http.client.rst +++ b/Doc/library/http.client.rst @@ -22,7 +22,7 @@ .. seealso:: The `Requests package `_ - is recommended for a higher-level http client interface. + is recommended for a higher-level HTTP client interface. .. note:: diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst --- a/Doc/library/urllib.parse.rst +++ b/Doc/library/urllib.parse.rst @@ -592,7 +592,7 @@ Names (URNs) and Uniform Resource Locators (URLs). :rfc:`2368` - The mailto URL scheme. - Parsing requirements for mailto url schemes. + Parsing requirements for mailto URL schemes. :rfc:`1808` - Relative Uniform Resource Locators This Request For Comments includes the rules for joining an absolute and a diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -15,7 +15,7 @@ .. seealso:: The `Requests package `_ - is recommended for a higher-level http client interface. + is recommended for a higher-level HTTP client interface. The :mod:`urllib.request` module defines the following functions: @@ -71,7 +71,7 @@ * :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response. - For http and https urls, this function returns a + For HTTP and HTTPS URLs, this function returns a :class:`http.client.HTTPResponse` object slightly modified. In addition to the three new methods above, the msg attribute contains the same information as the :attr:`~http.client.HTTPResponse.reason` @@ -79,7 +79,7 @@ the response headers as it is specified in the documentation for :class:`~http.client.HTTPResponse`. - For ftp, file, and data urls and requests explicitly handled by legacy + For FTP, file, and data URLs and requests explicitly handled by legacy :class:`URLopener` and :class:`FancyURLopener` classes, this function returns a :class:`urllib.response.addinfourl` object. @@ -453,7 +453,7 @@ .. attribute:: Request.selector The URI path. If the :class:`Request` uses a proxy, then selector - will be the full url that is passed to the proxy. + will be the full URL that is passed to the proxy. .. attribute:: Request.data @@ -772,8 +772,8 @@ details of the precise meanings of the various redirection codes. An :class:`HTTPError` exception raised as a security consideration if the - HTTPRedirectHandler is presented with a redirected url which is not an HTTP, - HTTPS or FTP url. + HTTPRedirectHandler is presented with a redirected URL which is not an HTTP, + HTTPS or FTP URL. .. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) @@ -1126,7 +1126,7 @@ Note that urlopen returns a bytes object. This is because there is no way for urlopen to automatically determine the encoding of the byte stream -it receives from the http server. In general, a program will decode +it receives from the HTTP server. In general, a program will decode the returned bytes object to string once it determines or guesses the appropriate encoding. diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -29,7 +29,7 @@ .. versionchanged:: 3.5 - For https URIs, :mod:`xmlrpc.client` now performs all the necessary + For HTTPS URIs, :mod:`xmlrpc.client` now performs all the necessary certificate and hostname checks by default. .. class:: ServerProxy(uri, transport=None, encoding=None, verbose=False, \ @@ -67,7 +67,7 @@ portion will be base64-encoded as an HTTP 'Authorization' header, and sent to the remote server as part of the connection process when invoking an XML-RPC method. You only need to use this if the remote server requires a Basic - Authentication user and password. If an HTTPS url is provided, *context* may + Authentication user and password. If an HTTPS URL is provided, *context* may be :class:`ssl.SSLContext` and configures the SSL settings of the underlying HTTPS connection. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 22:35:34 2016 From: python-checkins at python.org (martin.panter) Date: Sat, 28 May 2016 02:35:34 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI2NTUz?= =?utf-8?q?=3A_Capitalization_of_HTTP=2C_HTTPS=2C_FTP=2C_and_URL?= Message-ID: <20160528023534.30689.41155.F6D56802@psf.io> https://hg.python.org/cpython/rev/4275181c4229 changeset: 101531:4275181c4229 branch: 3.5 parent: 101529:bd41151a7429 user: Martin Panter date: Sat May 28 02:20:39 2016 +0000 summary: Issue #26553: Capitalization of HTTP, HTTPS, FTP, and URL Patch by Anish Shah and Aatish Neupane. files: Doc/library/concurrent.futures.rst | 2 +- Doc/library/ftplib.rst | 2 +- Doc/library/http.client.rst | 2 +- Doc/library/urllib.parse.rst | 2 +- Doc/library/urllib.request.rst | 14 +++++++------- Doc/library/xmlrpc.client.rst | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst --- a/Doc/library/concurrent.futures.rst +++ b/Doc/library/concurrent.futures.rst @@ -153,7 +153,7 @@ 'http://www.bbc.co.uk/', 'http://some-made-up-domain.com/'] - # Retrieve a single page and report the url and contents + # Retrieve a single page and report the URL and contents def load_url(url, timeout): with urllib.request.urlopen(url, timeout=timeout) as conn: return conn.read() diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst --- a/Doc/library/ftplib.rst +++ b/Doc/library/ftplib.rst @@ -16,7 +16,7 @@ This module defines the class :class:`FTP` and a few related items. The :class:`FTP` class implements the client side of the FTP protocol. You can use this to write Python programs that perform a variety of automated FTP jobs, such -as mirroring other ftp servers. It is also used by the module +as mirroring other FTP servers. It is also used by the module :mod:`urllib.request` to handle URLs that use FTP. For more information on FTP (File Transfer Protocol), see Internet :rfc:`959`. diff --git a/Doc/library/http.client.rst b/Doc/library/http.client.rst --- a/Doc/library/http.client.rst +++ b/Doc/library/http.client.rst @@ -22,7 +22,7 @@ .. seealso:: The `Requests package `_ - is recommended for a higher-level http client interface. + is recommended for a higher-level HTTP client interface. .. note:: diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst --- a/Doc/library/urllib.parse.rst +++ b/Doc/library/urllib.parse.rst @@ -582,7 +582,7 @@ Names (URNs) and Uniform Resource Locators (URLs). :rfc:`2368` - The mailto URL scheme. - Parsing requirements for mailto url schemes. + Parsing requirements for mailto URL schemes. :rfc:`1808` - Relative Uniform Resource Locators This Request For Comments includes the rules for joining an absolute and a diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -15,7 +15,7 @@ .. seealso:: The `Requests package `_ - is recommended for a higher-level http client interface. + is recommended for a higher-level HTTP client interface. The :mod:`urllib.request` module defines the following functions: @@ -71,7 +71,7 @@ * :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response. - For http and https urls, this function returns a + For HTTP and HTTPS URLs, this function returns a :class:`http.client.HTTPResponse` object slightly modified. In addition to the three new methods above, the msg attribute contains the same information as the :attr:`~http.client.HTTPResponse.reason` @@ -79,7 +79,7 @@ the response headers as it is specified in the documentation for :class:`~http.client.HTTPResponse`. - For ftp, file, and data urls and requests explicitly handled by legacy + For FTP, file, and data URLs and requests explicitly handled by legacy :class:`URLopener` and :class:`FancyURLopener` classes, this function returns a :class:`urllib.response.addinfourl` object. @@ -453,7 +453,7 @@ .. attribute:: Request.selector The URI path. If the :class:`Request` uses a proxy, then selector - will be the full url that is passed to the proxy. + will be the full URL that is passed to the proxy. .. attribute:: Request.data @@ -772,8 +772,8 @@ details of the precise meanings of the various redirection codes. An :class:`HTTPError` exception raised as a security consideration if the - HTTPRedirectHandler is presented with a redirected url which is not an HTTP, - HTTPS or FTP url. + HTTPRedirectHandler is presented with a redirected URL which is not an HTTP, + HTTPS or FTP URL. .. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl) @@ -1126,7 +1126,7 @@ Note that urlopen returns a bytes object. This is because there is no way for urlopen to automatically determine the encoding of the byte stream -it receives from the http server. In general, a program will decode +it receives from the HTTP server. In general, a program will decode the returned bytes object to string once it determines or guesses the appropriate encoding. diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -29,7 +29,7 @@ .. versionchanged:: 3.5 - For https URIs, :mod:`xmlrpc.client` now performs all the necessary + For HTTPS URIs, :mod:`xmlrpc.client` now performs all the necessary certificate and hostname checks by default. .. class:: ServerProxy(uri, transport=None, encoding=None, verbose=False, \ @@ -67,7 +67,7 @@ portion will be base64-encoded as an HTTP 'Authorization' header, and sent to the remote server as part of the connection process when invoking an XML-RPC method. You only need to use this if the remote server requires a Basic - Authentication user and password. If an HTTPS url is provided, *context* may + Authentication user and password. If an HTTPS URL is provided, *context* may be :class:`ssl.SSLContext` and configures the SSL settings of the underlying HTTPS connection. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Fri May 27 22:35:35 2016 From: python-checkins at python.org (martin.panter) Date: Sat, 28 May 2016 02:35:35 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI2NTUz?= =?utf-8?q?=3A_Capitalization_of_HTTP=2C_HTTPS=2C_FTP=2C_and_URL?= Message-ID: <20160528023534.10658.59152.A243C52A@psf.io> https://hg.python.org/cpython/rev/d914d681b7f3 changeset: 101533:d914d681b7f3 branch: 2.7 parent: 101526:0df93ab07a8f user: Martin Panter date: Sat May 28 02:33:05 2016 +0000 summary: Issue #26553: Capitalization of HTTP, HTTPS, FTP, and URL Patch by Anish Shah and Aatish Neupane. files: Doc/library/fl.rst | 2 +- Doc/library/ftplib.rst | 2 +- Doc/library/httplib.rst | 2 +- Doc/library/urllib.rst | 8 ++++---- Doc/library/urllib2.rst | 2 +- Doc/library/urlparse.rst | 2 +- Doc/library/xmlrpclib.rst | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Doc/library/fl.rst b/Doc/library/fl.rst --- a/Doc/library/fl.rst +++ b/Doc/library/fl.rst @@ -17,7 +17,7 @@ single: Overmars, Mark This module provides an interface to the FORMS Library by Mark Overmars. The -source for the library can be retrieved by anonymous ftp from host +source for the library can be retrieved by anonymous FTP from host ``ftp.cs.ruu.nl``, directory :file:`SGI/FORMS`. It was last tested with version 2.0b. diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst --- a/Doc/library/ftplib.rst +++ b/Doc/library/ftplib.rst @@ -16,7 +16,7 @@ This module defines the class :class:`FTP` and a few related items. The :class:`FTP` class implements the client side of the FTP protocol. You can use this to write Python programs that perform a variety of automated FTP jobs, such -as mirroring other ftp servers. It is also used by the module :mod:`urllib` to +as mirroring other FTP servers. It is also used by the module :mod:`urllib` to handle URLs that use FTP. For more information on FTP (File Transfer Protocol), see Internet :rfc:`959`. diff --git a/Doc/library/httplib.rst b/Doc/library/httplib.rst --- a/Doc/library/httplib.rst +++ b/Doc/library/httplib.rst @@ -27,7 +27,7 @@ .. seealso:: The `Requests package `_ - is recommended for a higher-level http client interface. + is recommended for a higher-level HTTP client interface. .. note:: diff --git a/Doc/library/urllib.rst b/Doc/library/urllib.rst --- a/Doc/library/urllib.rst +++ b/Doc/library/urllib.rst @@ -27,7 +27,7 @@ .. seealso:: The `Requests package `_ - is recommended for a higher-level http client interface. + is recommended for a higher-level HTTP client interface. .. warning:: When opening HTTPS URLs, it does not attempt to validate the server certificate. Use at your own risk! @@ -118,7 +118,7 @@ causes environmental proxy settings to be used as discussed above. For example:: - # Use http://www.someproxy.com:3128 for http proxying + # Use http://www.someproxy.com:3128 for HTTP proxying proxies = {'http': 'http://www.someproxy.com:3128'} filehandle = urllib.urlopen(some_url, proxies=proxies) # Don't use any proxies @@ -297,8 +297,8 @@ .. note:: urllib also exposes certain utility functions like splittype, splithost and - others parsing url into various components. But it is recommended to use - :mod:`urlparse` for parsing urls rather than using these functions directly. + others parsing URL into various components. But it is recommended to use + :mod:`urlparse` for parsing URLs rather than using these functions directly. Python 3 does not expose these helper functions from :mod:`urllib.parse` module. diff --git a/Doc/library/urllib2.rst b/Doc/library/urllib2.rst --- a/Doc/library/urllib2.rst +++ b/Doc/library/urllib2.rst @@ -21,7 +21,7 @@ .. seealso:: The `Requests package `_ - is recommended for a higher-level http client interface. + is recommended for a higher-level HTTP client interface. The :mod:`urllib2` module defines the following functions: diff --git a/Doc/library/urlparse.rst b/Doc/library/urlparse.rst --- a/Doc/library/urlparse.rst +++ b/Doc/library/urlparse.rst @@ -290,7 +290,7 @@ Names (URNs) and Uniform Resource Locators (URLs). :rfc:`2368` - The mailto URL scheme. - Parsing requirements for mailto url schemes. + Parsing requirements for mailto URL schemes. :rfc:`1808` - Relative Uniform Resource Locators This Request For Comments includes the rules for joining an absolute and a diff --git a/Doc/library/xmlrpclib.rst b/Doc/library/xmlrpclib.rst --- a/Doc/library/xmlrpclib.rst +++ b/Doc/library/xmlrpclib.rst @@ -36,7 +36,7 @@ .. versionchanged:: 2.7.9 - For https URIs, :mod:`xmlrpclib` now performs all the necessary certificate + For HTTPS URIs, :mod:`xmlrpclib` now performs all the necessary certificate and hostname checks by default. .. class:: ServerProxy(uri[, transport[, encoding[, verbose[, allow_none[, use_datetime[, context]]]]]]) @@ -65,7 +65,7 @@ portion will be base64-encoded as an HTTP 'Authorization' header, and sent to the remote server as part of the connection process when invoking an XML-RPC method. You only need to use this if the remote server requires a Basic - Authentication user and password. If an HTTPS url is provided, *context* may + Authentication user and password. If an HTTPS URL is provided, *context* may be :class:`ssl.SSLContext` and configures the SSL settings of the underlying HTTPS connection. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 03:18:40 2016 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 28 May 2016 07:18:40 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_25926=3A__Clarify_th?= =?utf-8?q?at_the_pure_python_equivalents_are_only_approximate=2E?= Message-ID: <20160528071839.13765.27144.7BE515F8@psf.io> https://hg.python.org/cpython/rev/e67e970de54a changeset: 101535:e67e970de54a parent: 101532:8c92ebcca83f user: Raymond Hettinger date: Sat May 28 00:17:54 2016 -0700 summary: Issue 25926: Clarify that the pure python equivalents are only approximate. files: Doc/library/itertools.rst | 42 ++++++++++++++------------ Misc/ACKS | 1 + 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -97,7 +97,7 @@ :class:`~fractions.Fraction`.) If the input iterable is empty, the output iterable will also be empty. - Equivalent to:: + Roughly equivalent to:: def accumulate(iterable, func=operator.add): 'Return running totals' @@ -156,7 +156,7 @@ Make an iterator that returns elements from the first iterable until it is exhausted, then proceeds to the next iterable, until all of the iterables are exhausted. Used for treating consecutive sequences as a single sequence. - Equivalent to:: + Roughly equivalent to:: def chain(*iterables): # chain('ABC', 'DEF') --> A B C D E F @@ -189,7 +189,7 @@ value. So if the input elements are unique, there will be no repeat values in each combination. - Equivalent to:: + Roughly equivalent to:: def combinations(iterable, r): # combinations('ABCD', 2) --> AB AC AD BC BD CD @@ -238,7 +238,7 @@ value. So if the input elements are unique, the generated combinations will also be unique. - Equivalent to:: + Roughly equivalent to:: def combinations_with_replacement(iterable, r): # combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC @@ -278,7 +278,7 @@ Make an iterator that filters elements from *data* returning only those that have a corresponding element in *selectors* that evaluates to ``True``. Stops when either the *data* or *selectors* iterables has been exhausted. - Equivalent to:: + Roughly equivalent to:: def compress(data, selectors): # compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F @@ -291,7 +291,7 @@ Make an iterator that returns evenly spaced values starting with number *start*. Often used as an argument to :func:`map` to generate consecutive data points. - Also, used with :func:`zip` to add sequence numbers. Equivalent to:: + Also, used with :func:`zip` to add sequence numbers. Roughly equivalent to:: def count(start=0, step=1): # count(10) --> 10 11 12 13 14 ... @@ -312,7 +312,7 @@ Make an iterator returning elements from the iterable and saving a copy of each. When the iterable is exhausted, return elements from the saved copy. Repeats - indefinitely. Equivalent to:: + indefinitely. Roughly equivalent to:: def cycle(iterable): # cycle('ABCD') --> A B C D A B C D A B C D ... @@ -333,7 +333,7 @@ Make an iterator that drops elements from the iterable as long as the predicate is true; afterwards, returns every element. Note, the iterator does not produce *any* output until the predicate first becomes false, so it may have a lengthy - start-up time. Equivalent to:: + start-up time. Roughly equivalent to:: def dropwhile(predicate, iterable): # dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1 @@ -349,7 +349,7 @@ Make an iterator that filters elements from iterable returning only those for which the predicate is ``False``. If *predicate* is ``None``, return the items - that are false. Equivalent to:: + that are false. Roughly equivalent to:: def filterfalse(predicate, iterable): # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 @@ -386,7 +386,7 @@ groups.append(list(g)) # Store group iterator as a list uniquekeys.append(k) - :func:`groupby` is equivalent to:: + :func:`groupby` is roughly equivalent to:: class groupby: # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B @@ -426,7 +426,7 @@ specified position. Unlike regular slicing, :func:`islice` does not support negative values for *start*, *stop*, or *step*. Can be used to extract related fields from data where the internal structure has been flattened (for example, a - multi-line report may list a name field on every third line). Equivalent to:: + multi-line report may list a name field on every third line). Roughly equivalent to:: def islice(iterable, *args): # islice('ABCDEFG', 2) --> A B @@ -464,7 +464,7 @@ value. So if the input elements are unique, there will be no repeat values in each permutation. - Equivalent to:: + Roughly equivalent to:: def permutations(iterable, r=None): # permutations('ABCD', 2) --> AB AC AD BA BC BD CA CB CD DA DB DC @@ -510,7 +510,7 @@ Cartesian product of input iterables. - Equivalent to nested for-loops in a generator expression. For example, + Roughly equivalent to nested for-loops in a generator expression. For example, ``product(A, B)`` returns the same as ``((x,y) for x in A for y in B)``. The nested loops cycle like an odometer with the rightmost element advancing @@ -522,7 +522,7 @@ repetitions with the optional *repeat* keyword argument. For example, ``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``. - This function is equivalent to the following code, except that the + This function is roughly equivalent to the following code, except that the actual implementation does not build up intermediate results in memory:: def product(*args, repeat=1): @@ -541,7 +541,9 @@ Make an iterator that returns *object* over and over again. Runs indefinitely unless the *times* argument is specified. Used as argument to :func:`map` for invariant parameters to the called function. Also used with :func:`zip` to - create an invariant part of a tuple record. Equivalent to:: + create an invariant part of a tuple record. + + Roughly equivalent to:: def repeat(object, times=None): # repeat(10, 3) --> 10 10 10 @@ -564,7 +566,7 @@ the iterable. Used instead of :func:`map` when argument parameters are already grouped in tuples from a single iterable (the data has been "pre-zipped"). The difference between :func:`map` and :func:`starmap` parallels the distinction - between ``function(a,b)`` and ``function(*c)``. Equivalent to:: + between ``function(a,b)`` and ``function(*c)``. Roughly equivalent to:: def starmap(function, iterable): # starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000 @@ -575,7 +577,7 @@ .. function:: takewhile(predicate, iterable) Make an iterator that returns elements from the iterable as long as the - predicate is true. Equivalent to:: + predicate is true. Roughly equivalent to:: def takewhile(predicate, iterable): # takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4 @@ -592,7 +594,9 @@ The following Python code helps explain what *tee* does (although the actual implementation is more complex and uses only a single underlying - :abbr:`FIFO (first-in, first-out)` queue):: + :abbr:`FIFO (first-in, first-out)` queue). + + Roughly equivalent to:: def tee(iterable, n=2): it = iter(iterable) @@ -623,7 +627,7 @@ Make an iterator that aggregates elements from each of the iterables. If the iterables are of uneven length, missing values are filled-in with *fillvalue*. - Iteration continues until the longest iterable is exhausted. Equivalent to:: + Iteration continues until the longest iterable is exhausted. Roughly equivalent to:: class ZipExhausted(Exception): pass diff --git a/Misc/ACKS b/Misc/ACKS --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1313,6 +1313,7 @@ Michael Schneider Peter Schneider-Kamp Arvin Schnell +Nofar Schnider Scott Schram Robin Schreiber Chad J. Schroeder -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 03:18:42 2016 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 28 May 2016 07:18:42 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgMjU5MjY6?= =?utf-8?q?__Clarify_that_the_pure_python_equivalents_are_only_approximate?= =?utf-8?q?=2E?= Message-ID: <20160528071839.23323.2872.6044DBEA@psf.io> https://hg.python.org/cpython/rev/613314c3f9ed changeset: 101534:613314c3f9ed branch: 3.5 parent: 101531:4275181c4229 user: Raymond Hettinger date: Sat May 28 00:10:56 2016 -0700 summary: Issue 25926: Clarify that the pure python equivalents are only approximate. files: Doc/library/itertools.rst | 40 ++++++++++++++------------ Misc/ACKS | 1 + 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -97,7 +97,7 @@ :class:`~fractions.Fraction`.) If the input iterable is empty, the output iterable will also be empty. - Equivalent to:: + Roughly equivalent to:: def accumulate(iterable, func=operator.add): 'Return running totals' @@ -156,7 +156,7 @@ Make an iterator that returns elements from the first iterable until it is exhausted, then proceeds to the next iterable, until all of the iterables are exhausted. Used for treating consecutive sequences as a single sequence. - Equivalent to:: + Roughly equivalent to:: def chain(*iterables): # chain('ABC', 'DEF') --> A B C D E F @@ -189,7 +189,7 @@ value. So if the input elements are unique, there will be no repeat values in each combination. - Equivalent to:: + Roughly equivalent to:: def combinations(iterable, r): # combinations('ABCD', 2) --> AB AC AD BC BD CD @@ -238,7 +238,7 @@ value. So if the input elements are unique, the generated combinations will also be unique. - Equivalent to:: + Roughly equivalent to:: def combinations_with_replacement(iterable, r): # combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC @@ -278,7 +278,7 @@ Make an iterator that filters elements from *data* returning only those that have a corresponding element in *selectors* that evaluates to ``True``. Stops when either the *data* or *selectors* iterables has been exhausted. - Equivalent to:: + Roughly equivalent to:: def compress(data, selectors): # compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F @@ -291,7 +291,7 @@ Make an iterator that returns evenly spaced values starting with number *start*. Often used as an argument to :func:`map` to generate consecutive data points. - Also, used with :func:`zip` to add sequence numbers. Equivalent to:: + Also, used with :func:`zip` to add sequence numbers. Roughly equivalent to:: def count(start=0, step=1): # count(10) --> 10 11 12 13 14 ... @@ -312,7 +312,7 @@ Make an iterator returning elements from the iterable and saving a copy of each. When the iterable is exhausted, return elements from the saved copy. Repeats - indefinitely. Equivalent to:: + indefinitely. Roughly equivalent to:: def cycle(iterable): # cycle('ABCD') --> A B C D A B C D A B C D ... @@ -333,7 +333,7 @@ Make an iterator that drops elements from the iterable as long as the predicate is true; afterwards, returns every element. Note, the iterator does not produce *any* output until the predicate first becomes false, so it may have a lengthy - start-up time. Equivalent to:: + start-up time. Roughly equivalent to:: def dropwhile(predicate, iterable): # dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1 @@ -349,7 +349,7 @@ Make an iterator that filters elements from iterable returning only those for which the predicate is ``False``. If *predicate* is ``None``, return the items - that are false. Equivalent to:: + that are false. Roughly equivalent to:: def filterfalse(predicate, iterable): # filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 @@ -386,7 +386,7 @@ groups.append(list(g)) # Store group iterator as a list uniquekeys.append(k) - :func:`groupby` is equivalent to:: + :func:`groupby` is roughly equivalent to:: class groupby: # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B @@ -426,7 +426,7 @@ specified position. Unlike regular slicing, :func:`islice` does not support negative values for *start*, *stop*, or *step*. Can be used to extract related fields from data where the internal structure has been flattened (for example, a - multi-line report may list a name field on every third line). Equivalent to:: + multi-line report may list a name field on every third line). Roughly equivalent to:: def islice(iterable, *args): # islice('ABCDEFG', 2) --> A B @@ -464,7 +464,7 @@ value. So if the input elements are unique, there will be no repeat values in each permutation. - Equivalent to:: + Roughly equivalent to:: def permutations(iterable, r=None): # permutations('ABCD', 2) --> AB AC AD BA BC BD CA CB CD DA DB DC @@ -510,7 +510,7 @@ Cartesian product of input iterables. - Equivalent to nested for-loops in a generator expression. For example, + Roughly equivalent to nested for-loops in a generator expression. For example, ``product(A, B)`` returns the same as ``((x,y) for x in A for y in B)``. The nested loops cycle like an odometer with the rightmost element advancing @@ -522,7 +522,7 @@ repetitions with the optional *repeat* keyword argument. For example, ``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``. - This function is equivalent to the following code, except that the + This function is roughly equivalent to the following code, except that the actual implementation does not build up intermediate results in memory:: def product(*args, repeat=1): @@ -541,7 +541,9 @@ Make an iterator that returns *object* over and over again. Runs indefinitely unless the *times* argument is specified. Used as argument to :func:`map` for invariant parameters to the called function. Also used with :func:`zip` to - create an invariant part of a tuple record. Equivalent to:: + create an invariant part of a tuple record. + + Roughly equivalent to:: def repeat(object, times=None): # repeat(10, 3) --> 10 10 10 @@ -564,7 +566,7 @@ the iterable. Used instead of :func:`map` when argument parameters are already grouped in tuples from a single iterable (the data has been "pre-zipped"). The difference between :func:`map` and :func:`starmap` parallels the distinction - between ``function(a,b)`` and ``function(*c)``. Equivalent to:: + between ``function(a,b)`` and ``function(*c)``. Roughly equivalent to:: def starmap(function, iterable): # starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000 @@ -575,7 +577,7 @@ .. function:: takewhile(predicate, iterable) Make an iterator that returns elements from the iterable as long as the - predicate is true. Equivalent to:: + predicate is true. Roughly equivalent to:: def takewhile(predicate, iterable): # takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4 @@ -588,7 +590,7 @@ .. function:: tee(iterable, n=2) - Return *n* independent iterators from a single iterable. Equivalent to:: + Return *n* independent iterators from a single iterable. Roughly equivalent to:: def tee(iterable, n=2): it = iter(iterable) @@ -619,7 +621,7 @@ Make an iterator that aggregates elements from each of the iterables. If the iterables are of uneven length, missing values are filled-in with *fillvalue*. - Iteration continues until the longest iterable is exhausted. Equivalent to:: + Iteration continues until the longest iterable is exhausted. Roughly equivalent to:: class ZipExhausted(Exception): pass diff --git a/Misc/ACKS b/Misc/ACKS --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1303,6 +1303,7 @@ Michael Schneider Peter Schneider-Kamp Arvin Schnell +Nofar Schnider Scott Schram Robin Schreiber Chad J. Schroeder -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 03:26:48 2016 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 28 May 2016 07:26:48 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgMjU5MjY6?= =?utf-8?q?__Clarify_that_the_pure_python_equivalents_are_only_approximate?= =?utf-8?q?=2E?= Message-ID: <20160528072647.30687.26581.D6980088@psf.io> https://hg.python.org/cpython/rev/f66c30f66235 changeset: 101536:f66c30f66235 branch: 2.7 parent: 101533:d914d681b7f3 user: Raymond Hettinger date: Sat May 28 00:26:41 2016 -0700 summary: Issue 25926: Clarify that the pure python equivalents are only approximate. files: Doc/library/itertools.rst | 40 +++++++++++++------------- Misc/ACKS | 1 + 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -94,7 +94,7 @@ Make an iterator that returns elements from the first iterable until it is exhausted, then proceeds to the next iterable, until all of the iterables are exhausted. Used for treating consecutive sequences as a single sequence. - Equivalent to:: + Roughly equivalent to:: def chain(*iterables): # chain('ABC', 'DEF') --> A B C D E F @@ -129,7 +129,7 @@ value. So if the input elements are unique, there will be no repeat values in each combination. - Equivalent to:: + Roughly equivalent to:: def combinations(iterable, r): # combinations('ABCD', 2) --> AB AC AD BC BD CD @@ -180,7 +180,7 @@ value. So if the input elements are unique, the generated combinations will also be unique. - Equivalent to:: + Roughly equivalent to:: def combinations_with_replacement(iterable, r): # combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC @@ -219,7 +219,7 @@ Make an iterator that filters elements from *data* returning only those that have a corresponding element in *selectors* that evaluates to ``True``. Stops when either the *data* or *selectors* iterables has been exhausted. - Equivalent to:: + Roughly equivalent to:: def compress(data, selectors): # compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F @@ -253,7 +253,7 @@ Make an iterator returning elements from the iterable and saving a copy of each. When the iterable is exhausted, return elements from the saved copy. Repeats - indefinitely. Equivalent to:: + indefinitely. Roughly equivalent to:: def cycle(iterable): # cycle('ABCD') --> A B C D A B C D A B C D ... @@ -274,7 +274,7 @@ Make an iterator that drops elements from the iterable as long as the predicate is true; afterwards, returns every element. Note, the iterator does not produce *any* output until the predicate first becomes false, so it may have a lengthy - start-up time. Equivalent to:: + start-up time. Roughly equivalent to:: def dropwhile(predicate, iterable): # dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1 @@ -313,7 +313,7 @@ groups.append(list(g)) # Store group iterator as a list uniquekeys.append(k) - :func:`groupby` is equivalent to:: + :func:`groupby` is roughly equivalent to:: class groupby(object): # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B @@ -345,7 +345,7 @@ Make an iterator that filters elements from iterable returning only those for which the predicate is ``True``. If *predicate* is ``None``, return the items - that are true. Equivalent to:: + that are true. Roughly equivalent to:: def ifilter(predicate, iterable): # ifilter(lambda x: x%2, range(10)) --> 1 3 5 7 9 @@ -360,7 +360,7 @@ Make an iterator that filters elements from iterable returning only those for which the predicate is ``False``. If *predicate* is ``None``, return the items - that are false. Equivalent to:: + that are false. Roughly equivalent to:: def ifilterfalse(predicate, iterable): # ifilterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8 @@ -379,7 +379,7 @@ exhausted instead of filling in ``None`` for shorter iterables. The reason for the difference is that infinite iterator arguments are typically an error for :func:`map` (because the output is fully evaluated) but represent a common and - useful way of supplying arguments to :func:`imap`. Equivalent to:: + useful way of supplying arguments to :func:`imap`. Roughly equivalent to:: def imap(function, *iterables): # imap(pow, (2,3,10), (5,2,3)) --> 32 9 1000 @@ -403,7 +403,7 @@ specified position. Unlike regular slicing, :func:`islice` does not support negative values for *start*, *stop*, or *step*. Can be used to extract related fields from data where the internal structure has been flattened (for example, a - multi-line report may list a name field on every third line). Equivalent to:: + multi-line report may list a name field on every third line). Roughly equivalent to:: def islice(iterable, *args): # islice('ABCDEFG', 2) --> A B @@ -429,7 +429,7 @@ Make an iterator that aggregates elements from each of the iterables. Like :func:`zip` except that it returns an iterator instead of a list. Used for - lock-step iteration over several iterables at a time. Equivalent to:: + lock-step iteration over several iterables at a time. Roughly equivalent to:: def izip(*iterables): # izip('ABCD', 'xy') --> Ax By @@ -454,7 +454,7 @@ Make an iterator that aggregates elements from each of the iterables. If the iterables are of uneven length, missing values are filled-in with *fillvalue*. - Iteration continues until the longest iterable is exhausted. Equivalent to:: + Iteration continues until the longest iterable is exhausted. Roughly equivalent to:: class ZipExhausted(Exception): pass @@ -499,7 +499,7 @@ value. So if the input elements are unique, there will be no repeat values in each permutation. - Equivalent to:: + Roughly equivalent to:: def permutations(iterable, r=None): # permutations('ABCD', 2) --> AB AC AD BA BC BD CA CB CD DA DB DC @@ -547,7 +547,7 @@ Cartesian product of input iterables. - Equivalent to nested for-loops in a generator expression. For example, + Roughly equivalent to nested for-loops in a generator expression. For example, ``product(A, B)`` returns the same as ``((x,y) for x in A for y in B)``. The nested loops cycle like an odometer with the rightmost element advancing @@ -559,7 +559,7 @@ repetitions with the optional *repeat* keyword argument. For example, ``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``. - This function is equivalent to the following code, except that the + This function is roughly equivalent to the following code, except that the actual implementation does not build up intermediate results in memory:: def product(*args, **kwds): @@ -579,7 +579,7 @@ Make an iterator that returns *object* over and over again. Runs indefinitely unless the *times* argument is specified. Used as argument to :func:`imap` for invariant function parameters. Also used with :func:`izip` to create constant - fields in a tuple record. Equivalent to:: + fields in a tuple record. Roughly equivalent to:: def repeat(object, times=None): # repeat(10, 3) --> 10 10 10 @@ -602,7 +602,7 @@ the iterable. Used instead of :func:`imap` when argument parameters are already grouped in tuples from a single iterable (the data has been "pre-zipped"). The difference between :func:`imap` and :func:`starmap` parallels the distinction - between ``function(a,b)`` and ``function(*c)``. Equivalent to:: + between ``function(a,b)`` and ``function(*c)``. Roughly equivalent to:: def starmap(function, iterable): # starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000 @@ -616,7 +616,7 @@ .. function:: takewhile(predicate, iterable) Make an iterator that returns elements from the iterable as long as the - predicate is true. Equivalent to:: + predicate is true. Roughly equivalent to:: def takewhile(predicate, iterable): # takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4 @@ -629,7 +629,7 @@ .. function:: tee(iterable[, n=2]) - Return *n* independent iterators from a single iterable. Equivalent to:: + Return *n* independent iterators from a single iterable. Roughly equivalent to:: def tee(iterable, n=2): it = iter(iterable) diff --git a/Misc/ACKS b/Misc/ACKS --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1235,6 +1235,7 @@ Michael Schneider Peter Schneider-Kamp Arvin Schnell +Nofar Schnider Scott Schram Robin Schreiber Chad J. Schroeder -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Sat May 28 04:51:14 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 28 May 2016 08:51:14 +0000 Subject: [Python-checkins] Daily reference leaks (8c92ebcca83f): sum=5 Message-ID: <20160528085110.10646.98113.1FE38330@psf.io> results for 8c92ebcca83f on branch "default" -------------------------------------------- test_asyncio leaked [3, 0, 0] memory blocks, sum=3 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_fork leaked [-2, 1, -1] memory blocks, sum=-2 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogHNP81w', '--timeout', '7200'] From python-checkins at python.org Sat May 28 07:26:03 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 28 May 2016 11:26:03 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogTWVyZ2UgaGVhZHMgKGlzc3VlICMyNTkyNiku?= Message-ID: <20160528112603.10648.77915.65F1898B@psf.io> https://hg.python.org/cpython/rev/35fa2ec1f237 changeset: 101537:35fa2ec1f237 parent: 101535:e67e970de54a parent: 101534:613314c3f9ed user: Serhiy Storchaka date: Sat May 28 14:25:46 2016 +0300 summary: Merge heads (issue #25926). files: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 07:48:45 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 28 May 2016 11:48:45 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MTM4?= =?utf-8?q?=3A_Regenerate_Python/importlib=5Fexternal=2Eh=2E?= Message-ID: <20160528114843.30685.65963.4EEB03D7@psf.io> https://hg.python.org/cpython/rev/8a49da84fc1d changeset: 101538:8a49da84fc1d branch: 3.5 parent: 101534:613314c3f9ed user: Serhiy Storchaka date: Sat May 28 14:46:13 2016 +0300 summary: Issue #27138: Regenerate Python/importlib_external.h. files: Python/importlib_external.h | 687 +++++++++++------------ 1 files changed, 343 insertions(+), 344 deletions(-) diff --git a/Python/importlib_external.h b/Python/importlib_external.h --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -2248,350 +2248,349 @@ 0,100,9,0,106,19,0,124,8,0,131,1,0,131,1,0, 1,116,20,0,106,21,0,124,1,0,100,8,0,131,2,0, 125,13,0,124,8,0,103,1,0,124,13,0,95,22,0,124, - 13,0,83,100,8,0,83,41,11,122,125,84,114,121,32,116, - 111,32,102,105,110,100,32,97,32,108,111,97,100,101,114,32, - 102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101, - 100,32,109,111,100,117,108,101,44,32,111,114,32,116,104,101, - 32,110,97,109,101,115,112,97,99,101,10,32,32,32,32,32, - 32,32,32,112,97,99,107,97,103,101,32,112,111,114,116,105, - 111,110,115,46,32,82,101,116,117,114,110,115,32,40,108,111, - 97,100,101,114,44,32,108,105,115,116,45,111,102,45,112,111, - 114,116,105,111,110,115,41,46,70,114,58,0,0,0,114,56, - 0,0,0,114,29,0,0,0,114,185,0,0,0,122,9,116, - 114,121,105,110,103,32,123,125,114,98,0,0,0,78,122,25, - 112,111,115,115,105,98,108,101,32,110,97,109,101,115,112,97, - 99,101,32,102,111,114,32,123,125,114,87,0,0,0,41,23, - 114,32,0,0,0,114,39,0,0,0,114,35,0,0,0,114, - 3,0,0,0,114,45,0,0,0,114,219,0,0,0,114,40, - 0,0,0,114,8,1,0,0,218,11,95,102,105,108,108,95, - 99,97,99,104,101,114,6,0,0,0,114,11,1,0,0,114, - 88,0,0,0,114,10,1,0,0,114,28,0,0,0,114,7, - 1,0,0,114,44,0,0,0,114,5,1,0,0,114,46,0, - 0,0,114,105,0,0,0,114,47,0,0,0,114,121,0,0, - 0,114,160,0,0,0,114,156,0,0,0,41,14,114,108,0, - 0,0,114,126,0,0,0,114,180,0,0,0,90,12,105,115, - 95,110,97,109,101,115,112,97,99,101,90,11,116,97,105,108, - 95,109,111,100,117,108,101,114,133,0,0,0,90,5,99,97, - 99,104,101,90,12,99,97,99,104,101,95,109,111,100,117,108, - 101,90,9,98,97,115,101,95,112,97,116,104,114,225,0,0, - 0,114,165,0,0,0,90,13,105,110,105,116,95,102,105,108, - 101,110,97,109,101,90,9,102,117,108,108,95,112,97,116,104, - 114,164,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,114,181,0,0,0,191,4,0,0,115,68,0, - 0,0,0,3,6,1,19,1,3,1,34,1,13,1,11,1, - 15,1,10,1,9,2,9,1,9,1,15,2,9,1,6,2, - 12,1,18,1,22,1,10,1,15,1,12,1,32,4,12,2, - 22,1,22,1,25,1,16,1,12,1,29,1,6,1,19,1, - 18,1,12,1,4,1,122,20,70,105,108,101,70,105,110,100, - 101,114,46,102,105,110,100,95,115,112,101,99,99,1,0,0, - 0,0,0,0,0,9,0,0,0,13,0,0,0,67,0,0, - 0,115,11,1,0,0,124,0,0,106,0,0,125,1,0,121, - 31,0,116,1,0,106,2,0,124,1,0,112,33,0,116,1, - 0,106,3,0,131,0,0,131,1,0,125,2,0,87,110,33, - 0,4,116,4,0,116,5,0,116,6,0,102,3,0,107,10, - 0,114,75,0,1,1,1,103,0,0,125,2,0,89,110,1, - 0,88,116,7,0,106,8,0,106,9,0,100,1,0,131,1, - 0,115,112,0,116,10,0,124,2,0,131,1,0,124,0,0, - 95,11,0,110,111,0,116,10,0,131,0,0,125,3,0,120, - 90,0,124,2,0,68,93,82,0,125,4,0,124,4,0,106, - 12,0,100,2,0,131,1,0,92,3,0,125,5,0,125,6, - 0,125,7,0,124,6,0,114,191,0,100,3,0,106,13,0, - 124,5,0,124,7,0,106,14,0,131,0,0,131,2,0,125, - 8,0,110,6,0,124,5,0,125,8,0,124,3,0,106,15, - 0,124,8,0,131,1,0,1,113,128,0,87,124,3,0,124, - 0,0,95,11,0,116,7,0,106,8,0,106,9,0,116,16, - 0,131,1,0,114,7,1,100,4,0,100,5,0,132,0,0, - 124,2,0,68,131,1,0,124,0,0,95,17,0,100,6,0, - 83,41,7,122,68,70,105,108,108,32,116,104,101,32,99,97, - 99,104,101,32,111,102,32,112,111,116,101,110,116,105,97,108, - 32,109,111,100,117,108,101,115,32,97,110,100,32,112,97,99, - 107,97,103,101,115,32,102,111,114,32,116,104,105,115,32,100, - 105,114,101,99,116,111,114,121,46,114,0,0,0,0,114,58, - 0,0,0,122,5,123,125,46,123,125,99,1,0,0,0,0, - 0,0,0,2,0,0,0,3,0,0,0,83,0,0,0,115, - 28,0,0,0,104,0,0,124,0,0,93,18,0,125,1,0, - 124,1,0,106,0,0,131,0,0,146,2,0,113,6,0,83, - 114,4,0,0,0,41,1,114,88,0,0,0,41,2,114,22, - 0,0,0,90,2,102,110,114,4,0,0,0,114,4,0,0, - 0,114,5,0,0,0,250,9,60,115,101,116,99,111,109,112, - 62,9,5,0,0,115,2,0,0,0,9,0,122,41,70,105, - 108,101,70,105,110,100,101,114,46,95,102,105,108,108,95,99, - 97,99,104,101,46,60,108,111,99,97,108,115,62,46,60,115, - 101,116,99,111,109,112,62,78,41,18,114,35,0,0,0,114, - 3,0,0,0,90,7,108,105,115,116,100,105,114,114,45,0, - 0,0,114,0,1,0,0,218,15,80,101,114,109,105,115,115, - 105,111,110,69,114,114,111,114,218,18,78,111,116,65,68,105, - 114,101,99,116,111,114,121,69,114,114,111,114,114,7,0,0, - 0,114,8,0,0,0,114,9,0,0,0,114,9,1,0,0, - 114,10,1,0,0,114,83,0,0,0,114,47,0,0,0,114, - 88,0,0,0,218,3,97,100,100,114,10,0,0,0,114,11, - 1,0,0,41,9,114,108,0,0,0,114,35,0,0,0,90, - 8,99,111,110,116,101,110,116,115,90,21,108,111,119,101,114, - 95,115,117,102,102,105,120,95,99,111,110,116,101,110,116,115, - 114,245,0,0,0,114,106,0,0,0,114,237,0,0,0,114, - 225,0,0,0,90,8,110,101,119,95,110,97,109,101,114,4, - 0,0,0,114,4,0,0,0,114,5,0,0,0,114,13,1, - 0,0,236,4,0,0,115,34,0,0,0,0,2,9,1,3, - 1,31,1,22,3,11,3,18,1,18,7,9,1,13,1,24, - 1,6,1,27,2,6,1,17,1,9,1,18,1,122,22,70, - 105,108,101,70,105,110,100,101,114,46,95,102,105,108,108,95, - 99,97,99,104,101,99,1,0,0,0,0,0,0,0,3,0, - 0,0,3,0,0,0,7,0,0,0,115,25,0,0,0,135, - 0,0,135,1,0,102,2,0,100,1,0,100,2,0,134,0, - 0,125,2,0,124,2,0,83,41,3,97,20,1,0,0,65, - 32,99,108,97,115,115,32,109,101,116,104,111,100,32,119,104, - 105,99,104,32,114,101,116,117,114,110,115,32,97,32,99,108, - 111,115,117,114,101,32,116,111,32,117,115,101,32,111,110,32, - 115,121,115,46,112,97,116,104,95,104,111,111,107,10,32,32, - 32,32,32,32,32,32,119,104,105,99,104,32,119,105,108,108, - 32,114,101,116,117,114,110,32,97,110,32,105,110,115,116,97, - 110,99,101,32,117,115,105,110,103,32,116,104,101,32,115,112, - 101,99,105,102,105,101,100,32,108,111,97,100,101,114,115,32, - 97,110,100,32,116,104,101,32,112,97,116,104,10,32,32,32, - 32,32,32,32,32,99,97,108,108,101,100,32,111,110,32,116, - 104,101,32,99,108,111,115,117,114,101,46,10,10,32,32,32, - 32,32,32,32,32,73,102,32,116,104,101,32,112,97,116,104, - 32,99,97,108,108,101,100,32,111,110,32,116,104,101,32,99, - 108,111,115,117,114,101,32,105,115,32,110,111,116,32,97,32, - 100,105,114,101,99,116,111,114,121,44,32,73,109,112,111,114, - 116,69,114,114,111,114,32,105,115,10,32,32,32,32,32,32, - 32,32,114,97,105,115,101,100,46,10,10,32,32,32,32,32, - 32,32,32,99,1,0,0,0,0,0,0,0,1,0,0,0, - 4,0,0,0,19,0,0,0,115,43,0,0,0,116,0,0, - 124,0,0,131,1,0,115,30,0,116,1,0,100,1,0,100, - 2,0,124,0,0,131,1,1,130,1,0,136,0,0,124,0, - 0,136,1,0,140,1,0,83,41,3,122,45,80,97,116,104, - 32,104,111,111,107,32,102,111,114,32,105,109,112,111,114,116, - 108,105,98,46,109,97,99,104,105,110,101,114,121,46,70,105, - 108,101,70,105,110,100,101,114,46,122,30,111,110,108,121,32, - 100,105,114,101,99,116,111,114,105,101,115,32,97,114,101,32, - 115,117,112,112,111,114,116,101,100,114,35,0,0,0,41,2, - 114,46,0,0,0,114,107,0,0,0,41,1,114,35,0,0, - 0,41,2,114,170,0,0,0,114,12,1,0,0,114,4,0, - 0,0,114,5,0,0,0,218,24,112,97,116,104,95,104,111, + 13,0,83,100,8,0,83,41,11,122,102,84,114,121,32,116, + 111,32,102,105,110,100,32,97,32,115,112,101,99,32,102,111, + 114,32,116,104,101,32,115,112,101,99,105,102,105,101,100,32, + 109,111,100,117,108,101,46,32,32,82,101,116,117,114,110,115, + 32,116,104,101,10,32,32,32,32,32,32,32,32,109,97,116, + 99,104,105,110,103,32,115,112,101,99,44,32,111,114,32,78, + 111,110,101,32,105,102,32,110,111,116,32,102,111,117,110,100, + 46,70,114,58,0,0,0,114,56,0,0,0,114,29,0,0, + 0,114,185,0,0,0,122,9,116,114,121,105,110,103,32,123, + 125,114,98,0,0,0,78,122,25,112,111,115,115,105,98,108, + 101,32,110,97,109,101,115,112,97,99,101,32,102,111,114,32, + 123,125,114,87,0,0,0,41,23,114,32,0,0,0,114,39, + 0,0,0,114,35,0,0,0,114,3,0,0,0,114,45,0, + 0,0,114,219,0,0,0,114,40,0,0,0,114,8,1,0, + 0,218,11,95,102,105,108,108,95,99,97,99,104,101,114,6, + 0,0,0,114,11,1,0,0,114,88,0,0,0,114,10,1, + 0,0,114,28,0,0,0,114,7,1,0,0,114,44,0,0, + 0,114,5,1,0,0,114,46,0,0,0,114,105,0,0,0, + 114,47,0,0,0,114,121,0,0,0,114,160,0,0,0,114, + 156,0,0,0,41,14,114,108,0,0,0,114,126,0,0,0, + 114,180,0,0,0,90,12,105,115,95,110,97,109,101,115,112, + 97,99,101,90,11,116,97,105,108,95,109,111,100,117,108,101, + 114,133,0,0,0,90,5,99,97,99,104,101,90,12,99,97, + 99,104,101,95,109,111,100,117,108,101,90,9,98,97,115,101, + 95,112,97,116,104,114,225,0,0,0,114,165,0,0,0,90, + 13,105,110,105,116,95,102,105,108,101,110,97,109,101,90,9, + 102,117,108,108,95,112,97,116,104,114,164,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,114,181,0, + 0,0,191,4,0,0,115,68,0,0,0,0,3,6,1,19, + 1,3,1,34,1,13,1,11,1,15,1,10,1,9,2,9, + 1,9,1,15,2,9,1,6,2,12,1,18,1,22,1,10, + 1,15,1,12,1,32,4,12,2,22,1,22,1,25,1,16, + 1,12,1,29,1,6,1,19,1,18,1,12,1,4,1,122, + 20,70,105,108,101,70,105,110,100,101,114,46,102,105,110,100, + 95,115,112,101,99,99,1,0,0,0,0,0,0,0,9,0, + 0,0,13,0,0,0,67,0,0,0,115,11,1,0,0,124, + 0,0,106,0,0,125,1,0,121,31,0,116,1,0,106,2, + 0,124,1,0,112,33,0,116,1,0,106,3,0,131,0,0, + 131,1,0,125,2,0,87,110,33,0,4,116,4,0,116,5, + 0,116,6,0,102,3,0,107,10,0,114,75,0,1,1,1, + 103,0,0,125,2,0,89,110,1,0,88,116,7,0,106,8, + 0,106,9,0,100,1,0,131,1,0,115,112,0,116,10,0, + 124,2,0,131,1,0,124,0,0,95,11,0,110,111,0,116, + 10,0,131,0,0,125,3,0,120,90,0,124,2,0,68,93, + 82,0,125,4,0,124,4,0,106,12,0,100,2,0,131,1, + 0,92,3,0,125,5,0,125,6,0,125,7,0,124,6,0, + 114,191,0,100,3,0,106,13,0,124,5,0,124,7,0,106, + 14,0,131,0,0,131,2,0,125,8,0,110,6,0,124,5, + 0,125,8,0,124,3,0,106,15,0,124,8,0,131,1,0, + 1,113,128,0,87,124,3,0,124,0,0,95,11,0,116,7, + 0,106,8,0,106,9,0,116,16,0,131,1,0,114,7,1, + 100,4,0,100,5,0,132,0,0,124,2,0,68,131,1,0, + 124,0,0,95,17,0,100,6,0,83,41,7,122,68,70,105, + 108,108,32,116,104,101,32,99,97,99,104,101,32,111,102,32, + 112,111,116,101,110,116,105,97,108,32,109,111,100,117,108,101, + 115,32,97,110,100,32,112,97,99,107,97,103,101,115,32,102, + 111,114,32,116,104,105,115,32,100,105,114,101,99,116,111,114, + 121,46,114,0,0,0,0,114,58,0,0,0,122,5,123,125, + 46,123,125,99,1,0,0,0,0,0,0,0,2,0,0,0, + 3,0,0,0,83,0,0,0,115,28,0,0,0,104,0,0, + 124,0,0,93,18,0,125,1,0,124,1,0,106,0,0,131, + 0,0,146,2,0,113,6,0,83,114,4,0,0,0,41,1, + 114,88,0,0,0,41,2,114,22,0,0,0,90,2,102,110, + 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,250, + 9,60,115,101,116,99,111,109,112,62,9,5,0,0,115,2, + 0,0,0,9,0,122,41,70,105,108,101,70,105,110,100,101, + 114,46,95,102,105,108,108,95,99,97,99,104,101,46,60,108, + 111,99,97,108,115,62,46,60,115,101,116,99,111,109,112,62, + 78,41,18,114,35,0,0,0,114,3,0,0,0,90,7,108, + 105,115,116,100,105,114,114,45,0,0,0,114,0,1,0,0, + 218,15,80,101,114,109,105,115,115,105,111,110,69,114,114,111, + 114,218,18,78,111,116,65,68,105,114,101,99,116,111,114,121, + 69,114,114,111,114,114,7,0,0,0,114,8,0,0,0,114, + 9,0,0,0,114,9,1,0,0,114,10,1,0,0,114,83, + 0,0,0,114,47,0,0,0,114,88,0,0,0,218,3,97, + 100,100,114,10,0,0,0,114,11,1,0,0,41,9,114,108, + 0,0,0,114,35,0,0,0,90,8,99,111,110,116,101,110, + 116,115,90,21,108,111,119,101,114,95,115,117,102,102,105,120, + 95,99,111,110,116,101,110,116,115,114,245,0,0,0,114,106, + 0,0,0,114,237,0,0,0,114,225,0,0,0,90,8,110, + 101,119,95,110,97,109,101,114,4,0,0,0,114,4,0,0, + 0,114,5,0,0,0,114,13,1,0,0,236,4,0,0,115, + 34,0,0,0,0,2,9,1,3,1,31,1,22,3,11,3, + 18,1,18,7,9,1,13,1,24,1,6,1,27,2,6,1, + 17,1,9,1,18,1,122,22,70,105,108,101,70,105,110,100, + 101,114,46,95,102,105,108,108,95,99,97,99,104,101,99,1, + 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,7, + 0,0,0,115,25,0,0,0,135,0,0,135,1,0,102,2, + 0,100,1,0,100,2,0,134,0,0,125,2,0,124,2,0, + 83,41,3,97,20,1,0,0,65,32,99,108,97,115,115,32, + 109,101,116,104,111,100,32,119,104,105,99,104,32,114,101,116, + 117,114,110,115,32,97,32,99,108,111,115,117,114,101,32,116, + 111,32,117,115,101,32,111,110,32,115,121,115,46,112,97,116, + 104,95,104,111,111,107,10,32,32,32,32,32,32,32,32,119, + 104,105,99,104,32,119,105,108,108,32,114,101,116,117,114,110, + 32,97,110,32,105,110,115,116,97,110,99,101,32,117,115,105, + 110,103,32,116,104,101,32,115,112,101,99,105,102,105,101,100, + 32,108,111,97,100,101,114,115,32,97,110,100,32,116,104,101, + 32,112,97,116,104,10,32,32,32,32,32,32,32,32,99,97, + 108,108,101,100,32,111,110,32,116,104,101,32,99,108,111,115, + 117,114,101,46,10,10,32,32,32,32,32,32,32,32,73,102, + 32,116,104,101,32,112,97,116,104,32,99,97,108,108,101,100, + 32,111,110,32,116,104,101,32,99,108,111,115,117,114,101,32, + 105,115,32,110,111,116,32,97,32,100,105,114,101,99,116,111, + 114,121,44,32,73,109,112,111,114,116,69,114,114,111,114,32, + 105,115,10,32,32,32,32,32,32,32,32,114,97,105,115,101, + 100,46,10,10,32,32,32,32,32,32,32,32,99,1,0,0, + 0,0,0,0,0,1,0,0,0,4,0,0,0,19,0,0, + 0,115,43,0,0,0,116,0,0,124,0,0,131,1,0,115, + 30,0,116,1,0,100,1,0,100,2,0,124,0,0,131,1, + 1,130,1,0,136,0,0,124,0,0,136,1,0,140,1,0, + 83,41,3,122,45,80,97,116,104,32,104,111,111,107,32,102, + 111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,99, + 104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,101, + 114,46,122,30,111,110,108,121,32,100,105,114,101,99,116,111, + 114,105,101,115,32,97,114,101,32,115,117,112,112,111,114,116, + 101,100,114,35,0,0,0,41,2,114,46,0,0,0,114,107, + 0,0,0,41,1,114,35,0,0,0,41,2,114,170,0,0, + 0,114,12,1,0,0,114,4,0,0,0,114,5,0,0,0, + 218,24,112,97,116,104,95,104,111,111,107,95,102,111,114,95, + 70,105,108,101,70,105,110,100,101,114,21,5,0,0,115,6, + 0,0,0,0,2,12,1,18,1,122,54,70,105,108,101,70, + 105,110,100,101,114,46,112,97,116,104,95,104,111,111,107,46, + 60,108,111,99,97,108,115,62,46,112,97,116,104,95,104,111, 111,107,95,102,111,114,95,70,105,108,101,70,105,110,100,101, - 114,21,5,0,0,115,6,0,0,0,0,2,12,1,18,1, - 122,54,70,105,108,101,70,105,110,100,101,114,46,112,97,116, - 104,95,104,111,111,107,46,60,108,111,99,97,108,115,62,46, - 112,97,116,104,95,104,111,111,107,95,102,111,114,95,70,105, - 108,101,70,105,110,100,101,114,114,4,0,0,0,41,3,114, - 170,0,0,0,114,12,1,0,0,114,18,1,0,0,114,4, - 0,0,0,41,2,114,170,0,0,0,114,12,1,0,0,114, - 5,0,0,0,218,9,112,97,116,104,95,104,111,111,107,11, - 5,0,0,115,4,0,0,0,0,10,21,6,122,20,70,105, - 108,101,70,105,110,100,101,114,46,112,97,116,104,95,104,111, - 111,107,99,1,0,0,0,0,0,0,0,1,0,0,0,2, - 0,0,0,67,0,0,0,115,16,0,0,0,100,1,0,106, - 0,0,124,0,0,106,1,0,131,1,0,83,41,2,78,122, - 16,70,105,108,101,70,105,110,100,101,114,40,123,33,114,125, - 41,41,2,114,47,0,0,0,114,35,0,0,0,41,1,114, - 108,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, - 0,0,0,114,244,0,0,0,29,5,0,0,115,2,0,0, - 0,0,1,122,19,70,105,108,101,70,105,110,100,101,114,46, - 95,95,114,101,112,114,95,95,41,15,114,112,0,0,0,114, - 111,0,0,0,114,113,0,0,0,114,114,0,0,0,114,185, - 0,0,0,114,250,0,0,0,114,130,0,0,0,114,182,0, - 0,0,114,124,0,0,0,114,5,1,0,0,114,181,0,0, - 0,114,13,1,0,0,114,183,0,0,0,114,19,1,0,0, - 114,244,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,114,6,1,0,0,145,4, - 0,0,115,20,0,0,0,12,7,6,2,12,14,12,4,6, - 2,12,12,12,5,15,45,12,31,18,18,114,6,1,0,0, - 99,4,0,0,0,0,0,0,0,6,0,0,0,11,0,0, - 0,67,0,0,0,115,195,0,0,0,124,0,0,106,0,0, - 100,1,0,131,1,0,125,4,0,124,0,0,106,0,0,100, - 2,0,131,1,0,125,5,0,124,4,0,115,99,0,124,5, - 0,114,54,0,124,5,0,106,1,0,125,4,0,110,45,0, - 124,2,0,124,3,0,107,2,0,114,84,0,116,2,0,124, - 1,0,124,2,0,131,2,0,125,4,0,110,15,0,116,3, - 0,124,1,0,124,2,0,131,2,0,125,4,0,124,5,0, - 115,126,0,116,4,0,124,1,0,124,2,0,100,3,0,124, - 4,0,131,2,1,125,5,0,121,44,0,124,5,0,124,0, - 0,100,2,0,60,124,4,0,124,0,0,100,1,0,60,124, - 2,0,124,0,0,100,4,0,60,124,3,0,124,0,0,100, - 5,0,60,87,110,18,0,4,116,5,0,107,10,0,114,190, - 0,1,1,1,89,110,1,0,88,100,0,0,83,41,6,78, - 218,10,95,95,108,111,97,100,101,114,95,95,218,8,95,95, - 115,112,101,99,95,95,114,127,0,0,0,90,8,95,95,102, - 105,108,101,95,95,90,10,95,95,99,97,99,104,101,100,95, - 95,41,6,218,3,103,101,116,114,127,0,0,0,114,223,0, - 0,0,114,218,0,0,0,114,167,0,0,0,218,9,69,120, - 99,101,112,116,105,111,110,41,6,90,2,110,115,114,106,0, - 0,0,90,8,112,97,116,104,110,97,109,101,90,9,99,112, - 97,116,104,110,97,109,101,114,127,0,0,0,114,164,0,0, - 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, - 218,14,95,102,105,120,95,117,112,95,109,111,100,117,108,101, - 35,5,0,0,115,34,0,0,0,0,2,15,1,15,1,6, - 1,6,1,12,1,12,1,18,2,15,1,6,1,21,1,3, - 1,10,1,10,1,10,1,14,1,13,2,114,24,1,0,0, - 99,0,0,0,0,0,0,0,0,3,0,0,0,3,0,0, - 0,67,0,0,0,115,55,0,0,0,116,0,0,116,1,0, - 106,2,0,131,0,0,102,2,0,125,0,0,116,3,0,116, - 4,0,102,2,0,125,1,0,116,5,0,116,6,0,102,2, - 0,125,2,0,124,0,0,124,1,0,124,2,0,103,3,0, - 83,41,1,122,95,82,101,116,117,114,110,115,32,97,32,108, - 105,115,116,32,111,102,32,102,105,108,101,45,98,97,115,101, - 100,32,109,111,100,117,108,101,32,108,111,97,100,101,114,115, - 46,10,10,32,32,32,32,69,97,99,104,32,105,116,101,109, - 32,105,115,32,97,32,116,117,112,108,101,32,40,108,111,97, - 100,101,114,44,32,115,117,102,102,105,120,101,115,41,46,10, - 32,32,32,32,41,7,114,224,0,0,0,114,145,0,0,0, - 218,18,101,120,116,101,110,115,105,111,110,95,115,117,102,102, - 105,120,101,115,114,218,0,0,0,114,84,0,0,0,114,223, - 0,0,0,114,74,0,0,0,41,3,90,10,101,120,116,101, - 110,115,105,111,110,115,90,6,115,111,117,114,99,101,90,8, - 98,121,116,101,99,111,100,101,114,4,0,0,0,114,4,0, - 0,0,114,5,0,0,0,114,161,0,0,0,58,5,0,0, - 115,8,0,0,0,0,5,18,1,12,1,12,1,114,161,0, - 0,0,99,1,0,0,0,0,0,0,0,12,0,0,0,12, - 0,0,0,67,0,0,0,115,70,2,0,0,124,0,0,97, - 0,0,116,0,0,106,1,0,97,1,0,116,0,0,106,2, - 0,97,2,0,116,1,0,106,3,0,116,4,0,25,125,1, - 0,120,76,0,100,26,0,68,93,68,0,125,2,0,124,2, - 0,116,1,0,106,3,0,107,7,0,114,83,0,116,0,0, - 106,5,0,124,2,0,131,1,0,125,3,0,110,13,0,116, - 1,0,106,3,0,124,2,0,25,125,3,0,116,6,0,124, - 1,0,124,2,0,124,3,0,131,3,0,1,113,44,0,87, - 100,5,0,100,6,0,103,1,0,102,2,0,100,7,0,100, - 8,0,100,6,0,103,2,0,102,2,0,102,2,0,125,4, - 0,120,149,0,124,4,0,68,93,129,0,92,2,0,125,5, - 0,125,6,0,116,7,0,100,9,0,100,10,0,132,0,0, - 124,6,0,68,131,1,0,131,1,0,115,199,0,116,8,0, - 130,1,0,124,6,0,100,11,0,25,125,7,0,124,5,0, - 116,1,0,106,3,0,107,6,0,114,241,0,116,1,0,106, - 3,0,124,5,0,25,125,8,0,80,113,156,0,121,20,0, - 116,0,0,106,5,0,124,5,0,131,1,0,125,8,0,80, - 87,113,156,0,4,116,9,0,107,10,0,114,28,1,1,1, - 1,119,156,0,89,113,156,0,88,113,156,0,87,116,9,0, - 100,12,0,131,1,0,130,1,0,116,6,0,124,1,0,100, - 13,0,124,8,0,131,3,0,1,116,6,0,124,1,0,100, - 14,0,124,7,0,131,3,0,1,116,6,0,124,1,0,100, - 15,0,100,16,0,106,10,0,124,6,0,131,1,0,131,3, - 0,1,121,19,0,116,0,0,106,5,0,100,17,0,131,1, - 0,125,9,0,87,110,24,0,4,116,9,0,107,10,0,114, - 147,1,1,1,1,100,18,0,125,9,0,89,110,1,0,88, - 116,6,0,124,1,0,100,17,0,124,9,0,131,3,0,1, - 116,0,0,106,5,0,100,19,0,131,1,0,125,10,0,116, - 6,0,124,1,0,100,19,0,124,10,0,131,3,0,1,124, - 5,0,100,7,0,107,2,0,114,238,1,116,0,0,106,5, - 0,100,20,0,131,1,0,125,11,0,116,6,0,124,1,0, - 100,21,0,124,11,0,131,3,0,1,116,6,0,124,1,0, - 100,22,0,116,11,0,131,0,0,131,3,0,1,116,12,0, - 106,13,0,116,2,0,106,14,0,131,0,0,131,1,0,1, - 124,5,0,100,7,0,107,2,0,114,66,2,116,15,0,106, - 16,0,100,23,0,131,1,0,1,100,24,0,116,12,0,107, - 6,0,114,66,2,100,25,0,116,17,0,95,18,0,100,18, - 0,83,41,27,122,205,83,101,116,117,112,32,116,104,101,32, - 112,97,116,104,45,98,97,115,101,100,32,105,109,112,111,114, - 116,101,114,115,32,102,111,114,32,105,109,112,111,114,116,108, - 105,98,32,98,121,32,105,109,112,111,114,116,105,110,103,32, - 110,101,101,100,101,100,10,32,32,32,32,98,117,105,108,116, - 45,105,110,32,109,111,100,117,108,101,115,32,97,110,100,32, - 105,110,106,101,99,116,105,110,103,32,116,104,101,109,32,105, - 110,116,111,32,116,104,101,32,103,108,111,98,97,108,32,110, - 97,109,101,115,112,97,99,101,46,10,10,32,32,32,32,79, - 116,104,101,114,32,99,111,109,112,111,110,101,110,116,115,32, - 97,114,101,32,101,120,116,114,97,99,116,101,100,32,102,114, - 111,109,32,116,104,101,32,99,111,114,101,32,98,111,111,116, - 115,116,114,97,112,32,109,111,100,117,108,101,46,10,10,32, - 32,32,32,114,49,0,0,0,114,60,0,0,0,218,8,98, - 117,105,108,116,105,110,115,114,142,0,0,0,90,5,112,111, - 115,105,120,250,1,47,218,2,110,116,250,1,92,99,1,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,115,0, - 0,0,115,33,0,0,0,124,0,0,93,23,0,125,1,0, - 116,0,0,124,1,0,131,1,0,100,0,0,107,2,0,86, - 1,113,3,0,100,1,0,83,41,2,114,29,0,0,0,78, - 41,1,114,31,0,0,0,41,2,114,22,0,0,0,114,77, + 114,114,4,0,0,0,41,3,114,170,0,0,0,114,12,1, + 0,0,114,18,1,0,0,114,4,0,0,0,41,2,114,170, + 0,0,0,114,12,1,0,0,114,5,0,0,0,218,9,112, + 97,116,104,95,104,111,111,107,11,5,0,0,115,4,0,0, + 0,0,10,21,6,122,20,70,105,108,101,70,105,110,100,101, + 114,46,112,97,116,104,95,104,111,111,107,99,1,0,0,0, + 0,0,0,0,1,0,0,0,2,0,0,0,67,0,0,0, + 115,16,0,0,0,100,1,0,106,0,0,124,0,0,106,1, + 0,131,1,0,83,41,2,78,122,16,70,105,108,101,70,105, + 110,100,101,114,40,123,33,114,125,41,41,2,114,47,0,0, + 0,114,35,0,0,0,41,1,114,108,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,114,244,0,0, + 0,29,5,0,0,115,2,0,0,0,0,1,122,19,70,105, + 108,101,70,105,110,100,101,114,46,95,95,114,101,112,114,95, + 95,41,15,114,112,0,0,0,114,111,0,0,0,114,113,0, + 0,0,114,114,0,0,0,114,185,0,0,0,114,250,0,0, + 0,114,130,0,0,0,114,182,0,0,0,114,124,0,0,0, + 114,5,1,0,0,114,181,0,0,0,114,13,1,0,0,114, + 183,0,0,0,114,19,1,0,0,114,244,0,0,0,114,4, 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, - 0,0,114,227,0,0,0,94,5,0,0,115,2,0,0,0, - 6,0,122,25,95,115,101,116,117,112,46,60,108,111,99,97, - 108,115,62,46,60,103,101,110,101,120,112,114,62,114,59,0, - 0,0,122,30,105,109,112,111,114,116,108,105,98,32,114,101, - 113,117,105,114,101,115,32,112,111,115,105,120,32,111,114,32, - 110,116,114,3,0,0,0,114,25,0,0,0,114,21,0,0, - 0,114,30,0,0,0,90,7,95,116,104,114,101,97,100,78, - 90,8,95,119,101,97,107,114,101,102,90,6,119,105,110,114, - 101,103,114,169,0,0,0,114,6,0,0,0,122,4,46,112, - 121,119,122,6,95,100,46,112,121,100,84,41,4,122,3,95, - 105,111,122,9,95,119,97,114,110,105,110,103,115,122,8,98, - 117,105,108,116,105,110,115,122,7,109,97,114,115,104,97,108, - 41,19,114,121,0,0,0,114,7,0,0,0,114,145,0,0, - 0,114,239,0,0,0,114,112,0,0,0,90,18,95,98,117, - 105,108,116,105,110,95,102,114,111,109,95,110,97,109,101,114, - 116,0,0,0,218,3,97,108,108,218,14,65,115,115,101,114, - 116,105,111,110,69,114,114,111,114,114,107,0,0,0,114,26, - 0,0,0,114,11,0,0,0,114,229,0,0,0,114,149,0, - 0,0,114,25,1,0,0,114,84,0,0,0,114,163,0,0, - 0,114,168,0,0,0,114,173,0,0,0,41,12,218,17,95, - 98,111,111,116,115,116,114,97,112,95,109,111,100,117,108,101, - 90,11,115,101,108,102,95,109,111,100,117,108,101,90,12,98, - 117,105,108,116,105,110,95,110,97,109,101,90,14,98,117,105, - 108,116,105,110,95,109,111,100,117,108,101,90,10,111,115,95, - 100,101,116,97,105,108,115,90,10,98,117,105,108,116,105,110, - 95,111,115,114,21,0,0,0,114,25,0,0,0,90,9,111, - 115,95,109,111,100,117,108,101,90,13,116,104,114,101,97,100, - 95,109,111,100,117,108,101,90,14,119,101,97,107,114,101,102, - 95,109,111,100,117,108,101,90,13,119,105,110,114,101,103,95, - 109,111,100,117,108,101,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,218,6,95,115,101,116,117,112,69,5,0, - 0,115,82,0,0,0,0,8,6,1,9,1,9,3,13,1, - 13,1,15,1,18,2,13,1,20,3,33,1,19,2,31,1, - 10,1,15,1,13,1,4,2,3,1,15,1,5,1,13,1, - 12,2,12,1,16,1,16,1,25,3,3,1,19,1,13,2, - 11,1,16,3,15,1,16,3,12,1,15,1,16,3,19,1, - 19,1,12,1,13,1,12,1,114,33,1,0,0,99,1,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, - 0,0,115,116,0,0,0,116,0,0,124,0,0,131,1,0, - 1,116,1,0,131,0,0,125,1,0,116,2,0,106,3,0, - 106,4,0,116,5,0,106,6,0,124,1,0,140,0,0,103, - 1,0,131,1,0,1,116,7,0,106,8,0,100,1,0,107, - 2,0,114,78,0,116,2,0,106,9,0,106,10,0,116,11, - 0,131,1,0,1,116,2,0,106,9,0,106,10,0,116,12, - 0,131,1,0,1,116,5,0,124,0,0,95,5,0,116,13, - 0,124,0,0,95,13,0,100,2,0,83,41,3,122,41,73, - 110,115,116,97,108,108,32,116,104,101,32,112,97,116,104,45, - 98,97,115,101,100,32,105,109,112,111,114,116,32,99,111,109, - 112,111,110,101,110,116,115,46,114,28,1,0,0,78,41,14, - 114,33,1,0,0,114,161,0,0,0,114,7,0,0,0,114, - 254,0,0,0,114,149,0,0,0,114,6,1,0,0,114,19, - 1,0,0,114,3,0,0,0,114,112,0,0,0,218,9,109, - 101,116,97,95,112,97,116,104,114,163,0,0,0,114,168,0, - 0,0,114,249,0,0,0,114,218,0,0,0,41,2,114,32, - 1,0,0,90,17,115,117,112,112,111,114,116,101,100,95,108, - 111,97,100,101,114,115,114,4,0,0,0,114,4,0,0,0, - 114,5,0,0,0,218,8,95,105,110,115,116,97,108,108,137, - 5,0,0,115,16,0,0,0,0,2,10,1,9,1,28,1, - 15,1,16,1,16,4,9,1,114,35,1,0,0,41,3,122, - 3,119,105,110,114,1,0,0,0,114,2,0,0,0,41,57, - 114,114,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 17,0,0,0,114,19,0,0,0,114,28,0,0,0,114,38, - 0,0,0,114,39,0,0,0,114,43,0,0,0,114,44,0, - 0,0,114,46,0,0,0,114,55,0,0,0,218,4,116,121, - 112,101,218,8,95,95,99,111,100,101,95,95,114,144,0,0, - 0,114,15,0,0,0,114,135,0,0,0,114,14,0,0,0, - 114,18,0,0,0,90,17,95,82,65,87,95,77,65,71,73, - 67,95,78,85,77,66,69,82,114,73,0,0,0,114,72,0, - 0,0,114,84,0,0,0,114,74,0,0,0,90,23,68,69, - 66,85,71,95,66,89,84,69,67,79,68,69,95,83,85,70, - 70,73,88,69,83,90,27,79,80,84,73,77,73,90,69,68, - 95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88, - 69,83,114,79,0,0,0,114,85,0,0,0,114,91,0,0, - 0,114,95,0,0,0,114,97,0,0,0,114,105,0,0,0, - 114,123,0,0,0,114,130,0,0,0,114,141,0,0,0,114, - 147,0,0,0,114,150,0,0,0,114,155,0,0,0,218,6, - 111,98,106,101,99,116,114,162,0,0,0,114,167,0,0,0, - 114,168,0,0,0,114,184,0,0,0,114,194,0,0,0,114, - 210,0,0,0,114,218,0,0,0,114,223,0,0,0,114,229, - 0,0,0,114,224,0,0,0,114,230,0,0,0,114,247,0, - 0,0,114,249,0,0,0,114,6,1,0,0,114,24,1,0, - 0,114,161,0,0,0,114,33,1,0,0,114,35,1,0,0, - 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114, - 5,0,0,0,218,8,60,109,111,100,117,108,101,62,8,0, - 0,0,115,100,0,0,0,6,17,6,3,12,12,12,5,12, - 5,12,6,12,12,12,10,12,9,12,5,12,7,15,22,15, - 113,22,1,18,2,6,1,6,2,9,2,9,2,10,2,21, - 44,12,33,12,19,12,12,12,12,18,8,12,28,12,17,21, - 55,21,12,18,10,12,14,9,3,12,1,15,65,19,64,19, - 28,22,110,19,41,25,43,25,16,6,3,25,53,19,57,19, - 41,19,134,19,146,15,23,12,11,12,68, + 0,0,114,6,1,0,0,145,4,0,0,115,20,0,0,0, + 12,7,6,2,12,14,12,4,6,2,12,12,12,5,15,45, + 12,31,18,18,114,6,1,0,0,99,4,0,0,0,0,0, + 0,0,6,0,0,0,11,0,0,0,67,0,0,0,115,195, + 0,0,0,124,0,0,106,0,0,100,1,0,131,1,0,125, + 4,0,124,0,0,106,0,0,100,2,0,131,1,0,125,5, + 0,124,4,0,115,99,0,124,5,0,114,54,0,124,5,0, + 106,1,0,125,4,0,110,45,0,124,2,0,124,3,0,107, + 2,0,114,84,0,116,2,0,124,1,0,124,2,0,131,2, + 0,125,4,0,110,15,0,116,3,0,124,1,0,124,2,0, + 131,2,0,125,4,0,124,5,0,115,126,0,116,4,0,124, + 1,0,124,2,0,100,3,0,124,4,0,131,2,1,125,5, + 0,121,44,0,124,5,0,124,0,0,100,2,0,60,124,4, + 0,124,0,0,100,1,0,60,124,2,0,124,0,0,100,4, + 0,60,124,3,0,124,0,0,100,5,0,60,87,110,18,0, + 4,116,5,0,107,10,0,114,190,0,1,1,1,89,110,1, + 0,88,100,0,0,83,41,6,78,218,10,95,95,108,111,97, + 100,101,114,95,95,218,8,95,95,115,112,101,99,95,95,114, + 127,0,0,0,90,8,95,95,102,105,108,101,95,95,90,10, + 95,95,99,97,99,104,101,100,95,95,41,6,218,3,103,101, + 116,114,127,0,0,0,114,223,0,0,0,114,218,0,0,0, + 114,167,0,0,0,218,9,69,120,99,101,112,116,105,111,110, + 41,6,90,2,110,115,114,106,0,0,0,90,8,112,97,116, + 104,110,97,109,101,90,9,99,112,97,116,104,110,97,109,101, + 114,127,0,0,0,114,164,0,0,0,114,4,0,0,0,114, + 4,0,0,0,114,5,0,0,0,218,14,95,102,105,120,95, + 117,112,95,109,111,100,117,108,101,35,5,0,0,115,34,0, + 0,0,0,2,15,1,15,1,6,1,6,1,12,1,12,1, + 18,2,15,1,6,1,21,1,3,1,10,1,10,1,10,1, + 14,1,13,2,114,24,1,0,0,99,0,0,0,0,0,0, + 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,55, + 0,0,0,116,0,0,116,1,0,106,2,0,131,0,0,102, + 2,0,125,0,0,116,3,0,116,4,0,102,2,0,125,1, + 0,116,5,0,116,6,0,102,2,0,125,2,0,124,0,0, + 124,1,0,124,2,0,103,3,0,83,41,1,122,95,82,101, + 116,117,114,110,115,32,97,32,108,105,115,116,32,111,102,32, + 102,105,108,101,45,98,97,115,101,100,32,109,111,100,117,108, + 101,32,108,111,97,100,101,114,115,46,10,10,32,32,32,32, + 69,97,99,104,32,105,116,101,109,32,105,115,32,97,32,116, + 117,112,108,101,32,40,108,111,97,100,101,114,44,32,115,117, + 102,102,105,120,101,115,41,46,10,32,32,32,32,41,7,114, + 224,0,0,0,114,145,0,0,0,218,18,101,120,116,101,110, + 115,105,111,110,95,115,117,102,102,105,120,101,115,114,218,0, + 0,0,114,84,0,0,0,114,223,0,0,0,114,74,0,0, + 0,41,3,90,10,101,120,116,101,110,115,105,111,110,115,90, + 6,115,111,117,114,99,101,90,8,98,121,116,101,99,111,100, + 101,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, + 114,161,0,0,0,58,5,0,0,115,8,0,0,0,0,5, + 18,1,12,1,12,1,114,161,0,0,0,99,1,0,0,0, + 0,0,0,0,12,0,0,0,12,0,0,0,67,0,0,0, + 115,70,2,0,0,124,0,0,97,0,0,116,0,0,106,1, + 0,97,1,0,116,0,0,106,2,0,97,2,0,116,1,0, + 106,3,0,116,4,0,25,125,1,0,120,76,0,100,26,0, + 68,93,68,0,125,2,0,124,2,0,116,1,0,106,3,0, + 107,7,0,114,83,0,116,0,0,106,5,0,124,2,0,131, + 1,0,125,3,0,110,13,0,116,1,0,106,3,0,124,2, + 0,25,125,3,0,116,6,0,124,1,0,124,2,0,124,3, + 0,131,3,0,1,113,44,0,87,100,5,0,100,6,0,103, + 1,0,102,2,0,100,7,0,100,8,0,100,6,0,103,2, + 0,102,2,0,102,2,0,125,4,0,120,149,0,124,4,0, + 68,93,129,0,92,2,0,125,5,0,125,6,0,116,7,0, + 100,9,0,100,10,0,132,0,0,124,6,0,68,131,1,0, + 131,1,0,115,199,0,116,8,0,130,1,0,124,6,0,100, + 11,0,25,125,7,0,124,5,0,116,1,0,106,3,0,107, + 6,0,114,241,0,116,1,0,106,3,0,124,5,0,25,125, + 8,0,80,113,156,0,121,20,0,116,0,0,106,5,0,124, + 5,0,131,1,0,125,8,0,80,87,113,156,0,4,116,9, + 0,107,10,0,114,28,1,1,1,1,119,156,0,89,113,156, + 0,88,113,156,0,87,116,9,0,100,12,0,131,1,0,130, + 1,0,116,6,0,124,1,0,100,13,0,124,8,0,131,3, + 0,1,116,6,0,124,1,0,100,14,0,124,7,0,131,3, + 0,1,116,6,0,124,1,0,100,15,0,100,16,0,106,10, + 0,124,6,0,131,1,0,131,3,0,1,121,19,0,116,0, + 0,106,5,0,100,17,0,131,1,0,125,9,0,87,110,24, + 0,4,116,9,0,107,10,0,114,147,1,1,1,1,100,18, + 0,125,9,0,89,110,1,0,88,116,6,0,124,1,0,100, + 17,0,124,9,0,131,3,0,1,116,0,0,106,5,0,100, + 19,0,131,1,0,125,10,0,116,6,0,124,1,0,100,19, + 0,124,10,0,131,3,0,1,124,5,0,100,7,0,107,2, + 0,114,238,1,116,0,0,106,5,0,100,20,0,131,1,0, + 125,11,0,116,6,0,124,1,0,100,21,0,124,11,0,131, + 3,0,1,116,6,0,124,1,0,100,22,0,116,11,0,131, + 0,0,131,3,0,1,116,12,0,106,13,0,116,2,0,106, + 14,0,131,0,0,131,1,0,1,124,5,0,100,7,0,107, + 2,0,114,66,2,116,15,0,106,16,0,100,23,0,131,1, + 0,1,100,24,0,116,12,0,107,6,0,114,66,2,100,25, + 0,116,17,0,95,18,0,100,18,0,83,41,27,122,205,83, + 101,116,117,112,32,116,104,101,32,112,97,116,104,45,98,97, + 115,101,100,32,105,109,112,111,114,116,101,114,115,32,102,111, + 114,32,105,109,112,111,114,116,108,105,98,32,98,121,32,105, + 109,112,111,114,116,105,110,103,32,110,101,101,100,101,100,10, + 32,32,32,32,98,117,105,108,116,45,105,110,32,109,111,100, + 117,108,101,115,32,97,110,100,32,105,110,106,101,99,116,105, + 110,103,32,116,104,101,109,32,105,110,116,111,32,116,104,101, + 32,103,108,111,98,97,108,32,110,97,109,101,115,112,97,99, + 101,46,10,10,32,32,32,32,79,116,104,101,114,32,99,111, + 109,112,111,110,101,110,116,115,32,97,114,101,32,101,120,116, + 114,97,99,116,101,100,32,102,114,111,109,32,116,104,101,32, + 99,111,114,101,32,98,111,111,116,115,116,114,97,112,32,109, + 111,100,117,108,101,46,10,10,32,32,32,32,114,49,0,0, + 0,114,60,0,0,0,218,8,98,117,105,108,116,105,110,115, + 114,142,0,0,0,90,5,112,111,115,105,120,250,1,47,218, + 2,110,116,250,1,92,99,1,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,115,0,0,0,115,33,0,0,0, + 124,0,0,93,23,0,125,1,0,116,0,0,124,1,0,131, + 1,0,100,0,0,107,2,0,86,1,113,3,0,100,1,0, + 83,41,2,114,29,0,0,0,78,41,1,114,31,0,0,0, + 41,2,114,22,0,0,0,114,77,0,0,0,114,4,0,0, + 0,114,4,0,0,0,114,5,0,0,0,114,227,0,0,0, + 94,5,0,0,115,2,0,0,0,6,0,122,25,95,115,101, + 116,117,112,46,60,108,111,99,97,108,115,62,46,60,103,101, + 110,101,120,112,114,62,114,59,0,0,0,122,30,105,109,112, + 111,114,116,108,105,98,32,114,101,113,117,105,114,101,115,32, + 112,111,115,105,120,32,111,114,32,110,116,114,3,0,0,0, + 114,25,0,0,0,114,21,0,0,0,114,30,0,0,0,90, + 7,95,116,104,114,101,97,100,78,90,8,95,119,101,97,107, + 114,101,102,90,6,119,105,110,114,101,103,114,169,0,0,0, + 114,6,0,0,0,122,4,46,112,121,119,122,6,95,100,46, + 112,121,100,84,41,4,122,3,95,105,111,122,9,95,119,97, + 114,110,105,110,103,115,122,8,98,117,105,108,116,105,110,115, + 122,7,109,97,114,115,104,97,108,41,19,114,121,0,0,0, + 114,7,0,0,0,114,145,0,0,0,114,239,0,0,0,114, + 112,0,0,0,90,18,95,98,117,105,108,116,105,110,95,102, + 114,111,109,95,110,97,109,101,114,116,0,0,0,218,3,97, + 108,108,218,14,65,115,115,101,114,116,105,111,110,69,114,114, + 111,114,114,107,0,0,0,114,26,0,0,0,114,11,0,0, + 0,114,229,0,0,0,114,149,0,0,0,114,25,1,0,0, + 114,84,0,0,0,114,163,0,0,0,114,168,0,0,0,114, + 173,0,0,0,41,12,218,17,95,98,111,111,116,115,116,114, + 97,112,95,109,111,100,117,108,101,90,11,115,101,108,102,95, + 109,111,100,117,108,101,90,12,98,117,105,108,116,105,110,95, + 110,97,109,101,90,14,98,117,105,108,116,105,110,95,109,111, + 100,117,108,101,90,10,111,115,95,100,101,116,97,105,108,115, + 90,10,98,117,105,108,116,105,110,95,111,115,114,21,0,0, + 0,114,25,0,0,0,90,9,111,115,95,109,111,100,117,108, + 101,90,13,116,104,114,101,97,100,95,109,111,100,117,108,101, + 90,14,119,101,97,107,114,101,102,95,109,111,100,117,108,101, + 90,13,119,105,110,114,101,103,95,109,111,100,117,108,101,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,6, + 95,115,101,116,117,112,69,5,0,0,115,82,0,0,0,0, + 8,6,1,9,1,9,3,13,1,13,1,15,1,18,2,13, + 1,20,3,33,1,19,2,31,1,10,1,15,1,13,1,4, + 2,3,1,15,1,5,1,13,1,12,2,12,1,16,1,16, + 1,25,3,3,1,19,1,13,2,11,1,16,3,15,1,16, + 3,12,1,15,1,16,3,19,1,19,1,12,1,13,1,12, + 1,114,33,1,0,0,99,1,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,67,0,0,0,115,116,0,0,0, + 116,0,0,124,0,0,131,1,0,1,116,1,0,131,0,0, + 125,1,0,116,2,0,106,3,0,106,4,0,116,5,0,106, + 6,0,124,1,0,140,0,0,103,1,0,131,1,0,1,116, + 7,0,106,8,0,100,1,0,107,2,0,114,78,0,116,2, + 0,106,9,0,106,10,0,116,11,0,131,1,0,1,116,2, + 0,106,9,0,106,10,0,116,12,0,131,1,0,1,116,5, + 0,124,0,0,95,5,0,116,13,0,124,0,0,95,13,0, + 100,2,0,83,41,3,122,41,73,110,115,116,97,108,108,32, + 116,104,101,32,112,97,116,104,45,98,97,115,101,100,32,105, + 109,112,111,114,116,32,99,111,109,112,111,110,101,110,116,115, + 46,114,28,1,0,0,78,41,14,114,33,1,0,0,114,161, + 0,0,0,114,7,0,0,0,114,254,0,0,0,114,149,0, + 0,0,114,6,1,0,0,114,19,1,0,0,114,3,0,0, + 0,114,112,0,0,0,218,9,109,101,116,97,95,112,97,116, + 104,114,163,0,0,0,114,168,0,0,0,114,249,0,0,0, + 114,218,0,0,0,41,2,114,32,1,0,0,90,17,115,117, + 112,112,111,114,116,101,100,95,108,111,97,100,101,114,115,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,8, + 95,105,110,115,116,97,108,108,137,5,0,0,115,16,0,0, + 0,0,2,10,1,9,1,28,1,15,1,16,1,16,4,9, + 1,114,35,1,0,0,41,3,122,3,119,105,110,114,1,0, + 0,0,114,2,0,0,0,41,57,114,114,0,0,0,114,10, + 0,0,0,114,11,0,0,0,114,17,0,0,0,114,19,0, + 0,0,114,28,0,0,0,114,38,0,0,0,114,39,0,0, + 0,114,43,0,0,0,114,44,0,0,0,114,46,0,0,0, + 114,55,0,0,0,218,4,116,121,112,101,218,8,95,95,99, + 111,100,101,95,95,114,144,0,0,0,114,15,0,0,0,114, + 135,0,0,0,114,14,0,0,0,114,18,0,0,0,90,17, + 95,82,65,87,95,77,65,71,73,67,95,78,85,77,66,69, + 82,114,73,0,0,0,114,72,0,0,0,114,84,0,0,0, + 114,74,0,0,0,90,23,68,69,66,85,71,95,66,89,84, + 69,67,79,68,69,95,83,85,70,70,73,88,69,83,90,27, + 79,80,84,73,77,73,90,69,68,95,66,89,84,69,67,79, + 68,69,95,83,85,70,70,73,88,69,83,114,79,0,0,0, + 114,85,0,0,0,114,91,0,0,0,114,95,0,0,0,114, + 97,0,0,0,114,105,0,0,0,114,123,0,0,0,114,130, + 0,0,0,114,141,0,0,0,114,147,0,0,0,114,150,0, + 0,0,114,155,0,0,0,218,6,111,98,106,101,99,116,114, + 162,0,0,0,114,167,0,0,0,114,168,0,0,0,114,184, + 0,0,0,114,194,0,0,0,114,210,0,0,0,114,218,0, + 0,0,114,223,0,0,0,114,229,0,0,0,114,224,0,0, + 0,114,230,0,0,0,114,247,0,0,0,114,249,0,0,0, + 114,6,1,0,0,114,24,1,0,0,114,161,0,0,0,114, + 33,1,0,0,114,35,1,0,0,114,4,0,0,0,114,4, + 0,0,0,114,4,0,0,0,114,5,0,0,0,218,8,60, + 109,111,100,117,108,101,62,8,0,0,0,115,100,0,0,0, + 6,17,6,3,12,12,12,5,12,5,12,6,12,12,12,10, + 12,9,12,5,12,7,15,22,15,113,22,1,18,2,6,1, + 6,2,9,2,9,2,10,2,21,44,12,33,12,19,12,12, + 12,12,18,8,12,28,12,17,21,55,21,12,18,10,12,14, + 9,3,12,1,15,65,19,64,19,28,22,110,19,41,25,43, + 25,16,6,3,25,53,19,57,19,41,19,134,19,146,15,23, + 12,11,12,68, }; -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 07:48:45 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sat, 28 May 2016 11:48:45 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327138=3A_Regenerate_Python/importlib=5Fexternal?= =?utf-8?b?Lmgu?= Message-ID: <20160528114844.30851.72798.BA8EE1AB@psf.io> https://hg.python.org/cpython/rev/fb965ee44d5e changeset: 101539:fb965ee44d5e parent: 101537:35fa2ec1f237 parent: 101538:8a49da84fc1d user: Serhiy Storchaka date: Sat May 28 14:48:19 2016 +0300 summary: Issue #27138: Regenerate Python/importlib_external.h. files: Python/importlib_external.h | 647 +++++++++++------------ 1 files changed, 323 insertions(+), 324 deletions(-) diff --git a/Python/importlib_external.h b/Python/importlib_external.h --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -2097,328 +2097,327 @@ 87,0,124,3,144,1,114,96,116,18,106,19,100,9,124,8, 131,2,1,0,116,18,106,20,124,1,100,8,131,2,125,13, 124,8,103,1,124,13,95,21,124,13,83,0,100,8,83,0, - 41,11,122,125,84,114,121,32,116,111,32,102,105,110,100,32, - 97,32,108,111,97,100,101,114,32,102,111,114,32,116,104,101, - 32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,108, - 101,44,32,111,114,32,116,104,101,32,110,97,109,101,115,112, - 97,99,101,10,32,32,32,32,32,32,32,32,112,97,99,107, - 97,103,101,32,112,111,114,116,105,111,110,115,46,32,82,101, - 116,117,114,110,115,32,40,108,111,97,100,101,114,44,32,108, - 105,115,116,45,111,102,45,112,111,114,116,105,111,110,115,41, - 46,70,114,58,0,0,0,114,56,0,0,0,114,29,0,0, - 0,114,179,0,0,0,122,9,116,114,121,105,110,103,32,123, - 125,90,9,118,101,114,98,111,115,105,116,121,78,122,25,112, - 111,115,115,105,98,108,101,32,110,97,109,101,115,112,97,99, - 101,32,102,111,114,32,123,125,114,87,0,0,0,41,22,114, - 32,0,0,0,114,39,0,0,0,114,35,0,0,0,114,3, - 0,0,0,114,45,0,0,0,114,213,0,0,0,114,40,0, - 0,0,114,4,1,0,0,218,11,95,102,105,108,108,95,99, - 97,99,104,101,114,6,0,0,0,114,7,1,0,0,114,88, - 0,0,0,114,6,1,0,0,114,28,0,0,0,114,3,1, - 0,0,114,44,0,0,0,114,1,1,0,0,114,46,0,0, - 0,114,114,0,0,0,114,129,0,0,0,114,154,0,0,0, - 114,150,0,0,0,41,14,114,100,0,0,0,114,119,0,0, - 0,114,174,0,0,0,90,12,105,115,95,110,97,109,101,115, - 112,97,99,101,90,11,116,97,105,108,95,109,111,100,117,108, - 101,114,126,0,0,0,90,5,99,97,99,104,101,90,12,99, - 97,99,104,101,95,109,111,100,117,108,101,90,9,98,97,115, - 101,95,112,97,116,104,114,219,0,0,0,114,159,0,0,0, - 90,13,105,110,105,116,95,102,105,108,101,110,97,109,101,90, - 9,102,117,108,108,95,112,97,116,104,114,158,0,0,0,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,175, - 0,0,0,193,4,0,0,115,70,0,0,0,0,3,4,1, - 14,1,2,1,24,1,14,1,10,1,10,1,8,1,6,2, - 6,1,6,1,10,2,6,1,4,2,8,1,12,1,16,1, - 8,1,10,1,8,1,24,4,8,2,16,1,16,1,18,1, - 12,1,8,1,10,1,12,1,6,1,12,1,12,1,8,1, - 4,1,122,20,70,105,108,101,70,105,110,100,101,114,46,102, - 105,110,100,95,115,112,101,99,99,1,0,0,0,0,0,0, - 0,9,0,0,0,13,0,0,0,67,0,0,0,115,194,0, - 0,0,124,0,106,0,125,1,121,22,116,1,106,2,124,1, - 112,22,116,1,106,3,131,0,131,1,125,2,87,0,110,30, - 4,0,116,4,116,5,116,6,102,3,107,10,114,58,1,0, - 1,0,1,0,103,0,125,2,89,0,110,2,88,0,116,7, - 106,8,106,9,100,1,131,1,115,84,116,10,124,2,131,1, - 124,0,95,11,110,78,116,10,131,0,125,3,120,64,124,2, - 68,0,93,56,125,4,124,4,106,12,100,2,131,1,92,3, - 125,5,125,6,125,7,124,6,114,138,100,3,106,13,124,5, - 124,7,106,14,131,0,131,2,125,8,110,4,124,5,125,8, - 124,3,106,15,124,8,131,1,1,0,113,96,87,0,124,3, - 124,0,95,11,116,7,106,8,106,9,116,16,131,1,114,190, - 100,4,100,5,132,0,124,2,68,0,131,1,124,0,95,17, - 100,6,83,0,41,7,122,68,70,105,108,108,32,116,104,101, - 32,99,97,99,104,101,32,111,102,32,112,111,116,101,110,116, - 105,97,108,32,109,111,100,117,108,101,115,32,97,110,100,32, - 112,97,99,107,97,103,101,115,32,102,111,114,32,116,104,105, - 115,32,100,105,114,101,99,116,111,114,121,46,114,0,0,0, - 0,114,58,0,0,0,122,5,123,125,46,123,125,99,1,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,83,0, - 0,0,115,20,0,0,0,104,0,124,0,93,12,125,1,124, - 1,106,0,131,0,146,2,113,4,83,0,114,4,0,0,0, - 41,1,114,88,0,0,0,41,2,114,22,0,0,0,90,2, - 102,110,114,4,0,0,0,114,4,0,0,0,114,5,0,0, - 0,250,9,60,115,101,116,99,111,109,112,62,12,5,0,0, - 115,2,0,0,0,6,0,122,41,70,105,108,101,70,105,110, - 100,101,114,46,95,102,105,108,108,95,99,97,99,104,101,46, - 60,108,111,99,97,108,115,62,46,60,115,101,116,99,111,109, - 112,62,78,41,18,114,35,0,0,0,114,3,0,0,0,90, - 7,108,105,115,116,100,105,114,114,45,0,0,0,114,252,0, - 0,0,218,15,80,101,114,109,105,115,115,105,111,110,69,114, - 114,111,114,218,18,78,111,116,65,68,105,114,101,99,116,111, - 114,121,69,114,114,111,114,114,7,0,0,0,114,8,0,0, - 0,114,9,0,0,0,114,5,1,0,0,114,6,1,0,0, - 114,83,0,0,0,114,47,0,0,0,114,88,0,0,0,218, - 3,97,100,100,114,10,0,0,0,114,7,1,0,0,41,9, - 114,100,0,0,0,114,35,0,0,0,90,8,99,111,110,116, - 101,110,116,115,90,21,108,111,119,101,114,95,115,117,102,102, - 105,120,95,99,111,110,116,101,110,116,115,114,241,0,0,0, - 114,98,0,0,0,114,231,0,0,0,114,219,0,0,0,90, - 8,110,101,119,95,110,97,109,101,114,4,0,0,0,114,4, - 0,0,0,114,5,0,0,0,114,9,1,0,0,239,4,0, - 0,115,34,0,0,0,0,2,6,1,2,1,22,1,20,3, - 10,3,12,1,12,7,6,1,10,1,16,1,4,1,18,2, - 4,1,14,1,6,1,12,1,122,22,70,105,108,101,70,105, - 110,100,101,114,46,95,102,105,108,108,95,99,97,99,104,101, - 99,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0, - 0,7,0,0,0,115,18,0,0,0,135,0,135,1,102,2, - 100,1,100,2,134,0,125,2,124,2,83,0,41,3,97,20, - 1,0,0,65,32,99,108,97,115,115,32,109,101,116,104,111, - 100,32,119,104,105,99,104,32,114,101,116,117,114,110,115,32, - 97,32,99,108,111,115,117,114,101,32,116,111,32,117,115,101, - 32,111,110,32,115,121,115,46,112,97,116,104,95,104,111,111, - 107,10,32,32,32,32,32,32,32,32,119,104,105,99,104,32, - 119,105,108,108,32,114,101,116,117,114,110,32,97,110,32,105, - 110,115,116,97,110,99,101,32,117,115,105,110,103,32,116,104, - 101,32,115,112,101,99,105,102,105,101,100,32,108,111,97,100, - 101,114,115,32,97,110,100,32,116,104,101,32,112,97,116,104, - 10,32,32,32,32,32,32,32,32,99,97,108,108,101,100,32, - 111,110,32,116,104,101,32,99,108,111,115,117,114,101,46,10, - 10,32,32,32,32,32,32,32,32,73,102,32,116,104,101,32, - 112,97,116,104,32,99,97,108,108,101,100,32,111,110,32,116, - 104,101,32,99,108,111,115,117,114,101,32,105,115,32,110,111, - 116,32,97,32,100,105,114,101,99,116,111,114,121,44,32,73, - 109,112,111,114,116,69,114,114,111,114,32,105,115,10,32,32, - 32,32,32,32,32,32,114,97,105,115,101,100,46,10,10,32, - 32,32,32,32,32,32,32,99,1,0,0,0,0,0,0,0, - 1,0,0,0,4,0,0,0,19,0,0,0,115,32,0,0, - 0,116,0,124,0,131,1,115,22,116,1,100,1,100,2,124, - 0,144,1,131,1,130,1,136,0,124,0,136,1,140,1,83, - 0,41,3,122,45,80,97,116,104,32,104,111,111,107,32,102, - 111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,99, - 104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,101, - 114,46,122,30,111,110,108,121,32,100,105,114,101,99,116,111, - 114,105,101,115,32,97,114,101,32,115,117,112,112,111,114,116, - 101,100,114,35,0,0,0,41,2,114,46,0,0,0,114,99, - 0,0,0,41,1,114,35,0,0,0,41,2,114,164,0,0, - 0,114,8,1,0,0,114,4,0,0,0,114,5,0,0,0, - 218,24,112,97,116,104,95,104,111,111,107,95,102,111,114,95, - 70,105,108,101,70,105,110,100,101,114,24,5,0,0,115,6, - 0,0,0,0,2,8,1,14,1,122,54,70,105,108,101,70, - 105,110,100,101,114,46,112,97,116,104,95,104,111,111,107,46, - 60,108,111,99,97,108,115,62,46,112,97,116,104,95,104,111, - 111,107,95,102,111,114,95,70,105,108,101,70,105,110,100,101, - 114,114,4,0,0,0,41,3,114,164,0,0,0,114,8,1, - 0,0,114,14,1,0,0,114,4,0,0,0,41,2,114,164, - 0,0,0,114,8,1,0,0,114,5,0,0,0,218,9,112, - 97,116,104,95,104,111,111,107,14,5,0,0,115,4,0,0, - 0,0,10,14,6,122,20,70,105,108,101,70,105,110,100,101, - 114,46,112,97,116,104,95,104,111,111,107,99,1,0,0,0, - 0,0,0,0,1,0,0,0,2,0,0,0,67,0,0,0, - 115,12,0,0,0,100,1,106,0,124,0,106,1,131,1,83, - 0,41,2,78,122,16,70,105,108,101,70,105,110,100,101,114, - 40,123,33,114,125,41,41,2,114,47,0,0,0,114,35,0, - 0,0,41,1,114,100,0,0,0,114,4,0,0,0,114,4, - 0,0,0,114,5,0,0,0,114,240,0,0,0,32,5,0, - 0,115,2,0,0,0,0,1,122,19,70,105,108,101,70,105, - 110,100,101,114,46,95,95,114,101,112,114,95,95,41,15,114, - 105,0,0,0,114,104,0,0,0,114,106,0,0,0,114,107, - 0,0,0,114,179,0,0,0,114,246,0,0,0,114,123,0, - 0,0,114,176,0,0,0,114,117,0,0,0,114,1,1,0, - 0,114,175,0,0,0,114,9,1,0,0,114,177,0,0,0, - 114,15,1,0,0,114,240,0,0,0,114,4,0,0,0,114, - 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,2, - 1,0,0,147,4,0,0,115,20,0,0,0,8,7,4,2, - 8,14,8,4,4,2,8,12,8,5,10,46,8,31,12,18, - 114,2,1,0,0,99,4,0,0,0,0,0,0,0,6,0, - 0,0,11,0,0,0,67,0,0,0,115,148,0,0,0,124, - 0,106,0,100,1,131,1,125,4,124,0,106,0,100,2,131, - 1,125,5,124,4,115,66,124,5,114,36,124,5,106,1,125, - 4,110,30,124,2,124,3,107,2,114,56,116,2,124,1,124, - 2,131,2,125,4,110,10,116,3,124,1,124,2,131,2,125, - 4,124,5,115,86,116,4,124,1,124,2,100,3,124,4,144, - 1,131,2,125,5,121,36,124,5,124,0,100,2,60,0,124, - 4,124,0,100,1,60,0,124,2,124,0,100,4,60,0,124, - 3,124,0,100,5,60,0,87,0,110,20,4,0,116,5,107, - 10,114,142,1,0,1,0,1,0,89,0,110,2,88,0,100, - 0,83,0,41,6,78,218,10,95,95,108,111,97,100,101,114, - 95,95,218,8,95,95,115,112,101,99,95,95,114,120,0,0, - 0,90,8,95,95,102,105,108,101,95,95,90,10,95,95,99, - 97,99,104,101,100,95,95,41,6,218,3,103,101,116,114,120, - 0,0,0,114,217,0,0,0,114,212,0,0,0,114,161,0, - 0,0,218,9,69,120,99,101,112,116,105,111,110,41,6,90, - 2,110,115,114,98,0,0,0,90,8,112,97,116,104,110,97, - 109,101,90,9,99,112,97,116,104,110,97,109,101,114,120,0, - 0,0,114,158,0,0,0,114,4,0,0,0,114,4,0,0, - 0,114,5,0,0,0,218,14,95,102,105,120,95,117,112,95, - 109,111,100,117,108,101,38,5,0,0,115,34,0,0,0,0, - 2,10,1,10,1,4,1,4,1,8,1,8,1,12,2,10, - 1,4,1,16,1,2,1,8,1,8,1,8,1,12,1,14, - 2,114,20,1,0,0,99,0,0,0,0,0,0,0,0,3, - 0,0,0,3,0,0,0,67,0,0,0,115,38,0,0,0, - 116,0,116,1,106,2,131,0,102,2,125,0,116,3,116,4, - 102,2,125,1,116,5,116,6,102,2,125,2,124,0,124,1, - 124,2,103,3,83,0,41,1,122,95,82,101,116,117,114,110, - 115,32,97,32,108,105,115,116,32,111,102,32,102,105,108,101, - 45,98,97,115,101,100,32,109,111,100,117,108,101,32,108,111, - 97,100,101,114,115,46,10,10,32,32,32,32,69,97,99,104, - 32,105,116,101,109,32,105,115,32,97,32,116,117,112,108,101, - 32,40,108,111,97,100,101,114,44,32,115,117,102,102,105,120, - 101,115,41,46,10,32,32,32,32,41,7,114,218,0,0,0, - 114,139,0,0,0,218,18,101,120,116,101,110,115,105,111,110, - 95,115,117,102,102,105,120,101,115,114,212,0,0,0,114,84, - 0,0,0,114,217,0,0,0,114,74,0,0,0,41,3,90, - 10,101,120,116,101,110,115,105,111,110,115,90,6,115,111,117, - 114,99,101,90,8,98,121,116,101,99,111,100,101,114,4,0, - 0,0,114,4,0,0,0,114,5,0,0,0,114,155,0,0, - 0,61,5,0,0,115,8,0,0,0,0,5,12,1,8,1, - 8,1,114,155,0,0,0,99,1,0,0,0,0,0,0,0, - 12,0,0,0,12,0,0,0,67,0,0,0,115,188,1,0, - 0,124,0,97,0,116,0,106,1,97,1,116,0,106,2,97, - 2,116,1,106,3,116,4,25,0,125,1,120,56,100,26,68, - 0,93,48,125,2,124,2,116,1,106,3,107,7,114,58,116, - 0,106,5,124,2,131,1,125,3,110,10,116,1,106,3,124, - 2,25,0,125,3,116,6,124,1,124,2,124,3,131,3,1, - 0,113,32,87,0,100,5,100,6,103,1,102,2,100,7,100, - 8,100,6,103,2,102,2,102,2,125,4,120,118,124,4,68, - 0,93,102,92,2,125,5,125,6,116,7,100,9,100,10,132, - 0,124,6,68,0,131,1,131,1,115,142,116,8,130,1,124, - 6,100,11,25,0,125,7,124,5,116,1,106,3,107,6,114, - 174,116,1,106,3,124,5,25,0,125,8,80,0,113,112,121, - 16,116,0,106,5,124,5,131,1,125,8,80,0,87,0,113, - 112,4,0,116,9,107,10,114,212,1,0,1,0,1,0,119, - 112,89,0,113,112,88,0,113,112,87,0,116,9,100,12,131, - 1,130,1,116,6,124,1,100,13,124,8,131,3,1,0,116, - 6,124,1,100,14,124,7,131,3,1,0,116,6,124,1,100, - 15,100,16,106,10,124,6,131,1,131,3,1,0,121,14,116, - 0,106,5,100,17,131,1,125,9,87,0,110,26,4,0,116, - 9,107,10,144,1,114,52,1,0,1,0,1,0,100,18,125, - 9,89,0,110,2,88,0,116,6,124,1,100,17,124,9,131, - 3,1,0,116,0,106,5,100,19,131,1,125,10,116,6,124, - 1,100,19,124,10,131,3,1,0,124,5,100,7,107,2,144, - 1,114,120,116,0,106,5,100,20,131,1,125,11,116,6,124, - 1,100,21,124,11,131,3,1,0,116,6,124,1,100,22,116, - 11,131,0,131,3,1,0,116,12,106,13,116,2,106,14,131, - 0,131,1,1,0,124,5,100,7,107,2,144,1,114,184,116, - 15,106,16,100,23,131,1,1,0,100,24,116,12,107,6,144, - 1,114,184,100,25,116,17,95,18,100,18,83,0,41,27,122, - 205,83,101,116,117,112,32,116,104,101,32,112,97,116,104,45, - 98,97,115,101,100,32,105,109,112,111,114,116,101,114,115,32, - 102,111,114,32,105,109,112,111,114,116,108,105,98,32,98,121, - 32,105,109,112,111,114,116,105,110,103,32,110,101,101,100,101, - 100,10,32,32,32,32,98,117,105,108,116,45,105,110,32,109, - 111,100,117,108,101,115,32,97,110,100,32,105,110,106,101,99, - 116,105,110,103,32,116,104,101,109,32,105,110,116,111,32,116, - 104,101,32,103,108,111,98,97,108,32,110,97,109,101,115,112, - 97,99,101,46,10,10,32,32,32,32,79,116,104,101,114,32, - 99,111,109,112,111,110,101,110,116,115,32,97,114,101,32,101, - 120,116,114,97,99,116,101,100,32,102,114,111,109,32,116,104, - 101,32,99,111,114,101,32,98,111,111,116,115,116,114,97,112, - 32,109,111,100,117,108,101,46,10,10,32,32,32,32,114,49, - 0,0,0,114,60,0,0,0,218,8,98,117,105,108,116,105, - 110,115,114,136,0,0,0,90,5,112,111,115,105,120,250,1, - 47,218,2,110,116,250,1,92,99,1,0,0,0,0,0,0, - 0,2,0,0,0,3,0,0,0,115,0,0,0,115,26,0, - 0,0,124,0,93,18,125,1,116,0,124,1,131,1,100,0, - 107,2,86,0,1,0,113,2,100,1,83,0,41,2,114,29, - 0,0,0,78,41,1,114,31,0,0,0,41,2,114,22,0, - 0,0,114,77,0,0,0,114,4,0,0,0,114,4,0,0, - 0,114,5,0,0,0,114,221,0,0,0,97,5,0,0,115, - 2,0,0,0,4,0,122,25,95,115,101,116,117,112,46,60, - 108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,114, - 62,114,59,0,0,0,122,30,105,109,112,111,114,116,108,105, - 98,32,114,101,113,117,105,114,101,115,32,112,111,115,105,120, - 32,111,114,32,110,116,114,3,0,0,0,114,25,0,0,0, - 114,21,0,0,0,114,30,0,0,0,90,7,95,116,104,114, - 101,97,100,78,90,8,95,119,101,97,107,114,101,102,90,6, - 119,105,110,114,101,103,114,163,0,0,0,114,6,0,0,0, - 122,4,46,112,121,119,122,6,95,100,46,112,121,100,84,41, - 4,122,3,95,105,111,122,9,95,119,97,114,110,105,110,103, - 115,122,8,98,117,105,108,116,105,110,115,122,7,109,97,114, - 115,104,97,108,41,19,114,114,0,0,0,114,7,0,0,0, - 114,139,0,0,0,114,233,0,0,0,114,105,0,0,0,90, - 18,95,98,117,105,108,116,105,110,95,102,114,111,109,95,110, - 97,109,101,114,109,0,0,0,218,3,97,108,108,218,14,65, - 115,115,101,114,116,105,111,110,69,114,114,111,114,114,99,0, - 0,0,114,26,0,0,0,114,11,0,0,0,114,223,0,0, - 0,114,143,0,0,0,114,21,1,0,0,114,84,0,0,0, - 114,157,0,0,0,114,162,0,0,0,114,167,0,0,0,41, - 12,218,17,95,98,111,111,116,115,116,114,97,112,95,109,111, - 100,117,108,101,90,11,115,101,108,102,95,109,111,100,117,108, - 101,90,12,98,117,105,108,116,105,110,95,110,97,109,101,90, - 14,98,117,105,108,116,105,110,95,109,111,100,117,108,101,90, - 10,111,115,95,100,101,116,97,105,108,115,90,10,98,117,105, - 108,116,105,110,95,111,115,114,21,0,0,0,114,25,0,0, - 0,90,9,111,115,95,109,111,100,117,108,101,90,13,116,104, - 114,101,97,100,95,109,111,100,117,108,101,90,14,119,101,97, - 107,114,101,102,95,109,111,100,117,108,101,90,13,119,105,110, - 114,101,103,95,109,111,100,117,108,101,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,218,6,95,115,101,116,117, - 112,72,5,0,0,115,82,0,0,0,0,8,4,1,6,1, - 6,3,10,1,10,1,10,1,12,2,10,1,16,3,22,1, - 14,2,22,1,8,1,10,1,10,1,4,2,2,1,10,1, - 6,1,14,1,12,2,8,1,12,1,12,1,18,3,2,1, - 14,1,16,2,10,1,12,3,10,1,12,3,10,1,10,1, - 12,3,14,1,14,1,10,1,10,1,10,1,114,29,1,0, - 0,99,1,0,0,0,0,0,0,0,2,0,0,0,3,0, - 0,0,67,0,0,0,115,84,0,0,0,116,0,124,0,131, - 1,1,0,116,1,131,0,125,1,116,2,106,3,106,4,116, - 5,106,6,124,1,140,0,103,1,131,1,1,0,116,7,106, - 8,100,1,107,2,114,56,116,2,106,9,106,10,116,11,131, - 1,1,0,116,2,106,9,106,10,116,12,131,1,1,0,116, - 5,124,0,95,5,116,13,124,0,95,13,100,2,83,0,41, - 3,122,41,73,110,115,116,97,108,108,32,116,104,101,32,112, - 97,116,104,45,98,97,115,101,100,32,105,109,112,111,114,116, - 32,99,111,109,112,111,110,101,110,116,115,46,114,24,1,0, - 0,78,41,14,114,29,1,0,0,114,155,0,0,0,114,7, - 0,0,0,114,250,0,0,0,114,143,0,0,0,114,2,1, - 0,0,114,15,1,0,0,114,3,0,0,0,114,105,0,0, - 0,218,9,109,101,116,97,95,112,97,116,104,114,157,0,0, - 0,114,162,0,0,0,114,245,0,0,0,114,212,0,0,0, - 41,2,114,28,1,0,0,90,17,115,117,112,112,111,114,116, - 101,100,95,108,111,97,100,101,114,115,114,4,0,0,0,114, - 4,0,0,0,114,5,0,0,0,218,8,95,105,110,115,116, - 97,108,108,140,5,0,0,115,16,0,0,0,0,2,8,1, - 6,1,20,1,10,1,12,1,12,4,6,1,114,31,1,0, - 0,41,3,122,3,119,105,110,114,1,0,0,0,114,2,0, - 0,0,41,56,114,107,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,17,0,0,0,114,19,0,0,0,114,28,0, - 0,0,114,38,0,0,0,114,39,0,0,0,114,43,0,0, - 0,114,44,0,0,0,114,46,0,0,0,114,55,0,0,0, - 218,4,116,121,112,101,218,8,95,95,99,111,100,101,95,95, - 114,138,0,0,0,114,15,0,0,0,114,128,0,0,0,114, - 14,0,0,0,114,18,0,0,0,90,17,95,82,65,87,95, - 77,65,71,73,67,95,78,85,77,66,69,82,114,73,0,0, - 0,114,72,0,0,0,114,84,0,0,0,114,74,0,0,0, - 90,23,68,69,66,85,71,95,66,89,84,69,67,79,68,69, - 95,83,85,70,70,73,88,69,83,90,27,79,80,84,73,77, - 73,90,69,68,95,66,89,84,69,67,79,68,69,95,83,85, - 70,70,73,88,69,83,114,79,0,0,0,114,85,0,0,0, - 114,91,0,0,0,114,95,0,0,0,114,97,0,0,0,114, - 116,0,0,0,114,123,0,0,0,114,135,0,0,0,114,141, - 0,0,0,114,144,0,0,0,114,149,0,0,0,218,6,111, - 98,106,101,99,116,114,156,0,0,0,114,161,0,0,0,114, - 162,0,0,0,114,178,0,0,0,114,188,0,0,0,114,204, - 0,0,0,114,212,0,0,0,114,217,0,0,0,114,223,0, - 0,0,114,218,0,0,0,114,224,0,0,0,114,243,0,0, - 0,114,245,0,0,0,114,2,1,0,0,114,20,1,0,0, - 114,155,0,0,0,114,29,1,0,0,114,31,1,0,0,114, - 4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, - 0,0,0,218,8,60,109,111,100,117,108,101,62,8,0,0, - 0,115,102,0,0,0,4,17,4,3,8,12,8,5,8,5, - 8,6,8,12,8,10,8,9,8,5,8,7,10,22,10,116, - 16,1,12,2,4,1,4,2,6,2,6,2,8,2,16,44, - 8,33,8,19,8,12,8,12,8,28,8,17,14,55,14,12, - 12,10,8,14,6,3,8,1,12,65,14,64,14,29,16,110, - 14,41,18,45,18,16,4,3,18,53,14,60,14,42,14,127, - 0,7,14,127,0,20,10,23,8,11,8,68, + 41,11,122,102,84,114,121,32,116,111,32,102,105,110,100,32, + 97,32,115,112,101,99,32,102,111,114,32,116,104,101,32,115, + 112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,46, + 32,32,82,101,116,117,114,110,115,32,116,104,101,10,32,32, + 32,32,32,32,32,32,109,97,116,99,104,105,110,103,32,115, + 112,101,99,44,32,111,114,32,78,111,110,101,32,105,102,32, + 110,111,116,32,102,111,117,110,100,46,70,114,58,0,0,0, + 114,56,0,0,0,114,29,0,0,0,114,179,0,0,0,122, + 9,116,114,121,105,110,103,32,123,125,90,9,118,101,114,98, + 111,115,105,116,121,78,122,25,112,111,115,115,105,98,108,101, + 32,110,97,109,101,115,112,97,99,101,32,102,111,114,32,123, + 125,114,87,0,0,0,41,22,114,32,0,0,0,114,39,0, + 0,0,114,35,0,0,0,114,3,0,0,0,114,45,0,0, + 0,114,213,0,0,0,114,40,0,0,0,114,4,1,0,0, + 218,11,95,102,105,108,108,95,99,97,99,104,101,114,6,0, + 0,0,114,7,1,0,0,114,88,0,0,0,114,6,1,0, + 0,114,28,0,0,0,114,3,1,0,0,114,44,0,0,0, + 114,1,1,0,0,114,46,0,0,0,114,114,0,0,0,114, + 129,0,0,0,114,154,0,0,0,114,150,0,0,0,41,14, + 114,100,0,0,0,114,119,0,0,0,114,174,0,0,0,90, + 12,105,115,95,110,97,109,101,115,112,97,99,101,90,11,116, + 97,105,108,95,109,111,100,117,108,101,114,126,0,0,0,90, + 5,99,97,99,104,101,90,12,99,97,99,104,101,95,109,111, + 100,117,108,101,90,9,98,97,115,101,95,112,97,116,104,114, + 219,0,0,0,114,159,0,0,0,90,13,105,110,105,116,95, + 102,105,108,101,110,97,109,101,90,9,102,117,108,108,95,112, + 97,116,104,114,158,0,0,0,114,4,0,0,0,114,4,0, + 0,0,114,5,0,0,0,114,175,0,0,0,193,4,0,0, + 115,70,0,0,0,0,3,4,1,14,1,2,1,24,1,14, + 1,10,1,10,1,8,1,6,2,6,1,6,1,10,2,6, + 1,4,2,8,1,12,1,16,1,8,1,10,1,8,1,24, + 4,8,2,16,1,16,1,18,1,12,1,8,1,10,1,12, + 1,6,1,12,1,12,1,8,1,4,1,122,20,70,105,108, + 101,70,105,110,100,101,114,46,102,105,110,100,95,115,112,101, + 99,99,1,0,0,0,0,0,0,0,9,0,0,0,13,0, + 0,0,67,0,0,0,115,194,0,0,0,124,0,106,0,125, + 1,121,22,116,1,106,2,124,1,112,22,116,1,106,3,131, + 0,131,1,125,2,87,0,110,30,4,0,116,4,116,5,116, + 6,102,3,107,10,114,58,1,0,1,0,1,0,103,0,125, + 2,89,0,110,2,88,0,116,7,106,8,106,9,100,1,131, + 1,115,84,116,10,124,2,131,1,124,0,95,11,110,78,116, + 10,131,0,125,3,120,64,124,2,68,0,93,56,125,4,124, + 4,106,12,100,2,131,1,92,3,125,5,125,6,125,7,124, + 6,114,138,100,3,106,13,124,5,124,7,106,14,131,0,131, + 2,125,8,110,4,124,5,125,8,124,3,106,15,124,8,131, + 1,1,0,113,96,87,0,124,3,124,0,95,11,116,7,106, + 8,106,9,116,16,131,1,114,190,100,4,100,5,132,0,124, + 2,68,0,131,1,124,0,95,17,100,6,83,0,41,7,122, + 68,70,105,108,108,32,116,104,101,32,99,97,99,104,101,32, + 111,102,32,112,111,116,101,110,116,105,97,108,32,109,111,100, + 117,108,101,115,32,97,110,100,32,112,97,99,107,97,103,101, + 115,32,102,111,114,32,116,104,105,115,32,100,105,114,101,99, + 116,111,114,121,46,114,0,0,0,0,114,58,0,0,0,122, + 5,123,125,46,123,125,99,1,0,0,0,0,0,0,0,2, + 0,0,0,3,0,0,0,83,0,0,0,115,20,0,0,0, + 104,0,124,0,93,12,125,1,124,1,106,0,131,0,146,2, + 113,4,83,0,114,4,0,0,0,41,1,114,88,0,0,0, + 41,2,114,22,0,0,0,90,2,102,110,114,4,0,0,0, + 114,4,0,0,0,114,5,0,0,0,250,9,60,115,101,116, + 99,111,109,112,62,12,5,0,0,115,2,0,0,0,6,0, + 122,41,70,105,108,101,70,105,110,100,101,114,46,95,102,105, + 108,108,95,99,97,99,104,101,46,60,108,111,99,97,108,115, + 62,46,60,115,101,116,99,111,109,112,62,78,41,18,114,35, + 0,0,0,114,3,0,0,0,90,7,108,105,115,116,100,105, + 114,114,45,0,0,0,114,252,0,0,0,218,15,80,101,114, + 109,105,115,115,105,111,110,69,114,114,111,114,218,18,78,111, + 116,65,68,105,114,101,99,116,111,114,121,69,114,114,111,114, + 114,7,0,0,0,114,8,0,0,0,114,9,0,0,0,114, + 5,1,0,0,114,6,1,0,0,114,83,0,0,0,114,47, + 0,0,0,114,88,0,0,0,218,3,97,100,100,114,10,0, + 0,0,114,7,1,0,0,41,9,114,100,0,0,0,114,35, + 0,0,0,90,8,99,111,110,116,101,110,116,115,90,21,108, + 111,119,101,114,95,115,117,102,102,105,120,95,99,111,110,116, + 101,110,116,115,114,241,0,0,0,114,98,0,0,0,114,231, + 0,0,0,114,219,0,0,0,90,8,110,101,119,95,110,97, + 109,101,114,4,0,0,0,114,4,0,0,0,114,5,0,0, + 0,114,9,1,0,0,239,4,0,0,115,34,0,0,0,0, + 2,6,1,2,1,22,1,20,3,10,3,12,1,12,7,6, + 1,10,1,16,1,4,1,18,2,4,1,14,1,6,1,12, + 1,122,22,70,105,108,101,70,105,110,100,101,114,46,95,102, + 105,108,108,95,99,97,99,104,101,99,1,0,0,0,0,0, + 0,0,3,0,0,0,3,0,0,0,7,0,0,0,115,18, + 0,0,0,135,0,135,1,102,2,100,1,100,2,134,0,125, + 2,124,2,83,0,41,3,97,20,1,0,0,65,32,99,108, + 97,115,115,32,109,101,116,104,111,100,32,119,104,105,99,104, + 32,114,101,116,117,114,110,115,32,97,32,99,108,111,115,117, + 114,101,32,116,111,32,117,115,101,32,111,110,32,115,121,115, + 46,112,97,116,104,95,104,111,111,107,10,32,32,32,32,32, + 32,32,32,119,104,105,99,104,32,119,105,108,108,32,114,101, + 116,117,114,110,32,97,110,32,105,110,115,116,97,110,99,101, + 32,117,115,105,110,103,32,116,104,101,32,115,112,101,99,105, + 102,105,101,100,32,108,111,97,100,101,114,115,32,97,110,100, + 32,116,104,101,32,112,97,116,104,10,32,32,32,32,32,32, + 32,32,99,97,108,108,101,100,32,111,110,32,116,104,101,32, + 99,108,111,115,117,114,101,46,10,10,32,32,32,32,32,32, + 32,32,73,102,32,116,104,101,32,112,97,116,104,32,99,97, + 108,108,101,100,32,111,110,32,116,104,101,32,99,108,111,115, + 117,114,101,32,105,115,32,110,111,116,32,97,32,100,105,114, + 101,99,116,111,114,121,44,32,73,109,112,111,114,116,69,114, + 114,111,114,32,105,115,10,32,32,32,32,32,32,32,32,114, + 97,105,115,101,100,46,10,10,32,32,32,32,32,32,32,32, + 99,1,0,0,0,0,0,0,0,1,0,0,0,4,0,0, + 0,19,0,0,0,115,32,0,0,0,116,0,124,0,131,1, + 115,22,116,1,100,1,100,2,124,0,144,1,131,1,130,1, + 136,0,124,0,136,1,140,1,83,0,41,3,122,45,80,97, + 116,104,32,104,111,111,107,32,102,111,114,32,105,109,112,111, + 114,116,108,105,98,46,109,97,99,104,105,110,101,114,121,46, + 70,105,108,101,70,105,110,100,101,114,46,122,30,111,110,108, + 121,32,100,105,114,101,99,116,111,114,105,101,115,32,97,114, + 101,32,115,117,112,112,111,114,116,101,100,114,35,0,0,0, + 41,2,114,46,0,0,0,114,99,0,0,0,41,1,114,35, + 0,0,0,41,2,114,164,0,0,0,114,8,1,0,0,114, + 4,0,0,0,114,5,0,0,0,218,24,112,97,116,104,95, + 104,111,111,107,95,102,111,114,95,70,105,108,101,70,105,110, + 100,101,114,24,5,0,0,115,6,0,0,0,0,2,8,1, + 14,1,122,54,70,105,108,101,70,105,110,100,101,114,46,112, + 97,116,104,95,104,111,111,107,46,60,108,111,99,97,108,115, + 62,46,112,97,116,104,95,104,111,111,107,95,102,111,114,95, + 70,105,108,101,70,105,110,100,101,114,114,4,0,0,0,41, + 3,114,164,0,0,0,114,8,1,0,0,114,14,1,0,0, + 114,4,0,0,0,41,2,114,164,0,0,0,114,8,1,0, + 0,114,5,0,0,0,218,9,112,97,116,104,95,104,111,111, + 107,14,5,0,0,115,4,0,0,0,0,10,14,6,122,20, + 70,105,108,101,70,105,110,100,101,114,46,112,97,116,104,95, + 104,111,111,107,99,1,0,0,0,0,0,0,0,1,0,0, + 0,2,0,0,0,67,0,0,0,115,12,0,0,0,100,1, + 106,0,124,0,106,1,131,1,83,0,41,2,78,122,16,70, + 105,108,101,70,105,110,100,101,114,40,123,33,114,125,41,41, + 2,114,47,0,0,0,114,35,0,0,0,41,1,114,100,0, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, + 0,114,240,0,0,0,32,5,0,0,115,2,0,0,0,0, + 1,122,19,70,105,108,101,70,105,110,100,101,114,46,95,95, + 114,101,112,114,95,95,41,15,114,105,0,0,0,114,104,0, + 0,0,114,106,0,0,0,114,107,0,0,0,114,179,0,0, + 0,114,246,0,0,0,114,123,0,0,0,114,176,0,0,0, + 114,117,0,0,0,114,1,1,0,0,114,175,0,0,0,114, + 9,1,0,0,114,177,0,0,0,114,15,1,0,0,114,240, + 0,0,0,114,4,0,0,0,114,4,0,0,0,114,4,0, + 0,0,114,5,0,0,0,114,2,1,0,0,147,4,0,0, + 115,20,0,0,0,8,7,4,2,8,14,8,4,4,2,8, + 12,8,5,10,46,8,31,12,18,114,2,1,0,0,99,4, + 0,0,0,0,0,0,0,6,0,0,0,11,0,0,0,67, + 0,0,0,115,148,0,0,0,124,0,106,0,100,1,131,1, + 125,4,124,0,106,0,100,2,131,1,125,5,124,4,115,66, + 124,5,114,36,124,5,106,1,125,4,110,30,124,2,124,3, + 107,2,114,56,116,2,124,1,124,2,131,2,125,4,110,10, + 116,3,124,1,124,2,131,2,125,4,124,5,115,86,116,4, + 124,1,124,2,100,3,124,4,144,1,131,2,125,5,121,36, + 124,5,124,0,100,2,60,0,124,4,124,0,100,1,60,0, + 124,2,124,0,100,4,60,0,124,3,124,0,100,5,60,0, + 87,0,110,20,4,0,116,5,107,10,114,142,1,0,1,0, + 1,0,89,0,110,2,88,0,100,0,83,0,41,6,78,218, + 10,95,95,108,111,97,100,101,114,95,95,218,8,95,95,115, + 112,101,99,95,95,114,120,0,0,0,90,8,95,95,102,105, + 108,101,95,95,90,10,95,95,99,97,99,104,101,100,95,95, + 41,6,218,3,103,101,116,114,120,0,0,0,114,217,0,0, + 0,114,212,0,0,0,114,161,0,0,0,218,9,69,120,99, + 101,112,116,105,111,110,41,6,90,2,110,115,114,98,0,0, + 0,90,8,112,97,116,104,110,97,109,101,90,9,99,112,97, + 116,104,110,97,109,101,114,120,0,0,0,114,158,0,0,0, + 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, + 14,95,102,105,120,95,117,112,95,109,111,100,117,108,101,38, + 5,0,0,115,34,0,0,0,0,2,10,1,10,1,4,1, + 4,1,8,1,8,1,12,2,10,1,4,1,16,1,2,1, + 8,1,8,1,8,1,12,1,14,2,114,20,1,0,0,99, + 0,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0, + 67,0,0,0,115,38,0,0,0,116,0,116,1,106,2,131, + 0,102,2,125,0,116,3,116,4,102,2,125,1,116,5,116, + 6,102,2,125,2,124,0,124,1,124,2,103,3,83,0,41, + 1,122,95,82,101,116,117,114,110,115,32,97,32,108,105,115, + 116,32,111,102,32,102,105,108,101,45,98,97,115,101,100,32, + 109,111,100,117,108,101,32,108,111,97,100,101,114,115,46,10, + 10,32,32,32,32,69,97,99,104,32,105,116,101,109,32,105, + 115,32,97,32,116,117,112,108,101,32,40,108,111,97,100,101, + 114,44,32,115,117,102,102,105,120,101,115,41,46,10,32,32, + 32,32,41,7,114,218,0,0,0,114,139,0,0,0,218,18, + 101,120,116,101,110,115,105,111,110,95,115,117,102,102,105,120, + 101,115,114,212,0,0,0,114,84,0,0,0,114,217,0,0, + 0,114,74,0,0,0,41,3,90,10,101,120,116,101,110,115, + 105,111,110,115,90,6,115,111,117,114,99,101,90,8,98,121, + 116,101,99,111,100,101,114,4,0,0,0,114,4,0,0,0, + 114,5,0,0,0,114,155,0,0,0,61,5,0,0,115,8, + 0,0,0,0,5,12,1,8,1,8,1,114,155,0,0,0, + 99,1,0,0,0,0,0,0,0,12,0,0,0,12,0,0, + 0,67,0,0,0,115,188,1,0,0,124,0,97,0,116,0, + 106,1,97,1,116,0,106,2,97,2,116,1,106,3,116,4, + 25,0,125,1,120,56,100,26,68,0,93,48,125,2,124,2, + 116,1,106,3,107,7,114,58,116,0,106,5,124,2,131,1, + 125,3,110,10,116,1,106,3,124,2,25,0,125,3,116,6, + 124,1,124,2,124,3,131,3,1,0,113,32,87,0,100,5, + 100,6,103,1,102,2,100,7,100,8,100,6,103,2,102,2, + 102,2,125,4,120,118,124,4,68,0,93,102,92,2,125,5, + 125,6,116,7,100,9,100,10,132,0,124,6,68,0,131,1, + 131,1,115,142,116,8,130,1,124,6,100,11,25,0,125,7, + 124,5,116,1,106,3,107,6,114,174,116,1,106,3,124,5, + 25,0,125,8,80,0,113,112,121,16,116,0,106,5,124,5, + 131,1,125,8,80,0,87,0,113,112,4,0,116,9,107,10, + 114,212,1,0,1,0,1,0,119,112,89,0,113,112,88,0, + 113,112,87,0,116,9,100,12,131,1,130,1,116,6,124,1, + 100,13,124,8,131,3,1,0,116,6,124,1,100,14,124,7, + 131,3,1,0,116,6,124,1,100,15,100,16,106,10,124,6, + 131,1,131,3,1,0,121,14,116,0,106,5,100,17,131,1, + 125,9,87,0,110,26,4,0,116,9,107,10,144,1,114,52, + 1,0,1,0,1,0,100,18,125,9,89,0,110,2,88,0, + 116,6,124,1,100,17,124,9,131,3,1,0,116,0,106,5, + 100,19,131,1,125,10,116,6,124,1,100,19,124,10,131,3, + 1,0,124,5,100,7,107,2,144,1,114,120,116,0,106,5, + 100,20,131,1,125,11,116,6,124,1,100,21,124,11,131,3, + 1,0,116,6,124,1,100,22,116,11,131,0,131,3,1,0, + 116,12,106,13,116,2,106,14,131,0,131,1,1,0,124,5, + 100,7,107,2,144,1,114,184,116,15,106,16,100,23,131,1, + 1,0,100,24,116,12,107,6,144,1,114,184,100,25,116,17, + 95,18,100,18,83,0,41,27,122,205,83,101,116,117,112,32, + 116,104,101,32,112,97,116,104,45,98,97,115,101,100,32,105, + 109,112,111,114,116,101,114,115,32,102,111,114,32,105,109,112, + 111,114,116,108,105,98,32,98,121,32,105,109,112,111,114,116, + 105,110,103,32,110,101,101,100,101,100,10,32,32,32,32,98, + 117,105,108,116,45,105,110,32,109,111,100,117,108,101,115,32, + 97,110,100,32,105,110,106,101,99,116,105,110,103,32,116,104, + 101,109,32,105,110,116,111,32,116,104,101,32,103,108,111,98, + 97,108,32,110,97,109,101,115,112,97,99,101,46,10,10,32, + 32,32,32,79,116,104,101,114,32,99,111,109,112,111,110,101, + 110,116,115,32,97,114,101,32,101,120,116,114,97,99,116,101, + 100,32,102,114,111,109,32,116,104,101,32,99,111,114,101,32, + 98,111,111,116,115,116,114,97,112,32,109,111,100,117,108,101, + 46,10,10,32,32,32,32,114,49,0,0,0,114,60,0,0, + 0,218,8,98,117,105,108,116,105,110,115,114,136,0,0,0, + 90,5,112,111,115,105,120,250,1,47,218,2,110,116,250,1, + 92,99,1,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,115,0,0,0,115,26,0,0,0,124,0,93,18,125, + 1,116,0,124,1,131,1,100,0,107,2,86,0,1,0,113, + 2,100,1,83,0,41,2,114,29,0,0,0,78,41,1,114, + 31,0,0,0,41,2,114,22,0,0,0,114,77,0,0,0, + 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, + 221,0,0,0,97,5,0,0,115,2,0,0,0,4,0,122, + 25,95,115,101,116,117,112,46,60,108,111,99,97,108,115,62, + 46,60,103,101,110,101,120,112,114,62,114,59,0,0,0,122, + 30,105,109,112,111,114,116,108,105,98,32,114,101,113,117,105, + 114,101,115,32,112,111,115,105,120,32,111,114,32,110,116,114, + 3,0,0,0,114,25,0,0,0,114,21,0,0,0,114,30, + 0,0,0,90,7,95,116,104,114,101,97,100,78,90,8,95, + 119,101,97,107,114,101,102,90,6,119,105,110,114,101,103,114, + 163,0,0,0,114,6,0,0,0,122,4,46,112,121,119,122, + 6,95,100,46,112,121,100,84,41,4,122,3,95,105,111,122, + 9,95,119,97,114,110,105,110,103,115,122,8,98,117,105,108, + 116,105,110,115,122,7,109,97,114,115,104,97,108,41,19,114, + 114,0,0,0,114,7,0,0,0,114,139,0,0,0,114,233, + 0,0,0,114,105,0,0,0,90,18,95,98,117,105,108,116, + 105,110,95,102,114,111,109,95,110,97,109,101,114,109,0,0, + 0,218,3,97,108,108,218,14,65,115,115,101,114,116,105,111, + 110,69,114,114,111,114,114,99,0,0,0,114,26,0,0,0, + 114,11,0,0,0,114,223,0,0,0,114,143,0,0,0,114, + 21,1,0,0,114,84,0,0,0,114,157,0,0,0,114,162, + 0,0,0,114,167,0,0,0,41,12,218,17,95,98,111,111, + 116,115,116,114,97,112,95,109,111,100,117,108,101,90,11,115, + 101,108,102,95,109,111,100,117,108,101,90,12,98,117,105,108, + 116,105,110,95,110,97,109,101,90,14,98,117,105,108,116,105, + 110,95,109,111,100,117,108,101,90,10,111,115,95,100,101,116, + 97,105,108,115,90,10,98,117,105,108,116,105,110,95,111,115, + 114,21,0,0,0,114,25,0,0,0,90,9,111,115,95,109, + 111,100,117,108,101,90,13,116,104,114,101,97,100,95,109,111, + 100,117,108,101,90,14,119,101,97,107,114,101,102,95,109,111, + 100,117,108,101,90,13,119,105,110,114,101,103,95,109,111,100, + 117,108,101,114,4,0,0,0,114,4,0,0,0,114,5,0, + 0,0,218,6,95,115,101,116,117,112,72,5,0,0,115,82, + 0,0,0,0,8,4,1,6,1,6,3,10,1,10,1,10, + 1,12,2,10,1,16,3,22,1,14,2,22,1,8,1,10, + 1,10,1,4,2,2,1,10,1,6,1,14,1,12,2,8, + 1,12,1,12,1,18,3,2,1,14,1,16,2,10,1,12, + 3,10,1,12,3,10,1,10,1,12,3,14,1,14,1,10, + 1,10,1,10,1,114,29,1,0,0,99,1,0,0,0,0, + 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, + 84,0,0,0,116,0,124,0,131,1,1,0,116,1,131,0, + 125,1,116,2,106,3,106,4,116,5,106,6,124,1,140,0, + 103,1,131,1,1,0,116,7,106,8,100,1,107,2,114,56, + 116,2,106,9,106,10,116,11,131,1,1,0,116,2,106,9, + 106,10,116,12,131,1,1,0,116,5,124,0,95,5,116,13, + 124,0,95,13,100,2,83,0,41,3,122,41,73,110,115,116, + 97,108,108,32,116,104,101,32,112,97,116,104,45,98,97,115, + 101,100,32,105,109,112,111,114,116,32,99,111,109,112,111,110, + 101,110,116,115,46,114,24,1,0,0,78,41,14,114,29,1, + 0,0,114,155,0,0,0,114,7,0,0,0,114,250,0,0, + 0,114,143,0,0,0,114,2,1,0,0,114,15,1,0,0, + 114,3,0,0,0,114,105,0,0,0,218,9,109,101,116,97, + 95,112,97,116,104,114,157,0,0,0,114,162,0,0,0,114, + 245,0,0,0,114,212,0,0,0,41,2,114,28,1,0,0, + 90,17,115,117,112,112,111,114,116,101,100,95,108,111,97,100, + 101,114,115,114,4,0,0,0,114,4,0,0,0,114,5,0, + 0,0,218,8,95,105,110,115,116,97,108,108,140,5,0,0, + 115,16,0,0,0,0,2,8,1,6,1,20,1,10,1,12, + 1,12,4,6,1,114,31,1,0,0,41,3,122,3,119,105, + 110,114,1,0,0,0,114,2,0,0,0,41,56,114,107,0, + 0,0,114,10,0,0,0,114,11,0,0,0,114,17,0,0, + 0,114,19,0,0,0,114,28,0,0,0,114,38,0,0,0, + 114,39,0,0,0,114,43,0,0,0,114,44,0,0,0,114, + 46,0,0,0,114,55,0,0,0,218,4,116,121,112,101,218, + 8,95,95,99,111,100,101,95,95,114,138,0,0,0,114,15, + 0,0,0,114,128,0,0,0,114,14,0,0,0,114,18,0, + 0,0,90,17,95,82,65,87,95,77,65,71,73,67,95,78, + 85,77,66,69,82,114,73,0,0,0,114,72,0,0,0,114, + 84,0,0,0,114,74,0,0,0,90,23,68,69,66,85,71, + 95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88, + 69,83,90,27,79,80,84,73,77,73,90,69,68,95,66,89, + 84,69,67,79,68,69,95,83,85,70,70,73,88,69,83,114, + 79,0,0,0,114,85,0,0,0,114,91,0,0,0,114,95, + 0,0,0,114,97,0,0,0,114,116,0,0,0,114,123,0, + 0,0,114,135,0,0,0,114,141,0,0,0,114,144,0,0, + 0,114,149,0,0,0,218,6,111,98,106,101,99,116,114,156, + 0,0,0,114,161,0,0,0,114,162,0,0,0,114,178,0, + 0,0,114,188,0,0,0,114,204,0,0,0,114,212,0,0, + 0,114,217,0,0,0,114,223,0,0,0,114,218,0,0,0, + 114,224,0,0,0,114,243,0,0,0,114,245,0,0,0,114, + 2,1,0,0,114,20,1,0,0,114,155,0,0,0,114,29, + 1,0,0,114,31,1,0,0,114,4,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,218,8,60,109, + 111,100,117,108,101,62,8,0,0,0,115,102,0,0,0,4, + 17,4,3,8,12,8,5,8,5,8,6,8,12,8,10,8, + 9,8,5,8,7,10,22,10,116,16,1,12,2,4,1,4, + 2,6,2,6,2,8,2,16,44,8,33,8,19,8,12,8, + 12,8,28,8,17,14,55,14,12,12,10,8,14,6,3,8, + 1,12,65,14,64,14,29,16,110,14,41,18,45,18,16,4, + 3,18,53,14,60,14,42,14,127,0,7,14,127,0,20,10, + 23,8,11,8,68, }; -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 14:10:08 2016 From: python-checkins at python.org (eric.snow) Date: Sat, 28 May 2016 18:10:08 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327147=3A_Mention_PEP_420_in_the_importlib_docs?= =?utf-8?q?=2E?= Message-ID: <20160528181008.13773.50928.AD5D5794@psf.io> https://hg.python.org/cpython/rev/0177af33ce76 changeset: 101541:0177af33ce76 parent: 101539:fb965ee44d5e parent: 101540:6f50c04e4a1e user: Eric Snow date: Sat May 28 11:08:20 2016 -0700 summary: Issue #27147: Mention PEP 420 in the importlib docs. files: Doc/library/importlib.rst | 3 +++ Misc/NEWS | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -52,6 +52,9 @@ :pep:`366` Main module explicit relative imports + :pep:`420` + Implicit namespace packages + :pep:`451` A ModuleSpec Type for the Import System diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -105,6 +105,8 @@ - Issue #27138: Fix the doc comment for FileFinder.find_spec(). +- Issue #27147: Mention PEP 420 in the importlib docs. + - Issue #25339: PYTHONIOENCODING now has priority over locale in setting the error handler for stdin and stdout. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 14:10:09 2016 From: python-checkins at python.org (eric.snow) Date: Sat, 28 May 2016 18:10:09 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MTQ3?= =?utf-8?q?=3A_Mention_PEP_420_in_the_importlib_docs=2E?= Message-ID: <20160528181008.122118.12626.96802CC5@psf.io> https://hg.python.org/cpython/rev/6f50c04e4a1e changeset: 101540:6f50c04e4a1e branch: 3.5 parent: 101538:8a49da84fc1d user: Eric Snow date: Sat May 28 11:56:53 2016 -0600 summary: Issue #27147: Mention PEP 420 in the importlib docs. files: Doc/library/importlib.rst | 3 +++ Misc/NEWS | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -52,6 +52,9 @@ :pep:`366` Main module explicit relative imports + :pep:`420` + Implicit namespace packages + :pep:`451` A ModuleSpec Type for the Import System diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -106,6 +106,8 @@ - Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache. +- Issue #27147: Mention PEP 420 in the importlib docs. + - Issue #24097: Fixed crash in object.__reduce__() if slot name is freed inside __getattr__. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 14:33:11 2016 From: python-checkins at python.org (guido.van.rossum) Date: Sat, 28 May 2016 18:33:11 +0000 Subject: [Python-checkins] =?utf-8?q?peps=3A_Add_=22Python-Version=3A_3=2E?= =?utf-8?q?6=22_header_to_PEP_519=2E?= Message-ID: <20160528183310.32431.89573.6C6AFC53@psf.io> https://hg.python.org/peps/rev/d755ae8df565 changeset: 6344:d755ae8df565 user: Guido van Rossum date: Sat May 28 11:32:59 2016 -0700 summary: Add "Python-Version: 3.6" header to PEP 519. files: pep-0519.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/pep-0519.txt b/pep-0519.txt --- a/pep-0519.txt +++ b/pep-0519.txt @@ -8,6 +8,7 @@ Type: Standards Track Content-Type: text/x-rst Created: 11-May-2016 +Python-Version: 3.6 Post-History: 11-May-2016, 12-May-2016, 13-May-2016 -- Repository URL: https://hg.python.org/peps From python-checkins at python.org Sat May 28 15:24:52 2016 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 28 May 2016 19:24:52 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogaXNzdWUyNjA4Mzog?= =?utf-8?q?Avoid_duplicate_error_message_string_from_a_subprocess_exec?= Message-ID: <20160528192450.32425.85265.3CA70CEC@psf.io> https://hg.python.org/cpython/rev/184dfef08a93 changeset: 101542:184dfef08a93 branch: 2.7 parent: 101536:f66c30f66235 user: Gregory P. Smith [Google Inc.] date: Sat May 28 19:24:14 2016 +0000 summary: issue26083: Avoid duplicate error message string from a subprocess exec failure.Avoid a duplicate error message string from a subprocess exec failure. :P files: Lib/subprocess.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1317,7 +1317,7 @@ # Wait for exec to fail or succeed; possibly raising exception data = _eintr_retry_call(os.read, errpipe_read, 1048576) - pickle_bits = [data] + pickle_bits = [] while data: pickle_bits.append(data) data = _eintr_retry_call(os.read, errpipe_read, 1048576) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 15:53:18 2016 From: python-checkins at python.org (terry.reedy) Date: Sat, 28 May 2016 19:53:18 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2324225=3A_Rename_m?= =?utf-8?q?any_idlelib/*=2Epy_and_idlelib/idle=5Ftest/test=5F*=2Epy_files?= =?utf-8?q?=2E?= Message-ID: <20160528195318.13753.69391.3E0FE826@psf.io> https://hg.python.org/cpython/rev/6ecd4db71b88 changeset: 101543:6ecd4db71b88 parent: 101541:0177af33ce76 user: Terry Jan Reedy date: Sun May 22 19:10:31 2016 -0400 summary: Issue #24225: Rename many idlelib/*.py and idlelib/idle_test/test_*.py files. files: Lib/idlelib/autocomplete.py | 0 Lib/idlelib/autocomplete_w.py | 0 Lib/idlelib/autoexpand.py | 0 Lib/idlelib/browser.py | 0 Lib/idlelib/calltip_w.py | 0 Lib/idlelib/calltips.py | 0 Lib/idlelib/codecontext.py | 0 Lib/idlelib/colorizer.py | 0 Lib/idlelib/config.py | 0 Lib/idlelib/config_help.py | 0 Lib/idlelib/config_key.py | 0 Lib/idlelib/config_sec.py | 0 Lib/idlelib/configdialog.py | 0 Lib/idlelib/debugger.py | 0 Lib/idlelib/debugger_r.py | 0 Lib/idlelib/debugobj.py | 0 Lib/idlelib/debugobj_r.py | 0 Lib/idlelib/delegator.py | 0 Lib/idlelib/dynoption.py | 0 Lib/idlelib/editor.py | 0 Lib/idlelib/filelist.py | 0 Lib/idlelib/grep.py | 0 Lib/idlelib/help_about.py | 0 Lib/idlelib/history.py | 0 Lib/idlelib/hyperparser.py | 0 Lib/idlelib/idle_test/test_history.py | 0 Lib/idlelib/idle_test/test_iomenu.py | 0 Lib/idlelib/idle_test/test_paragraph.py | 0 Lib/idlelib/idle_test/test_redirector.py | 0 Lib/idlelib/idle_test/test_replace.py | 0 Lib/idlelib/idle_test/test_search.py | 0 Lib/idlelib/idle_test/test_searchbase.py | 0 Lib/idlelib/idle_test/test_undo.py | 0 Lib/idlelib/iomenu.py | 0 Lib/idlelib/macosx.py | 0 Lib/idlelib/mainmenu.py | 0 Lib/idlelib/multicall.py | 0 Lib/idlelib/outwin.py | 0 Lib/idlelib/paragraph.py | 0 Lib/idlelib/parenmatch.py | 0 Lib/idlelib/pathbrowser.py | 0 Lib/idlelib/percolator.py | 0 Lib/idlelib/pyparse.py | 0 Lib/idlelib/pyshell.py | 0 Lib/idlelib/redirector.py | 0 Lib/idlelib/replace.py | 0 Lib/idlelib/rstrip.py | 0 Lib/idlelib/runscript.py | 0 Lib/idlelib/scrolledlist.py | 0 Lib/idlelib/search.py | 0 Lib/idlelib/searchbase.py | 0 Lib/idlelib/searchengine.py | 0 Lib/idlelib/stackviewer.py | 0 Lib/idlelib/statusbar.py | 0 Lib/idlelib/textview.py | 0 Lib/idlelib/tooltip.py | 0 Lib/idlelib/tree.py | 0 Lib/idlelib/undo.py | 0 Lib/idlelib/windows.py | 0 Lib/idlelib/zoomheight.py | 0 60 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/autocomplete.py rename from Lib/idlelib/AutoComplete.py rename to Lib/idlelib/autocomplete.py diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/autocomplete_w.py rename from Lib/idlelib/AutoCompleteWindow.py rename to Lib/idlelib/autocomplete_w.py diff --git a/Lib/idlelib/AutoExpand.py b/Lib/idlelib/autoexpand.py rename from Lib/idlelib/AutoExpand.py rename to Lib/idlelib/autoexpand.py diff --git a/Lib/idlelib/ClassBrowser.py b/Lib/idlelib/browser.py rename from Lib/idlelib/ClassBrowser.py rename to Lib/idlelib/browser.py diff --git a/Lib/idlelib/CallTipWindow.py b/Lib/idlelib/calltip_w.py rename from Lib/idlelib/CallTipWindow.py rename to Lib/idlelib/calltip_w.py diff --git a/Lib/idlelib/CallTips.py b/Lib/idlelib/calltips.py rename from Lib/idlelib/CallTips.py rename to Lib/idlelib/calltips.py diff --git a/Lib/idlelib/CodeContext.py b/Lib/idlelib/codecontext.py rename from Lib/idlelib/CodeContext.py rename to Lib/idlelib/codecontext.py diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/colorizer.py rename from Lib/idlelib/ColorDelegator.py rename to Lib/idlelib/colorizer.py diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/config.py rename from Lib/idlelib/configHandler.py rename to Lib/idlelib/config.py diff --git a/Lib/idlelib/configHelpSourceEdit.py b/Lib/idlelib/config_help.py rename from Lib/idlelib/configHelpSourceEdit.py rename to Lib/idlelib/config_help.py diff --git a/Lib/idlelib/keybindingDialog.py b/Lib/idlelib/config_key.py rename from Lib/idlelib/keybindingDialog.py rename to Lib/idlelib/config_key.py diff --git a/Lib/idlelib/configSectionNameDialog.py b/Lib/idlelib/config_sec.py rename from Lib/idlelib/configSectionNameDialog.py rename to Lib/idlelib/config_sec.py diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configdialog.py rename from Lib/idlelib/configDialog.py rename to Lib/idlelib/configdialog.py diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/debugger.py rename from Lib/idlelib/Debugger.py rename to Lib/idlelib/debugger.py diff --git a/Lib/idlelib/RemoteDebugger.py b/Lib/idlelib/debugger_r.py rename from Lib/idlelib/RemoteDebugger.py rename to Lib/idlelib/debugger_r.py diff --git a/Lib/idlelib/ObjectBrowser.py b/Lib/idlelib/debugobj.py rename from Lib/idlelib/ObjectBrowser.py rename to Lib/idlelib/debugobj.py diff --git a/Lib/idlelib/RemoteObjectBrowser.py b/Lib/idlelib/debugobj_r.py rename from Lib/idlelib/RemoteObjectBrowser.py rename to Lib/idlelib/debugobj_r.py diff --git a/Lib/idlelib/Delegator.py b/Lib/idlelib/delegator.py rename from Lib/idlelib/Delegator.py rename to Lib/idlelib/delegator.py diff --git a/Lib/idlelib/dynOptionMenuWidget.py b/Lib/idlelib/dynoption.py rename from Lib/idlelib/dynOptionMenuWidget.py rename to Lib/idlelib/dynoption.py diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/editor.py rename from Lib/idlelib/EditorWindow.py rename to Lib/idlelib/editor.py diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/filelist.py rename from Lib/idlelib/FileList.py rename to Lib/idlelib/filelist.py diff --git a/Lib/idlelib/GrepDialog.py b/Lib/idlelib/grep.py rename from Lib/idlelib/GrepDialog.py rename to Lib/idlelib/grep.py diff --git a/Lib/idlelib/aboutDialog.py b/Lib/idlelib/help_about.py rename from Lib/idlelib/aboutDialog.py rename to Lib/idlelib/help_about.py diff --git a/Lib/idlelib/IdleHistory.py b/Lib/idlelib/history.py rename from Lib/idlelib/IdleHistory.py rename to Lib/idlelib/history.py diff --git a/Lib/idlelib/HyperParser.py b/Lib/idlelib/hyperparser.py rename from Lib/idlelib/HyperParser.py rename to Lib/idlelib/hyperparser.py diff --git a/Lib/idlelib/idle_test/test_idlehistory.py b/Lib/idlelib/idle_test/test_history.py rename from Lib/idlelib/idle_test/test_idlehistory.py rename to Lib/idlelib/idle_test/test_history.py diff --git a/Lib/idlelib/idle_test/test_io.py b/Lib/idlelib/idle_test/test_iomenu.py rename from Lib/idlelib/idle_test/test_io.py rename to Lib/idlelib/idle_test/test_iomenu.py diff --git a/Lib/idlelib/idle_test/test_formatparagraph.py b/Lib/idlelib/idle_test/test_paragraph.py rename from Lib/idlelib/idle_test/test_formatparagraph.py rename to Lib/idlelib/idle_test/test_paragraph.py diff --git a/Lib/idlelib/idle_test/test_widgetredir.py b/Lib/idlelib/idle_test/test_redirector.py rename from Lib/idlelib/idle_test/test_widgetredir.py rename to Lib/idlelib/idle_test/test_redirector.py diff --git a/Lib/idlelib/idle_test/test_replacedialog.py b/Lib/idlelib/idle_test/test_replace.py rename from Lib/idlelib/idle_test/test_replacedialog.py rename to Lib/idlelib/idle_test/test_replace.py diff --git a/Lib/idlelib/idle_test/test_searchdialog.py b/Lib/idlelib/idle_test/test_search.py rename from Lib/idlelib/idle_test/test_searchdialog.py rename to Lib/idlelib/idle_test/test_search.py diff --git a/Lib/idlelib/idle_test/test_searchdialogbase.py b/Lib/idlelib/idle_test/test_searchbase.py rename from Lib/idlelib/idle_test/test_searchdialogbase.py rename to Lib/idlelib/idle_test/test_searchbase.py diff --git a/Lib/idlelib/idle_test/test_undodelegator.py b/Lib/idlelib/idle_test/test_undo.py rename from Lib/idlelib/idle_test/test_undodelegator.py rename to Lib/idlelib/idle_test/test_undo.py diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/iomenu.py rename from Lib/idlelib/IOBinding.py rename to Lib/idlelib/iomenu.py diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosx.py rename from Lib/idlelib/macosxSupport.py rename to Lib/idlelib/macosx.py diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/mainmenu.py rename from Lib/idlelib/Bindings.py rename to Lib/idlelib/mainmenu.py diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/multicall.py rename from Lib/idlelib/MultiCall.py rename to Lib/idlelib/multicall.py diff --git a/Lib/idlelib/OutputWindow.py b/Lib/idlelib/outwin.py rename from Lib/idlelib/OutputWindow.py rename to Lib/idlelib/outwin.py diff --git a/Lib/idlelib/FormatParagraph.py b/Lib/idlelib/paragraph.py rename from Lib/idlelib/FormatParagraph.py rename to Lib/idlelib/paragraph.py diff --git a/Lib/idlelib/ParenMatch.py b/Lib/idlelib/parenmatch.py rename from Lib/idlelib/ParenMatch.py rename to Lib/idlelib/parenmatch.py diff --git a/Lib/idlelib/PathBrowser.py b/Lib/idlelib/pathbrowser.py rename from Lib/idlelib/PathBrowser.py rename to Lib/idlelib/pathbrowser.py diff --git a/Lib/idlelib/Percolator.py b/Lib/idlelib/percolator.py rename from Lib/idlelib/Percolator.py rename to Lib/idlelib/percolator.py diff --git a/Lib/idlelib/PyParse.py b/Lib/idlelib/pyparse.py rename from Lib/idlelib/PyParse.py rename to Lib/idlelib/pyparse.py diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/pyshell.py rename from Lib/idlelib/PyShell.py rename to Lib/idlelib/pyshell.py diff --git a/Lib/idlelib/WidgetRedirector.py b/Lib/idlelib/redirector.py rename from Lib/idlelib/WidgetRedirector.py rename to Lib/idlelib/redirector.py diff --git a/Lib/idlelib/ReplaceDialog.py b/Lib/idlelib/replace.py rename from Lib/idlelib/ReplaceDialog.py rename to Lib/idlelib/replace.py diff --git a/Lib/idlelib/RstripExtension.py b/Lib/idlelib/rstrip.py rename from Lib/idlelib/RstripExtension.py rename to Lib/idlelib/rstrip.py diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/runscript.py rename from Lib/idlelib/ScriptBinding.py rename to Lib/idlelib/runscript.py diff --git a/Lib/idlelib/ScrolledList.py b/Lib/idlelib/scrolledlist.py rename from Lib/idlelib/ScrolledList.py rename to Lib/idlelib/scrolledlist.py diff --git a/Lib/idlelib/SearchDialog.py b/Lib/idlelib/search.py rename from Lib/idlelib/SearchDialog.py rename to Lib/idlelib/search.py diff --git a/Lib/idlelib/SearchDialogBase.py b/Lib/idlelib/searchbase.py rename from Lib/idlelib/SearchDialogBase.py rename to Lib/idlelib/searchbase.py diff --git a/Lib/idlelib/SearchEngine.py b/Lib/idlelib/searchengine.py rename from Lib/idlelib/SearchEngine.py rename to Lib/idlelib/searchengine.py diff --git a/Lib/idlelib/StackViewer.py b/Lib/idlelib/stackviewer.py rename from Lib/idlelib/StackViewer.py rename to Lib/idlelib/stackviewer.py diff --git a/Lib/idlelib/MultiStatusBar.py b/Lib/idlelib/statusbar.py rename from Lib/idlelib/MultiStatusBar.py rename to Lib/idlelib/statusbar.py diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textview.py rename from Lib/idlelib/textView.py rename to Lib/idlelib/textview.py diff --git a/Lib/idlelib/ToolTip.py b/Lib/idlelib/tooltip.py rename from Lib/idlelib/ToolTip.py rename to Lib/idlelib/tooltip.py diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/tree.py rename from Lib/idlelib/TreeWidget.py rename to Lib/idlelib/tree.py diff --git a/Lib/idlelib/UndoDelegator.py b/Lib/idlelib/undo.py rename from Lib/idlelib/UndoDelegator.py rename to Lib/idlelib/undo.py diff --git a/Lib/idlelib/WindowList.py b/Lib/idlelib/windows.py rename from Lib/idlelib/WindowList.py rename to Lib/idlelib/windows.py diff --git a/Lib/idlelib/ZoomHeight.py b/Lib/idlelib/zoomheight.py rename from Lib/idlelib/ZoomHeight.py rename to Lib/idlelib/zoomheight.py -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 15:53:20 2016 From: python-checkins at python.org (terry.reedy) Date: Sat, 28 May 2016 19:53:20 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2324225=3A_Within_i?= =?utf-8?q?dlelib_files=2C_update_idlelib_module_names=2E?= Message-ID: <20160528195318.10806.94685.C145E420@psf.io> https://hg.python.org/cpython/rev/0c3fdb161901 changeset: 101544:0c3fdb161901 user: Terry Jan Reedy date: Sat May 28 13:22:31 2016 -0400 summary: Issue #24225: Within idlelib files, update idlelib module names. This follows the previous patch that changed idlelib file names. Class names that matched old module names are not changed. Change idlelib imports in turtledemo.__main__. Exception: config-extensions.def. Previously, extension section names, file names, and class names had to match. Changing section names would create cross-version conflicts in config-extensions.cfg (user customizations). Instead map old names to new file names at point of import in editor.EditorWindow.load_extension. Patch extensively tested with test_idle, idle_test.htest.py, a custom import-all test, running IDLE in a console to catch messages, and testing each menu item. Based on a patch by Al Sweigart. files: Lib/idlelib/__main__.py | 4 +- Lib/idlelib/autocomplete.py | 10 +- Lib/idlelib/autocomplete_w.py | 10 +- Lib/idlelib/browser.py | 16 +- Lib/idlelib/calltip_w.py | 4 +- Lib/idlelib/calltips.py | 8 +- Lib/idlelib/codecontext.py | 6 +- Lib/idlelib/colorizer.py | 6 +- Lib/idlelib/config.py | 10 +- Lib/idlelib/config_sec.py | 2 +- Lib/idlelib/configdialog.py | 16 +- Lib/idlelib/debugger.py | 16 +- Lib/idlelib/debugger_r.py | 8 +- Lib/idlelib/debugobj.py | 4 +- Lib/idlelib/editor.py | 129 +++++---- Lib/idlelib/filelist.py | 4 +- Lib/idlelib/grep.py | 10 +- Lib/idlelib/help.py | 4 +- Lib/idlelib/help_about.py | 6 +- Lib/idlelib/history.py | 4 +- Lib/idlelib/hyperparser.py | 4 +- Lib/idlelib/idle.py | 4 +- Lib/idlelib/idle.pyw | 12 +- Lib/idlelib/idle_test/htest.py | 66 ++-- Lib/idlelib/idle_test/mock_idle.py | 4 +- Lib/idlelib/idle_test/test_autocomplete.py | 6 +- Lib/idlelib/idle_test/test_autoexpand.py | 4 +- Lib/idlelib/idle_test/test_calltips.py | 2 +- Lib/idlelib/idle_test/test_config_help.py | 4 +- Lib/idlelib/idle_test/test_config_sec.py | 4 +- Lib/idlelib/idle_test/test_configdialog.py | 6 +- Lib/idlelib/idle_test/test_delegator.py | 2 +- Lib/idlelib/idle_test/test_editor.py | 2 +- Lib/idlelib/idle_test/test_grep.py | 6 +- Lib/idlelib/idle_test/test_history.py | 4 +- Lib/idlelib/idle_test/test_hyperparser.py | 6 +- Lib/idlelib/idle_test/test_iomenu.py | 2 +- Lib/idlelib/idle_test/test_paragraph.py | 8 +- Lib/idlelib/idle_test/test_parenmatch.py | 4 +- Lib/idlelib/idle_test/test_pathbrowser.py | 8 +- Lib/idlelib/idle_test/test_percolator.py | 4 +- Lib/idlelib/idle_test/test_redirector.py | 4 +- Lib/idlelib/idle_test/test_replace.py | 6 +- Lib/idlelib/idle_test/test_rstrip.py | 4 +- Lib/idlelib/idle_test/test_search.py | 6 +- Lib/idlelib/idle_test/test_searchbase.py | 6 +- Lib/idlelib/idle_test/test_searchengine.py | 4 +- Lib/idlelib/idle_test/test_textview.py | 4 +- Lib/idlelib/idle_test/test_undo.py | 6 +- Lib/idlelib/idle_test/test_warning.py | 6 +- Lib/idlelib/iomenu.py | 5 +- Lib/idlelib/macosx.py | 40 +- Lib/idlelib/mainmenu.py | 4 +- Lib/idlelib/outwin.py | 6 +- Lib/idlelib/paragraph.py | 4 +- Lib/idlelib/parenmatch.py | 4 +- Lib/idlelib/pathbrowser.py | 6 +- Lib/idlelib/percolator.py | 4 +- Lib/idlelib/pyshell.py | 68 ++-- Lib/idlelib/redirector.py | 2 +- Lib/idlelib/replace.py | 8 +- Lib/idlelib/run.py | 42 +- Lib/idlelib/runscript.py | 16 +- Lib/idlelib/scrolledlist.py | 4 +- Lib/idlelib/search.py | 6 +- Lib/idlelib/searchbase.py | 2 +- Lib/idlelib/searchengine.py | 2 +- Lib/idlelib/stackviewer.py | 6 +- Lib/idlelib/tooltip.py | 4 +- Lib/idlelib/tree.py | 6 +- Lib/idlelib/undo.py | 4 +- Lib/idlelib/zoomheight.py | 4 +- Lib/turtledemo/__main__.py | 6 +- 73 files changed, 378 insertions(+), 360 deletions(-) diff --git a/Lib/idlelib/__main__.py b/Lib/idlelib/__main__.py --- a/Lib/idlelib/__main__.py +++ b/Lib/idlelib/__main__.py @@ -3,6 +3,6 @@ Run IDLE as python -m idlelib """ -import idlelib.PyShell -idlelib.PyShell.main() +import idlelib.pyshell +idlelib.pyshell.main() # This file does not work for 2.7; See issue 24212. diff --git a/Lib/idlelib/autocomplete.py b/Lib/idlelib/autocomplete.py --- a/Lib/idlelib/autocomplete.py +++ b/Lib/idlelib/autocomplete.py @@ -1,4 +1,4 @@ -"""AutoComplete.py - An IDLE extension for automatically completing names. +"""autocomplete.py - An IDLE extension for automatically completing names. This extension can complete either attribute names of file names. It can pop a window with all available names, for the user to select from. @@ -7,7 +7,7 @@ import sys import string -from idlelib.configHandler import idleConf +from idlelib.config import idleConf # This string includes all chars that may be in an identifier ID_CHARS = string.ascii_letters + string.digits + "_" @@ -15,8 +15,8 @@ # These constants represent the two different types of completions COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1) -from idlelib import AutoCompleteWindow -from idlelib.HyperParser import HyperParser +from idlelib import autocomplete_w +from idlelib.hyperparser import HyperParser import __main__ @@ -49,7 +49,7 @@ self._delayed_completion_index = None def _make_autocomplete_window(self): - return AutoCompleteWindow.AutoCompleteWindow(self.text) + return autocomplete_w.AutoCompleteWindow(self.text) def _remove_autocomplete_window(self, event=None): if self.autocompletewindow: diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -1,9 +1,9 @@ """ -An auto-completion window for IDLE, used by the AutoComplete extension +An auto-completion window for IDLE, used by the autocomplete extension """ from tkinter import * -from idlelib.MultiCall import MC_SHIFT -from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES +from idlelib.multicall import MC_SHIFT +from idlelib.autocomplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES HIDE_VIRTUAL_EVENT_NAME = "<>" HIDE_SEQUENCES = ("", "") @@ -34,8 +34,8 @@ self.completions = None # A list with more completions, or None self.morecompletions = None - # The completion mode. Either AutoComplete.COMPLETE_ATTRIBUTES or - # AutoComplete.COMPLETE_FILES + # The completion mode. Either autocomplete.COMPLETE_ATTRIBUTES or + # autocomplete.COMPLETE_FILES self.mode = None # The current completion start, on the text box (a string) self.start = None diff --git a/Lib/idlelib/browser.py b/Lib/idlelib/browser.py --- a/Lib/idlelib/browser.py +++ b/Lib/idlelib/browser.py @@ -14,13 +14,13 @@ import sys import pyclbr -from idlelib import PyShell -from idlelib.WindowList import ListedToplevel -from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas -from idlelib.configHandler import idleConf +from idlelib import pyshell +from idlelib.windows import ListedToplevel +from idlelib.tree import TreeNode, TreeItem, ScrolledCanvas +from idlelib.config import idleConf file_open = None # Method...Item and Class...Item use this. -# Normally PyShell.flist.open, but there is no PyShell.flist for htest. +# Normally pyshell.flist.open, but there is no pyshell.flist for htest. class ClassBrowser: @@ -32,7 +32,7 @@ """ global file_open if not _htest: - file_open = PyShell.flist.open + file_open = pyshell.flist.open self.name = name self.file = os.path.join(path[0], self.name + ".py") self._htest = _htest @@ -95,7 +95,7 @@ return if not os.path.exists(self.file): return - PyShell.flist.open(self.file) + pyshell.flist.open(self.file) def IsExpandable(self): return os.path.normcase(self.file[-3:]) == ".py" @@ -226,7 +226,7 @@ file = sys.argv[0] dir, file = os.path.split(file) name = os.path.splitext(file)[0] - flist = PyShell.PyShellFileList(parent) + flist = pyshell.PyShellFileList(parent) global file_open file_open = flist.open ClassBrowser(flist, name, [dir], _htest=True) diff --git a/Lib/idlelib/calltip_w.py b/Lib/idlelib/calltip_w.py --- a/Lib/idlelib/calltip_w.py +++ b/Lib/idlelib/calltip_w.py @@ -1,7 +1,7 @@ """A CallTip window class for Tkinter/IDLE. -After ToolTip.py, which uses ideas gleaned from PySol -Used by the CallTips IDLE extension. +After tooltip.py, which uses ideas gleaned from PySol +Used by the calltips IDLE extension. """ from tkinter import Toplevel, Label, LEFT, SOLID, TclError diff --git a/Lib/idlelib/calltips.py b/Lib/idlelib/calltips.py --- a/Lib/idlelib/calltips.py +++ b/Lib/idlelib/calltips.py @@ -1,4 +1,4 @@ -"""CallTips.py - An IDLE Extension to Jog Your Memory +"""calltips.py - An IDLE Extension to Jog Your Memory Call Tips are floating windows which display function, class, and method parameter and docstring information when you type an opening parenthesis, and @@ -12,8 +12,8 @@ import textwrap import types -from idlelib import CallTipWindow -from idlelib.HyperParser import HyperParser +from idlelib import calltip_w +from idlelib.hyperparser import HyperParser class CallTips: @@ -37,7 +37,7 @@ def _make_tk_calltip_window(self): # See __init__ for usage - return CallTipWindow.CallTip(self.text) + return calltip_w.CallTip(self.text) def _remove_calltip_window(self, event=None): if self.active_calltip: diff --git a/Lib/idlelib/codecontext.py b/Lib/idlelib/codecontext.py --- a/Lib/idlelib/codecontext.py +++ b/Lib/idlelib/codecontext.py @@ -1,11 +1,11 @@ -"""CodeContext - Extension to display the block context above the edit window +"""codecontext - Extension to display the block context above the edit window Once code has scrolled off the top of a window, it can be difficult to determine which block you are in. This extension implements a pane at the top of each IDLE edit window which provides block structure hints. These hints are the lines which contain the block opening keywords, e.g. 'if', for the enclosing block. The number of hint lines is determined by the numlines -variable in the CodeContext section of config-extensions.def. Lines which do +variable in the codecontext section of config-extensions.def. Lines which do not open blocks are not shown in the context hints pane. """ @@ -13,7 +13,7 @@ from tkinter.constants import TOP, LEFT, X, W, SUNKEN import re from sys import maxsize as INFINITY -from idlelib.configHandler import idleConf +from idlelib.config import idleConf BLOCKOPENERS = {"class", "def", "elif", "else", "except", "finally", "for", "if", "try", "while", "with"} diff --git a/Lib/idlelib/colorizer.py b/Lib/idlelib/colorizer.py --- a/Lib/idlelib/colorizer.py +++ b/Lib/idlelib/colorizer.py @@ -2,8 +2,8 @@ import re import keyword import builtins -from idlelib.Delegator import Delegator -from idlelib.configHandler import idleConf +from idlelib.delegator import Delegator +from idlelib.config import idleConf DEBUG = False @@ -235,7 +235,7 @@ def _color_delegator(parent): # htest # from tkinter import Toplevel, Text - from idlelib.Percolator import Percolator + from idlelib.percolator import Percolator top = Toplevel(parent) top.title("Test ColorDelegator") diff --git a/Lib/idlelib/config.py b/Lib/idlelib/config.py --- a/Lib/idlelib/config.py +++ b/Lib/idlelib/config.py @@ -7,7 +7,7 @@ and if a file becomes empty, it will be deleted. The contents of the user files may be altered using the Options/Configure IDLE -menu to access the configuration GUI (configDialog.py), or manually. +menu to access the configuration GUI (configdialog.py), or manually. Throughout this module there is an emphasis on returning useable defaults when a problem occurs in returning a requested configuration value back to @@ -230,7 +230,7 @@ return self.userCfg[configType].Get(section, option, type=type, raw=raw) except ValueError: - warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n' + warning = ('\n Warning: config.py - IdleConf.GetOption -\n' ' invalid %r value for configuration option %r\n' ' from section %r: %r' % (type, option, section, @@ -247,7 +247,7 @@ pass #returning default, print warning if warn_on_default: - warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n' + warning = ('\n Warning: config.py - IdleConf.GetOption -\n' ' problem retrieving configuration option %r\n' ' from section %r.\n' ' returning default value: %r' % @@ -358,7 +358,7 @@ for element in theme: if not cfgParser.has_option(themeName, element): # Print warning that will return a default color - warning = ('\n Warning: configHandler.IdleConf.GetThemeDict' + warning = ('\n Warning: config.IdleConf.GetThemeDict' ' -\n problem retrieving theme element %r' '\n from theme %r.\n' ' returning default color: %r' % @@ -644,7 +644,7 @@ if binding: keyBindings[event] = binding else: #we are going to return a default, print warning - warning=('\n Warning: configHandler.py - IdleConf.GetCoreKeys' + warning=('\n Warning: config.py - IdleConf.GetCoreKeys' ' -\n problem retrieving key binding for event %r' '\n from key set %r.\n' ' returning default value: %r' % diff --git a/Lib/idlelib/config_sec.py b/Lib/idlelib/config_sec.py --- a/Lib/idlelib/config_sec.py +++ b/Lib/idlelib/config_sec.py @@ -1,7 +1,7 @@ """ Dialog that allows user to specify a new config file section name. Used to get new highlight theme and keybinding set names. -The 'return value' for the dialog, used two placed in configDialog.py, +The 'return value' for the dialog, used two placed in configdialog.py, is the .result attribute set in the Ok and Cancel methods. """ from tkinter import * diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -14,14 +14,14 @@ import tkinter.colorchooser as tkColorChooser import tkinter.font as tkFont -from idlelib.configHandler import idleConf -from idlelib.dynOptionMenuWidget import DynOptionMenu -from idlelib.keybindingDialog import GetKeysDialog -from idlelib.configSectionNameDialog import GetCfgSectionNameDialog -from idlelib.configHelpSourceEdit import GetHelpSourceDialog +from idlelib.config import idleConf +from idlelib.dynoption import DynOptionMenu +from idlelib.config_key import GetKeysDialog +from idlelib.config_sec import GetCfgSectionNameDialog +from idlelib.config_help import GetHelpSourceDialog from idlelib.tabbedpages import TabbedPageSet -from idlelib.textView import view_text -from idlelib import macosxSupport +from idlelib.textview import view_text +from idlelib import macosx class ConfigDialog(Toplevel): @@ -91,7 +91,7 @@ self.create_action_buttons().pack(side=BOTTOM) def create_action_buttons(self): - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): # Changing the default padding on OSX results in unreadable # text in the buttons paddingArgs = {} diff --git a/Lib/idlelib/debugger.py b/Lib/idlelib/debugger.py --- a/Lib/idlelib/debugger.py +++ b/Lib/idlelib/debugger.py @@ -1,9 +1,9 @@ import os import bdb from tkinter import * -from idlelib.WindowList import ListedToplevel -from idlelib.ScrolledList import ScrolledList -from idlelib import macosxSupport +from idlelib.windows import ListedToplevel +from idlelib.scrolledlist import ScrolledList +from idlelib import macosx class Idb(bdb.Bdb): @@ -34,8 +34,10 @@ return True else: prev_frame = frame.f_back - if prev_frame.f_code.co_filename.count('Debugger.py'): - # (that test will catch both Debugger.py and RemoteDebugger.py) + prev_name = prev_frame.f_code.co_filename + if 'idlelib' in prev_name and 'debugger' in prev_name: + # catch both idlelib/debugger.py and idlelib/debugger_r.py + # on both posix and windows return False return self.in_rpc_code(prev_frame) @@ -370,7 +372,7 @@ class StackViewer(ScrolledList): def __init__(self, master, flist, gui): - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): # At least on with the stock AquaTk version on OSX 10.4 you'll # get a shaking GUI that eventually kills IDLE if the width # argument is specified. @@ -502,7 +504,7 @@ # # There is also an obscure bug in sorted(dict) where the # interpreter gets into a loop requesting non-existing dict[0], - # dict[1], dict[2], etc from the RemoteDebugger.DictProxy. + # dict[1], dict[2], etc from the debugger_r.DictProxy. ### keys_list = dict.keys() names = sorted(keys_list) diff --git a/Lib/idlelib/debugger_r.py b/Lib/idlelib/debugger_r.py --- a/Lib/idlelib/debugger_r.py +++ b/Lib/idlelib/debugger_r.py @@ -21,7 +21,7 @@ """ import types -from idlelib import Debugger +from idlelib import debugger debugging = 0 @@ -187,7 +187,7 @@ """ gui_proxy = GUIProxy(rpchandler, gui_adap_oid) - idb = Debugger.Idb(gui_proxy) + idb = debugger.Idb(gui_proxy) idb_adap = IdbAdapter(idb) rpchandler.register(idb_adap_oid, idb_adap) return idb_adap_oid @@ -362,7 +362,7 @@ idb_adap_oid = rpcclt.remotecall("exec", "start_the_debugger",\ (gui_adap_oid,), {}) idb_proxy = IdbProxy(rpcclt, pyshell, idb_adap_oid) - gui = Debugger.Debugger(pyshell, idb_proxy) + gui = debugger.Debugger(pyshell, idb_proxy) gui_adap = GUIAdapter(rpcclt, gui) rpcclt.register(gui_adap_oid, gui_adap) return gui @@ -373,7 +373,7 @@ Request that the RPCServer shut down the subprocess debugger and link. Unregister the GUIAdapter, which will cause a GC on the Idle process debugger and RPC link objects. (The second reference to the debugger GUI - is deleted in PyShell.close_remote_debugger().) + is deleted in pyshell.close_remote_debugger().) """ close_subprocess_debugger(rpcclt) diff --git a/Lib/idlelib/debugobj.py b/Lib/idlelib/debugobj.py --- a/Lib/idlelib/debugobj.py +++ b/Lib/idlelib/debugobj.py @@ -11,7 +11,7 @@ import re -from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas +from idlelib.tree import TreeItem, TreeNode, ScrolledCanvas from reprlib import Repr @@ -126,7 +126,7 @@ import sys from tkinter import Tk root = Tk() - root.title("Test ObjectBrowser") + root.title("Test debug object browser") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) root.geometry("+%d+%d"%(x, y + 150)) root.configure(bd=0, bg="yellow") diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -12,15 +12,15 @@ import traceback import webbrowser -from idlelib.MultiCall import MultiCallCreator -from idlelib import WindowList -from idlelib import SearchDialog -from idlelib import GrepDialog -from idlelib import ReplaceDialog -from idlelib import PyParse -from idlelib.configHandler import idleConf -from idlelib import aboutDialog, textView, configDialog -from idlelib import macosxSupport +from idlelib.multicall import MultiCallCreator +from idlelib import windows +from idlelib import search +from idlelib import grep +from idlelib import replace +from idlelib import pyparse +from idlelib.config import idleConf +from idlelib import help_about, textview, configdialog +from idlelib import macosx from idlelib import help # The default tab setting for a Text widget, in average-width characters. @@ -67,7 +67,7 @@ def show_dialog(self, parent): self.parent = parent fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') - self.dlg = dlg = textView.view_file(parent,'Help',fn, modal=False) + self.dlg = dlg = textview.view_file(parent,'Help',fn, modal=False) dlg.bind('', self.destroy, '+') def nearwindow(self, near): @@ -89,13 +89,13 @@ class EditorWindow(object): - from idlelib.Percolator import Percolator - from idlelib.ColorDelegator import ColorDelegator - from idlelib.UndoDelegator import UndoDelegator - from idlelib.IOBinding import IOBinding, filesystemencoding, encoding - from idlelib import Bindings + from idlelib.percolator import Percolator + from idlelib.colorizer import ColorDelegator + from idlelib.undo import UndoDelegator + from idlelib.iomenu import IOBinding, filesystemencoding, encoding + from idlelib import mainmenu from tkinter import Toplevel - from idlelib.MultiStatusBar import MultiStatusBar + from idlelib.statusbar import MultiStatusBar help_url = None @@ -136,11 +136,11 @@ except AttributeError: sys.ps1 = '>>> ' self.menubar = Menu(root) - self.top = top = WindowList.ListedToplevel(root, menu=self.menubar) + self.top = top = windows.ListedToplevel(root, menu=self.menubar) if flist: self.tkinter_vars = flist.vars #self.top.instance_dict makes flist.inversedict available to - #configDialog.py so it can access all EditorWindow instances + #configdialog.py so it can access all EditorWindow instances self.top.instance_dict = flist.inversedict else: self.tkinter_vars = {} # keys: Tkinter event names @@ -173,7 +173,7 @@ self.top.protocol("WM_DELETE_WINDOW", self.close) self.top.bind("<>", self.close_event) - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): # Command-W on editorwindows doesn't work without this. text.bind('<>', self.close_event) # Some OS X systems have only one mouse button, so use @@ -309,7 +309,7 @@ menu.add_separator() end = end + 1 self.wmenu_end = end - WindowList.register_callback(self.postwindowsmenu) + windows.register_callback(self.postwindowsmenu) # Some abstractions so IDLE extensions are cross-IDE self.askyesno = tkMessageBox.askyesno @@ -418,7 +418,7 @@ underline, label = prepstr(label) menudict[name] = menu = Menu(mbar, name=name, tearoff=0) mbar.add_cascade(label=label, menu=menu, underline=underline) - if macosxSupport.isCarbonTk(): + if macosx.isCarbonTk(): # Insert the application menu menudict['application'] = menu = Menu(mbar, name='apple', tearoff=0) @@ -439,7 +439,7 @@ end = -1 if end > self.wmenu_end: menu.delete(self.wmenu_end+1, end) - WindowList.add_windows_to_menu(menu) + windows.add_windows_to_menu(menu) rmenu = None @@ -507,17 +507,17 @@ def about_dialog(self, event=None): "Handle Help 'About IDLE' event." - # Synchronize with macosxSupport.overrideRootMenu.about_dialog. - aboutDialog.AboutDialog(self.top,'About IDLE') + # Synchronize with macosx.overrideRootMenu.about_dialog. + help_about.AboutDialog(self.top,'About IDLE') def config_dialog(self, event=None): "Handle Options 'Configure IDLE' event." - # Synchronize with macosxSupport.overrideRootMenu.config_dialog. - configDialog.ConfigDialog(self.top,'Settings') + # Synchronize with macosx.overrideRootMenu.config_dialog. + configdialog.ConfigDialog(self.top,'Settings') def help_dialog(self, event=None): "Handle Help 'IDLE Help' event." - # Synchronize with macosxSupport.overrideRootMenu.help_dialog. + # Synchronize with macosx.overrideRootMenu.help_dialog. if self.root: parent = self.root else: @@ -590,23 +590,23 @@ return "break" def find_event(self, event): - SearchDialog.find(self.text) + search.find(self.text) return "break" def find_again_event(self, event): - SearchDialog.find_again(self.text) + search.find_again(self.text) return "break" def find_selection_event(self, event): - SearchDialog.find_selection(self.text) + search.find_selection(self.text) return "break" def find_in_files_event(self, event): - GrepDialog.grep(self.text, self.io, self.flist) + grep.grep(self.text, self.io, self.flist) return "break" def replace_event(self, event): - ReplaceDialog.replace(self.text) + replace.replace(self.text) return "break" def goto_line_event(self, event): @@ -673,12 +673,12 @@ return head, tail = os.path.split(filename) base, ext = os.path.splitext(tail) - from idlelib import ClassBrowser - ClassBrowser.ClassBrowser(self.flist, base, [head]) + from idlelib import browser + browser.ClassBrowser(self.flist, base, [head]) def open_path_browser(self, event=None): - from idlelib import PathBrowser - PathBrowser.PathBrowser(self.flist) + from idlelib import pathbrowser + pathbrowser.PathBrowser(self.flist) def open_turtle_demo(self, event = None): import subprocess @@ -739,7 +739,7 @@ def ResetColorizer(self): "Update the color theme" - # Called from self.filename_change_hook and from configDialog.py + # Called from self.filename_change_hook and from configdialog.py self._rmcolorizer() self._addcolorizer() theme = idleConf.CurrentTheme() @@ -772,14 +772,14 @@ def ResetFont(self): "Update the text widgets' font if it is changed" - # Called from configDialog.py + # Called from configdialog.py self.text['font'] = idleConf.GetFont(self.root, 'main','EditorWindow') def RemoveKeybindings(self): "Remove the keybindings before they are changed." - # Called from configDialog.py - self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet() + # Called from configdialog.py + self.mainmenu.default_keydefs = keydefs = idleConf.GetCurrentKeySet() for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist) for extensionName in self.get_standard_extension_names(): @@ -790,8 +790,8 @@ def ApplyKeybindings(self): "Update the keybindings after they are changed" - # Called from configDialog.py - self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet() + # Called from configdialog.py + self.mainmenu.default_keydefs = keydefs = idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): xkeydefs = idleConf.GetExtensionBindings(extensionName) @@ -799,7 +799,7 @@ self.apply_bindings(xkeydefs) #update menu accelerators menuEventDict = {} - for menu in self.Bindings.menudefs: + for menu in self.mainmenu.menudefs: menuEventDict[menu[0]] = {} for item in menu[1]: if item: @@ -826,7 +826,7 @@ def set_notabs_indentwidth(self): "Update the indentwidth if changed and not using tabs in this window" - # Called from configDialog.py + # Called from configdialog.py if not self.usetabs: self.indentwidth = idleConf.GetOption('main', 'Indent','num-spaces', type='int') @@ -1006,7 +1006,7 @@ def _close(self): if self.io.filename: self.update_recent_files_list(new_file=self.io.filename) - WindowList.unregister_callback(self.postwindowsmenu) + windows.unregister_callback(self.postwindowsmenu) self.unload_extensions() self.io.close() self.io = None @@ -1044,12 +1044,25 @@ def get_standard_extension_names(self): return idleConf.GetExtensions(editor_only=True) + extfiles = { # map config-extension section names to new file names + 'AutoComplete': 'autocomplete', + 'AutoExpand': 'autoexpand', + 'CallTips': 'calltips', + 'CodeContext': 'codecontext', + 'FormatParagraph': 'paragraph', + 'ParenMatch': 'parenmatch', + 'RstripExtension': 'rstrip', + 'ScriptBinding': 'runscript', + 'ZoomHeight': 'zoomheight', + } + def load_extension(self, name): + fname = self.extfiles.get(name, name) try: try: - mod = importlib.import_module('.' + name, package=__package__) + mod = importlib.import_module('.' + fname, package=__package__) except (ImportError, TypeError): - mod = importlib.import_module(name) + mod = importlib.import_module(fname) except ImportError: print("\nFailed to import extension: ", name) raise @@ -1073,7 +1086,7 @@ def apply_bindings(self, keydefs=None): if keydefs is None: - keydefs = self.Bindings.default_keydefs + keydefs = self.mainmenu.default_keydefs text = self.text text.keydefs = keydefs for event, keylist in keydefs.items(): @@ -1086,9 +1099,9 @@ Menus that are absent or None in self.menudict are ignored. """ if menudefs is None: - menudefs = self.Bindings.menudefs + menudefs = self.mainmenu.menudefs if keydefs is None: - keydefs = self.Bindings.default_keydefs + keydefs = self.mainmenu.default_keydefs menudict = self.menudict text = self.text for mname, entrylist in menudefs: @@ -1315,7 +1328,7 @@ # adjust indentation for continuations and block # open/close first need to find the last stmt lno = index2line(text.index('insert')) - y = PyParse.Parser(self.indentwidth, self.tabwidth) + y = pyparse.Parser(self.indentwidth, self.tabwidth) if not self.context_use_ps1: for context in self.num_context_lines: startat = max(lno - context, 1) @@ -1339,22 +1352,22 @@ y.set_lo(0) c = y.get_continuation_type() - if c != PyParse.C_NONE: + if c != pyparse.C_NONE: # The current stmt hasn't ended yet. - if c == PyParse.C_STRING_FIRST_LINE: + if c == pyparse.C_STRING_FIRST_LINE: # after the first line of a string; do not indent at all pass - elif c == PyParse.C_STRING_NEXT_LINES: + elif c == pyparse.C_STRING_NEXT_LINES: # inside a string which started before this line; # just mimic the current indent text.insert("insert", indent) - elif c == PyParse.C_BRACKET: + elif c == pyparse.C_BRACKET: # line up with the first (if any) element of the # last open bracket structure; else indent one # level beyond the indent of the line with the # last open bracket self.reindent_to(y.compute_bracket_indent()) - elif c == PyParse.C_BACKSLASH: + elif c == pyparse.C_BACKSLASH: # if more than one line in this stmt already, just # mimic the current indent; else if initial line # has a start on an assignment stmt, indent to @@ -1657,7 +1670,7 @@ keylist = keydefs.get(eventname) # issue10940: temporary workaround to prevent hang with OS X Cocoa Tk 8.5 # if not keylist: - if (not keylist) or (macosxSupport.isCocoaTk() and eventname in { + if (not keylist) or (macosx.isCocoaTk() and eventname in { "<>", "<>", "<>"}): @@ -1692,7 +1705,7 @@ filename = sys.argv[1] else: filename = None - macosxSupport.setupApp(root, None) + macosx.setupApp(root, None) edit = EditorWindow(root=root, filename=filename) edit.text.bind("<>", edit.close_event) # Does not stop error, neither does following diff --git a/Lib/idlelib/filelist.py b/Lib/idlelib/filelist.py --- a/Lib/idlelib/filelist.py +++ b/Lib/idlelib/filelist.py @@ -6,7 +6,7 @@ class FileList: # N.B. this import overridden in PyShellFileList. - from idlelib.EditorWindow import EditorWindow + from idlelib.editor import EditorWindow def __init__(self, root): self.root = root @@ -111,7 +111,7 @@ def _test(): - from idlelib.EditorWindow import fixwordbreaks + from idlelib.editor import fixwordbreaks import sys root = Tk() fixwordbreaks(root) diff --git a/Lib/idlelib/grep.py b/Lib/idlelib/grep.py --- a/Lib/idlelib/grep.py +++ b/Lib/idlelib/grep.py @@ -4,14 +4,14 @@ import sys from tkinter import StringVar, BooleanVar, Checkbutton # for GrepDialog from tkinter import Tk, Text, Button, SEL, END # for htest -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import searchengine +from idlelib.searchbase import SearchDialogBase # Importing OutputWindow fails due to import loop # EditorWindow -> GrepDialop -> OutputWindow -> EditorWindow def grep(text, io=None, flist=None): root = text._root() - engine = SearchEngine.get(root) + engine = searchengine.get(root) if not hasattr(engine, "_grepdialog"): engine._grepdialog = GrepDialog(root, engine, flist) dialog = engine._grepdialog @@ -67,7 +67,7 @@ if not path: self.top.bell() return - from idlelib.OutputWindow import OutputWindow # leave here! + from idlelib.outwin import OutputWindow # leave here! save = sys.stdout try: sys.stdout = OutputWindow(self.flist) @@ -131,7 +131,7 @@ def _grep_dialog(parent): # htest # - from idlelib.PyShell import PyShellFileList + from idlelib.pyshell import PyShellFileList root = Tk() root.title("Test GrepDialog") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py --- a/Lib/idlelib/help.py +++ b/Lib/idlelib/help.py @@ -4,7 +4,7 @@ Help => About IDLE: diplay About Idle dialog - + Help => IDLE Help: Display help.html with proper formatting. @@ -28,7 +28,7 @@ from os.path import abspath, dirname, isfile, join from tkinter import Toplevel, Frame, Text, Scrollbar, Menu, Menubutton from tkinter import font as tkfont -from idlelib.configHandler import idleConf +from idlelib.config import idleConf use_ttk = False # until available to import if use_ttk: diff --git a/Lib/idlelib/help_about.py b/Lib/idlelib/help_about.py --- a/Lib/idlelib/help_about.py +++ b/Lib/idlelib/help_about.py @@ -5,7 +5,7 @@ import os from sys import version from tkinter import * -from idlelib import textView +from idlelib import textview class AboutDialog(Toplevel): """Modal about dialog for idle @@ -135,11 +135,11 @@ def display_printer_text(self, title, printer): printer._Printer__setup() text = '\n'.join(printer._Printer__lines) - textView.view_text(self, title, text) + textview.view_text(self, title, text) def display_file_text(self, title, filename, encoding=None): fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), filename) - textView.view_file(self, title, fn, encoding) + textview.view_file(self, title, fn, encoding) def Ok(self, event=None): self.destroy() diff --git a/Lib/idlelib/history.py b/Lib/idlelib/history.py --- a/Lib/idlelib/history.py +++ b/Lib/idlelib/history.py @@ -1,11 +1,11 @@ "Implement Idle Shell history mechanism with History class" -from idlelib.configHandler import idleConf +from idlelib.config import idleConf class History: ''' Implement Idle Shell history mechanism. - store - Store source statement (called from PyShell.resetoutput). + store - Store source statement (called from pyshell.resetoutput). fetch - Fetch stored statement matching prefix already entered. history_next - Bound to <> event (default Alt-N). history_prev - Bound to <> event (default Alt-P). diff --git a/Lib/idlelib/hyperparser.py b/Lib/idlelib/hyperparser.py --- a/Lib/idlelib/hyperparser.py +++ b/Lib/idlelib/hyperparser.py @@ -7,7 +7,7 @@ import string from keyword import iskeyword -from idlelib import PyParse +from idlelib import pyparse # all ASCII chars that may be in an identifier @@ -30,7 +30,7 @@ self.editwin = editwin self.text = text = editwin.text - parser = PyParse.Parser(editwin.indentwidth, editwin.tabwidth) + parser = pyparse.Parser(editwin.indentwidth, editwin.tabwidth) def index2line(index): return int(float(index)) diff --git a/Lib/idlelib/idle.py b/Lib/idlelib/idle.py --- a/Lib/idlelib/idle.py +++ b/Lib/idlelib/idle.py @@ -7,5 +7,5 @@ idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, idlelib_dir) -import idlelib.PyShell -idlelib.PyShell.main() +import idlelib.pyshell +idlelib.pyshell.main() diff --git a/Lib/idlelib/idle.pyw b/Lib/idlelib/idle.pyw --- a/Lib/idlelib/idle.pyw +++ b/Lib/idlelib/idle.pyw @@ -1,10 +1,10 @@ try: - import idlelib.PyShell + import idlelib.pyshell except ImportError: - # IDLE is not installed, but maybe PyShell is on sys.path: - from . import PyShell + # IDLE is not installed, but maybe pyshell is on sys.path: + from . import pyshell import os - idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) + idledir = os.path.dirname(os.path.abspath(pyshell.__file__)) if idledir != os.getcwd(): # We're not in the IDLE directory, help the subprocess find run.py pypath = os.environ.get('PYTHONPATH', '') @@ -12,6 +12,6 @@ os.environ['PYTHONPATH'] = pypath + ':' + idledir else: os.environ['PYTHONPATH'] = idledir - PyShell.main() + pyshell.main() else: - idlelib.PyShell.main() + idlelib.pyshell.main() diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py --- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -59,19 +59,19 @@ Modules and classes not being tested at the moment: -PyShell.PyShellEditorWindow -Debugger.Debugger -AutoCompleteWindow.AutoCompleteWindow -OutputWindow.OutputWindow (indirectly being tested with grep test) +pyshell.PyShellEditorWindow +debugger.Debugger +autocomplete_w.AutoCompleteWindow +outwin.OutputWindow (indirectly being tested with grep test) ''' from importlib import import_module -from idlelib.macosxSupport import _initializeTkVariantTests +from idlelib.macosx import _initializeTkVariantTests import tkinter as tk AboutDialog_spec = { - 'file': 'aboutDialog', - 'kwds': {'title': 'aboutDialog test', + 'file': 'help_about', + 'kwds': {'title': 'help_about test', '_htest': True, }, 'msg': "Test every button. Ensure Python, TK and IDLE versions " @@ -79,14 +79,14 @@ } _calltip_window_spec = { - 'file': 'CallTipWindow', + 'file': 'calltip_w', 'kwds': {}, 'msg': "Typing '(' should display a calltip.\n" "Typing ') should hide the calltip.\n" } _class_browser_spec = { - 'file': 'ClassBrowser', + 'file': 'browser', 'kwds': {}, 'msg': "Inspect names of module, class(with superclass if " "applicable), methods and functions.\nToggle nested items.\n" @@ -95,7 +95,7 @@ } _color_delegator_spec = { - 'file': 'ColorDelegator', + 'file': 'colorizer', 'kwds': {}, 'msg': "The text is sample Python code.\n" "Ensure components like comments, keywords, builtins,\n" @@ -104,7 +104,7 @@ } ConfigDialog_spec = { - 'file': 'configDialog', + 'file': 'configdialog', 'kwds': {'title': 'ConfigDialogTest', '_htest': True,}, 'msg': "IDLE preferences dialog.\n" @@ -121,7 +121,7 @@ # TODO Improve message _dyn_option_menu_spec = { - 'file': 'dynOptionMenuWidget', + 'file': 'dynoption', 'kwds': {}, 'msg': "Select one of the many options in the 'old option set'.\n" "Click the button to change the option set.\n" @@ -130,14 +130,14 @@ # TODO edit wrapper _editor_window_spec = { - 'file': 'EditorWindow', + 'file': 'editor', 'kwds': {}, 'msg': "Test editor functions of interest.\n" "Best to close editor first." } GetCfgSectionNameDialog_spec = { - 'file': 'configSectionNameDialog', + 'file': 'config_sec', 'kwds': {'title':'Get Name', 'message':'Enter something', 'used_names': {'abc'}, @@ -149,7 +149,7 @@ } GetHelpSourceDialog_spec = { - 'file': 'configHelpSourceEdit', + 'file': 'config_help', 'kwds': {'title': 'Get helpsource', '_htest': True}, 'msg': "Enter menu item name and help file path\n " @@ -162,7 +162,7 @@ # Update once issue21519 is resolved. GetKeysDialog_spec = { - 'file': 'keybindingDialog', + 'file': 'config_key', 'kwds': {'title': 'Test keybindings', 'action': 'find-again', 'currentKeySequences': [''] , @@ -177,7 +177,7 @@ } _grep_dialog_spec = { - 'file': 'GrepDialog', + 'file': 'grep', 'kwds': {}, 'msg': "Click the 'Show GrepDialog' button.\n" "Test the various 'Find-in-files' functions.\n" @@ -187,7 +187,7 @@ } _io_binding_spec = { - 'file': 'IOBinding', + 'file': 'iomenu', 'kwds': {}, 'msg': "Test the following bindings.\n" " to open file from dialog.\n" @@ -200,7 +200,7 @@ } _multi_call_spec = { - 'file': 'MultiCall', + 'file': 'multicall', 'kwds': {}, 'msg': "The following actions should trigger a print to console or IDLE" " Shell.\nEntering and leaving the text area, key entry, " @@ -210,14 +210,14 @@ } _multistatus_bar_spec = { - 'file': 'MultiStatusBar', + 'file': 'statusbar', 'kwds': {}, 'msg': "Ensure presence of multi-status bar below text area.\n" "Click 'Update Status' to change the multi-status text" } _object_browser_spec = { - 'file': 'ObjectBrowser', + 'file': 'debugobj', 'kwds': {}, 'msg': "Double click on items upto the lowest level.\n" "Attributes of the objects and related information " @@ -225,7 +225,7 @@ } _path_browser_spec = { - 'file': 'PathBrowser', + 'file': 'pathbrowser', 'kwds': {}, 'msg': "Test for correct display of all paths in sys.path.\n" "Toggle nested items upto the lowest level.\n" @@ -234,7 +234,7 @@ } _percolator_spec = { - 'file': 'Percolator', + 'file': 'percolator', 'kwds': {}, 'msg': "There are two tracers which can be toggled using a checkbox.\n" "Toggling a tracer 'on' by checking it should print tracer" @@ -245,7 +245,7 @@ } _replace_dialog_spec = { - 'file': 'ReplaceDialog', + 'file': 'replace', 'kwds': {}, 'msg': "Click the 'Replace' button.\n" "Test various replace options in the 'Replace dialog'.\n" @@ -253,7 +253,7 @@ } _search_dialog_spec = { - 'file': 'SearchDialog', + 'file': 'search', 'kwds': {}, 'msg': "Click the 'Search' button.\n" "Test various search options in the 'Search dialog'.\n" @@ -261,7 +261,7 @@ } _scrolled_list_spec = { - 'file': 'ScrolledList', + 'file': 'scrolledlist', 'kwds': {}, 'msg': "You should see a scrollable list of items\n" "Selecting (clicking) or double clicking an item " @@ -277,7 +277,7 @@ } _stack_viewer_spec = { - 'file': 'StackViewer', + 'file': 'stackviewer', 'kwds': {}, 'msg': "A stacktrace for a NameError exception.\n" "Expand 'idlelib ...' and ''.\n" @@ -295,8 +295,8 @@ } TextViewer_spec = { - 'file': 'textView', - 'kwds': {'title': 'Test textView', + 'file': 'textview', + 'kwds': {'title': 'Test textview', 'text':'The quick brown fox jumps over the lazy dog.\n'*35, '_htest': True}, 'msg': "Test for read-only property of text.\n" @@ -304,21 +304,21 @@ } _tooltip_spec = { - 'file': 'ToolTip', + 'file': 'tooltip', 'kwds': {}, 'msg': "Place mouse cursor over both the buttons\n" "A tooltip should appear with some text." } _tree_widget_spec = { - 'file': 'TreeWidget', + 'file': 'tree', 'kwds': {}, 'msg': "The canvas is scrollable.\n" "Click on folders upto to the lowest level." } _undo_delegator_spec = { - 'file': 'UndoDelegator', + 'file': 'undo', 'kwds': {}, 'msg': "Click [Undo] to undo any action.\n" "Click [Redo] to redo any action.\n" @@ -327,7 +327,7 @@ } _widget_redirector_spec = { - 'file': 'WidgetRedirector', + 'file': 'redirector', 'kwds': {}, 'msg': "Every text insert should be printed to the console." "or the IDLE shell." diff --git a/Lib/idlelib/idle_test/mock_idle.py b/Lib/idlelib/idle_test/mock_idle.py --- a/Lib/idlelib/idle_test/mock_idle.py +++ b/Lib/idlelib/idle_test/mock_idle.py @@ -33,7 +33,7 @@ class Editor: - '''Minimally imitate EditorWindow.EditorWindow class. + '''Minimally imitate editor.EditorWindow class. ''' def __init__(self, flist=None, filename=None, key=None, root=None): self.text = Text() @@ -46,7 +46,7 @@ class UndoDelegator: - '''Minimally imitate UndoDelegator,UndoDelegator class. + '''Minimally imitate undo.UndoDelegator class. ''' # A real undo block is only needed for user interaction. def undo_block_start(*args): diff --git a/Lib/idlelib/idle_test/test_autocomplete.py b/Lib/idlelib/idle_test/test_autocomplete.py --- a/Lib/idlelib/idle_test/test_autocomplete.py +++ b/Lib/idlelib/idle_test/test_autocomplete.py @@ -2,9 +2,9 @@ from test.support import requires from tkinter import Tk, Text -import idlelib.AutoComplete as ac -import idlelib.AutoCompleteWindow as acw -import idlelib.macosxSupport as mac +import idlelib.autocomplete as ac +import idlelib.autocomplete_w as acw +import idlelib.macosx as mac from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Event diff --git a/Lib/idlelib/idle_test/test_autoexpand.py b/Lib/idlelib/idle_test/test_autoexpand.py --- a/Lib/idlelib/idle_test/test_autoexpand.py +++ b/Lib/idlelib/idle_test/test_autoexpand.py @@ -1,9 +1,9 @@ -"""Unit tests for idlelib.AutoExpand""" +"""Unit tests for idlelib.autoexpand""" import unittest from test.support import requires from tkinter import Text, Tk #from idlelib.idle_test.mock_tk import Text -from idlelib.AutoExpand import AutoExpand +from idlelib.autoexpand import AutoExpand class Dummy_Editwin: diff --git a/Lib/idlelib/idle_test/test_calltips.py b/Lib/idlelib/idle_test/test_calltips.py --- a/Lib/idlelib/idle_test/test_calltips.py +++ b/Lib/idlelib/idle_test/test_calltips.py @@ -1,5 +1,5 @@ import unittest -import idlelib.CallTips as ct +import idlelib.calltips as ct import textwrap import types diff --git a/Lib/idlelib/idle_test/test_config_help.py b/Lib/idlelib/idle_test/test_config_help.py --- a/Lib/idlelib/idle_test/test_config_help.py +++ b/Lib/idlelib/idle_test/test_config_help.py @@ -1,7 +1,7 @@ -"""Unittests for idlelib.configHelpSourceEdit""" +"""Unittests for idlelib.config_help.py""" import unittest from idlelib.idle_test.mock_tk import Var, Mbox, Entry -from idlelib import configHelpSourceEdit as help_dialog_module +from idlelib import config_help as help_dialog_module help_dialog = help_dialog_module.GetHelpSourceDialog diff --git a/Lib/idlelib/idle_test/test_config_name.py b/Lib/idlelib/idle_test/test_config_sec.py rename from Lib/idlelib/idle_test/test_config_name.py rename to Lib/idlelib/idle_test/test_config_sec.py --- a/Lib/idlelib/idle_test/test_config_name.py +++ b/Lib/idlelib/idle_test/test_config_sec.py @@ -1,7 +1,7 @@ -"""Unit tests for idlelib.configSectionNameDialog""" +"""Unit tests for idlelib.config_sec""" import unittest from idlelib.idle_test.mock_tk import Var, Mbox -from idlelib import configSectionNameDialog as name_dialog_module +from idlelib import config_sec as name_dialog_module name_dialog = name_dialog_module.GetCfgSectionNameDialog diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -1,4 +1,4 @@ -'''Unittests for idlelib/configHandler.py +'''Unittests for idlelib/config.py Coverage: 46% just by creating dialog. The other half is change code. @@ -6,8 +6,8 @@ import unittest from test.support import requires from tkinter import Tk -from idlelib.configDialog import ConfigDialog -from idlelib.macosxSupport import _initializeTkVariantTests +from idlelib.configdialog import ConfigDialog +from idlelib.macosx import _initializeTkVariantTests class ConfigDialogTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_delegator.py b/Lib/idlelib/idle_test/test_delegator.py --- a/Lib/idlelib/idle_test/test_delegator.py +++ b/Lib/idlelib/idle_test/test_delegator.py @@ -1,5 +1,5 @@ import unittest -from idlelib.Delegator import Delegator +from idlelib.delegator import Delegator class DelegatorTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_editor.py b/Lib/idlelib/idle_test/test_editor.py --- a/Lib/idlelib/idle_test/test_editor.py +++ b/Lib/idlelib/idle_test/test_editor.py @@ -1,6 +1,6 @@ import unittest from tkinter import Tk, Text -from idlelib.EditorWindow import EditorWindow +from idlelib.editor import EditorWindow from test.support import requires class Editor_func_test(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_grep.py b/Lib/idlelib/idle_test/test_grep.py --- a/Lib/idlelib/idle_test/test_grep.py +++ b/Lib/idlelib/idle_test/test_grep.py @@ -1,5 +1,5 @@ """ !Changing this line will break Test_findfile.test_found! -Non-gui unit tests for idlelib.GrepDialog methods. +Non-gui unit tests for grep.GrepDialog methods. dummy_command calls grep_it calls findfiles. An exception raised in one method will fail callers. Otherwise, tests are mostly independent. @@ -8,7 +8,7 @@ import unittest from test.support import captured_stdout from idlelib.idle_test.mock_tk import Var -from idlelib.GrepDialog import GrepDialog +from idlelib.grep import GrepDialog import re class Dummy_searchengine: @@ -72,7 +72,7 @@ self.assertTrue(lines[4].startswith('(Hint:')) class Default_commandTest(unittest.TestCase): - # To write this, mode OutputWindow import to top of GrepDialog + # To write this, move outwin import to top of GrepDialog # so it can be replaced by captured_stdout in class setup/teardown. pass diff --git a/Lib/idlelib/idle_test/test_history.py b/Lib/idlelib/idle_test/test_history.py --- a/Lib/idlelib/idle_test/test_history.py +++ b/Lib/idlelib/idle_test/test_history.py @@ -4,8 +4,8 @@ import tkinter as tk from tkinter import Text as tkText from idlelib.idle_test.mock_tk import Text as mkText -from idlelib.IdleHistory import History -from idlelib.configHandler import idleConf +from idlelib.history import History +from idlelib.config import idleConf line1 = 'a = 7' line2 = 'b = a' diff --git a/Lib/idlelib/idle_test/test_hyperparser.py b/Lib/idlelib/idle_test/test_hyperparser.py --- a/Lib/idlelib/idle_test/test_hyperparser.py +++ b/Lib/idlelib/idle_test/test_hyperparser.py @@ -1,9 +1,9 @@ -"""Unittest for idlelib.HyperParser""" +"""Unittest for idlelib.hyperparser.py.""" import unittest from test.support import requires from tkinter import Tk, Text -from idlelib.EditorWindow import EditorWindow -from idlelib.HyperParser import HyperParser +from idlelib.editor import EditorWindow +from idlelib.hyperparser import HyperParser class DummyEditwin: def __init__(self, text): diff --git a/Lib/idlelib/idle_test/test_iomenu.py b/Lib/idlelib/idle_test/test_iomenu.py --- a/Lib/idlelib/idle_test/test_iomenu.py +++ b/Lib/idlelib/idle_test/test_iomenu.py @@ -1,6 +1,6 @@ import unittest import io -from idlelib.PyShell import PseudoInputFile, PseudoOutputFile +from idlelib.pyshell import PseudoInputFile, PseudoOutputFile class S(str): diff --git a/Lib/idlelib/idle_test/test_paragraph.py b/Lib/idlelib/idle_test/test_paragraph.py --- a/Lib/idlelib/idle_test/test_paragraph.py +++ b/Lib/idlelib/idle_test/test_paragraph.py @@ -1,7 +1,7 @@ -# Test the functions and main class method of FormatParagraph.py +# Test the functions and main class method of paragraph.py import unittest -from idlelib import FormatParagraph as fp -from idlelib.EditorWindow import EditorWindow +from idlelib import paragraph as fp +from idlelib.editor import EditorWindow from tkinter import Tk, Text from test.support import requires @@ -38,7 +38,7 @@ class FindTest(unittest.TestCase): - """Test the find_paragraph function in FormatParagraph. + """Test the find_paragraph function in paragraph module. Using the runcase() function, find_paragraph() is called with 'mark' set at multiple indexes before and inside the test paragraph. diff --git a/Lib/idlelib/idle_test/test_parenmatch.py b/Lib/idlelib/idle_test/test_parenmatch.py --- a/Lib/idlelib/idle_test/test_parenmatch.py +++ b/Lib/idlelib/idle_test/test_parenmatch.py @@ -1,4 +1,4 @@ -"""Test idlelib.ParenMatch.""" +"""Test idlelib.parenmatch.""" # This must currently be a gui test because ParenMatch methods use # several text methods not defined on idlelib.idle_test.mock_tk.Text. from test.support import requires @@ -7,7 +7,7 @@ import unittest from unittest.mock import Mock from tkinter import Tk, Text -from idlelib.ParenMatch import ParenMatch +from idlelib.parenmatch import ParenMatch class DummyEditwin: def __init__(self, text): diff --git a/Lib/idlelib/idle_test/test_pathbrowser.py b/Lib/idlelib/idle_test/test_pathbrowser.py --- a/Lib/idlelib/idle_test/test_pathbrowser.py +++ b/Lib/idlelib/idle_test/test_pathbrowser.py @@ -2,13 +2,13 @@ import os import sys import idlelib -from idlelib import PathBrowser +from idlelib import pathbrowser class PathBrowserTest(unittest.TestCase): def test_DirBrowserTreeItem(self): # Issue16226 - make sure that getting a sublist works - d = PathBrowser.DirBrowserTreeItem('') + d = pathbrowser.DirBrowserTreeItem('') d.GetSubList() self.assertEqual('', d.GetText()) @@ -17,11 +17,11 @@ self.assertEqual(d.ispackagedir(dir + '/Icons'), False) def test_PathBrowserTreeItem(self): - p = PathBrowser.PathBrowserTreeItem() + p = pathbrowser.PathBrowserTreeItem() self.assertEqual(p.GetText(), 'sys.path') sub = p.GetSubList() self.assertEqual(len(sub), len(sys.path)) - self.assertEqual(type(sub[0]), PathBrowser.DirBrowserTreeItem) + self.assertEqual(type(sub[0]), pathbrowser.DirBrowserTreeItem) if __name__ == '__main__': unittest.main(verbosity=2, exit=False) diff --git a/Lib/idlelib/idle_test/test_percolator.py b/Lib/idlelib/idle_test/test_percolator.py --- a/Lib/idlelib/idle_test/test_percolator.py +++ b/Lib/idlelib/idle_test/test_percolator.py @@ -1,10 +1,10 @@ -'''Test Percolator''' +'''Test percolator.py.''' from test.support import requires requires('gui') import unittest from tkinter import Text, Tk, END -from idlelib.Percolator import Percolator, Delegator +from idlelib.percolator import Percolator, Delegator class MyFilter(Delegator): diff --git a/Lib/idlelib/idle_test/test_redirector.py b/Lib/idlelib/idle_test/test_redirector.py --- a/Lib/idlelib/idle_test/test_redirector.py +++ b/Lib/idlelib/idle_test/test_redirector.py @@ -1,4 +1,4 @@ -"""Unittest for idlelib.WidgetRedirector +"""Unittest for idlelib.redirector 100% coverage """ @@ -6,7 +6,7 @@ import unittest from idlelib.idle_test.mock_idle import Func from tkinter import Tk, Text, TclError -from idlelib.WidgetRedirector import WidgetRedirector +from idlelib.redirector import WidgetRedirector class InitCloseTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_replace.py b/Lib/idlelib/idle_test/test_replace.py --- a/Lib/idlelib/idle_test/test_replace.py +++ b/Lib/idlelib/idle_test/test_replace.py @@ -1,4 +1,4 @@ -"""Unittest for idlelib.ReplaceDialog""" +"""Unittest for idlelib.replace.py""" from test.support import requires requires('gui') @@ -6,8 +6,8 @@ from unittest.mock import Mock from tkinter import Tk, Text from idlelib.idle_test.mock_tk import Mbox -import idlelib.SearchEngine as se -import idlelib.ReplaceDialog as rd +import idlelib.searchengine as se +import idlelib.replace as rd orig_mbox = se.tkMessageBox showerror = Mbox.showerror diff --git a/Lib/idlelib/idle_test/test_rstrip.py b/Lib/idlelib/idle_test/test_rstrip.py --- a/Lib/idlelib/idle_test/test_rstrip.py +++ b/Lib/idlelib/idle_test/test_rstrip.py @@ -1,5 +1,5 @@ import unittest -import idlelib.RstripExtension as rs +import idlelib.rstrip as rs from idlelib.idle_test.mock_idle import Editor class rstripTest(unittest.TestCase): @@ -21,7 +21,7 @@ def test_rstrip_multiple(self): editor = Editor() # Uncomment following to verify that test passes with real widgets. -## from idlelib.EditorWindow import EditorWindow as Editor +## from idlelib.editor import EditorWindow as Editor ## from tkinter import Tk ## editor = Editor(root=Tk()) text = editor.text diff --git a/Lib/idlelib/idle_test/test_search.py b/Lib/idlelib/idle_test/test_search.py --- a/Lib/idlelib/idle_test/test_search.py +++ b/Lib/idlelib/idle_test/test_search.py @@ -1,4 +1,4 @@ -"""Test SearchDialog class in SearchDialogue.py""" +"""Test SearchDialog class in idlelib.search.py""" # Does not currently test the event handler wrappers. # A usage test should simulate clicks and check hilighting. @@ -11,8 +11,8 @@ import unittest import tkinter as tk from tkinter import BooleanVar -import idlelib.SearchEngine as se -import idlelib.SearchDialog as sd +import idlelib.searchengine as se +import idlelib.search as sd class SearchDialogTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_searchbase.py b/Lib/idlelib/idle_test/test_searchbase.py --- a/Lib/idlelib/idle_test/test_searchbase.py +++ b/Lib/idlelib/idle_test/test_searchbase.py @@ -1,4 +1,4 @@ -'''Unittests for idlelib/SearchDialogBase.py +'''Unittests for idlelib/searchbase.py Coverage: 99%. The only thing not covered is inconsequential -- testing skipping of suite when self.needwrapbutton is false. @@ -7,8 +7,8 @@ import unittest from test.support import requires from tkinter import Tk, Toplevel, Frame ##, BooleanVar, StringVar -from idlelib import SearchEngine as se -from idlelib import SearchDialogBase as sdb +from idlelib import searchengine as se +from idlelib import searchbase as sdb from idlelib.idle_test.mock_idle import Func ## from idlelib.idle_test.mock_tk import Var diff --git a/Lib/idlelib/idle_test/test_searchengine.py b/Lib/idlelib/idle_test/test_searchengine.py --- a/Lib/idlelib/idle_test/test_searchengine.py +++ b/Lib/idlelib/idle_test/test_searchengine.py @@ -1,4 +1,4 @@ -'''Test functions and SearchEngine class in SearchEngine.py.''' +'''Test functions and SearchEngine class in idlelib.searchengine.py.''' # With mock replacements, the module does not use any gui widgets. # The use of tk.Text is avoided (for now, until mock Text is improved) @@ -10,7 +10,7 @@ # from test.support import requires from tkinter import BooleanVar, StringVar, TclError # ,Tk, Text import tkinter.messagebox as tkMessageBox -from idlelib import SearchEngine as se +from idlelib import searchengine as se from idlelib.idle_test.mock_tk import Var, Mbox from idlelib.idle_test.mock_tk import Text as mockText diff --git a/Lib/idlelib/idle_test/test_textview.py b/Lib/idlelib/idle_test/test_textview.py --- a/Lib/idlelib/idle_test/test_textview.py +++ b/Lib/idlelib/idle_test/test_textview.py @@ -1,4 +1,4 @@ -'''Test the functions and main class method of textView.py. +'''Test the functions and main class method of textview.py. Since all methods and functions create (or destroy) a TextViewer, which is a widget containing multiple widgets, all tests must be gui tests. @@ -13,7 +13,7 @@ import unittest import os from tkinter import Tk -from idlelib import textView as tv +from idlelib import textview as tv from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Mbox diff --git a/Lib/idlelib/idle_test/test_undo.py b/Lib/idlelib/idle_test/test_undo.py --- a/Lib/idlelib/idle_test/test_undo.py +++ b/Lib/idlelib/idle_test/test_undo.py @@ -1,4 +1,4 @@ -"""Unittest for UndoDelegator in idlelib.UndoDelegator. +"""Unittest for UndoDelegator in idlelib.undo.py. Coverage about 80% (retest). """ @@ -8,8 +8,8 @@ import unittest from unittest.mock import Mock from tkinter import Text, Tk -from idlelib.UndoDelegator import UndoDelegator -from idlelib.Percolator import Percolator +from idlelib.undo import UndoDelegator +from idlelib.percolator import Percolator class UndoDelegatorTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_warning.py b/Lib/idlelib/idle_test/test_warning.py --- a/Lib/idlelib/idle_test/test_warning.py +++ b/Lib/idlelib/idle_test/test_warning.py @@ -1,4 +1,4 @@ -'''Test warnings replacement in PyShell.py and run.py. +'''Test warnings replacement in pyshell.py and run.py. This file could be expanded to include traceback overrides (in same two modules). If so, change name. @@ -17,9 +17,9 @@ running_in_idle = 'idle' in showwarning.__name__ from idlelib import run -from idlelib import PyShell as shell +from idlelib import pyshell as shell -# The following was generated from PyShell.idle_formatwarning +# The following was generated from pyshell.idle_formatwarning # and checked as matching expectation. idlemsg = ''' Warning (from warnings module): diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py --- a/Lib/idlelib/iomenu.py +++ b/Lib/idlelib/iomenu.py @@ -10,7 +10,7 @@ import tkinter.messagebox as tkMessageBox from tkinter.simpledialog import askstring -from idlelib.configHandler import idleConf +from idlelib.config import idleConf # Try setting the locale, so that we can find out @@ -107,6 +107,9 @@ class IOBinding: +# One instance per editor Window so methods know which to save, close. +# Open returns focus to self.editwin if aborted. +# EditorWindow.open_module, others, belong here. def __init__(self, editwin): self.editwin = editwin diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py --- a/Lib/idlelib/macosx.py +++ b/Lib/idlelib/macosx.py @@ -123,23 +123,23 @@ # Due to a (mis-)feature of TkAqua the user will also see an empty Help # menu. from tkinter import Menu - from idlelib import Bindings - from idlelib import WindowList + from idlelib import mainmenu + from idlelib import windows - closeItem = Bindings.menudefs[0][1][-2] + closeItem = mainmenu.menudefs[0][1][-2] # Remove the last 3 items of the file menu: a separator, close window and # quit. Close window will be reinserted just above the save item, where # it should be according to the HIG. Quit is in the application menu. - del Bindings.menudefs[0][1][-3:] - Bindings.menudefs[0][1].insert(6, closeItem) + del mainmenu.menudefs[0][1][-3:] + mainmenu.menudefs[0][1].insert(6, closeItem) # Remove the 'About' entry from the help menu, it is in the application # menu - del Bindings.menudefs[-1][1][0:2] + del mainmenu.menudefs[-1][1][0:2] # Remove the 'Configure Idle' entry from the options menu, it is in the # application menu as 'Preferences' - del Bindings.menudefs[-2][1][0] + del mainmenu.menudefs[-2][1][0] menubar = Menu(root) root.configure(menu=menubar) menudict = {} @@ -154,30 +154,30 @@ if end > 0: menu.delete(0, end) - WindowList.add_windows_to_menu(menu) - WindowList.register_callback(postwindowsmenu) + windows.add_windows_to_menu(menu) + Windows.register_callback(postwindowsmenu) def about_dialog(event=None): "Handle Help 'About IDLE' event." - # Synchronize with EditorWindow.EditorWindow.about_dialog. - from idlelib import aboutDialog - aboutDialog.AboutDialog(root, 'About IDLE') + # Synchronize with editor.EditorWindow.about_dialog. + from idlelib import help_about + help_about.AboutDialog(root, 'About IDLE') def config_dialog(event=None): "Handle Options 'Configure IDLE' event." - # Synchronize with EditorWindow.EditorWindow.config_dialog. - from idlelib import configDialog + # Synchronize with editor.EditorWindow.config_dialog. + from idlelib import configdialog # Ensure that the root object has an instance_dict attribute, # mirrors code in EditorWindow (although that sets the attribute # on an EditorWindow instance that is then passed as the first # argument to ConfigDialog) root.instance_dict = flist.inversedict - configDialog.ConfigDialog(root, 'Settings') + configdialog.ConfigDialog(root, 'Settings') def help_dialog(event=None): "Handle Help 'IDLE Help' event." - # Synchronize with EditorWindow.EditorWindow.help_dialog. + # Synchronize with editor.EditorWindow.help_dialog. from idlelib import help help.show_idlehelp(root) @@ -197,7 +197,7 @@ menudict['application'] = menu = Menu(menubar, name='apple', tearoff=0) menubar.add_cascade(label='IDLE', menu=menu) - Bindings.menudefs.insert(0, + mainmenu.menudefs.insert(0, ('application', [ ('About IDLE', '<>'), None, @@ -205,7 +205,7 @@ tkversion = root.tk.eval('info patchlevel') if tuple(map(int, tkversion.split('.'))) < (8, 4, 14): # for earlier AquaTk versions, supply a Preferences menu item - Bindings.menudefs[0][1].append( + mainmenu.menudefs[0][1].append( ('_Preferences....', '<>'), ) if isCocoaTk(): @@ -214,12 +214,12 @@ # replace default "Help" item in Help menu root.createcommand('::tk::mac::ShowHelp', help_dialog) # remove redundant "IDLE Help" from menu - del Bindings.menudefs[-1][1][0] + del mainmenu.menudefs[-1][1][0] def setupApp(root, flist): """ Perform initial OS X customizations if needed. - Called from PyShell.main() after initial calls to Tk() + Called from pyshell.main() after initial calls to Tk() There are currently three major versions of Tk in use on OS X: 1. Aqua Cocoa Tk (native default since OS X 10.6) diff --git a/Lib/idlelib/mainmenu.py b/Lib/idlelib/mainmenu.py --- a/Lib/idlelib/mainmenu.py +++ b/Lib/idlelib/mainmenu.py @@ -10,9 +10,9 @@ """ from importlib.util import find_spec -from idlelib.configHandler import idleConf +from idlelib.config import idleConf -# Warning: menudefs is altered in macosxSupport.overrideRootMenu() +# Warning: menudefs is altered in macosx.overrideRootMenu() # after it is determined that an OS X Aqua Tk is in use, # which cannot be done until after Tk() is first called. # Do not alter the 'file', 'options', or 'help' cascades here diff --git a/Lib/idlelib/outwin.py b/Lib/idlelib/outwin.py --- a/Lib/idlelib/outwin.py +++ b/Lib/idlelib/outwin.py @@ -1,8 +1,8 @@ from tkinter import * -from idlelib.EditorWindow import EditorWindow +from idlelib.editor import EditorWindow import re import tkinter.messagebox as tkMessageBox -from idlelib import IOBinding +from idlelib import iomenu class OutputWindow(EditorWindow): @@ -36,7 +36,7 @@ def write(self, s, tags=(), mark="insert"): if isinstance(s, (bytes, bytes)): - s = s.decode(IOBinding.encoding, "replace") + s = s.decode(iomenu.encoding, "replace") self.text.insert(mark, s, tags) self.text.see(mark) self.text.update() diff --git a/Lib/idlelib/paragraph.py b/Lib/idlelib/paragraph.py --- a/Lib/idlelib/paragraph.py +++ b/Lib/idlelib/paragraph.py @@ -16,7 +16,7 @@ """ import re -from idlelib.configHandler import idleConf +from idlelib.config import idleConf class FormatParagraph: @@ -191,5 +191,5 @@ if __name__ == "__main__": import unittest - unittest.main('idlelib.idle_test.test_formatparagraph', + unittest.main('idlelib.idle_test.test_paragraph', verbosity=2, exit=False) diff --git a/Lib/idlelib/parenmatch.py b/Lib/idlelib/parenmatch.py --- a/Lib/idlelib/parenmatch.py +++ b/Lib/idlelib/parenmatch.py @@ -5,8 +5,8 @@ parentheses, square brackets, and curly braces. """ -from idlelib.HyperParser import HyperParser -from idlelib.configHandler import idleConf +from idlelib.hyperparser import HyperParser +from idlelib.config import idleConf _openers = {')':'(',']':'[','}':'{'} CHECK_DELAY = 100 # miliseconds diff --git a/Lib/idlelib/pathbrowser.py b/Lib/idlelib/pathbrowser.py --- a/Lib/idlelib/pathbrowser.py +++ b/Lib/idlelib/pathbrowser.py @@ -2,9 +2,9 @@ import sys import importlib.machinery -from idlelib.TreeWidget import TreeItem -from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem -from idlelib.PyShell import PyShellFileList +from idlelib.tree import TreeItem +from idlelib.browser import ClassBrowser, ModuleBrowserTreeItem +from idlelib.pyshell import PyShellFileList class PathBrowser(ClassBrowser): diff --git a/Lib/idlelib/percolator.py b/Lib/idlelib/percolator.py --- a/Lib/idlelib/percolator.py +++ b/Lib/idlelib/percolator.py @@ -1,5 +1,5 @@ -from idlelib.WidgetRedirector import WidgetRedirector -from idlelib.Delegator import Delegator +from idlelib.redirector import WidgetRedirector +from idlelib.delegator import Delegator class Percolator: diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -24,16 +24,16 @@ sys.exit(1) import tkinter.messagebox as tkMessageBox -from idlelib.EditorWindow import EditorWindow, fixwordbreaks -from idlelib.FileList import FileList -from idlelib.ColorDelegator import ColorDelegator -from idlelib.UndoDelegator import UndoDelegator -from idlelib.OutputWindow import OutputWindow -from idlelib.configHandler import idleConf +from idlelib.editor import EditorWindow, fixwordbreaks +from idlelib.filelist import FileList +from idlelib.colorizer import ColorDelegator +from idlelib.undo import UndoDelegator +from idlelib.outwin import OutputWindow +from idlelib.config import idleConf from idlelib import rpc -from idlelib import Debugger -from idlelib import RemoteDebugger -from idlelib import macosxSupport +from idlelib import debugger +from idlelib import debugger_r +from idlelib import macosx HOST = '127.0.0.1' # python execution server on localhost loopback PORT = 0 # someday pass in host, port for remote debug capability @@ -410,7 +410,7 @@ # run from the IDLE source directory. del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc', default=False, type='bool') - if __name__ == 'idlelib.PyShell': + if __name__ == 'idlelib.pyshell': command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,) else: command = "__import__('run').main(%r)" % (del_exitf,) @@ -468,7 +468,7 @@ if debug: try: # Only close subprocess debugger, don't unregister gui_adap! - RemoteDebugger.close_subprocess_debugger(self.rpcclt) + debugger_r.close_subprocess_debugger(self.rpcclt) except: pass # Kill subprocess, spawn a new one, accept connection. @@ -497,7 +497,7 @@ # restart subprocess debugger if debug: # Restarted debugger connects to current instance of debug GUI - RemoteDebugger.restart_subprocess_debugger(self.rpcclt) + debugger_r.restart_subprocess_debugger(self.rpcclt) # reload remote debugger breakpoints for all PyShellEditWindows debug.load_breakpoints() self.compile.compiler.flags = self.original_compiler_flags @@ -578,7 +578,7 @@ if self.tkconsole.getvar("<>"): self.remote_stack_viewer() elif how == "ERROR": - errmsg = "PyShell.ModifiedInterpreter: Subprocess ERROR:\n" + errmsg = "pyshell.ModifiedInterpreter: Subprocess ERROR:\n" print(errmsg, what, file=sys.__stderr__) print(errmsg, what, file=console) # we received a response to the currently active seq number: @@ -613,13 +613,13 @@ return def remote_stack_viewer(self): - from idlelib import RemoteObjectBrowser + from idlelib import debugobj_r oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {}) if oid is None: self.tkconsole.root.bell() return - item = RemoteObjectBrowser.StubObjectTreeItem(self.rpcclt, oid) - from idlelib.TreeWidget import ScrolledCanvas, TreeNode + item = debugobj_r.StubObjectTreeItem(self.rpcclt, oid) + from idlelib.tree import ScrolledCanvas, TreeNode top = Toplevel(self.tkconsole.root) theme = idleConf.CurrentTheme() background = idleConf.GetHighlight(theme, 'normal')['background'] @@ -662,9 +662,9 @@ # at the moment, InteractiveInterpreter expects str assert isinstance(source, str) #if isinstance(source, str): - # from idlelib import IOBinding + # from idlelib import iomenu # try: - # source = source.encode(IOBinding.encoding) + # source = source.encode(iomenu.encoding) # except UnicodeError: # self.tkconsole.resetoutput() # self.write("Unsupported characters in input\n") @@ -850,7 +850,7 @@ # New classes - from idlelib.IdleHistory import History + from idlelib.history import History def __init__(self, flist=None): if use_subprocess: @@ -888,11 +888,11 @@ self.save_stdout = sys.stdout self.save_stderr = sys.stderr self.save_stdin = sys.stdin - from idlelib import IOBinding - self.stdin = PseudoInputFile(self, "stdin", IOBinding.encoding) - self.stdout = PseudoOutputFile(self, "stdout", IOBinding.encoding) - self.stderr = PseudoOutputFile(self, "stderr", IOBinding.encoding) - self.console = PseudoOutputFile(self, "console", IOBinding.encoding) + from idlelib import iomenu + self.stdin = PseudoInputFile(self, "stdin", iomenu.encoding) + self.stdout = PseudoOutputFile(self, "stdout", iomenu.encoding) + self.stderr = PseudoOutputFile(self, "stderr", iomenu.encoding) + self.console = PseudoOutputFile(self, "console", iomenu.encoding) if not use_subprocess: sys.stdout = self.stdout sys.stderr = self.stderr @@ -900,7 +900,7 @@ try: # page help() text to shell. import pydoc # import must be done here to capture i/o rebinding. - # XXX KBK 27Dec07 use a textView someday, but must work w/o subproc + # XXX KBK 27Dec07 use TextViewer someday, but must work w/o subproc pydoc.pager = pydoc.plainpager except: sys.stderr = sys.__stderr__ @@ -954,7 +954,7 @@ self.interp.setdebugger(None) db.close() if self.interp.rpcclt: - RemoteDebugger.close_remote_debugger(self.interp.rpcclt) + debugger_r.close_remote_debugger(self.interp.rpcclt) self.resetoutput() self.console.write("[DEBUG OFF]\n") sys.ps1 = ">>> " @@ -963,10 +963,10 @@ def open_debugger(self): if self.interp.rpcclt: - dbg_gui = RemoteDebugger.start_remote_debugger(self.interp.rpcclt, + dbg_gui = debugger_r.start_remote_debugger(self.interp.rpcclt, self) else: - dbg_gui = Debugger.Debugger(self) + dbg_gui = debugger.Debugger(self) self.interp.setdebugger(dbg_gui) dbg_gui.load_breakpoints() sys.ps1 = "[DEBUG ON]\n>>> " @@ -1241,7 +1241,7 @@ "(sys.last_traceback is not defined)", parent=self.text) return - from idlelib.StackViewer import StackBrowser + from idlelib.stackviewer import StackBrowser StackBrowser(self.root, self.flist) def view_restart_mark(self, event=None): @@ -1546,9 +1546,9 @@ fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) - macosxSupport.setupApp(root, flist) + macosx.setupApp(root, flist) - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): # There are some screwed up <2> class bindings for text # widgets defined in Tk which we need to do away with. # See issue #24801. @@ -1569,7 +1569,7 @@ shell = flist.open_shell() if not shell: return # couldn't open shell - if macosxSupport.isAquaTk() and flist.dict: + if macosx.isAquaTk() and flist.dict: # On OSX: when the user has double-clicked on a file that causes # IDLE to be launched the shell window will open just in front of # the file she wants to see. Lower the interpreter window when @@ -1603,7 +1603,7 @@ # check for problematic OS X Tk versions and print a warning # message in the IDLE shell window; this is less intrusive # than always opening a separate window. - tkversionwarning = macosxSupport.tkVersionWarning(root) + tkversionwarning = macosx.tkVersionWarning(root) if tkversionwarning: shell.interp.runcommand("print('%s')" % tkversionwarning) @@ -1613,7 +1613,7 @@ capture_warnings(False) if __name__ == "__main__": - sys.modules['PyShell'] = sys.modules['__main__'] + sys.modules['pyshell'] = sys.modules['__main__'] main() capture_warnings(False) # Make sure turned off; see issue 18081 diff --git a/Lib/idlelib/redirector.py b/Lib/idlelib/redirector.py --- a/Lib/idlelib/redirector.py +++ b/Lib/idlelib/redirector.py @@ -104,7 +104,7 @@ Note that if a registered function is called, the operation is not passed through to Tk. Apply the function returned by self.register() - to *args to accomplish that. For an example, see ColorDelegator.py. + to *args to accomplish that. For an example, see colorizer.py. ''' m = self._operations.get(operation) diff --git a/Lib/idlelib/replace.py b/Lib/idlelib/replace.py --- a/Lib/idlelib/replace.py +++ b/Lib/idlelib/replace.py @@ -5,8 +5,8 @@ """ from tkinter import * -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import searchengine +from idlelib.searchbase import SearchDialogBase import re @@ -14,7 +14,7 @@ """Returns a singleton ReplaceDialog instance.The single dialog saves user entries and preferences across instances.""" root = text._root() - engine = SearchEngine.get(root) + engine = searchengine.get(root) if not hasattr(engine, "_replacedialog"): engine._replacedialog = ReplaceDialog(root, engine) dialog = engine._replacedialog @@ -164,7 +164,7 @@ pos = None if not pos: first = last = pos = text.index("insert") - line, col = SearchEngine.get_line_col(pos) + line, col = searchengine.get_line_col(pos) chars = text.get("%d.0" % line, "%d.0" % (line+1)) m = prog.match(chars, col) if not prog: diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -7,15 +7,15 @@ import queue import tkinter -from idlelib import CallTips -from idlelib import AutoComplete +from idlelib import calltips +from idlelib import autocomplete -from idlelib import RemoteDebugger -from idlelib import RemoteObjectBrowser -from idlelib import StackViewer +from idlelib import debugger_r +from idlelib import debugobj_r +from idlelib import stackviewer from idlelib import rpc -from idlelib import PyShell -from idlelib import IOBinding +from idlelib import pyshell +from idlelib import iomenu import __main__ @@ -32,7 +32,7 @@ if file is None: file = sys.stderr try: - file.write(PyShell.idle_formatwarning( + file.write(pyshell.idle_formatwarning( message, category, filename, lineno, line)) except IOError: pass # the file (probably stderr) is invalid - this warning gets lost. @@ -82,7 +82,7 @@ MyHandler object. That reference is saved as attribute rpchandler of the Executive instance. The Executive methods have access to the reference and can pass it on to entities that they command - (e.g. RemoteDebugger.Debugger.start_debugger()). The latter, in turn, can + (e.g. debugger_r.Debugger.start_debugger()). The latter, in turn, can call MyHandler(SocketIO) register/unregister methods via the reference to register and unregister themselves. @@ -204,7 +204,7 @@ tbe = traceback.extract_tb(tb) print('Traceback (most recent call last):', file=efile) exclude = ("run.py", "rpc.py", "threading.py", "queue.py", - "RemoteDebugger.py", "bdb.py") + "debugger_r.py", "bdb.py") cleanup_traceback(tbe, exclude) traceback.print_list(tbe, file=efile) lines = traceback.format_exception_only(typ, exc) @@ -298,12 +298,12 @@ executive = Executive(self) self.register("exec", executive) self.console = self.get_remote_proxy("console") - sys.stdin = PyShell.PseudoInputFile(self.console, "stdin", - IOBinding.encoding) - sys.stdout = PyShell.PseudoOutputFile(self.console, "stdout", - IOBinding.encoding) - sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr", - IOBinding.encoding) + sys.stdin = pyshell.PseudoInputFile(self.console, "stdin", + iomenu.encoding) + sys.stdout = pyshell.PseudoOutputFile(self.console, "stdout", + iomenu.encoding) + sys.stderr = pyshell.PseudoOutputFile(self.console, "stderr", + iomenu.encoding) sys.displayhook = rpc.displayhook # page help() text to shell. @@ -339,8 +339,8 @@ def __init__(self, rpchandler): self.rpchandler = rpchandler self.locals = __main__.__dict__ - self.calltip = CallTips.CallTips() - self.autocomplete = AutoComplete.AutoComplete() + self.calltip = calltips.CallTips() + self.autocomplete = autocomplete.AutoComplete() def runcode(self, code): global interruptable @@ -372,7 +372,7 @@ thread.interrupt_main() def start_the_debugger(self, gui_adap_oid): - return RemoteDebugger.start_debugger(self.rpchandler, gui_adap_oid) + return debugger_r.start_debugger(self.rpchandler, gui_adap_oid) def stop_the_debugger(self, idb_adap_oid): "Unregister the Idb Adapter. Link objects and Idb then subject to GC" @@ -396,7 +396,7 @@ tb = tb.tb_next sys.last_type = typ sys.last_value = val - item = StackViewer.StackTreeItem(flist, tb) - return RemoteObjectBrowser.remote_object_tree_item(item) + item = stackviewer.StackTreeItem(flist, tb) + return debugobj_r.remote_object_tree_item(item) capture_warnings(False) # Make sure turned off; see issue 18081 diff --git a/Lib/idlelib/runscript.py b/Lib/idlelib/runscript.py --- a/Lib/idlelib/runscript.py +++ b/Lib/idlelib/runscript.py @@ -21,10 +21,10 @@ import tabnanny import tokenize import tkinter.messagebox as tkMessageBox -from idlelib import PyShell +from idlelib import pyshell -from idlelib.configHandler import idleConf -from idlelib import macosxSupport +from idlelib.config import idleConf +from idlelib import macosx indent_message = """Error: Inconsistent indentation detected! @@ -46,12 +46,12 @@ def __init__(self, editwin): self.editwin = editwin - # Provide instance variables referenced by Debugger + # Provide instance variables referenced by debugger # XXX This should be done differently self.flist = self.editwin.flist self.root = self.editwin.root - if macosxSupport.isCocoaTk(): + if macosx.isCocoaTk(): self.editwin.text_frame.bind('<>', self._run_module_event) def check_module_event(self, event): @@ -112,7 +112,7 @@ shell.set_warning_stream(saved_stream) def run_module_event(self, event): - if macosxSupport.isCocoaTk(): + if macosx.isCocoaTk(): # Tk-Cocoa in MacOSX is broken until at least # Tk 8.5.9, and without this rather # crude workaround IDLE would hang when a user @@ -142,7 +142,7 @@ if not self.tabnanny(filename): return 'break' interp = self.shell.interp - if PyShell.use_subprocess: + if pyshell.use_subprocess: interp.restart_subprocess(with_cwd=False, filename= self.editwin._filename_to_unicode(filename)) dirname = os.path.dirname(filename) @@ -161,7 +161,7 @@ interp.prepend_syspath(filename) # XXX KBK 03Jul04 When run w/o subprocess, runtime warnings still # go to __stderr__. With subprocess, they go to the shell. - # Need to change streams in PyShell.ModifiedInterpreter. + # Need to change streams in pyshell.ModifiedInterpreter. interp.runcode(code) return 'break' diff --git a/Lib/idlelib/scrolledlist.py b/Lib/idlelib/scrolledlist.py --- a/Lib/idlelib/scrolledlist.py +++ b/Lib/idlelib/scrolledlist.py @@ -1,5 +1,5 @@ from tkinter import * -from idlelib import macosxSupport +from idlelib import macosx class ScrolledList: @@ -23,7 +23,7 @@ # Bind events to the list box listbox.bind("", self.click_event) listbox.bind("", self.double_click_event) - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): listbox.bind("", self.popup_event) listbox.bind("", self.popup_event) else: diff --git a/Lib/idlelib/search.py b/Lib/idlelib/search.py --- a/Lib/idlelib/search.py +++ b/Lib/idlelib/search.py @@ -1,12 +1,12 @@ from tkinter import * -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import searchengine +from idlelib.searchbase import SearchDialogBase def _setup(text): "Create or find the singleton SearchDialog instance." root = text._root() - engine = SearchEngine.get(root) + engine = searchengine.get(root) if not hasattr(engine, "_searchdialog"): engine._searchdialog = SearchDialog(root, engine) return engine._searchdialog diff --git a/Lib/idlelib/searchbase.py b/Lib/idlelib/searchbase.py --- a/Lib/idlelib/searchbase.py +++ b/Lib/idlelib/searchbase.py @@ -125,7 +125,7 @@ def create_option_buttons(self): '''Return (filled frame, options) for testing. - Options is a list of SearchEngine booleanvar, label pairs. + Options is a list of searchengine booleanvar, label pairs. A gridded frame from make_frame is filled with a Checkbutton for each pair, bound to the var, with the corresponding label. ''' diff --git a/Lib/idlelib/searchengine.py b/Lib/idlelib/searchengine.py --- a/Lib/idlelib/searchengine.py +++ b/Lib/idlelib/searchengine.py @@ -57,7 +57,7 @@ def setcookedpat(self, pat): "Set pattern after escaping if re." - # called only in SearchDialog.py: 66 + # called only in search.py: 66 if self.isre(): pat = re.escape(pat) self.setpat(pat) diff --git a/Lib/idlelib/stackviewer.py b/Lib/idlelib/stackviewer.py --- a/Lib/idlelib/stackviewer.py +++ b/Lib/idlelib/stackviewer.py @@ -4,9 +4,9 @@ import re import tkinter as tk -from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas -from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem -from idlelib.PyShell import PyShellFileList +from idlelib.tree import TreeNode, TreeItem, ScrolledCanvas +from idlelib.debugobj import ObjectTreeItem, make_objecttreeitem +from idlelib.pyshell import PyShellFileList def StackBrowser(root, flist=None, tb=None, top=None): if top is None: diff --git a/Lib/idlelib/tooltip.py b/Lib/idlelib/tooltip.py --- a/Lib/idlelib/tooltip.py +++ b/Lib/idlelib/tooltip.py @@ -1,4 +1,4 @@ -# general purpose 'tooltip' routines - currently unused in idlefork +# general purpose 'tooltip' routines - currently unused in idlelib # (although the 'calltips' extension is partly based on this code) # may be useful for some purposes in (or almost in ;) the current project scope # Ideas gleaned from PySol @@ -76,7 +76,7 @@ for item in self.items: listbox.insert(END, item) -def _tooltip(parent): +def _tooltip(parent): # htest # root = Tk() root.title("Test tooltip") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) diff --git a/Lib/idlelib/tree.py b/Lib/idlelib/tree.py --- a/Lib/idlelib/tree.py +++ b/Lib/idlelib/tree.py @@ -17,8 +17,8 @@ import os from tkinter import * -from idlelib import ZoomHeight -from idlelib.configHandler import idleConf +from idlelib import zoomheight +from idlelib.config import idleConf ICONDIR = "Icons" @@ -445,7 +445,7 @@ self.canvas.yview_scroll(1, "unit") return "break" def zoom_height(self, event): - ZoomHeight.zoom_height(self.master) + zoomheight.zoom_height(self.master) return "break" diff --git a/Lib/idlelib/undo.py b/Lib/idlelib/undo.py --- a/Lib/idlelib/undo.py +++ b/Lib/idlelib/undo.py @@ -1,7 +1,7 @@ import string from tkinter import * -from idlelib.Delegator import Delegator +from idlelib.delegator import Delegator #$ event <> #$ win @@ -340,7 +340,7 @@ def _undo_delegator(parent): # htest # import re import tkinter as tk - from idlelib.Percolator import Percolator + from idlelib.percolator import Percolator undowin = tk.Toplevel() undowin.title("Test UndoDelegator") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) diff --git a/Lib/idlelib/zoomheight.py b/Lib/idlelib/zoomheight.py --- a/Lib/idlelib/zoomheight.py +++ b/Lib/idlelib/zoomheight.py @@ -3,7 +3,7 @@ import re import sys -from idlelib import macosxSupport +from idlelib import macosx class ZoomHeight: @@ -32,7 +32,7 @@ newy = 0 newheight = newheight - 72 - elif macosxSupport.isAquaTk(): + elif macosx.isAquaTk(): # The '88' below is a magic number that avoids placing the bottom # of the window below the panel on my machine. I don't know how # to calculate the correct value for this with tkinter. diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -89,9 +89,9 @@ import os from tkinter import * -from idlelib.Percolator import Percolator -from idlelib.ColorDelegator import ColorDelegator -from idlelib.textView import view_text +from idlelib.percolator import Percolator +from idlelib.colorizer import ColorDelegator +from idlelib.textview import view_text from turtledemo import __doc__ as about_turtledemo import turtle -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:06:50 2016 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 28 May 2016 21:06:50 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Fix_issue27146?= =?utf-8?q?_-_add_stdio=2Eh_include_to_posixmodule=2Ec_for_ctermid=28=29?= =?utf-8?q?=2E?= Message-ID: <20160528210649.13769.21585.5F32979E@psf.io> https://hg.python.org/cpython/rev/c8e113bf56ae changeset: 101545:c8e113bf56ae branch: 3.5 parent: 101540:6f50c04e4a1e user: Gregory P. Smith [Google Inc.] date: Sat May 28 21:03:48 2016 +0000 summary: Fix issue27146 - add stdio.h include to posixmodule.c for ctermid(). files: Modules/posixmodule.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -32,6 +32,8 @@ #include "winreparse.h" #endif +#include /* needed for ctermid() */ + #ifdef __cplusplus extern "C" { #endif -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:06:50 2016 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 28 May 2016 21:06:50 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Fix_issue27146_-_add_stdio=2Eh_include_to_posixmodule=2E?= =?utf-8?q?c_for_ctermid=28=29=2E?= Message-ID: <20160528210650.30851.96449.41B25880@psf.io> https://hg.python.org/cpython/rev/74fcfc29187e changeset: 101546:74fcfc29187e parent: 101544:0c3fdb161901 parent: 101545:c8e113bf56ae user: Gregory P. Smith [Google Inc.] date: Sat May 28 21:06:41 2016 +0000 summary: Fix issue27146 - add stdio.h include to posixmodule.c for ctermid(). files: Modules/posixmodule.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -38,6 +38,8 @@ #undef HAVE_FACCESSAT #endif +#include /* needed for ctermid() */ + #ifdef __cplusplus extern "C" { #endif -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:08:15 2016 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 May 2016 21:08:15 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_default_-=3E_default?= =?utf-8?q?=29=3A_merge_heads?= Message-ID: <20160528210815.32431.62209.08D0E13B@psf.io> https://hg.python.org/cpython/rev/a3158a3fe837 changeset: 101552:a3158a3fe837 parent: 101550:8b6953fd2a5a parent: 101546:74fcfc29187e user: Benjamin Peterson date: Sat May 28 14:07:45 2016 -0700 summary: merge heads files: Modules/posixmodule.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -38,6 +38,8 @@ #undef HAVE_FACCESSAT #endif +#include /* needed for ctermid() */ + #ifdef __cplusplus extern "C" { #endif -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:08:15 2016 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 May 2016 21:08:15 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Backed_out_cha?= =?utf-8?q?ngeset_e7062dd9085e_=28=2325731=29?= Message-ID: <20160528210815.10324.52544.210012F0@psf.io> https://hg.python.org/cpython/rev/3ff84a3eeb6b changeset: 101549:3ff84a3eeb6b branch: 2.7 parent: 101542:184dfef08a93 user: Benjamin Peterson date: Sat May 28 14:03:41 2016 -0700 summary: Backed out changeset e7062dd9085e (#25731) files: Objects/typeobject.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Objects/typeobject.c b/Objects/typeobject.c --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6272,7 +6272,7 @@ sanity checks and constructing a new argument list. Cut all that nonsense short -- this speeds up instance creation tremendously. */ - specific = (void *)((PyTypeObject *)PyCFunction_GET_SELF(descr))->tp_new; + specific = (void *)type->tp_new; /* XXX I'm not 100% sure that there isn't a hole in this reasoning that requires additional sanity checks. I'll buy the first person to -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:08:15 2016 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 May 2016 21:08:15 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAobWVyZ2UgMy41IC0+IDMuNSk6?= =?utf-8?q?_merge_heads?= Message-ID: <20160528210815.30697.83613.947C1229@psf.io> https://hg.python.org/cpython/rev/7aeb9505cc2a changeset: 101551:7aeb9505cc2a branch: 3.5 parent: 101547:e9ae5d18d0fa parent: 101545:c8e113bf56ae user: Benjamin Peterson date: Sat May 28 14:07:30 2016 -0700 summary: merge heads files: Modules/posixmodule.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -32,6 +32,8 @@ #include "winreparse.h" #endif +#include /* needed for ctermid() */ + #ifdef __cplusplus extern "C" { #endif -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:08:16 2016 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 May 2016 21:08:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogbWVyZ2UgMy41?= Message-ID: <20160528210816.10648.57603.9CA3CB84@psf.io> https://hg.python.org/cpython/rev/113b64e74e72 changeset: 101553:113b64e74e72 parent: 101552:a3158a3fe837 parent: 101551:7aeb9505cc2a user: Benjamin Peterson date: Sat May 28 14:07:49 2016 -0700 summary: merge 3.5 files: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:08:16 2016 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 May 2016 21:08:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_backout_3c9512?= =?utf-8?q?d8ac0d?= Message-ID: <20160528210815.23333.53581.4A8F3179@psf.io> https://hg.python.org/cpython/rev/e9ae5d18d0fa changeset: 101547:e9ae5d18d0fa branch: 3.5 parent: 101540:6f50c04e4a1e user: Benjamin Peterson date: Sat May 28 14:04:40 2016 -0700 summary: backout 3c9512d8ac0d files: Lib/test/test_descr.py | 8 -------- Misc/NEWS | 2 -- Objects/typeobject.c | 2 +- 3 files changed, 1 insertions(+), 11 deletions(-) diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4564,14 +4564,6 @@ self.assertRegex(repr(method), r">") - def test_deleting_new_in_subclasses(self): - class X: - def __init__(self, a): - pass - X.__new__ = None - del X.__new__ - X(1) # should work - class DictProxyTests(unittest.TestCase): def setUp(self): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -80,8 +80,6 @@ (``int``) and ``f2()`` returns ``1.0`` (``int``), even if ``1`` and ``1.0`` are equal. -- Issue #25731: Fix set and deleting __new__ on a class. - - Issue #22995: [UPDATE] Comment out the one of the pickleability tests in _PyObject_GetState() due to regressions observed in Cython-based projects. diff --git a/Objects/typeobject.c b/Objects/typeobject.c --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6777,7 +6777,7 @@ sanity checks and constructing a new argument list. Cut all that nonsense short -- this speeds up instance creation tremendously. */ - specific = (void *)((PyTypeObject *)PyCFunction_GET_SELF(descr))->tp_new; + specific = (void *)type->tp_new; /* XXX I'm not 100% sure that there isn't a hole in this reasoning that requires additional sanity checks. I'll buy the first person to -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:08:16 2016 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 May 2016 21:08:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?b?KTogbWVyZ2UgMy41?= Message-ID: <20160528210815.122132.46086.811F2E22@psf.io> https://hg.python.org/cpython/rev/c8df1877d1bc changeset: 101548:c8df1877d1bc parent: 101541:0177af33ce76 parent: 101547:e9ae5d18d0fa user: Benjamin Peterson date: Sat May 28 14:05:11 2016 -0700 summary: merge 3.5 files: Lib/test/test_descr.py | 8 -------- Misc/NEWS | 3 ++- Objects/typeobject.c | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4564,14 +4564,6 @@ self.assertRegex(repr(method), r">") - def test_deleting_new_in_subclasses(self): - class X: - def __init__(self, a): - pass - X.__new__ = None - del X.__new__ - X(1) # should work - class DictProxyTests(unittest.TestCase): def setUp(self): diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -204,7 +204,8 @@ - Issue #25791: If __package__ != __spec__.parent or if neither __package__ or __spec__ are defined then ImportWarning is raised. -- Issue #25731: Fix set and deleting __new__ on a class. +- Issue #22995: [UPDATE] Comment out the one of the pickleability tests in + _PyObject_GetState() due to regressions observed in Cython-based projects. - Issue #25961: Disallowed null characters in the type name. diff --git a/Objects/typeobject.c b/Objects/typeobject.c --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6790,7 +6790,7 @@ sanity checks and constructing a new argument list. Cut all that nonsense short -- this speeds up instance creation tremendously. */ - specific = (void *)((PyTypeObject *)PyCFunction_GET_SELF(descr))->tp_new; + specific = (void *)type->tp_new; /* XXX I'm not 100% sure that there isn't a hole in this reasoning that requires additional sanity checks. I'll buy the first person to -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 17:08:15 2016 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 28 May 2016 21:08:15 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_default_-=3E_default?= =?utf-8?q?=29=3A_merge_heads?= Message-ID: <20160528210815.30703.76593.AEFAFF04@psf.io> https://hg.python.org/cpython/rev/8b6953fd2a5a changeset: 101550:8b6953fd2a5a parent: 101548:c8df1877d1bc parent: 101544:0c3fdb161901 user: Benjamin Peterson date: Sat May 28 14:06:48 2016 -0700 summary: merge heads files: Lib/idlelib/__main__.py | 4 +- Lib/idlelib/autocomplete.py | 10 +- Lib/idlelib/autocomplete_w.py | 10 +- Lib/idlelib/autoexpand.py | 0 Lib/idlelib/browser.py | 16 +- Lib/idlelib/calltip_w.py | 4 +- Lib/idlelib/calltips.py | 8 +- Lib/idlelib/codecontext.py | 6 +- Lib/idlelib/colorizer.py | 6 +- Lib/idlelib/config.py | 10 +- Lib/idlelib/config_help.py | 0 Lib/idlelib/config_key.py | 0 Lib/idlelib/config_sec.py | 2 +- Lib/idlelib/configdialog.py | 16 +- Lib/idlelib/debugger.py | 16 +- Lib/idlelib/debugger_r.py | 8 +- Lib/idlelib/debugobj.py | 4 +- Lib/idlelib/debugobj_r.py | 0 Lib/idlelib/delegator.py | 0 Lib/idlelib/dynoption.py | 0 Lib/idlelib/editor.py | 129 +++++---- Lib/idlelib/filelist.py | 4 +- Lib/idlelib/grep.py | 10 +- Lib/idlelib/help.py | 4 +- Lib/idlelib/help_about.py | 6 +- Lib/idlelib/history.py | 4 +- Lib/idlelib/hyperparser.py | 4 +- Lib/idlelib/idle.py | 4 +- Lib/idlelib/idle.pyw | 12 +- Lib/idlelib/idle_test/htest.py | 66 ++-- Lib/idlelib/idle_test/mock_idle.py | 4 +- Lib/idlelib/idle_test/test_autocomplete.py | 6 +- Lib/idlelib/idle_test/test_autoexpand.py | 4 +- Lib/idlelib/idle_test/test_calltips.py | 2 +- Lib/idlelib/idle_test/test_config_help.py | 4 +- Lib/idlelib/idle_test/test_config_sec.py | 4 +- Lib/idlelib/idle_test/test_configdialog.py | 6 +- Lib/idlelib/idle_test/test_delegator.py | 2 +- Lib/idlelib/idle_test/test_editor.py | 2 +- Lib/idlelib/idle_test/test_grep.py | 6 +- Lib/idlelib/idle_test/test_history.py | 4 +- Lib/idlelib/idle_test/test_hyperparser.py | 6 +- Lib/idlelib/idle_test/test_iomenu.py | 2 +- Lib/idlelib/idle_test/test_paragraph.py | 8 +- Lib/idlelib/idle_test/test_parenmatch.py | 4 +- Lib/idlelib/idle_test/test_pathbrowser.py | 8 +- Lib/idlelib/idle_test/test_percolator.py | 4 +- Lib/idlelib/idle_test/test_redirector.py | 4 +- Lib/idlelib/idle_test/test_replace.py | 6 +- Lib/idlelib/idle_test/test_rstrip.py | 4 +- Lib/idlelib/idle_test/test_search.py | 6 +- Lib/idlelib/idle_test/test_searchbase.py | 6 +- Lib/idlelib/idle_test/test_searchengine.py | 4 +- Lib/idlelib/idle_test/test_textview.py | 4 +- Lib/idlelib/idle_test/test_undo.py | 6 +- Lib/idlelib/idle_test/test_warning.py | 6 +- Lib/idlelib/iomenu.py | 5 +- Lib/idlelib/macosx.py | 40 +- Lib/idlelib/mainmenu.py | 4 +- Lib/idlelib/multicall.py | 0 Lib/idlelib/outwin.py | 6 +- Lib/idlelib/paragraph.py | 4 +- Lib/idlelib/parenmatch.py | 4 +- Lib/idlelib/pathbrowser.py | 6 +- Lib/idlelib/percolator.py | 4 +- Lib/idlelib/pyparse.py | 0 Lib/idlelib/pyshell.py | 68 ++-- Lib/idlelib/redirector.py | 2 +- Lib/idlelib/replace.py | 8 +- Lib/idlelib/rstrip.py | 0 Lib/idlelib/run.py | 42 +- Lib/idlelib/runscript.py | 16 +- Lib/idlelib/scrolledlist.py | 4 +- Lib/idlelib/search.py | 6 +- Lib/idlelib/searchbase.py | 2 +- Lib/idlelib/searchengine.py | 2 +- Lib/idlelib/stackviewer.py | 6 +- Lib/idlelib/statusbar.py | 0 Lib/idlelib/textview.py | 0 Lib/idlelib/tooltip.py | 4 +- Lib/idlelib/tree.py | 6 +- Lib/idlelib/undo.py | 4 +- Lib/idlelib/windows.py | 0 Lib/idlelib/zoomheight.py | 4 +- Lib/turtledemo/__main__.py | 6 +- 85 files changed, 378 insertions(+), 360 deletions(-) diff --git a/Lib/idlelib/__main__.py b/Lib/idlelib/__main__.py --- a/Lib/idlelib/__main__.py +++ b/Lib/idlelib/__main__.py @@ -3,6 +3,6 @@ Run IDLE as python -m idlelib """ -import idlelib.PyShell -idlelib.PyShell.main() +import idlelib.pyshell +idlelib.pyshell.main() # This file does not work for 2.7; See issue 24212. diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/autocomplete.py rename from Lib/idlelib/AutoComplete.py rename to Lib/idlelib/autocomplete.py --- a/Lib/idlelib/AutoComplete.py +++ b/Lib/idlelib/autocomplete.py @@ -1,4 +1,4 @@ -"""AutoComplete.py - An IDLE extension for automatically completing names. +"""autocomplete.py - An IDLE extension for automatically completing names. This extension can complete either attribute names of file names. It can pop a window with all available names, for the user to select from. @@ -7,7 +7,7 @@ import sys import string -from idlelib.configHandler import idleConf +from idlelib.config import idleConf # This string includes all chars that may be in an identifier ID_CHARS = string.ascii_letters + string.digits + "_" @@ -15,8 +15,8 @@ # These constants represent the two different types of completions COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1) -from idlelib import AutoCompleteWindow -from idlelib.HyperParser import HyperParser +from idlelib import autocomplete_w +from idlelib.hyperparser import HyperParser import __main__ @@ -49,7 +49,7 @@ self._delayed_completion_index = None def _make_autocomplete_window(self): - return AutoCompleteWindow.AutoCompleteWindow(self.text) + return autocomplete_w.AutoCompleteWindow(self.text) def _remove_autocomplete_window(self, event=None): if self.autocompletewindow: diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/autocomplete_w.py rename from Lib/idlelib/AutoCompleteWindow.py rename to Lib/idlelib/autocomplete_w.py --- a/Lib/idlelib/AutoCompleteWindow.py +++ b/Lib/idlelib/autocomplete_w.py @@ -1,9 +1,9 @@ """ -An auto-completion window for IDLE, used by the AutoComplete extension +An auto-completion window for IDLE, used by the autocomplete extension """ from tkinter import * -from idlelib.MultiCall import MC_SHIFT -from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES +from idlelib.multicall import MC_SHIFT +from idlelib.autocomplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES HIDE_VIRTUAL_EVENT_NAME = "<>" HIDE_SEQUENCES = ("", "") @@ -34,8 +34,8 @@ self.completions = None # A list with more completions, or None self.morecompletions = None - # The completion mode. Either AutoComplete.COMPLETE_ATTRIBUTES or - # AutoComplete.COMPLETE_FILES + # The completion mode. Either autocomplete.COMPLETE_ATTRIBUTES or + # autocomplete.COMPLETE_FILES self.mode = None # The current completion start, on the text box (a string) self.start = None diff --git a/Lib/idlelib/AutoExpand.py b/Lib/idlelib/autoexpand.py rename from Lib/idlelib/AutoExpand.py rename to Lib/idlelib/autoexpand.py diff --git a/Lib/idlelib/ClassBrowser.py b/Lib/idlelib/browser.py rename from Lib/idlelib/ClassBrowser.py rename to Lib/idlelib/browser.py --- a/Lib/idlelib/ClassBrowser.py +++ b/Lib/idlelib/browser.py @@ -14,13 +14,13 @@ import sys import pyclbr -from idlelib import PyShell -from idlelib.WindowList import ListedToplevel -from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas -from idlelib.configHandler import idleConf +from idlelib import pyshell +from idlelib.windows import ListedToplevel +from idlelib.tree import TreeNode, TreeItem, ScrolledCanvas +from idlelib.config import idleConf file_open = None # Method...Item and Class...Item use this. -# Normally PyShell.flist.open, but there is no PyShell.flist for htest. +# Normally pyshell.flist.open, but there is no pyshell.flist for htest. class ClassBrowser: @@ -32,7 +32,7 @@ """ global file_open if not _htest: - file_open = PyShell.flist.open + file_open = pyshell.flist.open self.name = name self.file = os.path.join(path[0], self.name + ".py") self._htest = _htest @@ -95,7 +95,7 @@ return if not os.path.exists(self.file): return - PyShell.flist.open(self.file) + pyshell.flist.open(self.file) def IsExpandable(self): return os.path.normcase(self.file[-3:]) == ".py" @@ -226,7 +226,7 @@ file = sys.argv[0] dir, file = os.path.split(file) name = os.path.splitext(file)[0] - flist = PyShell.PyShellFileList(parent) + flist = pyshell.PyShellFileList(parent) global file_open file_open = flist.open ClassBrowser(flist, name, [dir], _htest=True) diff --git a/Lib/idlelib/CallTipWindow.py b/Lib/idlelib/calltip_w.py rename from Lib/idlelib/CallTipWindow.py rename to Lib/idlelib/calltip_w.py --- a/Lib/idlelib/CallTipWindow.py +++ b/Lib/idlelib/calltip_w.py @@ -1,7 +1,7 @@ """A CallTip window class for Tkinter/IDLE. -After ToolTip.py, which uses ideas gleaned from PySol -Used by the CallTips IDLE extension. +After tooltip.py, which uses ideas gleaned from PySol +Used by the calltips IDLE extension. """ from tkinter import Toplevel, Label, LEFT, SOLID, TclError diff --git a/Lib/idlelib/CallTips.py b/Lib/idlelib/calltips.py rename from Lib/idlelib/CallTips.py rename to Lib/idlelib/calltips.py --- a/Lib/idlelib/CallTips.py +++ b/Lib/idlelib/calltips.py @@ -1,4 +1,4 @@ -"""CallTips.py - An IDLE Extension to Jog Your Memory +"""calltips.py - An IDLE Extension to Jog Your Memory Call Tips are floating windows which display function, class, and method parameter and docstring information when you type an opening parenthesis, and @@ -12,8 +12,8 @@ import textwrap import types -from idlelib import CallTipWindow -from idlelib.HyperParser import HyperParser +from idlelib import calltip_w +from idlelib.hyperparser import HyperParser class CallTips: @@ -37,7 +37,7 @@ def _make_tk_calltip_window(self): # See __init__ for usage - return CallTipWindow.CallTip(self.text) + return calltip_w.CallTip(self.text) def _remove_calltip_window(self, event=None): if self.active_calltip: diff --git a/Lib/idlelib/CodeContext.py b/Lib/idlelib/codecontext.py rename from Lib/idlelib/CodeContext.py rename to Lib/idlelib/codecontext.py --- a/Lib/idlelib/CodeContext.py +++ b/Lib/idlelib/codecontext.py @@ -1,11 +1,11 @@ -"""CodeContext - Extension to display the block context above the edit window +"""codecontext - Extension to display the block context above the edit window Once code has scrolled off the top of a window, it can be difficult to determine which block you are in. This extension implements a pane at the top of each IDLE edit window which provides block structure hints. These hints are the lines which contain the block opening keywords, e.g. 'if', for the enclosing block. The number of hint lines is determined by the numlines -variable in the CodeContext section of config-extensions.def. Lines which do +variable in the codecontext section of config-extensions.def. Lines which do not open blocks are not shown in the context hints pane. """ @@ -13,7 +13,7 @@ from tkinter.constants import TOP, LEFT, X, W, SUNKEN import re from sys import maxsize as INFINITY -from idlelib.configHandler import idleConf +from idlelib.config import idleConf BLOCKOPENERS = {"class", "def", "elif", "else", "except", "finally", "for", "if", "try", "while", "with"} diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/colorizer.py rename from Lib/idlelib/ColorDelegator.py rename to Lib/idlelib/colorizer.py --- a/Lib/idlelib/ColorDelegator.py +++ b/Lib/idlelib/colorizer.py @@ -2,8 +2,8 @@ import re import keyword import builtins -from idlelib.Delegator import Delegator -from idlelib.configHandler import idleConf +from idlelib.delegator import Delegator +from idlelib.config import idleConf DEBUG = False @@ -235,7 +235,7 @@ def _color_delegator(parent): # htest # from tkinter import Toplevel, Text - from idlelib.Percolator import Percolator + from idlelib.percolator import Percolator top = Toplevel(parent) top.title("Test ColorDelegator") diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/config.py rename from Lib/idlelib/configHandler.py rename to Lib/idlelib/config.py --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/config.py @@ -7,7 +7,7 @@ and if a file becomes empty, it will be deleted. The contents of the user files may be altered using the Options/Configure IDLE -menu to access the configuration GUI (configDialog.py), or manually. +menu to access the configuration GUI (configdialog.py), or manually. Throughout this module there is an emphasis on returning useable defaults when a problem occurs in returning a requested configuration value back to @@ -230,7 +230,7 @@ return self.userCfg[configType].Get(section, option, type=type, raw=raw) except ValueError: - warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n' + warning = ('\n Warning: config.py - IdleConf.GetOption -\n' ' invalid %r value for configuration option %r\n' ' from section %r: %r' % (type, option, section, @@ -247,7 +247,7 @@ pass #returning default, print warning if warn_on_default: - warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n' + warning = ('\n Warning: config.py - IdleConf.GetOption -\n' ' problem retrieving configuration option %r\n' ' from section %r.\n' ' returning default value: %r' % @@ -358,7 +358,7 @@ for element in theme: if not cfgParser.has_option(themeName, element): # Print warning that will return a default color - warning = ('\n Warning: configHandler.IdleConf.GetThemeDict' + warning = ('\n Warning: config.IdleConf.GetThemeDict' ' -\n problem retrieving theme element %r' '\n from theme %r.\n' ' returning default color: %r' % @@ -644,7 +644,7 @@ if binding: keyBindings[event] = binding else: #we are going to return a default, print warning - warning=('\n Warning: configHandler.py - IdleConf.GetCoreKeys' + warning=('\n Warning: config.py - IdleConf.GetCoreKeys' ' -\n problem retrieving key binding for event %r' '\n from key set %r.\n' ' returning default value: %r' % diff --git a/Lib/idlelib/configHelpSourceEdit.py b/Lib/idlelib/config_help.py rename from Lib/idlelib/configHelpSourceEdit.py rename to Lib/idlelib/config_help.py diff --git a/Lib/idlelib/keybindingDialog.py b/Lib/idlelib/config_key.py rename from Lib/idlelib/keybindingDialog.py rename to Lib/idlelib/config_key.py diff --git a/Lib/idlelib/configSectionNameDialog.py b/Lib/idlelib/config_sec.py rename from Lib/idlelib/configSectionNameDialog.py rename to Lib/idlelib/config_sec.py --- a/Lib/idlelib/configSectionNameDialog.py +++ b/Lib/idlelib/config_sec.py @@ -1,7 +1,7 @@ """ Dialog that allows user to specify a new config file section name. Used to get new highlight theme and keybinding set names. -The 'return value' for the dialog, used two placed in configDialog.py, +The 'return value' for the dialog, used two placed in configdialog.py, is the .result attribute set in the Ok and Cancel methods. """ from tkinter import * diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configdialog.py rename from Lib/idlelib/configDialog.py rename to Lib/idlelib/configdialog.py --- a/Lib/idlelib/configDialog.py +++ b/Lib/idlelib/configdialog.py @@ -14,14 +14,14 @@ import tkinter.colorchooser as tkColorChooser import tkinter.font as tkFont -from idlelib.configHandler import idleConf -from idlelib.dynOptionMenuWidget import DynOptionMenu -from idlelib.keybindingDialog import GetKeysDialog -from idlelib.configSectionNameDialog import GetCfgSectionNameDialog -from idlelib.configHelpSourceEdit import GetHelpSourceDialog +from idlelib.config import idleConf +from idlelib.dynoption import DynOptionMenu +from idlelib.config_key import GetKeysDialog +from idlelib.config_sec import GetCfgSectionNameDialog +from idlelib.config_help import GetHelpSourceDialog from idlelib.tabbedpages import TabbedPageSet -from idlelib.textView import view_text -from idlelib import macosxSupport +from idlelib.textview import view_text +from idlelib import macosx class ConfigDialog(Toplevel): @@ -91,7 +91,7 @@ self.create_action_buttons().pack(side=BOTTOM) def create_action_buttons(self): - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): # Changing the default padding on OSX results in unreadable # text in the buttons paddingArgs = {} diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/debugger.py rename from Lib/idlelib/Debugger.py rename to Lib/idlelib/debugger.py --- a/Lib/idlelib/Debugger.py +++ b/Lib/idlelib/debugger.py @@ -1,9 +1,9 @@ import os import bdb from tkinter import * -from idlelib.WindowList import ListedToplevel -from idlelib.ScrolledList import ScrolledList -from idlelib import macosxSupport +from idlelib.windows import ListedToplevel +from idlelib.scrolledlist import ScrolledList +from idlelib import macosx class Idb(bdb.Bdb): @@ -34,8 +34,10 @@ return True else: prev_frame = frame.f_back - if prev_frame.f_code.co_filename.count('Debugger.py'): - # (that test will catch both Debugger.py and RemoteDebugger.py) + prev_name = prev_frame.f_code.co_filename + if 'idlelib' in prev_name and 'debugger' in prev_name: + # catch both idlelib/debugger.py and idlelib/debugger_r.py + # on both posix and windows return False return self.in_rpc_code(prev_frame) @@ -370,7 +372,7 @@ class StackViewer(ScrolledList): def __init__(self, master, flist, gui): - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): # At least on with the stock AquaTk version on OSX 10.4 you'll # get a shaking GUI that eventually kills IDLE if the width # argument is specified. @@ -502,7 +504,7 @@ # # There is also an obscure bug in sorted(dict) where the # interpreter gets into a loop requesting non-existing dict[0], - # dict[1], dict[2], etc from the RemoteDebugger.DictProxy. + # dict[1], dict[2], etc from the debugger_r.DictProxy. ### keys_list = dict.keys() names = sorted(keys_list) diff --git a/Lib/idlelib/RemoteDebugger.py b/Lib/idlelib/debugger_r.py rename from Lib/idlelib/RemoteDebugger.py rename to Lib/idlelib/debugger_r.py --- a/Lib/idlelib/RemoteDebugger.py +++ b/Lib/idlelib/debugger_r.py @@ -21,7 +21,7 @@ """ import types -from idlelib import Debugger +from idlelib import debugger debugging = 0 @@ -187,7 +187,7 @@ """ gui_proxy = GUIProxy(rpchandler, gui_adap_oid) - idb = Debugger.Idb(gui_proxy) + idb = debugger.Idb(gui_proxy) idb_adap = IdbAdapter(idb) rpchandler.register(idb_adap_oid, idb_adap) return idb_adap_oid @@ -362,7 +362,7 @@ idb_adap_oid = rpcclt.remotecall("exec", "start_the_debugger",\ (gui_adap_oid,), {}) idb_proxy = IdbProxy(rpcclt, pyshell, idb_adap_oid) - gui = Debugger.Debugger(pyshell, idb_proxy) + gui = debugger.Debugger(pyshell, idb_proxy) gui_adap = GUIAdapter(rpcclt, gui) rpcclt.register(gui_adap_oid, gui_adap) return gui @@ -373,7 +373,7 @@ Request that the RPCServer shut down the subprocess debugger and link. Unregister the GUIAdapter, which will cause a GC on the Idle process debugger and RPC link objects. (The second reference to the debugger GUI - is deleted in PyShell.close_remote_debugger().) + is deleted in pyshell.close_remote_debugger().) """ close_subprocess_debugger(rpcclt) diff --git a/Lib/idlelib/ObjectBrowser.py b/Lib/idlelib/debugobj.py rename from Lib/idlelib/ObjectBrowser.py rename to Lib/idlelib/debugobj.py --- a/Lib/idlelib/ObjectBrowser.py +++ b/Lib/idlelib/debugobj.py @@ -11,7 +11,7 @@ import re -from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas +from idlelib.tree import TreeItem, TreeNode, ScrolledCanvas from reprlib import Repr @@ -126,7 +126,7 @@ import sys from tkinter import Tk root = Tk() - root.title("Test ObjectBrowser") + root.title("Test debug object browser") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) root.geometry("+%d+%d"%(x, y + 150)) root.configure(bd=0, bg="yellow") diff --git a/Lib/idlelib/RemoteObjectBrowser.py b/Lib/idlelib/debugobj_r.py rename from Lib/idlelib/RemoteObjectBrowser.py rename to Lib/idlelib/debugobj_r.py diff --git a/Lib/idlelib/Delegator.py b/Lib/idlelib/delegator.py rename from Lib/idlelib/Delegator.py rename to Lib/idlelib/delegator.py diff --git a/Lib/idlelib/dynOptionMenuWidget.py b/Lib/idlelib/dynoption.py rename from Lib/idlelib/dynOptionMenuWidget.py rename to Lib/idlelib/dynoption.py diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/editor.py rename from Lib/idlelib/EditorWindow.py rename to Lib/idlelib/editor.py --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/editor.py @@ -12,15 +12,15 @@ import traceback import webbrowser -from idlelib.MultiCall import MultiCallCreator -from idlelib import WindowList -from idlelib import SearchDialog -from idlelib import GrepDialog -from idlelib import ReplaceDialog -from idlelib import PyParse -from idlelib.configHandler import idleConf -from idlelib import aboutDialog, textView, configDialog -from idlelib import macosxSupport +from idlelib.multicall import MultiCallCreator +from idlelib import windows +from idlelib import search +from idlelib import grep +from idlelib import replace +from idlelib import pyparse +from idlelib.config import idleConf +from idlelib import help_about, textview, configdialog +from idlelib import macosx from idlelib import help # The default tab setting for a Text widget, in average-width characters. @@ -67,7 +67,7 @@ def show_dialog(self, parent): self.parent = parent fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') - self.dlg = dlg = textView.view_file(parent,'Help',fn, modal=False) + self.dlg = dlg = textview.view_file(parent,'Help',fn, modal=False) dlg.bind('', self.destroy, '+') def nearwindow(self, near): @@ -89,13 +89,13 @@ class EditorWindow(object): - from idlelib.Percolator import Percolator - from idlelib.ColorDelegator import ColorDelegator - from idlelib.UndoDelegator import UndoDelegator - from idlelib.IOBinding import IOBinding, filesystemencoding, encoding - from idlelib import Bindings + from idlelib.percolator import Percolator + from idlelib.colorizer import ColorDelegator + from idlelib.undo import UndoDelegator + from idlelib.iomenu import IOBinding, filesystemencoding, encoding + from idlelib import mainmenu from tkinter import Toplevel - from idlelib.MultiStatusBar import MultiStatusBar + from idlelib.statusbar import MultiStatusBar help_url = None @@ -136,11 +136,11 @@ except AttributeError: sys.ps1 = '>>> ' self.menubar = Menu(root) - self.top = top = WindowList.ListedToplevel(root, menu=self.menubar) + self.top = top = windows.ListedToplevel(root, menu=self.menubar) if flist: self.tkinter_vars = flist.vars #self.top.instance_dict makes flist.inversedict available to - #configDialog.py so it can access all EditorWindow instances + #configdialog.py so it can access all EditorWindow instances self.top.instance_dict = flist.inversedict else: self.tkinter_vars = {} # keys: Tkinter event names @@ -173,7 +173,7 @@ self.top.protocol("WM_DELETE_WINDOW", self.close) self.top.bind("<>", self.close_event) - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): # Command-W on editorwindows doesn't work without this. text.bind('<>', self.close_event) # Some OS X systems have only one mouse button, so use @@ -309,7 +309,7 @@ menu.add_separator() end = end + 1 self.wmenu_end = end - WindowList.register_callback(self.postwindowsmenu) + windows.register_callback(self.postwindowsmenu) # Some abstractions so IDLE extensions are cross-IDE self.askyesno = tkMessageBox.askyesno @@ -418,7 +418,7 @@ underline, label = prepstr(label) menudict[name] = menu = Menu(mbar, name=name, tearoff=0) mbar.add_cascade(label=label, menu=menu, underline=underline) - if macosxSupport.isCarbonTk(): + if macosx.isCarbonTk(): # Insert the application menu menudict['application'] = menu = Menu(mbar, name='apple', tearoff=0) @@ -439,7 +439,7 @@ end = -1 if end > self.wmenu_end: menu.delete(self.wmenu_end+1, end) - WindowList.add_windows_to_menu(menu) + windows.add_windows_to_menu(menu) rmenu = None @@ -507,17 +507,17 @@ def about_dialog(self, event=None): "Handle Help 'About IDLE' event." - # Synchronize with macosxSupport.overrideRootMenu.about_dialog. - aboutDialog.AboutDialog(self.top,'About IDLE') + # Synchronize with macosx.overrideRootMenu.about_dialog. + help_about.AboutDialog(self.top,'About IDLE') def config_dialog(self, event=None): "Handle Options 'Configure IDLE' event." - # Synchronize with macosxSupport.overrideRootMenu.config_dialog. - configDialog.ConfigDialog(self.top,'Settings') + # Synchronize with macosx.overrideRootMenu.config_dialog. + configdialog.ConfigDialog(self.top,'Settings') def help_dialog(self, event=None): "Handle Help 'IDLE Help' event." - # Synchronize with macosxSupport.overrideRootMenu.help_dialog. + # Synchronize with macosx.overrideRootMenu.help_dialog. if self.root: parent = self.root else: @@ -590,23 +590,23 @@ return "break" def find_event(self, event): - SearchDialog.find(self.text) + search.find(self.text) return "break" def find_again_event(self, event): - SearchDialog.find_again(self.text) + search.find_again(self.text) return "break" def find_selection_event(self, event): - SearchDialog.find_selection(self.text) + search.find_selection(self.text) return "break" def find_in_files_event(self, event): - GrepDialog.grep(self.text, self.io, self.flist) + grep.grep(self.text, self.io, self.flist) return "break" def replace_event(self, event): - ReplaceDialog.replace(self.text) + replace.replace(self.text) return "break" def goto_line_event(self, event): @@ -673,12 +673,12 @@ return head, tail = os.path.split(filename) base, ext = os.path.splitext(tail) - from idlelib import ClassBrowser - ClassBrowser.ClassBrowser(self.flist, base, [head]) + from idlelib import browser + browser.ClassBrowser(self.flist, base, [head]) def open_path_browser(self, event=None): - from idlelib import PathBrowser - PathBrowser.PathBrowser(self.flist) + from idlelib import pathbrowser + pathbrowser.PathBrowser(self.flist) def open_turtle_demo(self, event = None): import subprocess @@ -739,7 +739,7 @@ def ResetColorizer(self): "Update the color theme" - # Called from self.filename_change_hook and from configDialog.py + # Called from self.filename_change_hook and from configdialog.py self._rmcolorizer() self._addcolorizer() theme = idleConf.CurrentTheme() @@ -772,14 +772,14 @@ def ResetFont(self): "Update the text widgets' font if it is changed" - # Called from configDialog.py + # Called from configdialog.py self.text['font'] = idleConf.GetFont(self.root, 'main','EditorWindow') def RemoveKeybindings(self): "Remove the keybindings before they are changed." - # Called from configDialog.py - self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet() + # Called from configdialog.py + self.mainmenu.default_keydefs = keydefs = idleConf.GetCurrentKeySet() for event, keylist in keydefs.items(): self.text.event_delete(event, *keylist) for extensionName in self.get_standard_extension_names(): @@ -790,8 +790,8 @@ def ApplyKeybindings(self): "Update the keybindings after they are changed" - # Called from configDialog.py - self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet() + # Called from configdialog.py + self.mainmenu.default_keydefs = keydefs = idleConf.GetCurrentKeySet() self.apply_bindings() for extensionName in self.get_standard_extension_names(): xkeydefs = idleConf.GetExtensionBindings(extensionName) @@ -799,7 +799,7 @@ self.apply_bindings(xkeydefs) #update menu accelerators menuEventDict = {} - for menu in self.Bindings.menudefs: + for menu in self.mainmenu.menudefs: menuEventDict[menu[0]] = {} for item in menu[1]: if item: @@ -826,7 +826,7 @@ def set_notabs_indentwidth(self): "Update the indentwidth if changed and not using tabs in this window" - # Called from configDialog.py + # Called from configdialog.py if not self.usetabs: self.indentwidth = idleConf.GetOption('main', 'Indent','num-spaces', type='int') @@ -1006,7 +1006,7 @@ def _close(self): if self.io.filename: self.update_recent_files_list(new_file=self.io.filename) - WindowList.unregister_callback(self.postwindowsmenu) + windows.unregister_callback(self.postwindowsmenu) self.unload_extensions() self.io.close() self.io = None @@ -1044,12 +1044,25 @@ def get_standard_extension_names(self): return idleConf.GetExtensions(editor_only=True) + extfiles = { # map config-extension section names to new file names + 'AutoComplete': 'autocomplete', + 'AutoExpand': 'autoexpand', + 'CallTips': 'calltips', + 'CodeContext': 'codecontext', + 'FormatParagraph': 'paragraph', + 'ParenMatch': 'parenmatch', + 'RstripExtension': 'rstrip', + 'ScriptBinding': 'runscript', + 'ZoomHeight': 'zoomheight', + } + def load_extension(self, name): + fname = self.extfiles.get(name, name) try: try: - mod = importlib.import_module('.' + name, package=__package__) + mod = importlib.import_module('.' + fname, package=__package__) except (ImportError, TypeError): - mod = importlib.import_module(name) + mod = importlib.import_module(fname) except ImportError: print("\nFailed to import extension: ", name) raise @@ -1073,7 +1086,7 @@ def apply_bindings(self, keydefs=None): if keydefs is None: - keydefs = self.Bindings.default_keydefs + keydefs = self.mainmenu.default_keydefs text = self.text text.keydefs = keydefs for event, keylist in keydefs.items(): @@ -1086,9 +1099,9 @@ Menus that are absent or None in self.menudict are ignored. """ if menudefs is None: - menudefs = self.Bindings.menudefs + menudefs = self.mainmenu.menudefs if keydefs is None: - keydefs = self.Bindings.default_keydefs + keydefs = self.mainmenu.default_keydefs menudict = self.menudict text = self.text for mname, entrylist in menudefs: @@ -1315,7 +1328,7 @@ # adjust indentation for continuations and block # open/close first need to find the last stmt lno = index2line(text.index('insert')) - y = PyParse.Parser(self.indentwidth, self.tabwidth) + y = pyparse.Parser(self.indentwidth, self.tabwidth) if not self.context_use_ps1: for context in self.num_context_lines: startat = max(lno - context, 1) @@ -1339,22 +1352,22 @@ y.set_lo(0) c = y.get_continuation_type() - if c != PyParse.C_NONE: + if c != pyparse.C_NONE: # The current stmt hasn't ended yet. - if c == PyParse.C_STRING_FIRST_LINE: + if c == pyparse.C_STRING_FIRST_LINE: # after the first line of a string; do not indent at all pass - elif c == PyParse.C_STRING_NEXT_LINES: + elif c == pyparse.C_STRING_NEXT_LINES: # inside a string which started before this line; # just mimic the current indent text.insert("insert", indent) - elif c == PyParse.C_BRACKET: + elif c == pyparse.C_BRACKET: # line up with the first (if any) element of the # last open bracket structure; else indent one # level beyond the indent of the line with the # last open bracket self.reindent_to(y.compute_bracket_indent()) - elif c == PyParse.C_BACKSLASH: + elif c == pyparse.C_BACKSLASH: # if more than one line in this stmt already, just # mimic the current indent; else if initial line # has a start on an assignment stmt, indent to @@ -1657,7 +1670,7 @@ keylist = keydefs.get(eventname) # issue10940: temporary workaround to prevent hang with OS X Cocoa Tk 8.5 # if not keylist: - if (not keylist) or (macosxSupport.isCocoaTk() and eventname in { + if (not keylist) or (macosx.isCocoaTk() and eventname in { "<>", "<>", "<>"}): @@ -1692,7 +1705,7 @@ filename = sys.argv[1] else: filename = None - macosxSupport.setupApp(root, None) + macosx.setupApp(root, None) edit = EditorWindow(root=root, filename=filename) edit.text.bind("<>", edit.close_event) # Does not stop error, neither does following diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/filelist.py rename from Lib/idlelib/FileList.py rename to Lib/idlelib/filelist.py --- a/Lib/idlelib/FileList.py +++ b/Lib/idlelib/filelist.py @@ -6,7 +6,7 @@ class FileList: # N.B. this import overridden in PyShellFileList. - from idlelib.EditorWindow import EditorWindow + from idlelib.editor import EditorWindow def __init__(self, root): self.root = root @@ -111,7 +111,7 @@ def _test(): - from idlelib.EditorWindow import fixwordbreaks + from idlelib.editor import fixwordbreaks import sys root = Tk() fixwordbreaks(root) diff --git a/Lib/idlelib/GrepDialog.py b/Lib/idlelib/grep.py rename from Lib/idlelib/GrepDialog.py rename to Lib/idlelib/grep.py --- a/Lib/idlelib/GrepDialog.py +++ b/Lib/idlelib/grep.py @@ -4,14 +4,14 @@ import sys from tkinter import StringVar, BooleanVar, Checkbutton # for GrepDialog from tkinter import Tk, Text, Button, SEL, END # for htest -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import searchengine +from idlelib.searchbase import SearchDialogBase # Importing OutputWindow fails due to import loop # EditorWindow -> GrepDialop -> OutputWindow -> EditorWindow def grep(text, io=None, flist=None): root = text._root() - engine = SearchEngine.get(root) + engine = searchengine.get(root) if not hasattr(engine, "_grepdialog"): engine._grepdialog = GrepDialog(root, engine, flist) dialog = engine._grepdialog @@ -67,7 +67,7 @@ if not path: self.top.bell() return - from idlelib.OutputWindow import OutputWindow # leave here! + from idlelib.outwin import OutputWindow # leave here! save = sys.stdout try: sys.stdout = OutputWindow(self.flist) @@ -131,7 +131,7 @@ def _grep_dialog(parent): # htest # - from idlelib.PyShell import PyShellFileList + from idlelib.pyshell import PyShellFileList root = Tk() root.title("Test GrepDialog") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py --- a/Lib/idlelib/help.py +++ b/Lib/idlelib/help.py @@ -4,7 +4,7 @@ Help => About IDLE: diplay About Idle dialog - + Help => IDLE Help: Display help.html with proper formatting. @@ -28,7 +28,7 @@ from os.path import abspath, dirname, isfile, join from tkinter import Toplevel, Frame, Text, Scrollbar, Menu, Menubutton from tkinter import font as tkfont -from idlelib.configHandler import idleConf +from idlelib.config import idleConf use_ttk = False # until available to import if use_ttk: diff --git a/Lib/idlelib/aboutDialog.py b/Lib/idlelib/help_about.py rename from Lib/idlelib/aboutDialog.py rename to Lib/idlelib/help_about.py --- a/Lib/idlelib/aboutDialog.py +++ b/Lib/idlelib/help_about.py @@ -5,7 +5,7 @@ import os from sys import version from tkinter import * -from idlelib import textView +from idlelib import textview class AboutDialog(Toplevel): """Modal about dialog for idle @@ -135,11 +135,11 @@ def display_printer_text(self, title, printer): printer._Printer__setup() text = '\n'.join(printer._Printer__lines) - textView.view_text(self, title, text) + textview.view_text(self, title, text) def display_file_text(self, title, filename, encoding=None): fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), filename) - textView.view_file(self, title, fn, encoding) + textview.view_file(self, title, fn, encoding) def Ok(self, event=None): self.destroy() diff --git a/Lib/idlelib/IdleHistory.py b/Lib/idlelib/history.py rename from Lib/idlelib/IdleHistory.py rename to Lib/idlelib/history.py --- a/Lib/idlelib/IdleHistory.py +++ b/Lib/idlelib/history.py @@ -1,11 +1,11 @@ "Implement Idle Shell history mechanism with History class" -from idlelib.configHandler import idleConf +from idlelib.config import idleConf class History: ''' Implement Idle Shell history mechanism. - store - Store source statement (called from PyShell.resetoutput). + store - Store source statement (called from pyshell.resetoutput). fetch - Fetch stored statement matching prefix already entered. history_next - Bound to <> event (default Alt-N). history_prev - Bound to <> event (default Alt-P). diff --git a/Lib/idlelib/HyperParser.py b/Lib/idlelib/hyperparser.py rename from Lib/idlelib/HyperParser.py rename to Lib/idlelib/hyperparser.py --- a/Lib/idlelib/HyperParser.py +++ b/Lib/idlelib/hyperparser.py @@ -7,7 +7,7 @@ import string from keyword import iskeyword -from idlelib import PyParse +from idlelib import pyparse # all ASCII chars that may be in an identifier @@ -30,7 +30,7 @@ self.editwin = editwin self.text = text = editwin.text - parser = PyParse.Parser(editwin.indentwidth, editwin.tabwidth) + parser = pyparse.Parser(editwin.indentwidth, editwin.tabwidth) def index2line(index): return int(float(index)) diff --git a/Lib/idlelib/idle.py b/Lib/idlelib/idle.py --- a/Lib/idlelib/idle.py +++ b/Lib/idlelib/idle.py @@ -7,5 +7,5 @@ idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, idlelib_dir) -import idlelib.PyShell -idlelib.PyShell.main() +import idlelib.pyshell +idlelib.pyshell.main() diff --git a/Lib/idlelib/idle.pyw b/Lib/idlelib/idle.pyw --- a/Lib/idlelib/idle.pyw +++ b/Lib/idlelib/idle.pyw @@ -1,10 +1,10 @@ try: - import idlelib.PyShell + import idlelib.pyshell except ImportError: - # IDLE is not installed, but maybe PyShell is on sys.path: - from . import PyShell + # IDLE is not installed, but maybe pyshell is on sys.path: + from . import pyshell import os - idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) + idledir = os.path.dirname(os.path.abspath(pyshell.__file__)) if idledir != os.getcwd(): # We're not in the IDLE directory, help the subprocess find run.py pypath = os.environ.get('PYTHONPATH', '') @@ -12,6 +12,6 @@ os.environ['PYTHONPATH'] = pypath + ':' + idledir else: os.environ['PYTHONPATH'] = idledir - PyShell.main() + pyshell.main() else: - idlelib.PyShell.main() + idlelib.pyshell.main() diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py --- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -59,19 +59,19 @@ Modules and classes not being tested at the moment: -PyShell.PyShellEditorWindow -Debugger.Debugger -AutoCompleteWindow.AutoCompleteWindow -OutputWindow.OutputWindow (indirectly being tested with grep test) +pyshell.PyShellEditorWindow +debugger.Debugger +autocomplete_w.AutoCompleteWindow +outwin.OutputWindow (indirectly being tested with grep test) ''' from importlib import import_module -from idlelib.macosxSupport import _initializeTkVariantTests +from idlelib.macosx import _initializeTkVariantTests import tkinter as tk AboutDialog_spec = { - 'file': 'aboutDialog', - 'kwds': {'title': 'aboutDialog test', + 'file': 'help_about', + 'kwds': {'title': 'help_about test', '_htest': True, }, 'msg': "Test every button. Ensure Python, TK and IDLE versions " @@ -79,14 +79,14 @@ } _calltip_window_spec = { - 'file': 'CallTipWindow', + 'file': 'calltip_w', 'kwds': {}, 'msg': "Typing '(' should display a calltip.\n" "Typing ') should hide the calltip.\n" } _class_browser_spec = { - 'file': 'ClassBrowser', + 'file': 'browser', 'kwds': {}, 'msg': "Inspect names of module, class(with superclass if " "applicable), methods and functions.\nToggle nested items.\n" @@ -95,7 +95,7 @@ } _color_delegator_spec = { - 'file': 'ColorDelegator', + 'file': 'colorizer', 'kwds': {}, 'msg': "The text is sample Python code.\n" "Ensure components like comments, keywords, builtins,\n" @@ -104,7 +104,7 @@ } ConfigDialog_spec = { - 'file': 'configDialog', + 'file': 'configdialog', 'kwds': {'title': 'ConfigDialogTest', '_htest': True,}, 'msg': "IDLE preferences dialog.\n" @@ -121,7 +121,7 @@ # TODO Improve message _dyn_option_menu_spec = { - 'file': 'dynOptionMenuWidget', + 'file': 'dynoption', 'kwds': {}, 'msg': "Select one of the many options in the 'old option set'.\n" "Click the button to change the option set.\n" @@ -130,14 +130,14 @@ # TODO edit wrapper _editor_window_spec = { - 'file': 'EditorWindow', + 'file': 'editor', 'kwds': {}, 'msg': "Test editor functions of interest.\n" "Best to close editor first." } GetCfgSectionNameDialog_spec = { - 'file': 'configSectionNameDialog', + 'file': 'config_sec', 'kwds': {'title':'Get Name', 'message':'Enter something', 'used_names': {'abc'}, @@ -149,7 +149,7 @@ } GetHelpSourceDialog_spec = { - 'file': 'configHelpSourceEdit', + 'file': 'config_help', 'kwds': {'title': 'Get helpsource', '_htest': True}, 'msg': "Enter menu item name and help file path\n " @@ -162,7 +162,7 @@ # Update once issue21519 is resolved. GetKeysDialog_spec = { - 'file': 'keybindingDialog', + 'file': 'config_key', 'kwds': {'title': 'Test keybindings', 'action': 'find-again', 'currentKeySequences': [''] , @@ -177,7 +177,7 @@ } _grep_dialog_spec = { - 'file': 'GrepDialog', + 'file': 'grep', 'kwds': {}, 'msg': "Click the 'Show GrepDialog' button.\n" "Test the various 'Find-in-files' functions.\n" @@ -187,7 +187,7 @@ } _io_binding_spec = { - 'file': 'IOBinding', + 'file': 'iomenu', 'kwds': {}, 'msg': "Test the following bindings.\n" " to open file from dialog.\n" @@ -200,7 +200,7 @@ } _multi_call_spec = { - 'file': 'MultiCall', + 'file': 'multicall', 'kwds': {}, 'msg': "The following actions should trigger a print to console or IDLE" " Shell.\nEntering and leaving the text area, key entry, " @@ -210,14 +210,14 @@ } _multistatus_bar_spec = { - 'file': 'MultiStatusBar', + 'file': 'statusbar', 'kwds': {}, 'msg': "Ensure presence of multi-status bar below text area.\n" "Click 'Update Status' to change the multi-status text" } _object_browser_spec = { - 'file': 'ObjectBrowser', + 'file': 'debugobj', 'kwds': {}, 'msg': "Double click on items upto the lowest level.\n" "Attributes of the objects and related information " @@ -225,7 +225,7 @@ } _path_browser_spec = { - 'file': 'PathBrowser', + 'file': 'pathbrowser', 'kwds': {}, 'msg': "Test for correct display of all paths in sys.path.\n" "Toggle nested items upto the lowest level.\n" @@ -234,7 +234,7 @@ } _percolator_spec = { - 'file': 'Percolator', + 'file': 'percolator', 'kwds': {}, 'msg': "There are two tracers which can be toggled using a checkbox.\n" "Toggling a tracer 'on' by checking it should print tracer" @@ -245,7 +245,7 @@ } _replace_dialog_spec = { - 'file': 'ReplaceDialog', + 'file': 'replace', 'kwds': {}, 'msg': "Click the 'Replace' button.\n" "Test various replace options in the 'Replace dialog'.\n" @@ -253,7 +253,7 @@ } _search_dialog_spec = { - 'file': 'SearchDialog', + 'file': 'search', 'kwds': {}, 'msg': "Click the 'Search' button.\n" "Test various search options in the 'Search dialog'.\n" @@ -261,7 +261,7 @@ } _scrolled_list_spec = { - 'file': 'ScrolledList', + 'file': 'scrolledlist', 'kwds': {}, 'msg': "You should see a scrollable list of items\n" "Selecting (clicking) or double clicking an item " @@ -277,7 +277,7 @@ } _stack_viewer_spec = { - 'file': 'StackViewer', + 'file': 'stackviewer', 'kwds': {}, 'msg': "A stacktrace for a NameError exception.\n" "Expand 'idlelib ...' and ''.\n" @@ -295,8 +295,8 @@ } TextViewer_spec = { - 'file': 'textView', - 'kwds': {'title': 'Test textView', + 'file': 'textview', + 'kwds': {'title': 'Test textview', 'text':'The quick brown fox jumps over the lazy dog.\n'*35, '_htest': True}, 'msg': "Test for read-only property of text.\n" @@ -304,21 +304,21 @@ } _tooltip_spec = { - 'file': 'ToolTip', + 'file': 'tooltip', 'kwds': {}, 'msg': "Place mouse cursor over both the buttons\n" "A tooltip should appear with some text." } _tree_widget_spec = { - 'file': 'TreeWidget', + 'file': 'tree', 'kwds': {}, 'msg': "The canvas is scrollable.\n" "Click on folders upto to the lowest level." } _undo_delegator_spec = { - 'file': 'UndoDelegator', + 'file': 'undo', 'kwds': {}, 'msg': "Click [Undo] to undo any action.\n" "Click [Redo] to redo any action.\n" @@ -327,7 +327,7 @@ } _widget_redirector_spec = { - 'file': 'WidgetRedirector', + 'file': 'redirector', 'kwds': {}, 'msg': "Every text insert should be printed to the console." "or the IDLE shell." diff --git a/Lib/idlelib/idle_test/mock_idle.py b/Lib/idlelib/idle_test/mock_idle.py --- a/Lib/idlelib/idle_test/mock_idle.py +++ b/Lib/idlelib/idle_test/mock_idle.py @@ -33,7 +33,7 @@ class Editor: - '''Minimally imitate EditorWindow.EditorWindow class. + '''Minimally imitate editor.EditorWindow class. ''' def __init__(self, flist=None, filename=None, key=None, root=None): self.text = Text() @@ -46,7 +46,7 @@ class UndoDelegator: - '''Minimally imitate UndoDelegator,UndoDelegator class. + '''Minimally imitate undo.UndoDelegator class. ''' # A real undo block is only needed for user interaction. def undo_block_start(*args): diff --git a/Lib/idlelib/idle_test/test_autocomplete.py b/Lib/idlelib/idle_test/test_autocomplete.py --- a/Lib/idlelib/idle_test/test_autocomplete.py +++ b/Lib/idlelib/idle_test/test_autocomplete.py @@ -2,9 +2,9 @@ from test.support import requires from tkinter import Tk, Text -import idlelib.AutoComplete as ac -import idlelib.AutoCompleteWindow as acw -import idlelib.macosxSupport as mac +import idlelib.autocomplete as ac +import idlelib.autocomplete_w as acw +import idlelib.macosx as mac from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Event diff --git a/Lib/idlelib/idle_test/test_autoexpand.py b/Lib/idlelib/idle_test/test_autoexpand.py --- a/Lib/idlelib/idle_test/test_autoexpand.py +++ b/Lib/idlelib/idle_test/test_autoexpand.py @@ -1,9 +1,9 @@ -"""Unit tests for idlelib.AutoExpand""" +"""Unit tests for idlelib.autoexpand""" import unittest from test.support import requires from tkinter import Text, Tk #from idlelib.idle_test.mock_tk import Text -from idlelib.AutoExpand import AutoExpand +from idlelib.autoexpand import AutoExpand class Dummy_Editwin: diff --git a/Lib/idlelib/idle_test/test_calltips.py b/Lib/idlelib/idle_test/test_calltips.py --- a/Lib/idlelib/idle_test/test_calltips.py +++ b/Lib/idlelib/idle_test/test_calltips.py @@ -1,5 +1,5 @@ import unittest -import idlelib.CallTips as ct +import idlelib.calltips as ct import textwrap import types diff --git a/Lib/idlelib/idle_test/test_config_help.py b/Lib/idlelib/idle_test/test_config_help.py --- a/Lib/idlelib/idle_test/test_config_help.py +++ b/Lib/idlelib/idle_test/test_config_help.py @@ -1,7 +1,7 @@ -"""Unittests for idlelib.configHelpSourceEdit""" +"""Unittests for idlelib.config_help.py""" import unittest from idlelib.idle_test.mock_tk import Var, Mbox, Entry -from idlelib import configHelpSourceEdit as help_dialog_module +from idlelib import config_help as help_dialog_module help_dialog = help_dialog_module.GetHelpSourceDialog diff --git a/Lib/idlelib/idle_test/test_config_name.py b/Lib/idlelib/idle_test/test_config_sec.py rename from Lib/idlelib/idle_test/test_config_name.py rename to Lib/idlelib/idle_test/test_config_sec.py --- a/Lib/idlelib/idle_test/test_config_name.py +++ b/Lib/idlelib/idle_test/test_config_sec.py @@ -1,7 +1,7 @@ -"""Unit tests for idlelib.configSectionNameDialog""" +"""Unit tests for idlelib.config_sec""" import unittest from idlelib.idle_test.mock_tk import Var, Mbox -from idlelib import configSectionNameDialog as name_dialog_module +from idlelib import config_sec as name_dialog_module name_dialog = name_dialog_module.GetCfgSectionNameDialog diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -1,4 +1,4 @@ -'''Unittests for idlelib/configHandler.py +'''Unittests for idlelib/config.py Coverage: 46% just by creating dialog. The other half is change code. @@ -6,8 +6,8 @@ import unittest from test.support import requires from tkinter import Tk -from idlelib.configDialog import ConfigDialog -from idlelib.macosxSupport import _initializeTkVariantTests +from idlelib.configdialog import ConfigDialog +from idlelib.macosx import _initializeTkVariantTests class ConfigDialogTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_delegator.py b/Lib/idlelib/idle_test/test_delegator.py --- a/Lib/idlelib/idle_test/test_delegator.py +++ b/Lib/idlelib/idle_test/test_delegator.py @@ -1,5 +1,5 @@ import unittest -from idlelib.Delegator import Delegator +from idlelib.delegator import Delegator class DelegatorTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_editor.py b/Lib/idlelib/idle_test/test_editor.py --- a/Lib/idlelib/idle_test/test_editor.py +++ b/Lib/idlelib/idle_test/test_editor.py @@ -1,6 +1,6 @@ import unittest from tkinter import Tk, Text -from idlelib.EditorWindow import EditorWindow +from idlelib.editor import EditorWindow from test.support import requires class Editor_func_test(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_grep.py b/Lib/idlelib/idle_test/test_grep.py --- a/Lib/idlelib/idle_test/test_grep.py +++ b/Lib/idlelib/idle_test/test_grep.py @@ -1,5 +1,5 @@ """ !Changing this line will break Test_findfile.test_found! -Non-gui unit tests for idlelib.GrepDialog methods. +Non-gui unit tests for grep.GrepDialog methods. dummy_command calls grep_it calls findfiles. An exception raised in one method will fail callers. Otherwise, tests are mostly independent. @@ -8,7 +8,7 @@ import unittest from test.support import captured_stdout from idlelib.idle_test.mock_tk import Var -from idlelib.GrepDialog import GrepDialog +from idlelib.grep import GrepDialog import re class Dummy_searchengine: @@ -72,7 +72,7 @@ self.assertTrue(lines[4].startswith('(Hint:')) class Default_commandTest(unittest.TestCase): - # To write this, mode OutputWindow import to top of GrepDialog + # To write this, move outwin import to top of GrepDialog # so it can be replaced by captured_stdout in class setup/teardown. pass diff --git a/Lib/idlelib/idle_test/test_idlehistory.py b/Lib/idlelib/idle_test/test_history.py rename from Lib/idlelib/idle_test/test_idlehistory.py rename to Lib/idlelib/idle_test/test_history.py --- a/Lib/idlelib/idle_test/test_idlehistory.py +++ b/Lib/idlelib/idle_test/test_history.py @@ -4,8 +4,8 @@ import tkinter as tk from tkinter import Text as tkText from idlelib.idle_test.mock_tk import Text as mkText -from idlelib.IdleHistory import History -from idlelib.configHandler import idleConf +from idlelib.history import History +from idlelib.config import idleConf line1 = 'a = 7' line2 = 'b = a' diff --git a/Lib/idlelib/idle_test/test_hyperparser.py b/Lib/idlelib/idle_test/test_hyperparser.py --- a/Lib/idlelib/idle_test/test_hyperparser.py +++ b/Lib/idlelib/idle_test/test_hyperparser.py @@ -1,9 +1,9 @@ -"""Unittest for idlelib.HyperParser""" +"""Unittest for idlelib.hyperparser.py.""" import unittest from test.support import requires from tkinter import Tk, Text -from idlelib.EditorWindow import EditorWindow -from idlelib.HyperParser import HyperParser +from idlelib.editor import EditorWindow +from idlelib.hyperparser import HyperParser class DummyEditwin: def __init__(self, text): diff --git a/Lib/idlelib/idle_test/test_io.py b/Lib/idlelib/idle_test/test_iomenu.py rename from Lib/idlelib/idle_test/test_io.py rename to Lib/idlelib/idle_test/test_iomenu.py --- a/Lib/idlelib/idle_test/test_io.py +++ b/Lib/idlelib/idle_test/test_iomenu.py @@ -1,6 +1,6 @@ import unittest import io -from idlelib.PyShell import PseudoInputFile, PseudoOutputFile +from idlelib.pyshell import PseudoInputFile, PseudoOutputFile class S(str): diff --git a/Lib/idlelib/idle_test/test_formatparagraph.py b/Lib/idlelib/idle_test/test_paragraph.py rename from Lib/idlelib/idle_test/test_formatparagraph.py rename to Lib/idlelib/idle_test/test_paragraph.py --- a/Lib/idlelib/idle_test/test_formatparagraph.py +++ b/Lib/idlelib/idle_test/test_paragraph.py @@ -1,7 +1,7 @@ -# Test the functions and main class method of FormatParagraph.py +# Test the functions and main class method of paragraph.py import unittest -from idlelib import FormatParagraph as fp -from idlelib.EditorWindow import EditorWindow +from idlelib import paragraph as fp +from idlelib.editor import EditorWindow from tkinter import Tk, Text from test.support import requires @@ -38,7 +38,7 @@ class FindTest(unittest.TestCase): - """Test the find_paragraph function in FormatParagraph. + """Test the find_paragraph function in paragraph module. Using the runcase() function, find_paragraph() is called with 'mark' set at multiple indexes before and inside the test paragraph. diff --git a/Lib/idlelib/idle_test/test_parenmatch.py b/Lib/idlelib/idle_test/test_parenmatch.py --- a/Lib/idlelib/idle_test/test_parenmatch.py +++ b/Lib/idlelib/idle_test/test_parenmatch.py @@ -1,4 +1,4 @@ -"""Test idlelib.ParenMatch.""" +"""Test idlelib.parenmatch.""" # This must currently be a gui test because ParenMatch methods use # several text methods not defined on idlelib.idle_test.mock_tk.Text. from test.support import requires @@ -7,7 +7,7 @@ import unittest from unittest.mock import Mock from tkinter import Tk, Text -from idlelib.ParenMatch import ParenMatch +from idlelib.parenmatch import ParenMatch class DummyEditwin: def __init__(self, text): diff --git a/Lib/idlelib/idle_test/test_pathbrowser.py b/Lib/idlelib/idle_test/test_pathbrowser.py --- a/Lib/idlelib/idle_test/test_pathbrowser.py +++ b/Lib/idlelib/idle_test/test_pathbrowser.py @@ -2,13 +2,13 @@ import os import sys import idlelib -from idlelib import PathBrowser +from idlelib import pathbrowser class PathBrowserTest(unittest.TestCase): def test_DirBrowserTreeItem(self): # Issue16226 - make sure that getting a sublist works - d = PathBrowser.DirBrowserTreeItem('') + d = pathbrowser.DirBrowserTreeItem('') d.GetSubList() self.assertEqual('', d.GetText()) @@ -17,11 +17,11 @@ self.assertEqual(d.ispackagedir(dir + '/Icons'), False) def test_PathBrowserTreeItem(self): - p = PathBrowser.PathBrowserTreeItem() + p = pathbrowser.PathBrowserTreeItem() self.assertEqual(p.GetText(), 'sys.path') sub = p.GetSubList() self.assertEqual(len(sub), len(sys.path)) - self.assertEqual(type(sub[0]), PathBrowser.DirBrowserTreeItem) + self.assertEqual(type(sub[0]), pathbrowser.DirBrowserTreeItem) if __name__ == '__main__': unittest.main(verbosity=2, exit=False) diff --git a/Lib/idlelib/idle_test/test_percolator.py b/Lib/idlelib/idle_test/test_percolator.py --- a/Lib/idlelib/idle_test/test_percolator.py +++ b/Lib/idlelib/idle_test/test_percolator.py @@ -1,10 +1,10 @@ -'''Test Percolator''' +'''Test percolator.py.''' from test.support import requires requires('gui') import unittest from tkinter import Text, Tk, END -from idlelib.Percolator import Percolator, Delegator +from idlelib.percolator import Percolator, Delegator class MyFilter(Delegator): diff --git a/Lib/idlelib/idle_test/test_widgetredir.py b/Lib/idlelib/idle_test/test_redirector.py rename from Lib/idlelib/idle_test/test_widgetredir.py rename to Lib/idlelib/idle_test/test_redirector.py --- a/Lib/idlelib/idle_test/test_widgetredir.py +++ b/Lib/idlelib/idle_test/test_redirector.py @@ -1,4 +1,4 @@ -"""Unittest for idlelib.WidgetRedirector +"""Unittest for idlelib.redirector 100% coverage """ @@ -6,7 +6,7 @@ import unittest from idlelib.idle_test.mock_idle import Func from tkinter import Tk, Text, TclError -from idlelib.WidgetRedirector import WidgetRedirector +from idlelib.redirector import WidgetRedirector class InitCloseTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_replacedialog.py b/Lib/idlelib/idle_test/test_replace.py rename from Lib/idlelib/idle_test/test_replacedialog.py rename to Lib/idlelib/idle_test/test_replace.py --- a/Lib/idlelib/idle_test/test_replacedialog.py +++ b/Lib/idlelib/idle_test/test_replace.py @@ -1,4 +1,4 @@ -"""Unittest for idlelib.ReplaceDialog""" +"""Unittest for idlelib.replace.py""" from test.support import requires requires('gui') @@ -6,8 +6,8 @@ from unittest.mock import Mock from tkinter import Tk, Text from idlelib.idle_test.mock_tk import Mbox -import idlelib.SearchEngine as se -import idlelib.ReplaceDialog as rd +import idlelib.searchengine as se +import idlelib.replace as rd orig_mbox = se.tkMessageBox showerror = Mbox.showerror diff --git a/Lib/idlelib/idle_test/test_rstrip.py b/Lib/idlelib/idle_test/test_rstrip.py --- a/Lib/idlelib/idle_test/test_rstrip.py +++ b/Lib/idlelib/idle_test/test_rstrip.py @@ -1,5 +1,5 @@ import unittest -import idlelib.RstripExtension as rs +import idlelib.rstrip as rs from idlelib.idle_test.mock_idle import Editor class rstripTest(unittest.TestCase): @@ -21,7 +21,7 @@ def test_rstrip_multiple(self): editor = Editor() # Uncomment following to verify that test passes with real widgets. -## from idlelib.EditorWindow import EditorWindow as Editor +## from idlelib.editor import EditorWindow as Editor ## from tkinter import Tk ## editor = Editor(root=Tk()) text = editor.text diff --git a/Lib/idlelib/idle_test/test_searchdialog.py b/Lib/idlelib/idle_test/test_search.py rename from Lib/idlelib/idle_test/test_searchdialog.py rename to Lib/idlelib/idle_test/test_search.py --- a/Lib/idlelib/idle_test/test_searchdialog.py +++ b/Lib/idlelib/idle_test/test_search.py @@ -1,4 +1,4 @@ -"""Test SearchDialog class in SearchDialogue.py""" +"""Test SearchDialog class in idlelib.search.py""" # Does not currently test the event handler wrappers. # A usage test should simulate clicks and check hilighting. @@ -11,8 +11,8 @@ import unittest import tkinter as tk from tkinter import BooleanVar -import idlelib.SearchEngine as se -import idlelib.SearchDialog as sd +import idlelib.searchengine as se +import idlelib.search as sd class SearchDialogTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_searchdialogbase.py b/Lib/idlelib/idle_test/test_searchbase.py rename from Lib/idlelib/idle_test/test_searchdialogbase.py rename to Lib/idlelib/idle_test/test_searchbase.py --- a/Lib/idlelib/idle_test/test_searchdialogbase.py +++ b/Lib/idlelib/idle_test/test_searchbase.py @@ -1,4 +1,4 @@ -'''Unittests for idlelib/SearchDialogBase.py +'''Unittests for idlelib/searchbase.py Coverage: 99%. The only thing not covered is inconsequential -- testing skipping of suite when self.needwrapbutton is false. @@ -7,8 +7,8 @@ import unittest from test.support import requires from tkinter import Tk, Toplevel, Frame ##, BooleanVar, StringVar -from idlelib import SearchEngine as se -from idlelib import SearchDialogBase as sdb +from idlelib import searchengine as se +from idlelib import searchbase as sdb from idlelib.idle_test.mock_idle import Func ## from idlelib.idle_test.mock_tk import Var diff --git a/Lib/idlelib/idle_test/test_searchengine.py b/Lib/idlelib/idle_test/test_searchengine.py --- a/Lib/idlelib/idle_test/test_searchengine.py +++ b/Lib/idlelib/idle_test/test_searchengine.py @@ -1,4 +1,4 @@ -'''Test functions and SearchEngine class in SearchEngine.py.''' +'''Test functions and SearchEngine class in idlelib.searchengine.py.''' # With mock replacements, the module does not use any gui widgets. # The use of tk.Text is avoided (for now, until mock Text is improved) @@ -10,7 +10,7 @@ # from test.support import requires from tkinter import BooleanVar, StringVar, TclError # ,Tk, Text import tkinter.messagebox as tkMessageBox -from idlelib import SearchEngine as se +from idlelib import searchengine as se from idlelib.idle_test.mock_tk import Var, Mbox from idlelib.idle_test.mock_tk import Text as mockText diff --git a/Lib/idlelib/idle_test/test_textview.py b/Lib/idlelib/idle_test/test_textview.py --- a/Lib/idlelib/idle_test/test_textview.py +++ b/Lib/idlelib/idle_test/test_textview.py @@ -1,4 +1,4 @@ -'''Test the functions and main class method of textView.py. +'''Test the functions and main class method of textview.py. Since all methods and functions create (or destroy) a TextViewer, which is a widget containing multiple widgets, all tests must be gui tests. @@ -13,7 +13,7 @@ import unittest import os from tkinter import Tk -from idlelib import textView as tv +from idlelib import textview as tv from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Mbox diff --git a/Lib/idlelib/idle_test/test_undodelegator.py b/Lib/idlelib/idle_test/test_undo.py rename from Lib/idlelib/idle_test/test_undodelegator.py rename to Lib/idlelib/idle_test/test_undo.py --- a/Lib/idlelib/idle_test/test_undodelegator.py +++ b/Lib/idlelib/idle_test/test_undo.py @@ -1,4 +1,4 @@ -"""Unittest for UndoDelegator in idlelib.UndoDelegator. +"""Unittest for UndoDelegator in idlelib.undo.py. Coverage about 80% (retest). """ @@ -8,8 +8,8 @@ import unittest from unittest.mock import Mock from tkinter import Text, Tk -from idlelib.UndoDelegator import UndoDelegator -from idlelib.Percolator import Percolator +from idlelib.undo import UndoDelegator +from idlelib.percolator import Percolator class UndoDelegatorTest(unittest.TestCase): diff --git a/Lib/idlelib/idle_test/test_warning.py b/Lib/idlelib/idle_test/test_warning.py --- a/Lib/idlelib/idle_test/test_warning.py +++ b/Lib/idlelib/idle_test/test_warning.py @@ -1,4 +1,4 @@ -'''Test warnings replacement in PyShell.py and run.py. +'''Test warnings replacement in pyshell.py and run.py. This file could be expanded to include traceback overrides (in same two modules). If so, change name. @@ -17,9 +17,9 @@ running_in_idle = 'idle' in showwarning.__name__ from idlelib import run -from idlelib import PyShell as shell +from idlelib import pyshell as shell -# The following was generated from PyShell.idle_formatwarning +# The following was generated from pyshell.idle_formatwarning # and checked as matching expectation. idlemsg = ''' Warning (from warnings module): diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/iomenu.py rename from Lib/idlelib/IOBinding.py rename to Lib/idlelib/iomenu.py --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/iomenu.py @@ -10,7 +10,7 @@ import tkinter.messagebox as tkMessageBox from tkinter.simpledialog import askstring -from idlelib.configHandler import idleConf +from idlelib.config import idleConf # Try setting the locale, so that we can find out @@ -107,6 +107,9 @@ class IOBinding: +# One instance per editor Window so methods know which to save, close. +# Open returns focus to self.editwin if aborted. +# EditorWindow.open_module, others, belong here. def __init__(self, editwin): self.editwin = editwin diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosx.py rename from Lib/idlelib/macosxSupport.py rename to Lib/idlelib/macosx.py --- a/Lib/idlelib/macosxSupport.py +++ b/Lib/idlelib/macosx.py @@ -123,23 +123,23 @@ # Due to a (mis-)feature of TkAqua the user will also see an empty Help # menu. from tkinter import Menu - from idlelib import Bindings - from idlelib import WindowList + from idlelib import mainmenu + from idlelib import windows - closeItem = Bindings.menudefs[0][1][-2] + closeItem = mainmenu.menudefs[0][1][-2] # Remove the last 3 items of the file menu: a separator, close window and # quit. Close window will be reinserted just above the save item, where # it should be according to the HIG. Quit is in the application menu. - del Bindings.menudefs[0][1][-3:] - Bindings.menudefs[0][1].insert(6, closeItem) + del mainmenu.menudefs[0][1][-3:] + mainmenu.menudefs[0][1].insert(6, closeItem) # Remove the 'About' entry from the help menu, it is in the application # menu - del Bindings.menudefs[-1][1][0:2] + del mainmenu.menudefs[-1][1][0:2] # Remove the 'Configure Idle' entry from the options menu, it is in the # application menu as 'Preferences' - del Bindings.menudefs[-2][1][0] + del mainmenu.menudefs[-2][1][0] menubar = Menu(root) root.configure(menu=menubar) menudict = {} @@ -154,30 +154,30 @@ if end > 0: menu.delete(0, end) - WindowList.add_windows_to_menu(menu) - WindowList.register_callback(postwindowsmenu) + windows.add_windows_to_menu(menu) + Windows.register_callback(postwindowsmenu) def about_dialog(event=None): "Handle Help 'About IDLE' event." - # Synchronize with EditorWindow.EditorWindow.about_dialog. - from idlelib import aboutDialog - aboutDialog.AboutDialog(root, 'About IDLE') + # Synchronize with editor.EditorWindow.about_dialog. + from idlelib import help_about + help_about.AboutDialog(root, 'About IDLE') def config_dialog(event=None): "Handle Options 'Configure IDLE' event." - # Synchronize with EditorWindow.EditorWindow.config_dialog. - from idlelib import configDialog + # Synchronize with editor.EditorWindow.config_dialog. + from idlelib import configdialog # Ensure that the root object has an instance_dict attribute, # mirrors code in EditorWindow (although that sets the attribute # on an EditorWindow instance that is then passed as the first # argument to ConfigDialog) root.instance_dict = flist.inversedict - configDialog.ConfigDialog(root, 'Settings') + configdialog.ConfigDialog(root, 'Settings') def help_dialog(event=None): "Handle Help 'IDLE Help' event." - # Synchronize with EditorWindow.EditorWindow.help_dialog. + # Synchronize with editor.EditorWindow.help_dialog. from idlelib import help help.show_idlehelp(root) @@ -197,7 +197,7 @@ menudict['application'] = menu = Menu(menubar, name='apple', tearoff=0) menubar.add_cascade(label='IDLE', menu=menu) - Bindings.menudefs.insert(0, + mainmenu.menudefs.insert(0, ('application', [ ('About IDLE', '<>'), None, @@ -205,7 +205,7 @@ tkversion = root.tk.eval('info patchlevel') if tuple(map(int, tkversion.split('.'))) < (8, 4, 14): # for earlier AquaTk versions, supply a Preferences menu item - Bindings.menudefs[0][1].append( + mainmenu.menudefs[0][1].append( ('_Preferences....', '<>'), ) if isCocoaTk(): @@ -214,12 +214,12 @@ # replace default "Help" item in Help menu root.createcommand('::tk::mac::ShowHelp', help_dialog) # remove redundant "IDLE Help" from menu - del Bindings.menudefs[-1][1][0] + del mainmenu.menudefs[-1][1][0] def setupApp(root, flist): """ Perform initial OS X customizations if needed. - Called from PyShell.main() after initial calls to Tk() + Called from pyshell.main() after initial calls to Tk() There are currently three major versions of Tk in use on OS X: 1. Aqua Cocoa Tk (native default since OS X 10.6) diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/mainmenu.py rename from Lib/idlelib/Bindings.py rename to Lib/idlelib/mainmenu.py --- a/Lib/idlelib/Bindings.py +++ b/Lib/idlelib/mainmenu.py @@ -10,9 +10,9 @@ """ from importlib.util import find_spec -from idlelib.configHandler import idleConf +from idlelib.config import idleConf -# Warning: menudefs is altered in macosxSupport.overrideRootMenu() +# Warning: menudefs is altered in macosx.overrideRootMenu() # after it is determined that an OS X Aqua Tk is in use, # which cannot be done until after Tk() is first called. # Do not alter the 'file', 'options', or 'help' cascades here diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/multicall.py rename from Lib/idlelib/MultiCall.py rename to Lib/idlelib/multicall.py diff --git a/Lib/idlelib/OutputWindow.py b/Lib/idlelib/outwin.py rename from Lib/idlelib/OutputWindow.py rename to Lib/idlelib/outwin.py --- a/Lib/idlelib/OutputWindow.py +++ b/Lib/idlelib/outwin.py @@ -1,8 +1,8 @@ from tkinter import * -from idlelib.EditorWindow import EditorWindow +from idlelib.editor import EditorWindow import re import tkinter.messagebox as tkMessageBox -from idlelib import IOBinding +from idlelib import iomenu class OutputWindow(EditorWindow): @@ -36,7 +36,7 @@ def write(self, s, tags=(), mark="insert"): if isinstance(s, (bytes, bytes)): - s = s.decode(IOBinding.encoding, "replace") + s = s.decode(iomenu.encoding, "replace") self.text.insert(mark, s, tags) self.text.see(mark) self.text.update() diff --git a/Lib/idlelib/FormatParagraph.py b/Lib/idlelib/paragraph.py rename from Lib/idlelib/FormatParagraph.py rename to Lib/idlelib/paragraph.py --- a/Lib/idlelib/FormatParagraph.py +++ b/Lib/idlelib/paragraph.py @@ -16,7 +16,7 @@ """ import re -from idlelib.configHandler import idleConf +from idlelib.config import idleConf class FormatParagraph: @@ -191,5 +191,5 @@ if __name__ == "__main__": import unittest - unittest.main('idlelib.idle_test.test_formatparagraph', + unittest.main('idlelib.idle_test.test_paragraph', verbosity=2, exit=False) diff --git a/Lib/idlelib/ParenMatch.py b/Lib/idlelib/parenmatch.py rename from Lib/idlelib/ParenMatch.py rename to Lib/idlelib/parenmatch.py --- a/Lib/idlelib/ParenMatch.py +++ b/Lib/idlelib/parenmatch.py @@ -5,8 +5,8 @@ parentheses, square brackets, and curly braces. """ -from idlelib.HyperParser import HyperParser -from idlelib.configHandler import idleConf +from idlelib.hyperparser import HyperParser +from idlelib.config import idleConf _openers = {')':'(',']':'[','}':'{'} CHECK_DELAY = 100 # miliseconds diff --git a/Lib/idlelib/PathBrowser.py b/Lib/idlelib/pathbrowser.py rename from Lib/idlelib/PathBrowser.py rename to Lib/idlelib/pathbrowser.py --- a/Lib/idlelib/PathBrowser.py +++ b/Lib/idlelib/pathbrowser.py @@ -2,9 +2,9 @@ import sys import importlib.machinery -from idlelib.TreeWidget import TreeItem -from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem -from idlelib.PyShell import PyShellFileList +from idlelib.tree import TreeItem +from idlelib.browser import ClassBrowser, ModuleBrowserTreeItem +from idlelib.pyshell import PyShellFileList class PathBrowser(ClassBrowser): diff --git a/Lib/idlelib/Percolator.py b/Lib/idlelib/percolator.py rename from Lib/idlelib/Percolator.py rename to Lib/idlelib/percolator.py --- a/Lib/idlelib/Percolator.py +++ b/Lib/idlelib/percolator.py @@ -1,5 +1,5 @@ -from idlelib.WidgetRedirector import WidgetRedirector -from idlelib.Delegator import Delegator +from idlelib.redirector import WidgetRedirector +from idlelib.delegator import Delegator class Percolator: diff --git a/Lib/idlelib/PyParse.py b/Lib/idlelib/pyparse.py rename from Lib/idlelib/PyParse.py rename to Lib/idlelib/pyparse.py diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/pyshell.py rename from Lib/idlelib/PyShell.py rename to Lib/idlelib/pyshell.py --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/pyshell.py @@ -24,16 +24,16 @@ sys.exit(1) import tkinter.messagebox as tkMessageBox -from idlelib.EditorWindow import EditorWindow, fixwordbreaks -from idlelib.FileList import FileList -from idlelib.ColorDelegator import ColorDelegator -from idlelib.UndoDelegator import UndoDelegator -from idlelib.OutputWindow import OutputWindow -from idlelib.configHandler import idleConf +from idlelib.editor import EditorWindow, fixwordbreaks +from idlelib.filelist import FileList +from idlelib.colorizer import ColorDelegator +from idlelib.undo import UndoDelegator +from idlelib.outwin import OutputWindow +from idlelib.config import idleConf from idlelib import rpc -from idlelib import Debugger -from idlelib import RemoteDebugger -from idlelib import macosxSupport +from idlelib import debugger +from idlelib import debugger_r +from idlelib import macosx HOST = '127.0.0.1' # python execution server on localhost loopback PORT = 0 # someday pass in host, port for remote debug capability @@ -410,7 +410,7 @@ # run from the IDLE source directory. del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc', default=False, type='bool') - if __name__ == 'idlelib.PyShell': + if __name__ == 'idlelib.pyshell': command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,) else: command = "__import__('run').main(%r)" % (del_exitf,) @@ -468,7 +468,7 @@ if debug: try: # Only close subprocess debugger, don't unregister gui_adap! - RemoteDebugger.close_subprocess_debugger(self.rpcclt) + debugger_r.close_subprocess_debugger(self.rpcclt) except: pass # Kill subprocess, spawn a new one, accept connection. @@ -497,7 +497,7 @@ # restart subprocess debugger if debug: # Restarted debugger connects to current instance of debug GUI - RemoteDebugger.restart_subprocess_debugger(self.rpcclt) + debugger_r.restart_subprocess_debugger(self.rpcclt) # reload remote debugger breakpoints for all PyShellEditWindows debug.load_breakpoints() self.compile.compiler.flags = self.original_compiler_flags @@ -578,7 +578,7 @@ if self.tkconsole.getvar("<>"): self.remote_stack_viewer() elif how == "ERROR": - errmsg = "PyShell.ModifiedInterpreter: Subprocess ERROR:\n" + errmsg = "pyshell.ModifiedInterpreter: Subprocess ERROR:\n" print(errmsg, what, file=sys.__stderr__) print(errmsg, what, file=console) # we received a response to the currently active seq number: @@ -613,13 +613,13 @@ return def remote_stack_viewer(self): - from idlelib import RemoteObjectBrowser + from idlelib import debugobj_r oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {}) if oid is None: self.tkconsole.root.bell() return - item = RemoteObjectBrowser.StubObjectTreeItem(self.rpcclt, oid) - from idlelib.TreeWidget import ScrolledCanvas, TreeNode + item = debugobj_r.StubObjectTreeItem(self.rpcclt, oid) + from idlelib.tree import ScrolledCanvas, TreeNode top = Toplevel(self.tkconsole.root) theme = idleConf.CurrentTheme() background = idleConf.GetHighlight(theme, 'normal')['background'] @@ -662,9 +662,9 @@ # at the moment, InteractiveInterpreter expects str assert isinstance(source, str) #if isinstance(source, str): - # from idlelib import IOBinding + # from idlelib import iomenu # try: - # source = source.encode(IOBinding.encoding) + # source = source.encode(iomenu.encoding) # except UnicodeError: # self.tkconsole.resetoutput() # self.write("Unsupported characters in input\n") @@ -850,7 +850,7 @@ # New classes - from idlelib.IdleHistory import History + from idlelib.history import History def __init__(self, flist=None): if use_subprocess: @@ -888,11 +888,11 @@ self.save_stdout = sys.stdout self.save_stderr = sys.stderr self.save_stdin = sys.stdin - from idlelib import IOBinding - self.stdin = PseudoInputFile(self, "stdin", IOBinding.encoding) - self.stdout = PseudoOutputFile(self, "stdout", IOBinding.encoding) - self.stderr = PseudoOutputFile(self, "stderr", IOBinding.encoding) - self.console = PseudoOutputFile(self, "console", IOBinding.encoding) + from idlelib import iomenu + self.stdin = PseudoInputFile(self, "stdin", iomenu.encoding) + self.stdout = PseudoOutputFile(self, "stdout", iomenu.encoding) + self.stderr = PseudoOutputFile(self, "stderr", iomenu.encoding) + self.console = PseudoOutputFile(self, "console", iomenu.encoding) if not use_subprocess: sys.stdout = self.stdout sys.stderr = self.stderr @@ -900,7 +900,7 @@ try: # page help() text to shell. import pydoc # import must be done here to capture i/o rebinding. - # XXX KBK 27Dec07 use a textView someday, but must work w/o subproc + # XXX KBK 27Dec07 use TextViewer someday, but must work w/o subproc pydoc.pager = pydoc.plainpager except: sys.stderr = sys.__stderr__ @@ -954,7 +954,7 @@ self.interp.setdebugger(None) db.close() if self.interp.rpcclt: - RemoteDebugger.close_remote_debugger(self.interp.rpcclt) + debugger_r.close_remote_debugger(self.interp.rpcclt) self.resetoutput() self.console.write("[DEBUG OFF]\n") sys.ps1 = ">>> " @@ -963,10 +963,10 @@ def open_debugger(self): if self.interp.rpcclt: - dbg_gui = RemoteDebugger.start_remote_debugger(self.interp.rpcclt, + dbg_gui = debugger_r.start_remote_debugger(self.interp.rpcclt, self) else: - dbg_gui = Debugger.Debugger(self) + dbg_gui = debugger.Debugger(self) self.interp.setdebugger(dbg_gui) dbg_gui.load_breakpoints() sys.ps1 = "[DEBUG ON]\n>>> " @@ -1241,7 +1241,7 @@ "(sys.last_traceback is not defined)", parent=self.text) return - from idlelib.StackViewer import StackBrowser + from idlelib.stackviewer import StackBrowser StackBrowser(self.root, self.flist) def view_restart_mark(self, event=None): @@ -1546,9 +1546,9 @@ fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) - macosxSupport.setupApp(root, flist) + macosx.setupApp(root, flist) - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): # There are some screwed up <2> class bindings for text # widgets defined in Tk which we need to do away with. # See issue #24801. @@ -1569,7 +1569,7 @@ shell = flist.open_shell() if not shell: return # couldn't open shell - if macosxSupport.isAquaTk() and flist.dict: + if macosx.isAquaTk() and flist.dict: # On OSX: when the user has double-clicked on a file that causes # IDLE to be launched the shell window will open just in front of # the file she wants to see. Lower the interpreter window when @@ -1603,7 +1603,7 @@ # check for problematic OS X Tk versions and print a warning # message in the IDLE shell window; this is less intrusive # than always opening a separate window. - tkversionwarning = macosxSupport.tkVersionWarning(root) + tkversionwarning = macosx.tkVersionWarning(root) if tkversionwarning: shell.interp.runcommand("print('%s')" % tkversionwarning) @@ -1613,7 +1613,7 @@ capture_warnings(False) if __name__ == "__main__": - sys.modules['PyShell'] = sys.modules['__main__'] + sys.modules['pyshell'] = sys.modules['__main__'] main() capture_warnings(False) # Make sure turned off; see issue 18081 diff --git a/Lib/idlelib/WidgetRedirector.py b/Lib/idlelib/redirector.py rename from Lib/idlelib/WidgetRedirector.py rename to Lib/idlelib/redirector.py --- a/Lib/idlelib/WidgetRedirector.py +++ b/Lib/idlelib/redirector.py @@ -104,7 +104,7 @@ Note that if a registered function is called, the operation is not passed through to Tk. Apply the function returned by self.register() - to *args to accomplish that. For an example, see ColorDelegator.py. + to *args to accomplish that. For an example, see colorizer.py. ''' m = self._operations.get(operation) diff --git a/Lib/idlelib/ReplaceDialog.py b/Lib/idlelib/replace.py rename from Lib/idlelib/ReplaceDialog.py rename to Lib/idlelib/replace.py --- a/Lib/idlelib/ReplaceDialog.py +++ b/Lib/idlelib/replace.py @@ -5,8 +5,8 @@ """ from tkinter import * -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import searchengine +from idlelib.searchbase import SearchDialogBase import re @@ -14,7 +14,7 @@ """Returns a singleton ReplaceDialog instance.The single dialog saves user entries and preferences across instances.""" root = text._root() - engine = SearchEngine.get(root) + engine = searchengine.get(root) if not hasattr(engine, "_replacedialog"): engine._replacedialog = ReplaceDialog(root, engine) dialog = engine._replacedialog @@ -164,7 +164,7 @@ pos = None if not pos: first = last = pos = text.index("insert") - line, col = SearchEngine.get_line_col(pos) + line, col = searchengine.get_line_col(pos) chars = text.get("%d.0" % line, "%d.0" % (line+1)) m = prog.match(chars, col) if not prog: diff --git a/Lib/idlelib/RstripExtension.py b/Lib/idlelib/rstrip.py rename from Lib/idlelib/RstripExtension.py rename to Lib/idlelib/rstrip.py diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -7,15 +7,15 @@ import queue import tkinter -from idlelib import CallTips -from idlelib import AutoComplete +from idlelib import calltips +from idlelib import autocomplete -from idlelib import RemoteDebugger -from idlelib import RemoteObjectBrowser -from idlelib import StackViewer +from idlelib import debugger_r +from idlelib import debugobj_r +from idlelib import stackviewer from idlelib import rpc -from idlelib import PyShell -from idlelib import IOBinding +from idlelib import pyshell +from idlelib import iomenu import __main__ @@ -32,7 +32,7 @@ if file is None: file = sys.stderr try: - file.write(PyShell.idle_formatwarning( + file.write(pyshell.idle_formatwarning( message, category, filename, lineno, line)) except IOError: pass # the file (probably stderr) is invalid - this warning gets lost. @@ -82,7 +82,7 @@ MyHandler object. That reference is saved as attribute rpchandler of the Executive instance. The Executive methods have access to the reference and can pass it on to entities that they command - (e.g. RemoteDebugger.Debugger.start_debugger()). The latter, in turn, can + (e.g. debugger_r.Debugger.start_debugger()). The latter, in turn, can call MyHandler(SocketIO) register/unregister methods via the reference to register and unregister themselves. @@ -204,7 +204,7 @@ tbe = traceback.extract_tb(tb) print('Traceback (most recent call last):', file=efile) exclude = ("run.py", "rpc.py", "threading.py", "queue.py", - "RemoteDebugger.py", "bdb.py") + "debugger_r.py", "bdb.py") cleanup_traceback(tbe, exclude) traceback.print_list(tbe, file=efile) lines = traceback.format_exception_only(typ, exc) @@ -298,12 +298,12 @@ executive = Executive(self) self.register("exec", executive) self.console = self.get_remote_proxy("console") - sys.stdin = PyShell.PseudoInputFile(self.console, "stdin", - IOBinding.encoding) - sys.stdout = PyShell.PseudoOutputFile(self.console, "stdout", - IOBinding.encoding) - sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr", - IOBinding.encoding) + sys.stdin = pyshell.PseudoInputFile(self.console, "stdin", + iomenu.encoding) + sys.stdout = pyshell.PseudoOutputFile(self.console, "stdout", + iomenu.encoding) + sys.stderr = pyshell.PseudoOutputFile(self.console, "stderr", + iomenu.encoding) sys.displayhook = rpc.displayhook # page help() text to shell. @@ -339,8 +339,8 @@ def __init__(self, rpchandler): self.rpchandler = rpchandler self.locals = __main__.__dict__ - self.calltip = CallTips.CallTips() - self.autocomplete = AutoComplete.AutoComplete() + self.calltip = calltips.CallTips() + self.autocomplete = autocomplete.AutoComplete() def runcode(self, code): global interruptable @@ -372,7 +372,7 @@ thread.interrupt_main() def start_the_debugger(self, gui_adap_oid): - return RemoteDebugger.start_debugger(self.rpchandler, gui_adap_oid) + return debugger_r.start_debugger(self.rpchandler, gui_adap_oid) def stop_the_debugger(self, idb_adap_oid): "Unregister the Idb Adapter. Link objects and Idb then subject to GC" @@ -396,7 +396,7 @@ tb = tb.tb_next sys.last_type = typ sys.last_value = val - item = StackViewer.StackTreeItem(flist, tb) - return RemoteObjectBrowser.remote_object_tree_item(item) + item = stackviewer.StackTreeItem(flist, tb) + return debugobj_r.remote_object_tree_item(item) capture_warnings(False) # Make sure turned off; see issue 18081 diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/runscript.py rename from Lib/idlelib/ScriptBinding.py rename to Lib/idlelib/runscript.py --- a/Lib/idlelib/ScriptBinding.py +++ b/Lib/idlelib/runscript.py @@ -21,10 +21,10 @@ import tabnanny import tokenize import tkinter.messagebox as tkMessageBox -from idlelib import PyShell +from idlelib import pyshell -from idlelib.configHandler import idleConf -from idlelib import macosxSupport +from idlelib.config import idleConf +from idlelib import macosx indent_message = """Error: Inconsistent indentation detected! @@ -46,12 +46,12 @@ def __init__(self, editwin): self.editwin = editwin - # Provide instance variables referenced by Debugger + # Provide instance variables referenced by debugger # XXX This should be done differently self.flist = self.editwin.flist self.root = self.editwin.root - if macosxSupport.isCocoaTk(): + if macosx.isCocoaTk(): self.editwin.text_frame.bind('<>', self._run_module_event) def check_module_event(self, event): @@ -112,7 +112,7 @@ shell.set_warning_stream(saved_stream) def run_module_event(self, event): - if macosxSupport.isCocoaTk(): + if macosx.isCocoaTk(): # Tk-Cocoa in MacOSX is broken until at least # Tk 8.5.9, and without this rather # crude workaround IDLE would hang when a user @@ -142,7 +142,7 @@ if not self.tabnanny(filename): return 'break' interp = self.shell.interp - if PyShell.use_subprocess: + if pyshell.use_subprocess: interp.restart_subprocess(with_cwd=False, filename= self.editwin._filename_to_unicode(filename)) dirname = os.path.dirname(filename) @@ -161,7 +161,7 @@ interp.prepend_syspath(filename) # XXX KBK 03Jul04 When run w/o subprocess, runtime warnings still # go to __stderr__. With subprocess, they go to the shell. - # Need to change streams in PyShell.ModifiedInterpreter. + # Need to change streams in pyshell.ModifiedInterpreter. interp.runcode(code) return 'break' diff --git a/Lib/idlelib/ScrolledList.py b/Lib/idlelib/scrolledlist.py rename from Lib/idlelib/ScrolledList.py rename to Lib/idlelib/scrolledlist.py --- a/Lib/idlelib/ScrolledList.py +++ b/Lib/idlelib/scrolledlist.py @@ -1,5 +1,5 @@ from tkinter import * -from idlelib import macosxSupport +from idlelib import macosx class ScrolledList: @@ -23,7 +23,7 @@ # Bind events to the list box listbox.bind("", self.click_event) listbox.bind("", self.double_click_event) - if macosxSupport.isAquaTk(): + if macosx.isAquaTk(): listbox.bind("", self.popup_event) listbox.bind("", self.popup_event) else: diff --git a/Lib/idlelib/SearchDialog.py b/Lib/idlelib/search.py rename from Lib/idlelib/SearchDialog.py rename to Lib/idlelib/search.py --- a/Lib/idlelib/SearchDialog.py +++ b/Lib/idlelib/search.py @@ -1,12 +1,12 @@ from tkinter import * -from idlelib import SearchEngine -from idlelib.SearchDialogBase import SearchDialogBase +from idlelib import searchengine +from idlelib.searchbase import SearchDialogBase def _setup(text): "Create or find the singleton SearchDialog instance." root = text._root() - engine = SearchEngine.get(root) + engine = searchengine.get(root) if not hasattr(engine, "_searchdialog"): engine._searchdialog = SearchDialog(root, engine) return engine._searchdialog diff --git a/Lib/idlelib/SearchDialogBase.py b/Lib/idlelib/searchbase.py rename from Lib/idlelib/SearchDialogBase.py rename to Lib/idlelib/searchbase.py --- a/Lib/idlelib/SearchDialogBase.py +++ b/Lib/idlelib/searchbase.py @@ -125,7 +125,7 @@ def create_option_buttons(self): '''Return (filled frame, options) for testing. - Options is a list of SearchEngine booleanvar, label pairs. + Options is a list of searchengine booleanvar, label pairs. A gridded frame from make_frame is filled with a Checkbutton for each pair, bound to the var, with the corresponding label. ''' diff --git a/Lib/idlelib/SearchEngine.py b/Lib/idlelib/searchengine.py rename from Lib/idlelib/SearchEngine.py rename to Lib/idlelib/searchengine.py --- a/Lib/idlelib/SearchEngine.py +++ b/Lib/idlelib/searchengine.py @@ -57,7 +57,7 @@ def setcookedpat(self, pat): "Set pattern after escaping if re." - # called only in SearchDialog.py: 66 + # called only in search.py: 66 if self.isre(): pat = re.escape(pat) self.setpat(pat) diff --git a/Lib/idlelib/StackViewer.py b/Lib/idlelib/stackviewer.py rename from Lib/idlelib/StackViewer.py rename to Lib/idlelib/stackviewer.py --- a/Lib/idlelib/StackViewer.py +++ b/Lib/idlelib/stackviewer.py @@ -4,9 +4,9 @@ import re import tkinter as tk -from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas -from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem -from idlelib.PyShell import PyShellFileList +from idlelib.tree import TreeNode, TreeItem, ScrolledCanvas +from idlelib.debugobj import ObjectTreeItem, make_objecttreeitem +from idlelib.pyshell import PyShellFileList def StackBrowser(root, flist=None, tb=None, top=None): if top is None: diff --git a/Lib/idlelib/MultiStatusBar.py b/Lib/idlelib/statusbar.py rename from Lib/idlelib/MultiStatusBar.py rename to Lib/idlelib/statusbar.py diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textview.py rename from Lib/idlelib/textView.py rename to Lib/idlelib/textview.py diff --git a/Lib/idlelib/ToolTip.py b/Lib/idlelib/tooltip.py rename from Lib/idlelib/ToolTip.py rename to Lib/idlelib/tooltip.py --- a/Lib/idlelib/ToolTip.py +++ b/Lib/idlelib/tooltip.py @@ -1,4 +1,4 @@ -# general purpose 'tooltip' routines - currently unused in idlefork +# general purpose 'tooltip' routines - currently unused in idlelib # (although the 'calltips' extension is partly based on this code) # may be useful for some purposes in (or almost in ;) the current project scope # Ideas gleaned from PySol @@ -76,7 +76,7 @@ for item in self.items: listbox.insert(END, item) -def _tooltip(parent): +def _tooltip(parent): # htest # root = Tk() root.title("Test tooltip") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/tree.py rename from Lib/idlelib/TreeWidget.py rename to Lib/idlelib/tree.py --- a/Lib/idlelib/TreeWidget.py +++ b/Lib/idlelib/tree.py @@ -17,8 +17,8 @@ import os from tkinter import * -from idlelib import ZoomHeight -from idlelib.configHandler import idleConf +from idlelib import zoomheight +from idlelib.config import idleConf ICONDIR = "Icons" @@ -445,7 +445,7 @@ self.canvas.yview_scroll(1, "unit") return "break" def zoom_height(self, event): - ZoomHeight.zoom_height(self.master) + zoomheight.zoom_height(self.master) return "break" diff --git a/Lib/idlelib/UndoDelegator.py b/Lib/idlelib/undo.py rename from Lib/idlelib/UndoDelegator.py rename to Lib/idlelib/undo.py --- a/Lib/idlelib/UndoDelegator.py +++ b/Lib/idlelib/undo.py @@ -1,7 +1,7 @@ import string from tkinter import * -from idlelib.Delegator import Delegator +from idlelib.delegator import Delegator #$ event <> #$ win @@ -340,7 +340,7 @@ def _undo_delegator(parent): # htest # import re import tkinter as tk - from idlelib.Percolator import Percolator + from idlelib.percolator import Percolator undowin = tk.Toplevel() undowin.title("Test UndoDelegator") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) diff --git a/Lib/idlelib/WindowList.py b/Lib/idlelib/windows.py rename from Lib/idlelib/WindowList.py rename to Lib/idlelib/windows.py diff --git a/Lib/idlelib/ZoomHeight.py b/Lib/idlelib/zoomheight.py rename from Lib/idlelib/ZoomHeight.py rename to Lib/idlelib/zoomheight.py --- a/Lib/idlelib/ZoomHeight.py +++ b/Lib/idlelib/zoomheight.py @@ -3,7 +3,7 @@ import re import sys -from idlelib import macosxSupport +from idlelib import macosx class ZoomHeight: @@ -32,7 +32,7 @@ newy = 0 newheight = newheight - 72 - elif macosxSupport.isAquaTk(): + elif macosx.isAquaTk(): # The '88' below is a magic number that avoids placing the bottom # of the window below the panel on my machine. I don't know how # to calculate the correct value for this with tkinter. diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -89,9 +89,9 @@ import os from tkinter import * -from idlelib.Percolator import Percolator -from idlelib.ColorDelegator import ColorDelegator -from idlelib.textView import view_text +from idlelib.percolator import Percolator +from idlelib.colorizer import ColorDelegator +from idlelib.textview import view_text from turtledemo import __doc__ as about_turtledemo import turtle -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 21:10:34 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 29 May 2016 01:10:34 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327124=3A_Merge_binascii_doc_from_3=2E5?= Message-ID: <20160529011034.13748.24982.F26EBF8B@psf.io> https://hg.python.org/cpython/rev/85e6da63d73f changeset: 101555:85e6da63d73f parent: 101553:113b64e74e72 parent: 101554:ef89ecb6debc user: Martin Panter date: Sun May 29 00:56:02 2016 +0000 summary: Issue #27124: Merge binascii doc from 3.5 files: Doc/library/binascii.rst | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst --- a/Doc/library/binascii.rst +++ b/Doc/library/binascii.rst @@ -152,8 +152,8 @@ Return the binary data represented by the hexadecimal string *hexstr*. This function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even number - of hexadecimal digits (which can be upper or lower case), otherwise a - :exc:`TypeError` is raised. + of hexadecimal digits (which can be upper or lower case), otherwise an + :exc:`Error` exception is raised. .. exception:: Error -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sat May 28 21:10:34 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 29 May 2016 01:10:34 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MTI0?= =?utf-8?q?=3A_Fix_documentation_of_exception_raised_by_a2b=5Fhex=28=29?= Message-ID: <20160529011034.10672.71750.11DDB79D@psf.io> https://hg.python.org/cpython/rev/ef89ecb6debc changeset: 101554:ef89ecb6debc branch: 3.5 parent: 101551:7aeb9505cc2a user: Martin Panter date: Sun May 29 00:48:54 2016 +0000 summary: Issue #27124: Fix documentation of exception raised by a2b_hex() files: Doc/library/binascii.rst | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst --- a/Doc/library/binascii.rst +++ b/Doc/library/binascii.rst @@ -151,8 +151,8 @@ Return the binary data represented by the hexadecimal string *hexstr*. This function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even number - of hexadecimal digits (which can be upper or lower case), otherwise a - :exc:`TypeError` is raised. + of hexadecimal digits (which can be upper or lower case), otherwise an + :exc:`Error` exception is raised. .. exception:: Error -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 01:42:23 2016 From: python-checkins at python.org (terry.reedy) Date: Sun, 29 May 2016 05:42:23 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MTE3?= =?utf-8?q?=3A_Make_ColorDelegator_htest_and_turtledemo_work_with_dark_the?= =?utf-8?b?bWUu?= Message-ID: <20160529054223.122114.88783.9C172A27@psf.io> https://hg.python.org/cpython/rev/f383eaf207ca changeset: 101557:f383eaf207ca branch: 3.5 parent: 101554:ef89ecb6debc user: Terry Jan Reedy date: Sun May 29 01:40:30 2016 -0400 summary: Issue #27117: Make ColorDelegator htest and turtledemo work with dark theme. Factor out code for configuring text widget colors to a new function. files: Lib/idlelib/ColorDelegator.py | 25 +++++++++++++++++++++++ Lib/idlelib/EditorWindow.py | 17 +------------- Lib/turtledemo/__main__.py | 5 +++- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py --- a/Lib/idlelib/ColorDelegator.py +++ b/Lib/idlelib/ColorDelegator.py @@ -2,6 +2,7 @@ import re import keyword import builtins +from tkinter import TkVersion from idlelib.Delegator import Delegator from idlelib.configHandler import idleConf @@ -32,6 +33,28 @@ prog = re.compile(make_pat(), re.S) idprog = re.compile(r"\s+(\w+)", re.S) +def color_config(text): # Called from htest, Editor, and Turtle Demo. + '''Set color opitons of Text widget. + + Should be called whenever ColorDelegator is called. + ''' + # Not automatic because ColorDelegator does not know 'text'. + theme = idleConf.CurrentTheme() + normal_colors = idleConf.GetHighlight(theme, 'normal') + cursor_color = idleConf.GetHighlight(theme, 'cursor', fgBg='fg') + select_colors = idleConf.GetHighlight(theme, 'hilite') + text.config( + foreground=normal_colors['foreground'], + background=normal_colors['background'], + insertbackground=cursor_color, + selectforeground=select_colors['foreground'], + selectbackground=select_colors['background'], + ) + if TkVersion >= 8.5: + text.config( + inactiveselectbackground=select_colors['background']) + + class ColorDelegator(Delegator): def __init__(self): @@ -233,6 +256,7 @@ for tag in self.tagdefs: self.tag_remove(tag, "1.0", "end") + def _color_delegator(parent): # htest # from tkinter import Toplevel, Text from idlelib.Percolator import Percolator @@ -247,6 +271,7 @@ text.insert("insert", source) text.focus_set() + color_config(text) p = Percolator(text) d = ColorDelegator() p.insertfilter(d) diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -90,7 +90,7 @@ class EditorWindow(object): from idlelib.Percolator import Percolator - from idlelib.ColorDelegator import ColorDelegator + from idlelib.ColorDelegator import ColorDelegator, color_config from idlelib.UndoDelegator import UndoDelegator from idlelib.IOBinding import IOBinding, filesystemencoding, encoding from idlelib import Bindings @@ -742,20 +742,7 @@ # Called from self.filename_change_hook and from configDialog.py self._rmcolorizer() self._addcolorizer() - theme = idleConf.CurrentTheme() - normal_colors = idleConf.GetHighlight(theme, 'normal') - cursor_color = idleConf.GetHighlight(theme, 'cursor', fgBg='fg') - select_colors = idleConf.GetHighlight(theme, 'hilite') - self.text.config( - foreground=normal_colors['foreground'], - background=normal_colors['background'], - insertbackground=cursor_color, - selectforeground=select_colors['foreground'], - selectbackground=select_colors['background'], - ) - if TkVersion >= 8.5: - self.text.config( - inactiveselectbackground=select_colors['background']) + EditorWindow.color_config(self.text) IDENTCHARS = string.ascii_letters + string.digits + "_" diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -89,8 +89,8 @@ import os from tkinter import * +from idlelib.ColorDelegator import ColorDelegator, color_config from idlelib.Percolator import Percolator -from idlelib.ColorDelegator import ColorDelegator from idlelib.textView import view_text from turtledemo import __doc__ as about_turtledemo @@ -124,6 +124,8 @@ ('About turtle module', turtle.__doc__), ) + + class DemoWindow(object): def __init__(self, filename=None): @@ -204,6 +206,7 @@ self.text_frame = text_frame = Frame(root) self.text = text = Text(text_frame, name='text', padx=5, wrap='none', width=45) + color_config(text) self.vbar = vbar = Scrollbar(text_frame, name='vbar') vbar['command'] = text.yview -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 01:42:23 2016 From: python-checkins at python.org (terry.reedy) Date: Sun, 29 May 2016 05:42:23 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327117=3A_Make_col?= =?utf-8?q?orizer_htest_and_turtledemo_work_with_dark_theme=2E?= Message-ID: <20160529054223.25276.35389.C73D5CA4@psf.io> https://hg.python.org/cpython/rev/c95864a37ee2 changeset: 101556:c95864a37ee2 user: Terry Jan Reedy date: Sun May 29 01:40:22 2016 -0400 summary: Issue #27117: Make colorizer htest and turtledemo work with dark theme. Factor out code for configuring text widget colors to a new function. files: Lib/idlelib/colorizer.py | 25 +++++++++++++++++++++++++ Lib/idlelib/editor.py | 17 ++--------------- Lib/turtledemo/__main__.py | 5 ++++- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/Lib/idlelib/colorizer.py b/Lib/idlelib/colorizer.py --- a/Lib/idlelib/colorizer.py +++ b/Lib/idlelib/colorizer.py @@ -2,6 +2,7 @@ import re import keyword import builtins +from tkinter import TkVersion from idlelib.delegator import Delegator from idlelib.config import idleConf @@ -32,6 +33,28 @@ prog = re.compile(make_pat(), re.S) idprog = re.compile(r"\s+(\w+)", re.S) +def color_config(text): # Called from htest, Editor, and Turtle Demo. + '''Set color opitons of Text widget. + + Should be called whenever ColorDelegator is called. + ''' + # Not automatic because ColorDelegator does not know 'text'. + theme = idleConf.CurrentTheme() + normal_colors = idleConf.GetHighlight(theme, 'normal') + cursor_color = idleConf.GetHighlight(theme, 'cursor', fgBg='fg') + select_colors = idleConf.GetHighlight(theme, 'hilite') + text.config( + foreground=normal_colors['foreground'], + background=normal_colors['background'], + insertbackground=cursor_color, + selectforeground=select_colors['foreground'], + selectbackground=select_colors['background'], + ) + if TkVersion >= 8.5: + text.config( + inactiveselectbackground=select_colors['background']) + + class ColorDelegator(Delegator): def __init__(self): @@ -233,6 +256,7 @@ for tag in self.tagdefs: self.tag_remove(tag, "1.0", "end") + def _color_delegator(parent): # htest # from tkinter import Toplevel, Text from idlelib.percolator import Percolator @@ -247,6 +271,7 @@ text.insert("insert", source) text.focus_set() + color_config(text) p = Percolator(text) d = ColorDelegator() p.insertfilter(d) diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -90,7 +90,7 @@ class EditorWindow(object): from idlelib.percolator import Percolator - from idlelib.colorizer import ColorDelegator + from idlelib.colorizer import ColorDelegator, color_config from idlelib.undo import UndoDelegator from idlelib.iomenu import IOBinding, filesystemencoding, encoding from idlelib import mainmenu @@ -742,20 +742,7 @@ # Called from self.filename_change_hook and from configdialog.py self._rmcolorizer() self._addcolorizer() - theme = idleConf.CurrentTheme() - normal_colors = idleConf.GetHighlight(theme, 'normal') - cursor_color = idleConf.GetHighlight(theme, 'cursor', fgBg='fg') - select_colors = idleConf.GetHighlight(theme, 'hilite') - self.text.config( - foreground=normal_colors['foreground'], - background=normal_colors['background'], - insertbackground=cursor_color, - selectforeground=select_colors['foreground'], - selectbackground=select_colors['background'], - ) - if TkVersion >= 8.5: - self.text.config( - inactiveselectbackground=select_colors['background']) + EditorWindow.color_config(self.text) IDENTCHARS = string.ascii_letters + string.digits + "_" diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -89,8 +89,8 @@ import os from tkinter import * +from idlelib.colorizer import ColorDelegator, color_config from idlelib.percolator import Percolator -from idlelib.colorizer import ColorDelegator from idlelib.textview import view_text from turtledemo import __doc__ as about_turtledemo @@ -123,6 +123,8 @@ ('About turtle module', turtle.__doc__), ) + + class DemoWindow(object): def __init__(self, filename=None): @@ -203,6 +205,7 @@ self.text_frame = text_frame = Frame(root) self.text = text = Text(text_frame, name='text', padx=5, wrap='none', width=45) + color_config(text) self.vbar = vbar = Scrollbar(text_frame, name='vbar') vbar['command'] = text.yview -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Sun May 29 04:47:47 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 29 May 2016 08:47:47 +0000 Subject: [Python-checkins] Daily reference leaks (c95864a37ee2): sum=5 Message-ID: <20160529084746.122118.42697.F069234D@psf.io> results for c95864a37ee2 on branch "default" -------------------------------------------- test_asyncio leaked [3, 0, 0] memory blocks, sum=3 test_collections leaked [-2, 0, 0] references, sum=-2 test_collections leaked [3, 0, -4] memory blocks, sum=-1 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_spawn leaked [-1, -1, 2] memory blocks, sum=0 test_smtplib leaked [1, 0, 0] references, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogdZTIC1', '--timeout', '7200'] From python-checkins at python.org Sun May 29 05:09:01 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 29 May 2016 09:09:01 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MTI1?= =?utf-8?q?=3A_Fix_various_errors_like_=E2=80=9Cwill_=5Bbe=5D_inherited?= =?utf-8?b?4oCd?= Message-ID: <20160529090859.110816.13403.55E5ED28@psf.io> https://hg.python.org/cpython/rev/f7c85accbde9 changeset: 101559:f7c85accbde9 branch: 3.5 parent: 101557:f383eaf207ca user: Martin Panter date: Sun May 29 04:13:35 2016 +0000 summary: Issue #27125: Fix various errors like ?will [be] inherited? files: Doc/library/collections.rst | 2 +- Doc/library/multiprocessing.rst | 2 +- Doc/library/os.rst | 2 +- Doc/library/shlex.rst | 3 ++- Doc/library/typing.rst | 2 +- Doc/whatsnew/2.6.rst | 2 +- Lib/collections/__init__.py | 3 ++- Lib/email/message.py | 2 +- Lib/test/test_httplib.py | 4 ++-- Lib/tkinter/tix.py | 2 +- Misc/HISTORY | 4 ++-- Objects/object.c | 2 +- README | 2 +- 13 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -56,7 +56,7 @@ dictionary is provided so that a new chain always has at least one mapping. The underlying mappings are stored in a list. That list is public and can - accessed or updated using the *maps* attribute. There is no other state. + be accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -2478,7 +2478,7 @@ If authentication is requested but no authentication key is specified then the return value of ``current_process().authkey`` is used (see -:class:`~multiprocessing.Process`). This value will automatically inherited by +:class:`~multiprocessing.Process`). This value will be automatically inherited by any :class:`~multiprocessing.Process` object that the current process creates. This means that (by default) all processes of a multi-process program will share a single authentication key which can be used when setting up connections diff --git a/Doc/library/os.rst b/Doc/library/os.rst --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3486,7 +3486,7 @@ .. data:: SCHED_RESET_ON_FORK - This flag can OR'ed with any other scheduling policy. When a process with + This flag can be OR'ed with any other scheduling policy. When a process with this flag set forks, its child's scheduling policy and priority are reset to the default. diff --git a/Doc/library/shlex.rst b/Doc/library/shlex.rst --- a/Doc/library/shlex.rst +++ b/Doc/library/shlex.rst @@ -244,7 +244,8 @@ This attribute is ``None`` by default. If you assign a string to it, that string will be recognized as a lexical-level inclusion request similar to the ``source`` keyword in various shells. That is, the immediately following token - will opened as a filename and input taken from that stream until EOF, at which + will be opened as a filename and input will + be taken from that stream until EOF, at which point the :meth:`~io.IOBase.close` method of that stream will be called and the input source will again become the original input stream. Source requests may be stacked any number of levels deep. diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -156,7 +156,7 @@ class LinkedList(Sized, Generic[T]): ... -When inheriting from generic classes, some type variables could fixed:: +When inheriting from generic classes, some type variables could be fixed:: from typing import TypeVar, Mapping diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -3154,7 +3154,7 @@ :func:`macostools.touched` function to be removed because it depended on the :mod:`macfs` module. (:issue:`1490190`) -* Many other Mac OS modules have been deprecated and will removed in +* Many other Mac OS modules have been deprecated and will be removed in Python 3.0: :mod:`_builtinSuites`, :mod:`aepack`, diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -850,7 +850,8 @@ to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can - accessed or updated using the *maps* attribute. There is no other state. + be accessed or updated using the *maps* attribute. There is no other + state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first diff --git a/Lib/email/message.py b/Lib/email/message.py --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -710,7 +710,7 @@ message, it will be set to "text/plain" and the new parameter and value will be appended as per RFC 2045. - An alternate header can specified in the header argument, and all + An alternate header can be specified in the header argument, and all parameters will be quoted as necessary unless requote is False. If charset is specified, the parameter will be encoded according to RFC diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -255,8 +255,8 @@ self.assertIn(b'\xa0NonbreakSpace: value', conn._buffer) def test_ipv6host_header(self): - # Default host header on IPv6 transaction should wrapped by [] if - # its actual IPv6 address + # Default host header on IPv6 transaction should be wrapped by [] if + # it is an IPv6 address expected = b'GET /foo HTTP/1.1\r\nHost: [2001::]:81\r\n' \ b'Accept-Encoding: identity\r\n\r\n' conn = client.HTTPConnection('[2001::]:81') diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py --- a/Lib/tkinter/tix.py +++ b/Lib/tkinter/tix.py @@ -1052,7 +1052,7 @@ class LabelEntry(TixWidget): """LabelEntry - Entry field with label. Packages an entry widget - and a label into one mega widget. It can beused be used to simplify + and a label into one mega widget. It can be used be used to simplify the creation of ``entry-form'' type of interface. Subwidgets Class diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -6633,7 +6633,7 @@ PyErr_Format, on machines with HAVE_LONG_LONG defined. - Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in - PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be should used for + PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be used for accessing the d_type and d_name members of structures using PyDescr_COMMON. - Issue #6405: Remove duplicate type declarations in descrobject.h. @@ -16065,7 +16065,7 @@ - All standard iterators now ensure that, once StopIteration has been raised, all future calls to next() on the same iterator will also raise StopIteration. There used to be various counterexamples to - this behavior, which could caused confusion or subtle program + this behavior, which could have caused confusion or subtle program breakage, without any benefits. (Note that this is still an iterator's responsibility; the iterator framework does not enforce this.) diff --git a/Objects/object.c b/Objects/object.c --- a/Objects/object.c +++ b/Objects/object.c @@ -1865,7 +1865,7 @@ /* These methods are used to control infinite recursion in repr, str, print, etc. Container objects that may recursively contain themselves, - e.g. builtin dictionaries and lists, should used Py_ReprEnter() and + e.g. builtin dictionaries and lists, should use Py_ReprEnter() and Py_ReprLeave() to avoid infinite recursion. Py_ReprEnter() returns 0 the first time it is called for a particular diff --git a/README b/README --- a/README +++ b/README @@ -58,7 +58,7 @@ If ran, the "profile-opt" rule will do several steps. First, the entire Python directory is cleaned of temporary files that -may resulted in a previous compilation. +may have resulted in a previous compilation. Then, an instrumented version of the interpreter is built, using suitable compiler flags for each flavour. Note that this is just an intermediary -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 05:09:01 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 29 May 2016 09:09:01 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI3MTI1?= =?utf-8?q?=3A_Fix_various_errors_like_=E2=80=9Cwill_=5Bbe=5D_inherited?= =?utf-8?b?4oCd?= Message-ID: <20160529090859.122132.96242.673F5BAD@psf.io> https://hg.python.org/cpython/rev/c817d1b5b937 changeset: 101558:c817d1b5b937 branch: 2.7 parent: 101549:3ff84a3eeb6b user: Martin Panter date: Sun May 29 08:13:58 2016 +0000 summary: Issue #27125: Fix various errors like ?will [be] inherited? files: Demo/tkinter/guido/canvasevents.py | 2 +- Doc/c-api/allocation.rst | 2 +- Doc/library/multiprocessing.rst | 4 ++-- Doc/library/shlex.rst | 3 ++- Doc/whatsnew/2.6.rst | 2 +- Lib/email/message.py | 2 +- Lib/lib-tk/Tix.py | 2 +- Lib/rfc822.py | 2 +- Lib/test/test_httplib.py | 4 ++-- Misc/HISTORY | 2 +- Objects/object.c | 2 +- README | 2 +- 12 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Demo/tkinter/guido/canvasevents.py b/Demo/tkinter/guido/canvasevents.py --- a/Demo/tkinter/guido/canvasevents.py +++ b/Demo/tkinter/guido/canvasevents.py @@ -24,7 +24,7 @@ depends on the object; for simple objects, it may be their center. Objects have mouse sensitivity. They can be clicked, dragged and - double-clicked. The behavior may actually determined by the pile + double-clicked. The behavior may actually be determined by the pile they are in. All instance attributes are public since the derived class may diff --git a/Doc/c-api/allocation.rst b/Doc/c-api/allocation.rst --- a/Doc/c-api/allocation.rst +++ b/Doc/c-api/allocation.rst @@ -98,7 +98,7 @@ Create a new module object based on a name and table of functions, returning the new module object. If *doc* is non-*NULL*, it will be used to define the docstring for the module. If *self* is non-*NULL*, it will - passed to the functions of the module as their (otherwise *NULL*) first + be passed to the functions of the module as their (otherwise *NULL*) first parameter. (This was added as an experimental feature, and there are no known uses in the current version of Python.) For *apiver*, the only value which should be passed is defined by the constant diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -2137,9 +2137,9 @@ authentication key. (Demonstrating that both ends are using the same key does **not** involve sending the key over the connection.) -If authentication is requested but do authentication key is specified then the +If authentication is requested but no authentication key is specified then the return value of ``current_process().authkey`` is used (see -:class:`~multiprocessing.Process`). This value will automatically inherited by +:class:`~multiprocessing.Process`). This value will be automatically inherited by any :class:`~multiprocessing.Process` object that the current process creates. This means that (by default) all processes of a multi-process program will share a single authentication key which can be used when setting up connections diff --git a/Doc/library/shlex.rst b/Doc/library/shlex.rst --- a/Doc/library/shlex.rst +++ b/Doc/library/shlex.rst @@ -231,7 +231,8 @@ This attribute is ``None`` by default. If you assign a string to it, that string will be recognized as a lexical-level inclusion request similar to the ``source`` keyword in various shells. That is, the immediately following token - will opened as a filename and input taken from that stream until EOF, at which + will be opened as a filename and input will + be taken from that stream until EOF, at which point the :meth:`~io.IOBase.close` method of that stream will be called and the input source will again become the original input stream. Source requests may be stacked any number of levels deep. diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -3150,7 +3150,7 @@ :func:`macostools.touched` function to be removed because it depended on the :mod:`macfs` module. (:issue:`1490190`) -* Many other Mac OS modules have been deprecated and will removed in +* Many other Mac OS modules have been deprecated and will be removed in Python 3.0: :mod:`_builtinSuites`, :mod:`aepack`, diff --git a/Lib/email/message.py b/Lib/email/message.py --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -579,7 +579,7 @@ message, it will be set to "text/plain" and the new parameter and value will be appended as per RFC 2045. - An alternate header can specified in the header argument, and all + An alternate header can be specified in the header argument, and all parameters will be quoted as necessary unless requote is False. If charset is specified, the parameter will be encoded according to RFC diff --git a/Lib/lib-tk/Tix.py b/Lib/lib-tk/Tix.py --- a/Lib/lib-tk/Tix.py +++ b/Lib/lib-tk/Tix.py @@ -1052,7 +1052,7 @@ class LabelEntry(TixWidget): """LabelEntry - Entry field with label. Packages an entry widget - and a label into one mega widget. It can beused be used to simplify + and a label into one mega widget. It can be used be used to simplify the creation of ``entry-form'' type of interface. Subwidgets Class diff --git a/Lib/rfc822.py b/Lib/rfc822.py --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -961,7 +961,7 @@ According to RFC 1123, day and month names must always be in English. If not for that, this code could use strftime(). It - can't because strftime() honors the locale and could generated + can't because strftime() honors the locale and could generate non-English names. """ if timeval is None: diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -213,8 +213,8 @@ self.assertIn(b'\xa0NonbreakSpace: value', conn._buffer) def test_ipv6host_header(self): - # Default host header on IPv6 transaction should wrapped by [] if - # its actual IPv6 address + # Default host header on IPv6 transaction should be wrapped by [] if + # it is an IPv6 address expected = 'GET /foo HTTP/1.1\r\nHost: [2001::]:81\r\n' \ 'Accept-Encoding: identity\r\n\r\n' conn = httplib.HTTPConnection('[2001::]:81') diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -5148,7 +5148,7 @@ - All standard iterators now ensure that, once StopIteration has been raised, all future calls to next() on the same iterator will also raise StopIteration. There used to be various counterexamples to - this behavior, which could caused confusion or subtle program + this behavior, which could have caused confusion or subtle program breakage, without any benefits. (Note that this is still an iterator's responsibility; the iterator framework does not enforce this.) diff --git a/Objects/object.c b/Objects/object.c --- a/Objects/object.c +++ b/Objects/object.c @@ -2358,7 +2358,7 @@ /* These methods are used to control infinite recursion in repr, str, print, etc. Container objects that may recursively contain themselves, - e.g. builtin dictionaries and lists, should used Py_ReprEnter() and + e.g. builtin dictionaries and lists, should use Py_ReprEnter() and Py_ReprLeave() to avoid infinite recursion. Py_ReprEnter() returns 0 the first time it is called for a particular diff --git a/README b/README --- a/README +++ b/README @@ -197,7 +197,7 @@ If ran, the "profile-opt" rule will do several steps. First, the entire Python directory is cleaned of temporary files that -may resulted in a previous compilation. +may have resulted in a previous compilation. Then, an instrumented version of the interpreter is built, using suitable compiler flags for each flavour. Note that this is just an intermediary -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 05:09:16 2016 From: python-checkins at python.org (martin.panter) Date: Sun, 29 May 2016 09:09:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327125=3A_Merge_typo_fixes_from_3=2E5?= Message-ID: <20160529090859.32451.45142.E7DBB5C9@psf.io> https://hg.python.org/cpython/rev/169551a8d5d1 changeset: 101560:169551a8d5d1 parent: 101556:c95864a37ee2 parent: 101559:f7c85accbde9 user: Martin Panter date: Sun May 29 09:05:06 2016 +0000 summary: Issue #27125: Merge typo fixes from 3.5 Also merge changes from Issue #27117; no actual code changes to 3.6. files: Doc/library/collections.rst | 2 +- Doc/library/multiprocessing.rst | 2 +- Doc/library/os.rst | 2 +- Doc/library/shlex.rst | 3 ++- Doc/library/typing.rst | 2 +- Doc/whatsnew/2.6.rst | 2 +- Lib/collections/__init__.py | 3 ++- Lib/email/message.py | 2 +- Lib/test/test_httplib.py | 4 ++-- Lib/tkinter/tix.py | 2 +- Misc/HISTORY | 4 ++-- Objects/object.c | 2 +- README | 2 +- 13 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -56,7 +56,7 @@ dictionary is provided so that a new chain always has at least one mapping. The underlying mappings are stored in a list. That list is public and can - accessed or updated using the *maps* attribute. There is no other state. + be accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -2484,7 +2484,7 @@ If authentication is requested but no authentication key is specified then the return value of ``current_process().authkey`` is used (see -:class:`~multiprocessing.Process`). This value will automatically inherited by +:class:`~multiprocessing.Process`). This value will be automatically inherited by any :class:`~multiprocessing.Process` object that the current process creates. This means that (by default) all processes of a multi-process program will share a single authentication key which can be used when setting up connections diff --git a/Doc/library/os.rst b/Doc/library/os.rst --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3507,7 +3507,7 @@ .. data:: SCHED_RESET_ON_FORK - This flag can OR'ed with any other scheduling policy. When a process with + This flag can be OR'ed with any other scheduling policy. When a process with this flag set forks, its child's scheduling policy and priority are reset to the default. diff --git a/Doc/library/shlex.rst b/Doc/library/shlex.rst --- a/Doc/library/shlex.rst +++ b/Doc/library/shlex.rst @@ -244,7 +244,8 @@ This attribute is ``None`` by default. If you assign a string to it, that string will be recognized as a lexical-level inclusion request similar to the ``source`` keyword in various shells. That is, the immediately following token - will opened as a filename and input taken from that stream until EOF, at which + will be opened as a filename and input will + be taken from that stream until EOF, at which point the :meth:`~io.IOBase.close` method of that stream will be called and the input source will again become the original input stream. Source requests may be stacked any number of levels deep. diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -156,7 +156,7 @@ class LinkedList(Sized, Generic[T]): ... -When inheriting from generic classes, some type variables could fixed:: +When inheriting from generic classes, some type variables could be fixed:: from typing import TypeVar, Mapping diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -3154,7 +3154,7 @@ :func:`macostools.touched` function to be removed because it depended on the :mod:`macfs` module. (:issue:`1490190`) -* Many other Mac OS modules have been deprecated and will removed in +* Many other Mac OS modules have been deprecated and will be removed in Python 3.0: :mod:`_builtinSuites`, :mod:`aepack`, diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -850,7 +850,8 @@ to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can - accessed or updated using the *maps* attribute. There is no other state. + be accessed or updated using the *maps* attribute. There is no other + state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first diff --git a/Lib/email/message.py b/Lib/email/message.py --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -710,7 +710,7 @@ message, it will be set to "text/plain" and the new parameter and value will be appended as per RFC 2045. - An alternate header can specified in the header argument, and all + An alternate header can be specified in the header argument, and all parameters will be quoted as necessary unless requote is False. If charset is specified, the parameter will be encoded according to RFC diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -255,8 +255,8 @@ self.assertIn(b'\xa0NonbreakSpace: value', conn._buffer) def test_ipv6host_header(self): - # Default host header on IPv6 transaction should wrapped by [] if - # its actual IPv6 address + # Default host header on IPv6 transaction should be wrapped by [] if + # it is an IPv6 address expected = b'GET /foo HTTP/1.1\r\nHost: [2001::]:81\r\n' \ b'Accept-Encoding: identity\r\n\r\n' conn = client.HTTPConnection('[2001::]:81') diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py --- a/Lib/tkinter/tix.py +++ b/Lib/tkinter/tix.py @@ -1048,7 +1048,7 @@ class LabelEntry(TixWidget): """LabelEntry - Entry field with label. Packages an entry widget - and a label into one mega widget. It can beused be used to simplify + and a label into one mega widget. It can be used be used to simplify the creation of ``entry-form'' type of interface. Subwidgets Class diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -6633,7 +6633,7 @@ PyErr_Format, on machines with HAVE_LONG_LONG defined. - Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in - PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be should used for + PEP 3123). The PyDescr_TYPE and PyDescr_NAME macros should be used for accessing the d_type and d_name members of structures using PyDescr_COMMON. - Issue #6405: Remove duplicate type declarations in descrobject.h. @@ -16065,7 +16065,7 @@ - All standard iterators now ensure that, once StopIteration has been raised, all future calls to next() on the same iterator will also raise StopIteration. There used to be various counterexamples to - this behavior, which could caused confusion or subtle program + this behavior, which could have caused confusion or subtle program breakage, without any benefits. (Note that this is still an iterator's responsibility; the iterator framework does not enforce this.) diff --git a/Objects/object.c b/Objects/object.c --- a/Objects/object.c +++ b/Objects/object.c @@ -1853,7 +1853,7 @@ /* These methods are used to control infinite recursion in repr, str, print, etc. Container objects that may recursively contain themselves, - e.g. builtin dictionaries and lists, should used Py_ReprEnter() and + e.g. builtin dictionaries and lists, should use Py_ReprEnter() and Py_ReprLeave() to avoid infinite recursion. Py_ReprEnter() returns 0 the first time it is called for a particular diff --git a/README b/README --- a/README +++ b/README @@ -58,7 +58,7 @@ If ran, the "profile-opt" rule will do several steps. First, the entire Python directory is cleaned of temporary files that -may resulted in a previous compilation. +may have resulted in a previous compilation. Then, an instrumented version of the interpreter is built, using suitable compiler flags for each flavour. Note that this is just an intermediary -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 12:47:56 2016 From: python-checkins at python.org (terry.reedy) Date: Sun, 29 May 2016 16:47:56 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_default_-=3E_default?= =?utf-8?q?=29=3A_Merge_heads?= Message-ID: <20160529164756.110808.64153.C2D28830@psf.io> https://hg.python.org/cpython/rev/d251106cf095 changeset: 101562:d251106cf095 parent: 101560:169551a8d5d1 parent: 101561:0bbcb4cd64ba user: Terry Jan Reedy date: Sun May 29 12:47:38 2016 -0400 summary: Merge heads files: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 12:47:56 2016 From: python-checkins at python.org (terry.reedy) Date: Sun, 29 May 2016 16:47:56 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Null_merge?= Message-ID: <20160529164756.23323.86316.F9DD90EB@psf.io> https://hg.python.org/cpython/rev/0bbcb4cd64ba changeset: 101561:0bbcb4cd64ba parent: 101556:c95864a37ee2 parent: 101557:f383eaf207ca user: Terry Jan Reedy date: Sun May 29 12:42:46 2016 -0400 summary: Null merge files: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 16:44:05 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 29 May 2016 20:44:05 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Improved_docs_for_issue270?= =?utf-8?q?33=2E_Based_on_comments_by_R=2E_David_Murray=2E?= Message-ID: <20160529204359.122126.34900.5CCFFC25@psf.io> https://hg.python.org/cpython/rev/9abde519cc1e changeset: 101563:9abde519cc1e user: Serhiy Storchaka date: Sun May 29 23:43:24 2016 +0300 summary: Improved docs for issue27033. Based on comments by R. David Murray. files: Doc/library/smtpd.rst | 10 +++++----- Doc/whatsnew/3.6.rst | 8 ++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst --- a/Doc/library/smtpd.rst +++ b/Doc/library/smtpd.rst @@ -52,8 +52,8 @@ cannot be set to ``True`` at the same time. *decode_data* specifies whether the data portion of the SMTP transaction - should be decoded using UTF-8. The default is ``False``. When - *decode_data* is not set to ``True`` the server advertises the ``8BITMIME`` + should be decoded using UTF-8. When *decode_data* is ``False`` (the + default), the server advertises the ``8BITMIME`` extension (:rfc:`6152`), accepts the ``BODY=8BITMIME`` parameter to the ``MAIL`` command, and when present passes it to :meth:`process_message` in the ``kwargs['mail_options']`` list. *decode_data* and *enable_SMTPUTF8* @@ -70,7 +70,7 @@ format). If the *decode_data* constructor keyword is set to ``True``, the *data* - parameter will be a unicode string. If it is set to ``False``, it + argument will be a unicode string. If it is set to ``False``, it will be a bytes object. *kwargs* is a dictionary containing additional information. It is empty @@ -107,8 +107,8 @@ .. versionadded:: 3.5 The *decode_data* and *enable_SMTPUTF8* constructor parameters, and the - *kwargs* parameter to :meth:`process_message` when one or more of these is - specified. + *kwargs* parameter to :meth:`process_message` when *decode_data* is + ``False``. .. versionchanged:: 3.6 *decode_data* is now ``False`` by default. diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -640,6 +640,14 @@ an error (e.g. EBADF) was reported by the underlying system call. See :issue:`26685`. +* The *decode_data* argument for :class:`smtpd.SMTPChannel` and + :class:`smtpd.SMTPServer` constructors is now ``False`` by default. + This means that the argument passed to + :meth:`~smtpd.SMTPServer.process_message` is now a bytes object by + default, and ``process_message()`` will be passed keyword arguments. + Code that has already been updated in accordance with the deprecation + warning generated by 3.5 will not be affected. + Changes in the C API -------------------- -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 16:51:57 2016 From: python-checkins at python.org (serhiy.storchaka) Date: Sun, 29 May 2016 20:51:57 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327033=3A_Removed_?= =?utf-8?q?unnecessary_the_bool_calls=2E?= Message-ID: <20160529205156.10648.38720.0040A53E@psf.io> https://hg.python.org/cpython/rev/71813a05e488 changeset: 101564:71813a05e488 user: Serhiy Storchaka date: Sun May 29 23:50:56 2016 +0300 summary: Issue #27033: Removed unnecessary the bool calls. files: Lib/smtpd.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/smtpd.py b/Lib/smtpd.py --- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -134,8 +134,8 @@ self.conn = conn self.addr = addr self.data_size_limit = data_size_limit - self.enable_SMTPUTF8 = enable_SMTPUTF8 = bool(enable_SMTPUTF8) - self._decode_data = decode_data = bool(decode_data) + self.enable_SMTPUTF8 = enable_SMTPUTF8 + self._decode_data = decode_data if enable_SMTPUTF8 and decode_data: raise ValueError("decode_data and enable_SMTPUTF8 cannot" " be set to True at the same time") @@ -632,8 +632,8 @@ self._localaddr = localaddr self._remoteaddr = remoteaddr self.data_size_limit = data_size_limit - self.enable_SMTPUTF8 = enable_SMTPUTF8 = bool(enable_SMTPUTF8) - self._decode_data = decode_data = bool(decode_data) + self.enable_SMTPUTF8 = enable_SMTPUTF8 + self._decode_data = decode_data if enable_SMTPUTF8 and decode_data: raise ValueError("decode_data and enable_SMTPUTF8 cannot" " be set to True at the same time") -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 23:38:01 2016 From: python-checkins at python.org (senthil.kumaran) Date: Mon, 30 May 2016 03:38:01 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_=5Bmerge_from_3=2E5=5D_issue27043_-_Explain_the_inspect?= =?utf-8?q?=2Ecleandoc_behavior_on_synopsis?= Message-ID: <20160530033801.13771.70286.35C4729F@psf.io> https://hg.python.org/cpython/rev/4d5a5d4e731d changeset: 101566:4d5a5d4e731d parent: 101564:71813a05e488 parent: 101565:c1eb32e183fd user: Senthil Kumaran date: Sun May 29 20:37:54 2016 -0700 summary: [merge from 3.5] issue27043 - Explain the inspect.cleandoc behavior on synopsis line and other lines. Patch contributed by Nathan Harold. files: Doc/library/inspect.rst | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -470,8 +470,12 @@ .. function:: cleandoc(doc) Clean up indentation from docstrings that are indented to line up with blocks - of code. Any whitespace that can be uniformly removed from the second line - onwards is removed. Also, all tabs are expanded to spaces. + of code. + + All leading whitespace is removed from the first line. Any leading whitespace + that can be uniformly removed from the second line onwards is removed. Empty + lines at the beginning and end are subsequently removed. Also, all tabs are + expanded to spaces. .. _inspect-signature-object: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 23:38:02 2016 From: python-checkins at python.org (senthil.kumaran) Date: Mon, 30 May 2016 03:38:02 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_issue27043_-_E?= =?utf-8?q?xplain_the_inspect=2Ecleandoc_behavior_on_synopsis_line_and_oth?= =?utf-8?q?er?= Message-ID: <20160530033801.103227.58740.90DC309E@psf.io> https://hg.python.org/cpython/rev/c1eb32e183fd changeset: 101565:c1eb32e183fd branch: 3.5 parent: 101559:f7c85accbde9 user: Senthil Kumaran date: Sun May 29 20:36:58 2016 -0700 summary: issue27043 - Explain the inspect.cleandoc behavior on synopsis line and other lines. Patch contributed by Nathan Harold. files: Doc/library/inspect.rst | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -489,8 +489,12 @@ .. function:: cleandoc(doc) Clean up indentation from docstrings that are indented to line up with blocks - of code. Any whitespace that can be uniformly removed from the second line - onwards is removed. Also, all tabs are expanded to spaces. + of code. + + All leading whitespace is removed from the first line. Any leading whitespace + that can be uniformly removed from the second line onwards is removed. Empty + lines at the beginning and end are subsequently removed. Also, all tabs are + expanded to spaces. .. _inspect-signature-object: -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Sun May 29 23:39:01 2016 From: python-checkins at python.org (senthil.kumaran) Date: Mon, 30 May 2016 03:39:01 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_issue27043_-_E?= =?utf-8?q?xplain_the_inspect=2Ecleandoc_behavior_on_synopsis_line_and_oth?= =?utf-8?q?er?= Message-ID: <20160530033900.10654.52115.D709B46C@psf.io> https://hg.python.org/cpython/rev/8f841baa0e06 changeset: 101567:8f841baa0e06 branch: 2.7 parent: 101558:c817d1b5b937 user: Senthil Kumaran date: Sun May 29 20:38:55 2016 -0700 summary: issue27043 - Explain the inspect.cleandoc behavior on synopsis line and other lines. Patch contributed by Nathan Harold. files: Doc/library/inspect.rst | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -443,8 +443,12 @@ .. function:: cleandoc(doc) Clean up indentation from docstrings that are indented to line up with blocks - of code. Any whitespace that can be uniformly removed from the second line - onwards is removed. Also, all tabs are expanded to spaces. + of code. + + All leading whitespace is removed from the first line. Any leading whitespace + that can be uniformly removed from the second line onwards is removed. Empty + lines at the beginning and end are subsequently removed. Also, all tabs are + expanded to spaces. .. versionadded:: 2.6 -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 30 01:04:24 2016 From: python-checkins at python.org (terry.reedy) Date: Mon, 30 May 2016 05:04:24 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Add_items_to_M?= =?utf-8?q?ISC/NEWS_and_idlelib/NEWS=2Etxt=2E?= Message-ID: <20160530050423.11432.5410.D1731544@psf.io> https://hg.python.org/cpython/rev/6a9d851c64cb changeset: 101568:6a9d851c64cb branch: 2.7 user: Terry Jan Reedy date: Mon May 30 01:02:28 2016 -0400 summary: Add items to MISC/NEWS and idlelib/NEWS.txt. files: Lib/idlelib/NEWS.txt | 25 +++++++++++++++++++++++++ Misc/NEWS | 16 ++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -1,3 +1,28 @@ +What's New in IDLE 2.7.12? +========================== +*Release date: 2015-06-30?* + +- Issue #26673: When tk reports font size as 0, change to size 10. + Such fonts on Linux prevented the configuration dialog from opening. + +- Issue #27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. + +- In the 'IDLE-console differences' section of the IDLE doc, clarify + how running with IDLE affects sys.modules and the standard streams. + +- Issue #25507: fix incorrect change in IOBinding that prevented printing. + Change also prevented saving shell window with non-ascii characters. + Augment IOBinding htest to include all major IOBinding functions. + +- Issue #25905: Revert unwanted conversion of ' to ? RIGHT SINGLE QUOTATION + MARK in README.txt and open this and NEWS.txt with 'ascii'. + Re-encode CREDITS.txt to utf-8 and open it with 'utf-8'. + +- Issue #26417: Prevent spurious errors and incorrect defaults when + installing IDLE 2.7 on OS X: default configuration settings are + no longer installed from OS X specific copies. + + What's New in IDLE 2.7.11? ========================== *Release date: 2015-12-06* diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -253,6 +253,22 @@ IDLE ---- +- Issue #26673: When tk reports font size as 0, change to size 10. + Such fonts on Linux prevented the configuration dialog from opening. + +- Issue #27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. + +- In the 'IDLE-console differences' section of the IDLE doc, clarify + how running with IDLE affects sys.modules and the standard streams. + +- Issue #25507: fix incorrect change in IOBinding that prevented printing. + Change also prevented saving shell window with non-ascii characters. + Augment IOBinding htest to include all major IOBinding functions. + +- Issue #25905: Revert unwanted conversion of ' to ??? RIGHT SINGLE QUOTATION + MARK in README.txt and open this and NEWS.txt with 'ascii'. + Re-encode CREDITS.txt to utf-8 and open it with 'utf-8'. + - Issue #26417: Prevent spurious errors and incorrect defaults when installing IDLE 2.7 on OS X: default configuration settings are no longer installed from OS X specific copies. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 30 01:04:24 2016 From: python-checkins at python.org (terry.reedy) Date: Mon, 30 May 2016 05:04:24 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Add_items_to_MISC/NEWS_and_idlelib/NEWS=2Etxt=2E?= Message-ID: <20160530050424.10318.76292.A291725B@psf.io> https://hg.python.org/cpython/rev/d9de41e633d6 changeset: 101570:d9de41e633d6 parent: 101566:4d5a5d4e731d parent: 101569:8bde7ef688b7 user: Terry Jan Reedy date: Mon May 30 01:04:08 2016 -0400 summary: Add items to MISC/NEWS and idlelib/NEWS.txt. files: Lib/idlelib/NEWS.txt | 44 ++++++++++++++++++++++++++++++- Misc/NEWS | 43 +++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 2 deletions(-) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -1,6 +1,46 @@ -What's New in IDLE 3.6.0a1? +What's New in IDLE 3.6.0? =========================== -*Release date: 2017?* +*Release date: 2016-09-??* + +- Issue #27117: Make colorizer htest and turtledemo work with dark themes. + Move code for configuring text widget colors to a new function. + +- Issue #24225: Rename many idlelib/*.py and idle_test/test_*.py files. + Edit files to replace old names with new names when the old name + referred to the module rather than the class it contained. + See the issue and IDLE section in What's New in 3.6 for more. + +- Issue #26673: When tk reports font size as 0, change to size 10. + Such fonts on Linux prevented the configuration dialog from opening. + +- Issue #21939: Add test for IDLE's percolator. + Original patch by Saimadhav Heblikar. + +- Issue #21676: Add test for IDLE's replace dialog. + Original patch by Saimadhav Heblikar. + +- Issue #18410: Add test for IDLE's search dialog. + Original patch by Westley Mart?nez. + +- Issue #21703: Add test for undo delegator. Patch mostly by + Saimadhav Heblikar . + +- Issue #27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. + +- Issue #23977: Add more asserts to test_delegator. + +- Issue #20640: Add tests for idlelib.configHelpSourceEdit. + Patch by Saimadhav Heblikar. + +- In the 'IDLE-console differences' section of the IDLE doc, clarify + how running with IDLE affects sys.modules and the standard streams. + +- Issue #25507: fix incorrect change in IOBinding that prevented printing. + Augment IOBinding htest to include all major IOBinding functions. + +- Issue #25905: Revert unwanted conversion of ' to ? RIGHT SINGLE QUOTATION + MARK in README.txt and open this and NEWS.txt with 'ascii'. + Re-encode CREDITS.txt to utf-8 and open it with 'utf-8'. - Issue 15348: Stop the debugger engine (normally in a user process) before closing the debugger window (running in the IDLE process). diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -36,6 +36,36 @@ - Issue #27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to deserialize a lot of small objects. +IDLE +---- + +- Issue #27117: Make colorizer htest and turtledemo work with dark themes. + Move code for configuring text widget colors to a new function. + +- Issue #24225: Rename many idlelib/*.py and idle_test/test_*.py files. + Edit files to replace old names with new names when the old name + referred to the module rather than the class it contained. + See the issue and IDLE section in What's New in 3.6 for more. + +- Issue #26673: When tk reports font size as 0, change to size 10. + Such fonts on Linux prevented the configuration dialog from opening. + +- Issue #21939: Add test for IDLE's percolator. + Original patch by Saimadhav Heblikar. + +- Issue #21676: Add test for IDLE's replace dialog. + Original patch by Saimadhav Heblikar. + +- Issue #18410: Add test for IDLE's search dialog. + Original patch by Westley Mart??nez. + +- Issue #21703: Add test for undo delegator. Patch mostly by + Saimadhav Heblikar . + +- Issue #27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. + +- Issue #23977: Add more asserts to test_delegator. + Tests ----- @@ -1051,6 +1081,19 @@ IDLE ---- +- Issue #20640: Add tests for idlelib.configHelpSourceEdit. + Patch by Saimadhav Heblikar. + +- In the 'IDLE-console differences' section of the IDLE doc, clarify + how running with IDLE affects sys.modules and the standard streams. + +- Issue #25507: fix incorrect change in IOBinding that prevented printing. + Augment IOBinding htest to include all major IOBinding functions. + +- Issue #25905: Revert unwanted conversion of ' to ??? RIGHT SINGLE QUOTATION + MARK in README.txt and open this and NEWS.txt with 'ascii'. + Re-encode CREDITS.txt to utf-8 and open it with 'utf-8'. + - Issue #15348: Stop the debugger engine (normally in a user process) before closing the debugger window (running in the IDLE process). This prevents the RuntimeErrors that were being caught and ignored. -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 30 01:04:34 2016 From: python-checkins at python.org (terry.reedy) Date: Mon, 30 May 2016 05:04:34 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=283=2E5=29=3A_Add_items_to_M?= =?utf-8?q?ISC/NEWS_and_idlelib/NEWS=2Etxt=2E?= Message-ID: <20160530050424.10806.98781.B943CEAD@psf.io> https://hg.python.org/cpython/rev/8bde7ef688b7 changeset: 101569:8bde7ef688b7 branch: 3.5 parent: 101565:c1eb32e183fd user: Terry Jan Reedy date: Mon May 30 01:02:34 2016 -0400 summary: Add items to MISC/NEWS and idlelib/NEWS.txt. files: Lib/idlelib/NEWS.txt | 40 ++++++++++++++++++++++++++++++++ Misc/NEWS | 38 ++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 0 deletions(-) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -1,3 +1,43 @@ +What's New in IDLE 3.5.2? +========================= +*Release date: 2016-06-30?* + +- Issue #27117: Make colorizer htest and turtledemo work with dark themes. + Move code for configuring text widget colors to a new function. + +- Issue #26673: When tk reports font size as 0, change to size 10. + Such fonts on Linux prevented the configuration dialog from opening. + +- Issue #21939: Add test for IDLE's percolator. + Original patch by Saimadhav Heblikar. + +- Issue #21676: Add test for IDLE's replace dialog. + Original patch by Saimadhav Heblikar. + +- Issue #18410: Add test for IDLE's search dialog. + Original patch by Westley Mart?nez. + +- Issue #21703: Add test for undo delegator. + Original patch by Saimadhav Heblikar . + +- Issue #27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. + +- Issue #23977: Add more asserts to test_delegator. + +- Issue #20640: Add tests for idlelib.configHelpSourceEdit. + Patch by Saimadhav Heblikar. + +- In the 'IDLE-console differences' section of the IDLE doc, clarify + how running with IDLE affects sys.modules and the standard streams. + +- Issue #25507: fix incorrect change in IOBinding that prevented printing. + Augment IOBinding htest to include all major IOBinding functions. + +- Issue #25905: Revert unwanted conversion of ' to ? RIGHT SINGLE QUOTATION + MARK in README.txt and open this and NEWS.txt with 'ascii'. + Re-encode CREDITS.txt to utf-8 and open it with 'utf-8'. + + What's New in IDLE 3.5.1? ========================= *Release date: 2015-12-06* diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -471,6 +471,44 @@ - Issue #27041: asyncio: Add loop.create_future method +IDLE +---- + +- Issue #27117: Make colorizer htest and turtledemo work with dark themes. + Move code for configuring text widget colors to a new function. + +- Issue #26673: When tk reports font size as 0, change to size 10. + Such fonts on Linux prevented the configuration dialog from opening. + +- Issue #21939: Add test for IDLE's percolator. + Original patch by Saimadhav Heblikar. + +- Issue #21676: Add test for IDLE's replace dialog. + Original patch by Saimadhav Heblikar. + +- Issue #18410: Add test for IDLE's search dialog. + Original patch by Westley Mart??nez. + +- Issue #21703: Add test for IDLE's undo delegator. + Original patch by Saimadhav Heblikar . + +- Issue #27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. + +- Issue #23977: Add more asserts to test_delegator. + +- Issue #20640: Add tests for idlelib.configHelpSourceEdit. + Patch by Saimadhav Heblikar. + +- In the 'IDLE-console differences' section of the IDLE doc, clarify + how running with IDLE affects sys.modules and the standard streams. + +- Issue #25507: fix incorrect change in IOBinding that prevented printing. + Augment IOBinding htest to include all major IOBinding functions. + +- Issue #25905: Revert unwanted conversion of ' to ??? RIGHT SINGLE QUOTATION + MARK in README.txt and open this and NEWS.txt with 'ascii'. + Re-encode CREDITS.txt to utf-8 and open it with 'utf-8'. + Documentation ------------- -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 30 01:27:06 2016 From: python-checkins at python.org (martin.panter) Date: Mon, 30 May 2016 05:27:06 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMi43KTogSXNzdWUgIzI3MTI1?= =?utf-8?q?=3A_Remove_duplicated_words_from_documentation_and_comments?= Message-ID: <20160530052706.32433.87087.292F25FB@psf.io> https://hg.python.org/cpython/rev/824d32436198 changeset: 101571:824d32436198 branch: 2.7 parent: 101568:6a9d851c64cb user: Martin Panter date: Mon May 30 04:04:50 2016 +0000 summary: Issue #27125: Remove duplicated words from documentation and comments files: Doc/howto/pyporting.rst | 2 +- Doc/library/tix.rst | 2 +- Lib/ctypes/macholib/README.ctypes | 2 +- Lib/idlelib/idle_test/README.txt | 2 +- Lib/lib-tk/Tix.py | 4 ++-- Lib/test/test_socket.py | 2 +- Modules/_ctypes/_ctypes.c | 2 +- Objects/setobject.c | 2 +- Objects/stringobject.c | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst --- a/Doc/howto/pyporting.rst +++ b/Doc/howto/pyporting.rst @@ -346,7 +346,7 @@ tox with your continuous integration system so that you never accidentally break Python 2 or 3 support. -You may also want to use use the ``-bb`` flag with the Python 3 interpreter to +You may also want to use the ``-bb`` flag with the Python 3 interpreter to trigger an exception when you are comparing bytes to strings. Usually it's simply ``False``, but if you made a mistake in your separation of text/binary data handling you may be accidentally comparing text and binary data. This flag diff --git a/Doc/library/tix.rst b/Doc/library/tix.rst --- a/Doc/library/tix.rst +++ b/Doc/library/tix.rst @@ -151,7 +151,7 @@ The `LabelEntry `_ - widget packages an entry widget and a label into one mega widget. It can be used + widget packages an entry widget and a label into one mega widget. It can be used to simplify the creation of "entry-form" type of interface. .. Python Demo of: diff --git a/Lib/ctypes/macholib/README.ctypes b/Lib/ctypes/macholib/README.ctypes --- a/Lib/ctypes/macholib/README.ctypes +++ b/Lib/ctypes/macholib/README.ctypes @@ -1,4 +1,4 @@ -Files in this directory from from Bob Ippolito's py2app. +Files in this directory come from Bob Ippolito's py2app. License: Any components of the py2app suite may be distributed under the MIT or PSF open source licenses. diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt --- a/Lib/idlelib/idle_test/README.txt +++ b/Lib/idlelib/idle_test/README.txt @@ -16,7 +16,7 @@ The idle directory, idlelib, has over 60 xyz.py files. The idle_test subdirectory should contain a test_xyz.py for each, where 'xyz' is lowercased -even if xyz.py is not. Here is a possible template, with the blanks after after +even if xyz.py is not. Here is a possible template, with the blanks after '.' and 'as', and before and after '_' to be filled in. import unittest diff --git a/Lib/lib-tk/Tix.py b/Lib/lib-tk/Tix.py --- a/Lib/lib-tk/Tix.py +++ b/Lib/lib-tk/Tix.py @@ -1052,8 +1052,8 @@ class LabelEntry(TixWidget): """LabelEntry - Entry field with label. Packages an entry widget - and a label into one mega widget. It can be used be used to simplify - the creation of ``entry-form'' type of interface. + and a label into one mega widget. It can be used to simplify the creation + of ``entry-form'' type of interface. Subwidgets Class ---------- ----- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1755,7 +1755,7 @@ self.conn, self.connaddr = self.srv.accept() def clientSetUp(self): - # The is a hittable race between serverExplicitReady() and the + # There is a hittable race between serverExplicitReady() and the # accept() call; sleep a little while to avoid it, otherwise # we could get an exception time.sleep(0.1) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -55,7 +55,7 @@ from_param(obj) - typecheck and convert a Python object into a C function call parameter - the result may be an instance of the type, or an integer or tuple + The result may be an instance of the type, or an integer or tuple (typecode, value[, obj]) instance methods/properties diff --git a/Objects/setobject.c b/Objects/setobject.c --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -784,7 +784,7 @@ hash *= PySet_GET_SIZE(self) + 1; while (set_next(so, &pos, &entry)) { /* Work to increase the bit dispersion for closely spaced hash - values. The is important because some use cases have many + values. This is important because some use cases have many combinations of a small number of elements with nearby hashes so that many distinct combinations collapse to only a handful of distinct hash values. */ diff --git a/Objects/stringobject.c b/Objects/stringobject.c --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -35,7 +35,7 @@ For PyString_FromString(), the parameter `str' points to a null-terminated string containing exactly `size' bytes. - For PyString_FromStringAndSize(), the parameter the parameter `str' is + For PyString_FromStringAndSize(), the parameter `str' is either NULL or else points to a string containing at least `size' bytes. For PyString_FromStringAndSize(), the string in the `str' parameter does not have to be null-terminated. (Therefore it is safe to construct a -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 30 01:27:12 2016 From: python-checkins at python.org (martin.panter) Date: Mon, 30 May 2016 05:27:12 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327125=3A_Remove_d?= =?utf-8?q?uplicated_words_in_exception_message?= Message-ID: <20160530052712.18932.60416.775503B0@psf.io> https://hg.python.org/cpython/rev/bd0a12277a8e changeset: 101574:bd0a12277a8e user: Martin Panter date: Mon May 30 04:08:23 2016 +0000 summary: Issue #27125: Remove duplicated words in exception message files: Lib/datetime.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/datetime.py b/Lib/datetime.py --- a/Lib/datetime.py +++ b/Lib/datetime.py @@ -254,7 +254,7 @@ raise ValueError("tzinfo.%s() must return a whole number " "of minutes, got %s" % (name, offset)) if not -timedelta(1) < offset < timedelta(1): - raise ValueError("%s()=%s, must be must be strictly between " + raise ValueError("%s()=%s, must be strictly between " "-timedelta(hours=24) and timedelta(hours=24)" % (name, offset)) -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 30 01:27:18 2016 From: python-checkins at python.org (martin.panter) Date: Mon, 30 May 2016 05:27:18 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=28merge_3=2E5_-=3E_default?= =?utf-8?q?=29=3A_Issue_=2327125=3A_Merge_typo_fixes_from_3=2E5?= Message-ID: <20160530052706.10658.6917.A1D98CFF@psf.io> https://hg.python.org/cpython/rev/e553b5ef7ff3 changeset: 101573:e553b5ef7ff3 parent: 101570:d9de41e633d6 parent: 101572:fd0ac7ba091e user: Martin Panter date: Mon May 30 05:24:49 2016 +0000 summary: Issue #27125: Merge typo fixes from 3.5 files: Doc/c-api/module.rst | 2 +- Doc/howto/pyporting.rst | 2 +- Doc/library/enum.rst | 4 ++-- Doc/library/tkinter.tix.rst | 2 +- Doc/library/typing.rst | 2 +- Doc/whatsnew/3.4.rst | 2 +- Doc/whatsnew/3.5.rst | 2 +- Lib/ctypes/macholib/README.ctypes | 2 +- Lib/idlelib/idle_test/README.txt | 3 +-- Lib/test/test_dict.py | 2 +- Lib/test/test_socket.py | 2 +- Lib/tkinter/tix.py | 4 ++-- Misc/HISTORY | 4 ++-- Misc/NEWS | 2 +- Modules/_ctypes/_ctypes.c | 2 +- Modules/_pickle.c | 2 +- Objects/bytesobject.c | 2 +- 17 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -129,7 +129,7 @@ (where the initialization function is added using :c:func:`PyImport_AppendInittab`). See :ref:`building` or :ref:`extending-with-embedding` for details. -The initialization function can either pass pass a module definition instance +The initialization function can either pass a module definition instance to :c:func:`PyModule_Create`, and return the resulting module object, or request "multi-phase initialization" by returning the definition struct itself. diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst --- a/Doc/howto/pyporting.rst +++ b/Doc/howto/pyporting.rst @@ -390,7 +390,7 @@ tox with your continuous integration system so that you never accidentally break Python 2 or 3 support. -You may also want to use use the ``-bb`` flag with the Python 3 interpreter to +You may also want to use the ``-bb`` flag with the Python 3 interpreter to trigger an exception when you are comparing bytes to strings or bytes to an int (the latter is available starting in Python 3.5). By default type-differing comparisons simply return ``False``, but if you made a mistake in your diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -314,8 +314,8 @@ >>> str(Mood.funky) 'my custom str! 1' -The rules for what is allowed are as follows: names that start and end with a -with a single underscore are reserved by enum and cannot be used; all other +The rules for what is allowed are as follows: names that start and end with +a single underscore are reserved by enum and cannot be used; all other attributes defined within an enumeration will become members of this enumeration, with the exception of special methods (:meth:`__str__`, :meth:`__add__`, etc.) and descriptors (methods are also descriptors). diff --git a/Doc/library/tkinter.tix.rst b/Doc/library/tkinter.tix.rst --- a/Doc/library/tkinter.tix.rst +++ b/Doc/library/tkinter.tix.rst @@ -142,7 +142,7 @@ The `LabelEntry `_ - widget packages an entry widget and a label into one mega widget. It can be used + widget packages an entry widget and a label into one mega widget. It can be used to simplify the creation of "entry-form" type of interface. .. Python Demo of: diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -297,7 +297,7 @@ .. class:: Tuple - Tuple type; ``Tuple[X, Y]`` is the is the type of a tuple of two items + Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the first item of type X and the second of type Y. Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -1322,7 +1322,7 @@ ability to query or set the resource limits for processes other than the one making the call. (Contributed by Christian Heimes in :issue:`16595`.) -On Linux kernel version 2.6.36 or later, there are there are also some new +On Linux kernel version 2.6.36 or later, there are also some new Linux specific constants: :attr:`~resource.RLIMIT_MSGQUEUE`, :attr:`~resource.RLIMIT_NICE`, :attr:`~resource.RLIMIT_RTPRIO`, :attr:`~resource.RLIMIT_RTTIME`, and :attr:`~resource.RLIMIT_SIGPENDING`. diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -1690,7 +1690,7 @@ Both the :meth:`SMTP.sendmail() ` and :meth:`SMTP.send_message() ` methods now -support support :rfc:`6531` (SMTPUTF8). +support :rfc:`6531` (SMTPUTF8). (Contributed by Milan Oberkirch and R. David Murray in :issue:`22027`.) diff --git a/Lib/ctypes/macholib/README.ctypes b/Lib/ctypes/macholib/README.ctypes --- a/Lib/ctypes/macholib/README.ctypes +++ b/Lib/ctypes/macholib/README.ctypes @@ -1,4 +1,4 @@ -Files in this directory from from Bob Ippolito's py2app. +Files in this directory come from Bob Ippolito's py2app. License: Any components of the py2app suite may be distributed under the MIT or PSF open source licenses. diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt --- a/Lib/idlelib/idle_test/README.txt +++ b/Lib/idlelib/idle_test/README.txt @@ -17,8 +17,7 @@ The idle directory, idlelib, has over 60 xyz.py files. The idle_test subdirectory should contain a test_xyz.py for each, where 'xyz' is lowercased even if xyz.py is not. Here is a possible template, with the -blanks after after '.' and 'as', and before and after '_' to be filled -in. +blanks after '.' and 'as', and before and after '_' to be filled in. import unittest from test.support import requires diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -863,7 +863,7 @@ itorg = iter(data.items()) d = pickle.dumps(itorg, proto) it = pickle.loads(d) - # note that the type of type of the unpickled iterator + # note that the type of the unpickled iterator # is not necessarily the same as the original. It is # merely an object supporting the iterator protocol, yielding # the same objects as the original one. diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4758,7 +4758,7 @@ self.addCleanup(self.conn.close) def clientSetUp(self): - # The is a hittable race between serverExplicitReady() and the + # There is a hittable race between serverExplicitReady() and the # accept() call; sleep a little while to avoid it, otherwise # we could get an exception time.sleep(0.1) diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py --- a/Lib/tkinter/tix.py +++ b/Lib/tkinter/tix.py @@ -1048,8 +1048,8 @@ class LabelEntry(TixWidget): """LabelEntry - Entry field with label. Packages an entry widget - and a label into one mega widget. It can be used be used to simplify - the creation of ``entry-form'' type of interface. + and a label into one mega widget. It can be used to simplify the creation + of ``entry-form'' type of interface. Subwidgets Class ---------- ----- diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -10639,8 +10639,8 @@ certain operations between bytes/buffer and str like str(b'') and comparison. -- The standards streams sys.stdin, stdout and stderr may be None when - the when the C runtime library returns an invalid file descriptor +- The standard streams sys.stdin, stdout and stderr may be None + when the C runtime library returns an invalid file descriptor for the streams (fileno(stdin) < 0). For now this happens only for Windows GUI apps and scripts started with `pythonw.exe`. diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -3775,7 +3775,7 @@ - Issue #22247: Add NNTPError to nntplib.__all__. - Issue #22366: urllib.request.urlopen will accept a context object - (SSLContext) as an argument which will then used be for HTTPS connection. + (SSLContext) as an argument which will then be used for HTTPS connection. Patch by Alex Gaynor. - Issue #4180: The warnings registries are now reset when the filters diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -49,7 +49,7 @@ from_param(obj) - typecheck and convert a Python object into a C function call parameter - the result may be an instance of the type, or an integer or tuple + The result may be an instance of the type, or an integer or tuple (typecode, value[, obj]) instance methods/properties diff --git a/Modules/_pickle.c b/Modules/_pickle.c --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -573,7 +573,7 @@ int bin; /* Boolean, true if proto > 0 */ int framing; /* True when framing is enabled, proto >= 4 */ Py_ssize_t frame_start; /* Position in output_buffer where the - where the current frame begins. -1 if there + current frame begins. -1 if there is no frame currently open. */ Py_ssize_t buf_size; /* Size of the current buffered pickle data */ diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -38,7 +38,7 @@ For PyBytes_FromString(), the parameter `str' points to a null-terminated string containing exactly `size' bytes. - For PyBytes_FromStringAndSize(), the parameter the parameter `str' is + For PyBytes_FromStringAndSize(), the parameter `str' is either NULL or else points to a string containing at least `size' bytes. For PyBytes_FromStringAndSize(), the string in the `str' parameter does not have to be null-terminated. (Therefore it is safe to construct a -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 30 01:27:18 2016 From: python-checkins at python.org (martin.panter) Date: Mon, 30 May 2016 05:27:18 +0000 Subject: [Python-checkins] =?utf-8?b?Y3B5dGhvbiAoMy41KTogSXNzdWUgIzI3MTI1?= =?utf-8?q?=3A_Remove_duplicated_words_from_documentation_and_comments?= Message-ID: <20160530052706.122132.23133.EEA22237@psf.io> https://hg.python.org/cpython/rev/fd0ac7ba091e changeset: 101572:fd0ac7ba091e branch: 3.5 parent: 101569:8bde7ef688b7 user: Martin Panter date: Mon May 30 04:04:50 2016 +0000 summary: Issue #27125: Remove duplicated words from documentation and comments files: Doc/c-api/module.rst | 2 +- Doc/howto/pyporting.rst | 2 +- Doc/library/enum.rst | 4 ++-- Doc/library/tkinter.tix.rst | 2 +- Doc/library/typing.rst | 2 +- Doc/whatsnew/3.4.rst | 2 +- Doc/whatsnew/3.5.rst | 2 +- Lib/ctypes/macholib/README.ctypes | 2 +- Lib/idlelib/idle_test/README.txt | 3 +-- Lib/test/test_dict.py | 2 +- Lib/test/test_socket.py | 2 +- Lib/tkinter/tix.py | 4 ++-- Misc/HISTORY | 4 ++-- Misc/NEWS | 2 +- Modules/_ctypes/_ctypes.c | 2 +- Modules/_pickle.c | 2 +- Objects/bytesobject.c | 2 +- 17 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -129,7 +129,7 @@ (where the initialization function is added using :c:func:`PyImport_AppendInittab`). See :ref:`building` or :ref:`extending-with-embedding` for details. -The initialization function can either pass pass a module definition instance +The initialization function can either pass a module definition instance to :c:func:`PyModule_Create`, and return the resulting module object, or request "multi-phase initialization" by returning the definition struct itself. diff --git a/Doc/howto/pyporting.rst b/Doc/howto/pyporting.rst --- a/Doc/howto/pyporting.rst +++ b/Doc/howto/pyporting.rst @@ -390,7 +390,7 @@ tox with your continuous integration system so that you never accidentally break Python 2 or 3 support. -You may also want to use use the ``-bb`` flag with the Python 3 interpreter to +You may also want to use the ``-bb`` flag with the Python 3 interpreter to trigger an exception when you are comparing bytes to strings or bytes to an int (the latter is available starting in Python 3.5). By default type-differing comparisons simply return ``False``, but if you made a mistake in your diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -314,8 +314,8 @@ >>> str(Mood.funky) 'my custom str! 1' -The rules for what is allowed are as follows: names that start and end with a -with a single underscore are reserved by enum and cannot be used; all other +The rules for what is allowed are as follows: names that start and end with +a single underscore are reserved by enum and cannot be used; all other attributes defined within an enumeration will become members of this enumeration, with the exception of special methods (:meth:`__str__`, :meth:`__add__`, etc.) and descriptors (methods are also descriptors). diff --git a/Doc/library/tkinter.tix.rst b/Doc/library/tkinter.tix.rst --- a/Doc/library/tkinter.tix.rst +++ b/Doc/library/tkinter.tix.rst @@ -142,7 +142,7 @@ The `LabelEntry `_ - widget packages an entry widget and a label into one mega widget. It can be used + widget packages an entry widget and a label into one mega widget. It can be used to simplify the creation of "entry-form" type of interface. .. Python Demo of: diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -297,7 +297,7 @@ .. class:: Tuple - Tuple type; ``Tuple[X, Y]`` is the is the type of a tuple of two items + Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the first item of type X and the second of type Y. Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -1322,7 +1322,7 @@ ability to query or set the resource limits for processes other than the one making the call. (Contributed by Christian Heimes in :issue:`16595`.) -On Linux kernel version 2.6.36 or later, there are there are also some new +On Linux kernel version 2.6.36 or later, there are also some new Linux specific constants: :attr:`~resource.RLIMIT_MSGQUEUE`, :attr:`~resource.RLIMIT_NICE`, :attr:`~resource.RLIMIT_RTPRIO`, :attr:`~resource.RLIMIT_RTTIME`, and :attr:`~resource.RLIMIT_SIGPENDING`. diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -1690,7 +1690,7 @@ Both the :meth:`SMTP.sendmail() ` and :meth:`SMTP.send_message() ` methods now -support support :rfc:`6531` (SMTPUTF8). +support :rfc:`6531` (SMTPUTF8). (Contributed by Milan Oberkirch and R. David Murray in :issue:`22027`.) diff --git a/Lib/ctypes/macholib/README.ctypes b/Lib/ctypes/macholib/README.ctypes --- a/Lib/ctypes/macholib/README.ctypes +++ b/Lib/ctypes/macholib/README.ctypes @@ -1,4 +1,4 @@ -Files in this directory from from Bob Ippolito's py2app. +Files in this directory come from Bob Ippolito's py2app. License: Any components of the py2app suite may be distributed under the MIT or PSF open source licenses. diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt --- a/Lib/idlelib/idle_test/README.txt +++ b/Lib/idlelib/idle_test/README.txt @@ -17,8 +17,7 @@ The idle directory, idlelib, has over 60 xyz.py files. The idle_test subdirectory should contain a test_xyz.py for each, where 'xyz' is lowercased even if xyz.py is not. Here is a possible template, with the -blanks after after '.' and 'as', and before and after '_' to be filled -in. +blanks after '.' and 'as', and before and after '_' to be filled in. import unittest from test.support import requires diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -861,7 +861,7 @@ itorg = iter(data.items()) d = pickle.dumps(itorg, proto) it = pickle.loads(d) - # note that the type of type of the unpickled iterator + # note that the type of the unpickled iterator # is not necessarily the same as the original. It is # merely an object supporting the iterator protocol, yielding # the same objects as the original one. diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4747,7 +4747,7 @@ self.addCleanup(self.conn.close) def clientSetUp(self): - # The is a hittable race between serverExplicitReady() and the + # There is a hittable race between serverExplicitReady() and the # accept() call; sleep a little while to avoid it, otherwise # we could get an exception time.sleep(0.1) diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py --- a/Lib/tkinter/tix.py +++ b/Lib/tkinter/tix.py @@ -1052,8 +1052,8 @@ class LabelEntry(TixWidget): """LabelEntry - Entry field with label. Packages an entry widget - and a label into one mega widget. It can be used be used to simplify - the creation of ``entry-form'' type of interface. + and a label into one mega widget. It can be used to simplify the creation + of ``entry-form'' type of interface. Subwidgets Class ---------- ----- diff --git a/Misc/HISTORY b/Misc/HISTORY --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -10639,8 +10639,8 @@ certain operations between bytes/buffer and str like str(b'') and comparison. -- The standards streams sys.stdin, stdout and stderr may be None when - the when the C runtime library returns an invalid file descriptor +- The standard streams sys.stdin, stdout and stderr may be None + when the C runtime library returns an invalid file descriptor for the streams (fileno(stdin) < 0). For now this happens only for Windows GUI apps and scripts started with `pythonw.exe`. diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -3054,7 +3054,7 @@ - Issue #22247: Add NNTPError to nntplib.__all__. - Issue #22366: urllib.request.urlopen will accept a context object - (SSLContext) as an argument which will then used be for HTTPS connection. + (SSLContext) as an argument which will then be used for HTTPS connection. Patch by Alex Gaynor. - Issue #4180: The warnings registries are now reset when the filters diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -49,7 +49,7 @@ from_param(obj) - typecheck and convert a Python object into a C function call parameter - the result may be an instance of the type, or an integer or tuple + The result may be an instance of the type, or an integer or tuple (typecode, value[, obj]) instance methods/properties diff --git a/Modules/_pickle.c b/Modules/_pickle.c --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -550,7 +550,7 @@ int bin; /* Boolean, true if proto > 0 */ int framing; /* True when framing is enabled, proto >= 4 */ Py_ssize_t frame_start; /* Position in output_buffer where the - where the current frame begins. -1 if there + current frame begins. -1 if there is no frame currently open. */ Py_ssize_t buf_size; /* Size of the current buffered pickle data */ diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -34,7 +34,7 @@ For PyBytes_FromString(), the parameter `str' points to a null-terminated string containing exactly `size' bytes. - For PyBytes_FromStringAndSize(), the parameter the parameter `str' is + For PyBytes_FromStringAndSize(), the parameter `str' is either NULL or else points to a string containing at least `size' bytes. For PyBytes_FromStringAndSize(), the string in the `str' parameter does not have to be null-terminated. (Therefore it is safe to construct a -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Mon May 30 01:59:55 2016 From: python-checkins at python.org (terry.reedy) Date: Mon, 30 May 2016 05:59:55 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=2327156=3A_Remove_o?= =?utf-8?q?bsolete_code_not_used_by_IDLE=2E?= Message-ID: <20160530055955.18940.27475.41BEEE01@psf.io> https://hg.python.org/cpython/rev/0945b9729734 changeset: 101575:0945b9729734 user: Terry Jan Reedy date: Mon May 30 01:59:42 2016 -0400 summary: Issue #27156: Remove obsolete code not used by IDLE. help.txt, replaced by help.html, is out-of-date and should not be used. Its dedicated viewer has be replaced by the html viewer in help.py. 'import idlever; I = idlever.IDLE_VERSION' is the same as 'import sys; I = version[:version.index(' ')]' files: Lib/idlelib/editor.py | 48 --- Lib/idlelib/help.txt | 372 ----------------------------- Lib/idlelib/idlever.py | 12 - 3 files changed, 0 insertions(+), 432 deletions(-) diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -40,54 +40,6 @@ return release -class HelpDialog(object): - - def __init__(self): - self.parent = None # parent of help window - self.dlg = None # the help window iteself - - def display(self, parent, near=None): - """ Display the help dialog. - - parent - parent widget for the help window - - near - a Toplevel widget (e.g. EditorWindow or PyShell) - to use as a reference for placing the help window - """ - import warnings as w - w.warn("EditorWindow.HelpDialog is no longer used by Idle.\n" - "It will be removed in 3.6 or later.\n" - "It has been replaced by private help.HelpWindow\n", - DeprecationWarning, stacklevel=2) - if self.dlg is None: - self.show_dialog(parent) - if near: - self.nearwindow(near) - - def show_dialog(self, parent): - self.parent = parent - fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') - self.dlg = dlg = textview.view_file(parent,'Help',fn, modal=False) - dlg.bind('', self.destroy, '+') - - def nearwindow(self, near): - # Place the help dialog near the window specified by parent. - # Note - this may not reposition the window in Metacity - # if "/apps/metacity/general/disable_workarounds" is enabled - dlg = self.dlg - geom = (near.winfo_rootx() + 10, near.winfo_rooty() + 10) - dlg.withdraw() - dlg.geometry("=+%d+%d" % geom) - dlg.deiconify() - dlg.lift() - - def destroy(self, ev=None): - self.dlg = None - self.parent = None - -helpDialog = HelpDialog() # singleton instance, no longer used - - class EditorWindow(object): from idlelib.percolator import Percolator from idlelib.colorizer import ColorDelegator, color_config diff --git a/Lib/idlelib/help.txt b/Lib/idlelib/help.txt deleted file mode 100644 --- a/Lib/idlelib/help.txt +++ /dev/null @@ -1,372 +0,0 @@ -This file, idlelib/help.txt is out-of-date and no longer used by Idle. -It is deprecated and will be removed in the future, possibly in 3.6 ----------------------------------------------------------------------- - -[See the end of this file for ** TIPS ** on using IDLE !!] - -IDLE is the Python IDE built with the tkinter GUI toolkit. - -IDLE has the following features: --coded in 100% pure Python, using the tkinter GUI toolkit --cross-platform: works on Windows, Unix, and OS X --multi-window text editor with multiple undo, Python colorizing, smart indent, -call tips, and many other features --Python shell window (a.k.a interactive interpreter) --debugger (not complete, but you can set breakpoints, view and step) - -Menus: - -IDLE has two window types the Shell window and the Editor window. It is -possible to have multiple editor windows simultaneously. IDLE's -menus dynamically change based on which window is currently selected. Each menu -documented below indicates which window type it is associated with. - -File Menu (Shell and Editor): - - New File -- Create a new file editing window - Open... -- Open an existing file - Open Module... -- Open an existing module (searches sys.path) - Recent Files... -- Open a list of recent files - Class Browser -- Show classes and methods in current file - Path Browser -- Show sys.path directories, modules, classes, - and methods - --- - Save -- Save current window to the associated file (unsaved - windows have a * before and after the window title) - - Save As... -- Save current window to new file, which becomes - the associated file - Save Copy As... -- Save current window to different file - without changing the associated file - --- - Print Window -- Print the current window - --- - Close -- Close current window (asks to save if unsaved) - Exit -- Close all windows, quit (asks to save if unsaved) - -Edit Menu (Shell and Editor): - - Undo -- Undo last change to current window - (a maximum of 1000 changes may be undone) - Redo -- Redo last undone change to current window - --- - Cut -- Copy a selection into system-wide clipboard, - then delete the selection - Copy -- Copy selection into system-wide clipboard - Paste -- Insert system-wide clipboard into window - Select All -- Select the entire contents of the edit buffer - --- - Find... -- Open a search dialog box with many options - Find Again -- Repeat last search - Find Selection -- Search for the string in the selection - Find in Files... -- Open a search dialog box for searching files - Replace... -- Open a search-and-replace dialog box - Go to Line -- Ask for a line number and show that line - Expand Word -- Expand the word you have typed to match another - word in the same buffer; repeat to get a - different expansion - Show Calltip -- After an unclosed parenthesis for a function, open - a small window with function parameter hints - Show Parens -- Highlight the surrounding parenthesis - Show Completions -- Open a scroll window allowing selection keywords - and attributes. (see '*TIPS*', below) - -Format Menu (Editor window only): - - Indent Region -- Shift selected lines right by the indent width - (default 4 spaces) - Dedent Region -- Shift selected lines left by the indent width - (default 4 spaces) - Comment Out Region -- Insert ## in front of selected lines - Uncomment Region -- Remove leading # or ## from selected lines - Tabify Region -- Turns *leading* stretches of spaces into tabs. - (Note: We recommend using 4 space blocks to indent Python code.) - Untabify Region -- Turn *all* tabs into the corrent number of spaces - Toggle tabs -- Open a dialog to switch between indenting with - spaces and tabs. - New Indent Width... -- Open a dialog to change indent width. The - accepted default by the Python community is 4 - spaces. - Format Paragraph -- Reformat the current blank-line-separated - paragraph. All lines in the paragraph will be - formatted to less than 80 columns. - --- - Strip trailing whitespace -- Removed any space characters after the end - of the last non-space character - -Run Menu (Editor window only): - - Python Shell -- Open or wake up the Python shell window - --- - Check Module -- Check the syntax of the module currently open in the - Editor window. If the module has not been saved IDLE - will prompt the user to save the code. - Run Module -- Restart the shell to clean the environment, then - execute the currently open module. If the module has - not been saved IDLE will prompt the user to save the - code. - -Shell Menu (Shell window only): - - View Last Restart -- Scroll the shell window to the last Shell restart - Restart Shell -- Restart the shell to clean the environment - -Debug Menu (Shell window only): - - Go to File/Line -- Look around the insert point for a filename - and line number, open the file, and show the line. - Useful to view the source lines referenced in an - exception traceback. Available in the context - menu of the Shell window. - Debugger (toggle) -- This feature is not complete and considered - experimental. Run commands in the shell under the - debugger. - Stack Viewer -- Show the stack traceback of the last exception - Auto-open Stack Viewer (toggle) -- Toggle automatically opening the - stack viewer on unhandled - exception - -Options Menu (Shell and Editor): - - Configure IDLE -- Open a configuration dialog. Fonts, indentation, - keybindings, and color themes may be altered. - Startup Preferences may be set, and additional Help - sources can be specified. On OS X, open the - configuration dialog by selecting Preferences - in the application menu. - - --- - Code Context (toggle) -- Open a pane at the top of the edit window - which shows the block context of the section - of code which is scrolling off the top or the - window. This is not present in the Shell - window only the Editor window. - -Window Menu (Shell and Editor): - - Zoom Height -- Toggles the window between normal size (40x80 initial - setting) and maximum height. The initial size is in the Configure - IDLE dialog under the general tab. - --- - The rest of this menu lists the names of all open windows; - select one to bring it to the foreground (deiconifying it if - necessary). - -Help Menu: - - About IDLE -- Version, copyright, license, credits - --- - IDLE Help -- Display this file which is a help file for IDLE - detailing the menu options, basic editing and navigation, - and other tips. - Python Docs -- Access local Python documentation, if - installed. Or will start a web browser and open - docs.python.org showing the latest Python documentation. - --- - Additional help sources may be added here with the Configure IDLE - dialog under the General tab. - -Editor context menu (Right-click / Control-click on OS X in Edit window): - - Cut -- Copy a selection into system-wide clipboard, - then delete the selection - Copy -- Copy selection into system-wide clipboard - Paste -- Insert system-wide clipboard into window - Set Breakpoint -- Sets a breakpoint. Breakpoints are only enabled - when the debugger is open. - Clear Breakpoint -- Clears the breakpoint on that line - -Shell context menu (Right-click / Control-click on OS X in Shell window): - - Cut -- Copy a selection into system-wide clipboard, - then delete the selection - Copy -- Copy selection into system-wide clipboard - Paste -- Insert system-wide clipboard into window - --- - Go to file/line -- Same as in Debug menu - - -** TIPS ** -========== - -Additional Help Sources: - - Windows users can Google on zopeshelf.chm to access Zope help files in - the Windows help format. The Additional Help Sources feature of the - configuration GUI supports .chm, along with any other filetypes - supported by your browser. Supply a Menu Item title, and enter the - location in the Help File Path slot of the New Help Source dialog. Use - http:// and/or www. to identify external URLs, or download the file and - browse for its path on your machine using the Browse button. - - All users can access the extensive sources of help, including - tutorials, available at docs.python.org. Selected URLs can be added - or removed from the Help menu at any time using Configure IDLE. - -Basic editing and navigation: - - Backspace deletes char to the left; DEL deletes char to the right. - Control-backspace deletes word left, Control-DEL deletes word right. - Arrow keys and Page Up/Down move around. - Control-left/right Arrow moves by words in a strange but useful way. - Home/End go to begin/end of line. - Control-Home/End go to begin/end of file. - Some useful Emacs bindings are inherited from Tcl/Tk: - Control-a beginning of line - Control-e end of line - Control-k kill line (but doesn't put it in clipboard) - Control-l center window around the insertion point - Standard keybindings (like Control-c to copy and Control-v to - paste) may work. Keybindings are selected in the Configure IDLE - dialog. - -Automatic indentation: - - After a block-opening statement, the next line is indented by 4 spaces - (in the Python Shell window by one tab). After certain keywords - (break, return etc.) the next line is dedented. In leading - indentation, Backspace deletes up to 4 spaces if they are there. Tab - inserts spaces (in the Python Shell window one tab), number depends on - Indent Width. Currently tabs are restricted to four spaces due - to Tcl/Tk limitations. - - See also the indent/dedent region commands in the edit menu. - -Completions: - - Completions are supplied for functions, classes, and attributes of - classes, both built-in and user-defined. Completions are also provided - for filenames. - - The AutoCompleteWindow (ACW) will open after a predefined delay - (default is two seconds) after a '.' or (in a string) an os.sep is - typed. If after one of those characters (plus zero or more other - characters) a tab is typed the ACW will open immediately if a possible - continuation is found. - - If there is only one possible completion for the characters entered, a - tab will supply that completion without opening the ACW. - - 'Show Completions' will force open a completions window, by default the - Control-space keys will open a completions window. In an empty - string, this will contain the files in the current directory. On a - blank line, it will contain the built-in and user-defined functions and - classes in the current name spaces, plus any modules imported. If some - characters have been entered, the ACW will attempt to be more specific. - - If string of characters is typed, the ACW selection will jump to the - entry most closely matching those characters. Entering a tab will cause - the longest non-ambiguous match to be entered in the Edit window or - Shell. Two tabs in a row will supply the current ACW selection, as - will return or a double click. Cursor keys, Page Up/Down, mouse - selection, and the scroll wheel all operate on the ACW. - - "Hidden" attributes can be accessed by typing the beginning of hidden - name after a '.', e.g. '_'. This allows access to modules with - '__all__' set, or to class-private attributes. - - Completions and the 'Expand Word' facility can save a lot of typing! - - Completions are currently limited to those in the namespaces. Names in - an Editor window which are not via __main__ or sys.modules will not be - found. Run the module once with your imports to correct this - situation. Note that IDLE itself places quite a few modules in - sys.modules, so much can be found by default, e.g. the re module. - - If you don't like the ACW popping up unbidden, simply make the delay - longer or disable the extension. Or another option is the delay could - be set to zero. Another alternative to preventing ACW popups is to - disable the call tips extension. - -Python Shell window: - - Control-c interrupts executing command. - Control-d sends end-of-file; closes window if typed at >>> prompt. - Alt-/ expand word is also useful to reduce typing. - - Command history: - - Alt-p retrieves previous command matching what you have typed. On OS X - use Control-p. - Alt-n retrieves next. On OS X use Control-n. - Return while cursor is on a previous command retrieves that command. - - Syntax colors: - - The coloring is applied in a background "thread", so you may - occasionally see uncolorized text. To change the color - scheme, use the Configure IDLE / Highlighting dialog. - - Python default syntax colors: - - Keywords orange - Builtins royal purple - Strings green - Comments red - Definitions blue - - Shell default colors: - - Console output brown - stdout blue - stderr red - stdin black - -Other preferences: - - The font preferences, highlighting, keys, and general preferences can - be changed via the Configure IDLE menu option. Be sure to note that - keys can be user defined, IDLE ships with four built in key sets. In - addition a user can create a custom key set in the Configure IDLE - dialog under the keys tab. - -Command line usage: - - Enter idle -h at the command prompt to get a usage message. - - idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ... - - -c command run this command - -d enable debugger - -e edit mode; arguments are files to be edited - -s run $IDLESTARTUP or $PYTHONSTARTUP first - -t title set title of shell window - - If there are arguments: - 1. If -e is used, arguments are files opened for editing and sys.argv - reflects the arguments passed to IDLE itself. - 2. Otherwise, if -c is used, all arguments are placed in - sys.argv[1:...], with sys.argv[0] set to -c. - 3. Otherwise, if neither -e nor -c is used, the first argument is a - script which is executed with the remaining arguments in - sys.argv[1:...] and sys.argv[0] set to the script name. If the - script name is -, no script is executed but an interactive Python - session is started; the arguments are still available in sys.argv. - -Running without a subprocess: (DEPRECATED in Python 3.4 see Issue 16123) - - If IDLE is started with the -n command line switch it will run in a - single process and will not create the subprocess which runs the RPC - Python execution server. This can be useful if Python cannot create - the subprocess or the RPC socket interface on your platform. However, - in this mode user code is not isolated from IDLE itself. Also, the - environment is not restarted when Run/Run Module (F5) is selected. If - your code has been modified, you must reload() the affected modules and - re-import any specific items (e.g. from foo import baz) if the changes - are to take effect. For these reasons, it is preferable to run IDLE - with the default subprocess if at all possible. - -Extensions: - - IDLE contains an extension facility. See the beginning of - config-extensions.def in the idlelib directory for further information. - The default extensions are currently: - - FormatParagraph - AutoExpand - ZoomHeight - ScriptBinding - CallTips - ParenMatch - AutoComplete - CodeContext diff --git a/Lib/idlelib/idlever.py b/Lib/idlelib/idlever.py deleted file mode 100644 --- a/Lib/idlelib/idlever.py +++ /dev/null @@ -1,12 +0,0 @@ -""" -The separate Idle version was eliminated years ago; -idlelib.idlever is no longer used by Idle -and will be removed in 3.6 or later. Use - from sys import version - IDLE_VERSION = version[:version.index(' ')] -""" -# Kept for now only for possible existing extension use -import warnings as w -w.warn(__doc__, DeprecationWarning, stacklevel=2) -from sys import version -IDLE_VERSION = version[:version.index(' ')] -- Repository URL: https://hg.python.org/cpython From solipsis at pitrou.net Mon May 30 04:52:25 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Mon, 30 May 2016 08:52:25 +0000 Subject: [Python-checkins] Daily reference leaks (bd0a12277a8e): sum=8 Message-ID: <20160530085225.32421.8959.FE5BC99F@psf.io> results for bd0a12277a8e on branch "default" -------------------------------------------- test_collections leaked [0, 0, 4] memory blocks, sum=4 test_functools leaked [0, 3, 1] memory blocks, sum=4 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogqDFcj5', '--timeout', '7200'] From lp_benchmark_robot at intel.com Mon May 30 09:17:44 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Mon, 30 May 2016 14:17:44 +0100 Subject: [Python-checkins] BAD Benchmark Results for Python Default 2016-05-30 Message-ID: Results for project Python default, build date 2016-05-30 02:02:33 +0000 commit: 71813a05e488 previous commit: eaee5aed6fbc revision date: 2016-05-29 20:50:56 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.24% -2.46% 6.14% 16.48% :-| pybench 0.36% 0.34% 1.59% 7.64% :-( regex_v8 2.66% -0.39% -2.59% 3.36% :-| nbody 0.11% 0.58% 0.70% 7.88% :-| json_dump_v2 0.34% -0.32% -0.14% 11.33% :-| normal_startup 0.90% -0.46% -0.54% 6.39% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/bad-benchmark-results-for-python-default-2016-05-30/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Mon May 30 09:19:03 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Mon, 30 May 2016 14:19:03 +0100 Subject: [Python-checkins] NEUTRAL Benchmark Results for Python 2.7 2016-05-30 Message-ID: <5ca824c4-0e30-4297-9211-c16bd362dc78@irsmsx153.ger.corp.intel.com> Results for project Python 2.7, build date 2016-05-30 02:46:31 +0000 commit: c817d1b5b937 previous commit: 40f3f2b27112 revision date: 2016-05-29 08:13:58 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.13% -0.70% 4.32% 5.95% :-) pybench 0.19% -0.18% 5.91% 5.14% :-( regex_v8 0.68% 0.17% -2.14% 10.63% :-) nbody 0.14% 0.00% 9.35% 1.50% :-| json_dump_v2 0.52% -0.89% 1.10% 12.09% :-( normal_startup 1.80% -0.32% -5.69% 2.83% :-) ssbench 0.18% -0.06% 2.36% 1.98% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/neutral-benchmark-results-for-python-2-7-2016-05-30/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Mon May 30 10:09:51 2016 From: python-checkins at python.org (berker.peksag) Date: Mon, 30 May 2016 14:09:51 +0000 Subject: [Python-checkins] =?utf-8?q?test=3A_Testing_my_new_key?= Message-ID: <20160530140943.18936.14230.F0A19E67@psf.io> https://hg.python.org/test/rev/1fdb150094ae changeset: 231:1fdb150094ae user: Berker Peksag date: Mon May 30 07:19:22 2016 -0700 summary: Testing my new key files: a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/a b/a --- a/a +++ b/a @@ -9,3 +9,4 @@ eidfjzeijd snthdiueoa (obviously it should have gone this direction the first time) spam eggs +42 -- Repository URL: https://hg.python.org/test From solipsis at pitrou.net Tue May 31 04:52:46 2016 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Tue, 31 May 2016 08:52:46 +0000 Subject: [Python-checkins] Daily reference leaks (0945b9729734): sum=-2 Message-ID: <20160531085246.30681.23436.EFE2E08E@psf.io> results for 0945b9729734 on branch "default" -------------------------------------------- test_collections leaked [-2, 0, 0] references, sum=-2 test_collections leaked [-5, 0, 0] memory blocks, sum=-5 test_functools leaked [0, 3, 1] memory blocks, sum=4 test_multiprocessing_forkserver leaked [2, 0, -1] memory blocks, sum=1 Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/psf-users/antoine/refleaks/reflogH8yASs', '--timeout', '7200'] From lp_benchmark_robot at intel.com Tue May 31 05:27:50 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Tue, 31 May 2016 10:27:50 +0100 Subject: [Python-checkins] GOOD Benchmark Results for Python Default 2016-05-31 Message-ID: Results for project Python default, build date 2016-05-31 02:02:09 +0000 commit: 0945b9729734 previous commit: 71813a05e488 revision date: 2016-05-30 05:59:42 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v3.4.3, with hash b4cbecbc0781 from 2015-02-25 12:15:33+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.18% 1.43% 7.48% 19.02% :-| pybench 0.35% 0.00% 1.60% 7.04% :-( regex_v8 2.67% 0.04% -2.55% 2.22% :-| nbody 0.29% -0.10% 0.60% 10.33% :-| json_dump_v2 0.34% -0.08% -0.22% 12.72% :-| normal_startup 0.78% 0.42% -0.06% 5.99% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/good-benchmark-results-for-python-default-2016-05-31/ Note: Benchmark results are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From lp_benchmark_robot at intel.com Tue May 31 05:28:20 2016 From: lp_benchmark_robot at intel.com (lp_benchmark_robot at intel.com) Date: Tue, 31 May 2016 10:28:20 +0100 Subject: [Python-checkins] NEUTRAL Benchmark Results for Python 2.7 2016-05-31 Message-ID: Results for project Python 2.7, build date 2016-05-31 02:45:54 +0000 commit: 824d32436198 previous commit: c817d1b5b937 revision date: 2016-05-30 04:04:50 +0000 environment: Haswell-EP cpu: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB mem: 128 GB os: CentOS 7.1 kernel: Linux 3.10.0-229.4.2.el7.x86_64 Baseline results were generated using release v2.7.10, with hash 15c95b7d81dc from 2015-05-23 16:02:14+00:00 ---------------------------------------------------------------------------------- benchmark relative change since change since current rev run std_dev* last run baseline with PGO ---------------------------------------------------------------------------------- :-) django_v2 0.16% 0.43% 4.74% 7.57% :-) pybench 0.19% -0.04% 5.88% 4.70% :-( regex_v8 0.87% -0.05% -2.19% 11.23% :-) nbody 0.15% -0.29% 9.09% 2.09% :-| json_dump_v2 0.52% 0.70% 1.79% 12.84% :-( normal_startup 1.96% 0.72% -4.93% 1.58% :-) ssbench 0.21% -0.13% 2.23% 1.69% ---------------------------------------------------------------------------------- * Relative Standard Deviation (Standard Deviation/Average) If this is not displayed properly please visit our results page here: http://languagesperformance.intel.com/neutral-benchmark-results-for-python-2-7-2016-05-31/ Note: Benchmark results for ssbench are measured in requests/second while all other are measured in seconds. Subject Label Legend: Attributes are determined based on the performance evolution of the workloads compared to the previous measurement iteration. NEUTRAL: performance did not change by more than 1% for any workload GOOD: performance improved by more than 1% for at least one workload and there is no regression greater than 1% BAD: performance dropped by more than 1% for at least one workload and there is no improvement greater than 1% UGLY: performance improved by more than 1% for at least one workload and also dropped by more than 1% for at least one workload Our lab does a nightly source pull and build of the Python project and measures performance changes against the previous stable version and the previous nightly measurement. This is provided as a service to the community so that quality issues with current hardware can be identified quickly. Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. From python-checkins at python.org Tue May 31 13:41:48 2016 From: python-checkins at python.org (davin.potts) Date: Tue, 31 May 2016 17:41:48 +0000 Subject: [Python-checkins] =?utf-8?q?devguide=3A_Add_myself_to_experts/mul?= =?utf-8?q?tiprocessing?= Message-ID: <20160531174143.11166.79575.5980A368@psf.io> https://hg.python.org/devguide/rev/e0d858d2f00d changeset: 805:e0d858d2f00d user: Davin Potts date: Tue May 31 12:40:45 2016 -0500 summary: Add myself to experts/multiprocessing files: experts.rst | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/experts.rst b/experts.rst --- a/experts.rst +++ b/experts.rst @@ -156,7 +156,7 @@ modulefinder theller (inactive), jvr msilib loewis msvcrt -multiprocessing jnoller, sbt* +multiprocessing davin*, jnoller (inactive), sbt (inactive) netrc nis nntplib pitrou -- Repository URL: https://hg.python.org/devguide From python-checkins at python.org Tue May 31 20:18:16 2016 From: python-checkins at python.org (terry.reedy) Date: Wed, 01 Jun 2016 00:18:16 +0000 Subject: [Python-checkins] =?utf-8?q?cpython=3A_Issue_=23_24225=3A_Update_?= =?utf-8?q?idlelib=2EREADME=2Etxt_with_new_file_names_and_event_handlers?= =?utf-8?q?=2E?= Message-ID: <20160601001816.27159.29313.8EC233D6@psf.io> https://hg.python.org/cpython/rev/20bd4c23cfe4 changeset: 101576:20bd4c23cfe4 user: Terry Jan Reedy date: Tue May 31 20:17:58 2016 -0400 summary: Issue # 24225: Update idlelib.README.txt with new file names and event handlers. files: Lib/idlelib/README.txt | 266 ++++++++++++++-------------- 1 files changed, 134 insertions(+), 132 deletions(-) diff --git a/Lib/idlelib/README.txt b/Lib/idlelib/README.txt --- a/Lib/idlelib/README.txt +++ b/Lib/idlelib/README.txt @@ -29,61 +29,61 @@ Implementation -------------- -AutoComplete.py # Complete attribute names or filenames. -AutoCompleteWindow.py # Display completions. -AutoExpand.py # Expand word with previous word in file. -Bindings.py # Define most of IDLE menu. -CallTipWindow.py # Display calltip. -CallTips.py # Create calltip text. -ClassBrowser.py # Create module browser window. -CodeContext.py # Show compound statement headers otherwise not visible. -ColorDelegator.py # Colorize text (nim). -Debugger.py # Debug code run from editor; show window. -Delegator.py # Define base class for delegators (nim). -EditorWindow.py # Define most of editor and utility functions. -FileList.py # Open files and manage list of open windows (nim). -FormatParagraph.py# Re-wrap multiline strings and comments. -GrepDialog.py # Find all occurrences of pattern in multiple files. -HyperParser.py # Parse code around a given index. -IOBinding.py # Open, read, and write files -IdleHistory.py # Get previous or next user input in shell (nim) -MultiCall.py # Wrap tk widget to allow multiple calls per event (nim). -MultiStatusBar.py # Define status bar for windows (nim). -ObjectBrowser.py # Define class used in StackViewer (nim). -OutputWindow.py # Create window for grep output. -ParenMatch.py # Match fenceposts: (), [], and {}. -PathBrowser.py # Create path browser window. -Percolator.py # Manage delegator stack (nim). -PyParse.py # Give information on code indentation -PyShell.py # Start IDLE, manage shell, complete editor window -RemoteDebugger.py # Debug code run in remote process. -RemoteObjectBrowser.py # Communicate objects between processes with rpc (nim). -ReplaceDialog.py # Search and replace pattern in text. -RstripExtension.py# Strip trailing whitespace -ScriptBinding.py # Check and run user code. -ScrolledList.py # Define ScrolledList widget for IDLE (nim). -SearchDialog.py # Search for pattern in text. -SearchDialogBase.py # Define base for search, replace, and grep dialogs. -SearchEngine.py # Define engine for all 3 search dialogs. -StackViewer.py # View stack after exception. -TreeWidget.py # Define tree widger, used in browsers (nim). -UndoDelegator.py # Manage undo stack. -WidgetRedirector.py # Intercept widget subcommands (for percolator) (nim). -WindowList.py # Manage window list and define listed top level. -ZoomHeight.py # Zoom window to full height of screen. -aboutDialog.py # Display About IDLE dialog. -configDialog.py # Display user configuration dialogs. -configHandler.py # Load, fetch, and save configuration (nim). -configHelpSourceEdit.py # Specify help source. -configSectionNameDialog.py # Spefify user config section name -dynOptionMenuWidget.py # define mutable OptionMenu widget (nim). +autocomplete.py # Complete attribute names or filenames. +autocomplete_w.py # Display completions. +autoexpand.py # Expand word with previous word in file. +browser.py # Create module browser window. +calltip_w.py # Display calltip. +calltips.py # Create calltip text. +codecontext.py # Show compound statement headers otherwise not visible. +colorizer.py # Colorize text (nim) +config.py # Load, fetch, and save configuration (nim). +configdialog.py # Display user configuration dialogs. +config_help.py # Specify help source in configdialog. +config_key.py # Change keybindings. +config_sec.py # Spefify user config section name +dynoption.py # Define mutable OptionMenu widget (nim). +debugobj.py # Define class used in stackviewer. +debugobj_r.py # Communicate objects between processes with rpc (nim). +debugger.py # Debug code run from shell or editor; show window. +debugger_r.py # Debug code run in remote process. +delegator.py # Define base class for delegators (nim). +editor.py # Define most of editor and utility functions. +filelist.py # Open files and manage list of open windows (nim). +grep.py # Find all occurrences of pattern in multiple files. help.py # Display IDLE's html doc. -keybindingDialog.py # Change keybindings. -macosxSupport.py # Help IDLE run on Macs (nim). +help_about.py # Display About IDLE dialog. +history.py # Get previous or next user input in shell (nim) +hyperparser.py # Parse code around a given index. +iomenu.py # Open, read, and write files +macosx.py # Help IDLE run on Macs (nim). +mainmenu.py # Define most of IDLE menu. +multicall.py # Wrap tk widget to allow multiple calls per event (nim). +outwin.py # Create window for grep output. +paragraph.py # Re-wrap multiline strings and comments. +parenmatch.py # Match fenceposts: (), [], and {}. +pathbrowser.py # Create path browser window. +percolator.py # Manage delegator stack (nim). +pyparse.py # Give information on code indentation +pyshell.py # Start IDLE, manage shell, complete editor window +redirector.py # Intercept widget subcommands (for percolator) (nim). +replace.py # Search and replace pattern in text. rpc.py # Commuicate between idle and user processes (nim). +rstrip.py # Strip trailing whitespace. run.py # Manage user code execution subprocess. +runscript.py # Check and run user code. +scrolledlist.py # Define scrolledlist widget for IDLE (nim). +search.py # Search for pattern in text. +searchbase.py # Define base for search, replace, and grep dialogs. +searchengine.py # Define engine for all 3 search dialogs. +stackviewer.py # View stack after exception. +statusbar.py # Define status bar for windows (nim). tabbedpages.py # Define tabbed pages widget (nim). -textView.py # Define read-only text widget (nim). +textview.py # Define read-only text widget (nim). +tree.py # Define tree widger, used in browsers (nim). +undo.py # Manage undo stack. +windows.py # Manage window list and define listed top level. +zoomheight.py # Zoom window to full height of screen. Configuration ------------- @@ -104,126 +104,128 @@ Subdirectories -------------- -Icons # small image files -idle_test # files for human test and automated unit tests +Icons # small image files +idle_test # files for human test and automated unit tests Unused and Deprecated files and objects (nim) --------------------------------------------- -EditorWindow.py: Helpdialog and helpDialog -ToolTip.py: unused. -help.txt -idlever.py +tooltip.py # unused + IDLE MENUS -Top level items and most submenu items are defined in Bindings. +Top level items and most submenu items are defined in mainmenu. Extenstions add submenu items when active. The names given are found, quoted, in one of these modules, paired with a '<>'. Each pseudoevent is bound to an event handler. Some event handlers call another function that does the actual work. The annotations below are intended to at least give the module where the actual work is done. +'eEW' = editor.EditorWindow -File # IOBindig except as noted - New File - Open... # IOBinding.open - Open Module +File + New File # eEW.new_callback + Open... # iomenu.open + Open Module # eEw.open_module Recent Files - Class Browser # Class Browser - Path Browser # Path Browser + Class Browser # eEW.open_class_browser, browser.ClassBrowser + Path Browser # eEW.open_path_browser, pathbrowser --- - Save # IDBinding.save - Save As... # IOBinding.save_as - Save Copy As... # IOBindling.save_a_copy + Save # iomenu.save + Save As... # iomenu.save_as + Save Copy As... # iomenu.save_a_copy --- - Print Window # IOBinding.print_window + Print Window # iomenu.print_window --- - Close - Exit + Close # eEW.close_event + Exit # flist.close_all_callback (bound in eEW) Edit - Undo # undoDelegator - Redo # undoDelegator - --- - Cut - Copy - Paste - Select All - --- # Next 5 items use SearchEngine; dialogs use SearchDialogBase - Find # Search Dialog - Find Again - Find Selection - Find in Files... # GrepDialog - Replace... # ReplaceDialog - Go to Line - Show Completions # AutoComplete extension and AutoCompleteWidow (&HP) - Expand Word # AutoExpand extension - Show call tip # Calltips extension and CalltipWindow (& Hyperparser) - Show surrounding parens # ParenMatch (& Hyperparser) + Undo # undodelegator + Redo # undodelegator + --- # eEW.right_menu_event + Cut # eEW.cut + Copy # eEW.copy + Paste # eEW.past + Select All # eEW.select_all (+ see eEW.remove_selection) + --- # Next 5 items use searchengine; dialogs use searchbase + Find # eEW.find_event, search.SearchDialog.find + Find Again # eEW.find_again_event, sSD.find_again + Find Selection # eEW.find_selection_event, sSD.find_selection + Find in Files... # eEW.find_in_files_event, grep + Replace... # eEW.replace_event, replace.ReplaceDialog.replace + Go to Line # eEW.goto_line_event + Show Completions # autocomplete extension and autocompleteWidow (&HP) + Expand Word # autoexpand extension + Show call tip # Calltips extension and CalltipWindow (& Hyperparser) + Show surrounding parens # parenmatch (& Hyperparser) -Shell # PyShell - View Last Restart # PyShell.? - Restart Shell # PyShell.? +Shell # pyshell + View Last Restart# pyshell.? + Restart Shell # pyshell.? Debug (Shell only) Go to File/Line - Debugger # Debugger, RemoteDebugger - Stack Viewer # StackViewer - Auto-open Stack Viewer # StackViewer + debugger # debugger, debugger_r + Stack Viewer # stackviewer + Auto-open Stack Viewer # stackviewer Format (Editor only) - Indent Region - Dedent Region - Comment Out Region - Uncomment Region - Tabify Region - Untabify Region - Toggle Tabs - New Indent Width - Format Paragraph # FormatParagraph extension + Indent Region # eEW.indent_region_event + Dedent Region # eEW.dedent_region_event + Comment Out Reg. # eEW.comment_region_event + Uncomment Region # eEW.uncomment_region_event + Tabify Region # eEW.tabify_region_event + Untabify Region # eEW.untabify_region_event + Toggle Tabs # eEW.toggle_tabs_event + New Indent Width # eEW.change_indentwidth_event + Format Paragraph # paragraph extension --- - Strip tailing whitespace # RstripExtension extension + Strip tailing whitespace # rstrip extension Run (Editor only) - Python Shell # PyShell + Python Shell # pyshell --- - Check Module # ScriptBinding - Run Module # ScriptBinding + Check Module # runscript + Run Module # runscript Options - Configure IDLE # configDialog + Configure IDLE # eEW.config_dialog, configdialog (tabs in the dialog) - Font tab # onfig-main.def - Highlight tab # configSectionNameDialog, config-highlight.def - Keys tab # keybindingDialog, configSectionNameDialog, onfig-keus.def - General tab # configHelpSourceEdit, config-main.def - Configure Extensions # configDialog - Xyz tab # xyz.py, config-extensions.def + Font tab # config-main.def + Highlight tab # config_sec, config-highlight.def + Keys tab # config_key, configconfig_secg-keus.def + General tab # config_help, config-main.def + Extensions tab # config-extensions.def, corresponding .py --- - Code Context (editor only) # CodeContext extension + Code Context (ed)# codecontext extension Window - Zoomheight # ZoomHeight extension + Zoomheight # zoomheight extension --- - # WindowList + # windows Help - About IDLE # aboutDialog + About IDLE # eEW.about_dialog, help_about.AboutDialog --- - IDLE Help # help - Python Doc - Turtle Demo + IDLE Help # eEW.help_dialog, helpshow_idlehelp + Python Doc # eEW.python_docs + Turtle Demo # eEW.open_turtle_demo --- (right click) -Defined in EditorWindow, PyShell, Output - Cut - Copy - Paste - --- - Go to file/line (shell and output only) - Set Breakpoint (editor only) - Clear Breakpoint (editor only) - Defined in Debugger - Go to source line - Show stack frame + Defined in editor, PyShelpyshellut + Cut + Copy + Paste + --- + Go to file/line (shell and output only) + Set Breakpoint (editor only) + Clear Breakpoint (editor only) + Defined in debugger + Go to source line + Show stack frame + + +Center Insert # eEW.center_insert_event + -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 31 23:52:02 2016 From: python-checkins at python.org (martin.panter) Date: Wed, 01 Jun 2016 03:52:02 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_Fix_a_few_typo?= =?utf-8?q?s=2E__Patch_by_Eitan_Adler=2E?= Message-ID: <20160601035201.67406.24356.D9455891@psf.io> https://hg.python.org/cpython/rev/55e6b4fd0e04 changeset: 101578:55e6b4fd0e04 branch: 2.7 user: Ezio Melotti date: Sun Jan 27 06:20:14 2013 +0200 summary: Fix a few typos. Patch by Eitan Adler. files: Lib/test/test_startfile.py | 2 +- Tools/msi/schema.py | 2 +- Tools/msi/uisample.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_startfile.py b/Lib/test/test_startfile.py --- a/Lib/test/test_startfile.py +++ b/Lib/test/test_startfile.py @@ -5,7 +5,7 @@ # # A possible improvement would be to have empty.vbs do something that # we can detect here, to make sure that not only the os.startfile() -# call succeeded, but also the the script actually has run. +# call succeeded, but also the script actually has run. import unittest from test import test_support diff --git a/Tools/msi/schema.py b/Tools/msi/schema.py --- a/Tools/msi/schema.py +++ b/Tools/msi/schema.py @@ -958,7 +958,7 @@ (u'ServiceInstall',u'StartType',u'N',0,4,None, None, None, None, u'Type of the service',), (u'Shortcut',u'Name',u'N',None, None, None, None, u'Filename',None, u'The name of the shortcut to be created.',), (u'Shortcut',u'Description',u'Y',None, None, None, None, u'Text',None, u'The description for the shortcut.',), -(u'Shortcut',u'Component_',u'N',None, None, u'Component',1,u'Identifier',None, u'Foreign key into the Component table denoting the component whose selection gates the the shortcut creation/deletion.',), +(u'Shortcut',u'Component_',u'N',None, None, u'Component',1,u'Identifier',None, u'Foreign key into the Component table denoting the component whose selection gates the shortcut creation/deletion.',), (u'Shortcut',u'Icon_',u'Y',None, None, u'Icon',1,u'Identifier',None, u'Foreign key into the File table denoting the external icon file for the shortcut.',), (u'Shortcut',u'IconIndex',u'Y',-32767,32767,None, None, None, None, u'The icon index for the shortcut.',), (u'Shortcut',u'Directory_',u'N',None, None, u'Directory',1,u'Identifier',None, u'Foreign key into the Directory table denoting the directory where the shortcut file is created.',), diff --git a/Tools/msi/uisample.py b/Tools/msi/uisample.py --- a/Tools/msi/uisample.py +++ b/Tools/msi/uisample.py @@ -1195,7 +1195,7 @@ (u'ServiceInstall', u'StartType', u'N', 0, 4, None, None, None, None, u'Type of the service'), (u'Shortcut', u'Name', u'N', None, None, None, None, u'Filename', None, u'The name of the shortcut to be created.'), (u'Shortcut', u'Description', u'Y', None, None, None, None, u'Text', None, u'The description for the shortcut.'), -(u'Shortcut', u'Component_', u'N', None, None, u'Component', 1, u'Identifier', None, u'Foreign key into the Component table denoting the component whose selection gates the the shortcut creation/deletion.'), +(u'Shortcut', u'Component_', u'N', None, None, u'Component', 1, u'Identifier', None, u'Foreign key into the Component table denoting the component whose selection gates the shortcut creation/deletion.'), (u'Shortcut', u'Icon_', u'Y', None, None, u'Icon', 1, u'Identifier', None, u'Foreign key into the File table denoting the external icon file for the shortcut.'), (u'Shortcut', u'IconIndex', u'Y', -32767, 32767, None, None, None, None, u'The icon index for the shortcut.'), (u'Shortcut', u'Directory_', u'N', None, None, u'Directory', 1, u'Identifier', None, u'Foreign key into the Directory table denoting the directory where the shortcut file is created.'), -- Repository URL: https://hg.python.org/cpython From python-checkins at python.org Tue May 31 23:52:02 2016 From: python-checkins at python.org (martin.panter) Date: Wed, 01 Jun 2016 03:52:02 +0000 Subject: [Python-checkins] =?utf-8?q?cpython_=282=2E7=29=3A_fix_typo?= Message-ID: <20160601035201.7750.42275.6B3D2BF1@psf.io> https://hg.python.org/cpython/rev/4e1a483deebf changeset: 101577:4e1a483deebf branch: 2.7 parent: 101571:824d32436198 user: Fred Drake date: Tue Sep 04 19:43:19 2007 +0000 summary: fix typo files: setup.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -769,7 +769,7 @@ if host_platform == 'darwin' and os_release < 9: # In every directory on the search path search for a dynamic # library and then a static library, instead of first looking - # for dynamic libraries on the entiry path. + # for dynamic libraries on the entire path. # This way a staticly linked custom readline gets picked up # before the (possibly broken) dynamic library in /usr/lib. readline_extra_link_args = ('-Wl,-search_paths_first',) -- Repository URL: https://hg.python.org/cpython