Python-checkins
Threads by month
- ----- 2025 -----
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
August 2019
- 3 participants
- 442 discussions

Aug. 30, 2019
https://github.com/python/cpython/commit/39d87b54715197ca9dcb6902bb43461c0e…
commit: 39d87b54715197ca9dcb6902bb43461c0ed701a2
branch: master
author: Min ho Kim <minho42(a)gmail.com>
committer: Terry Jan Reedy <tjreedy(a)udel.edu>
date: 2019-08-30T16:21:19-04:00
summary:
Fix typos mostly in comments, docs and test names (GH-15209)
files:
M Doc/c-api/init_config.rst
M Doc/library/importlib.rst
M Include/pyhash.h
M Lib/asyncio/streams.py
M Lib/bdb.py
M Lib/multiprocessing/util.py
M …
[View More]Lib/test/lock_tests.py
M Lib/test/test_cmd_line_script.py
M Lib/test/test_collections.py
M Lib/test/test_descr.py
M Lib/test/test_format.py
M Lib/test/test_gc.py
M Lib/test/test_hmac.py
M Lib/test/test_importlib/source/test_file_loader.py
M Lib/test/test_importlib/test_main.py
M Lib/test/test_importlib/util.py
M Lib/test/test_statistics.py
M Lib/test/test_tracemalloc.py
M Lib/test/test_warnings/__init__.py
M Lib/test/test_winreg.py
M Lib/test/test_wsgiref.py
M Lib/tkinter/filedialog.py
M Lib/unittest/test/testmock/testpatch.py
M Lib/uuid.py
M Misc/HISTORY
M Misc/NEWS.d/3.5.0a1.rst
M Misc/NEWS.d/3.5.4rc1.rst
M Misc/NEWS.d/3.6.0b1.rst
M Misc/NEWS.d/3.6.0rc1.rst
M Misc/NEWS.d/3.6.1rc1.rst
M Misc/NEWS.d/3.7.0a1.rst
M Misc/NEWS.d/3.8.0a1.rst
M Misc/NEWS.d/3.8.0a4.rst
M Misc/NEWS.d/3.8.0b1.rst
M Modules/_ctypes/callproc.c
M Modules/_ctypes/stgdict.c
M Modules/_io/bytesio.c
M Modules/_io/stringio.c
M Modules/_testcapimodule.c
M Modules/expat/loadlibrary.c
M Modules/expat/xmlparse.c
M Modules/termios.c
M Objects/listsort.txt
M Objects/typeobject.c
M Python/ast.c
M Python/pystate.c
diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst
index 72bd8c37b435..c198df3fb1d0 100644
--- a/Doc/c-api/init_config.rst
+++ b/Doc/c-api/init_config.rst
@@ -876,7 +876,7 @@ Path Configuration
If at least one "output field" is not set, Python computes the path
configuration to fill unset fields. If
:c:member:`~PyConfig.module_search_paths_set` is equal to 0,
-:c:member:`~PyConfig.module_search_paths` is overriden and
+:c:member:`~PyConfig.module_search_paths` is overridden and
:c:member:`~PyConfig.module_search_paths_set` is set to 1.
It is possible to completely ignore the function computing the default
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index 8be6172d4c76..0976360c6965 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -1379,8 +1379,8 @@ an :term:`importer`.
bytecode file. An empty string represents no optimization, so
``/foo/bar/baz.py`` with an *optimization* of ``''`` will result in a
bytecode path of ``/foo/bar/__pycache__/baz.cpython-32.pyc``. ``None`` causes
- the interpter's optimization level to be used. Any other value's string
- representation being used, so ``/foo/bar/baz.py`` with an *optimization* of
+ the interpreter's optimization level to be used. Any other value's string
+ representation is used, so ``/foo/bar/baz.py`` with an *optimization* of
``2`` will lead to the bytecode path of
``/foo/bar/__pycache__/baz.cpython-32.opt-2.pyc``. The string representation
of *optimization* can only be alphanumeric, else :exc:`ValueError` is raised.
diff --git a/Include/pyhash.h b/Include/pyhash.h
index 9cfd071ea17b..dbcc9744be35 100644
--- a/Include/pyhash.h
+++ b/Include/pyhash.h
@@ -119,7 +119,7 @@ PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
* configure script.
*
* - FNV is available on all platforms and architectures.
- * - SIPHASH24 only works on plaforms that don't require aligned memory for integers.
+ * - SIPHASH24 only works on platforms that don't require aligned memory for integers.
* - With EXTERNAL embedders can provide an alternative implementation with::
*
* PyHash_FuncDef PyHash_Func = {...};
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py
index e56e2efe5cf1..33b2fa55673e 100644
--- a/Lib/asyncio/streams.py
+++ b/Lib/asyncio/streams.py
@@ -71,7 +71,7 @@ def connect(host=None, port=None, *,
ssl_handshake_timeout=None,
happy_eyeballs_delay=None, interleave=None):
# Design note:
- # Don't use decorator approach but exilicit non-async
+ # Don't use decorator approach but explicit non-async
# function to fail fast and explicitly
# if passed arguments don't match the function signature
return _ContextManagerHelper(_connect(host, port, limit,
@@ -442,7 +442,7 @@ def connect_unix(path=None, *,
ssl_handshake_timeout=None):
"""Similar to `connect()` but works with UNIX Domain Sockets."""
# Design note:
- # Don't use decorator approach but exilicit non-async
+ # Don't use decorator approach but explicit non-async
# function to fail fast and explicitly
# if passed arguments don't match the function signature
return _ContextManagerHelper(_connect_unix(path,
diff --git a/Lib/bdb.py b/Lib/bdb.py
index fd34976a4d0b..7b19ba369036 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -38,7 +38,7 @@ def canonic(self, filename):
"""Return canonical form of filename.
For real filenames, the canonical form is a case-normalized (on
- case insenstive filesystems) absolute path. 'Filenames' with
+ case insensitive filesystems) absolute path. 'Filenames' with
angle brackets, such as "<stdin>", generated in interactive
mode, are returned unchanged.
"""
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py
index 19380917b6f5..32b51b04373f 100644
--- a/Lib/multiprocessing/util.py
+++ b/Lib/multiprocessing/util.py
@@ -238,7 +238,7 @@ def __repr__(self):
if self._kwargs:
x += ', kwargs=' + str(self._kwargs)
if self._key[0] is not None:
- x += ', exitprority=' + str(self._key[0])
+ x += ', exitpriority=' + str(self._key[0])
return x + '>'
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py
index 888586840f2c..d12a86e7e934 100644
--- a/Lib/test/lock_tests.py
+++ b/Lib/test/lock_tests.py
@@ -467,7 +467,7 @@ def _check_notify(self, cond):
# of the workers.
# Secondly, this test assumes that condition variables are not subject
# to spurious wakeups. The absence of spurious wakeups is an implementation
- # detail of Condition Cariables in current CPython, but in general, not
+ # detail of Condition Variables in current CPython, but in general, not
# a guaranteed property of condition variables as a programming
# construct. In particular, it is possible that this can no longer
# be conveniently guaranteed should their implementation ever change.
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index c8bf8af964f8..60723078efc6 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -474,7 +474,7 @@ def test_dash_m_errors(self):
('os.path', br'loader.*cannot handle'),
('importlib', br'No module named.*'
br'is a package and cannot be directly executed'),
- ('importlib.nonexistant', br'No module named'),
+ ('importlib.nonexistent', br'No module named'),
('.unittest', br'Relative module names not supported'),
)
for name, regex in tests:
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 7f01de6f433d..a2a66a757220 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -1927,7 +1927,7 @@ def test_order_preservation(self):
'r', 'c', 'd', ' ', 's', 's', 'i', 'i', 'm', 'm', 'l'])
# Math operations order first by the order encountered in the left
- # operand and then by the order encounted in the right operand.
+ # operand and then by the order encountered in the right operand.
ps = 'aaabbcdddeefggghhijjjkkl'
qs = 'abbcccdeefffhkkllllmmnno'
order = {letter: i for i, letter in enumerate(dict.fromkeys(ps + qs))}
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 770e0c496e28..4368bb585f31 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3025,7 +3025,7 @@ def test_str_subclass_as_dict_key(self):
# Testing a str subclass used as dict key ..
class cistr(str):
- """Sublcass of str that computes __eq__ case-insensitively.
+ """Subclass of str that computes __eq__ case-insensitively.
Also computes a hash code of the string in canonical form.
"""
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 83804cbb00ab..4559cd5623ef 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -48,7 +48,7 @@ def testformat(formatstr, args, output=None, limit=None, overflowok=False):
def testcommon(formatstr, args, output=None, limit=None, overflowok=False):
# if formatstr is a str, test str, bytes, and bytearray;
- # otherwise, test bytes and bytearry
+ # otherwise, test bytes and bytearray
if isinstance(formatstr, str):
testformat(formatstr, args, output, limit, overflowok)
b_format = formatstr.encode('ascii')
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 2dab53004452..311143da91d0 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -912,7 +912,7 @@ def test_collect_generation(self):
def test_collect_garbage(self):
self.preclean()
# Each of these cause four objects to be garbage: Two
- # Uncolectables and their instance dicts.
+ # Uncollectables and their instance dicts.
Uncollectable()
Uncollectable()
C1055820(666)
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index 896bbe9ab798..f2eb6d716d52 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -445,7 +445,7 @@ def test_compare_digest(self):
a, b = bytearray(b"foobar"), bytearray(b"foobar")
self.assertTrue(hmac.compare_digest(a, b))
- # Testing bytearrays of diffeent lengths
+ # Testing bytearrays of different lengths
a, b = bytearray(b"foobar"), bytearray(b"foo")
self.assertFalse(hmac.compare_digest(a, b))
@@ -458,7 +458,7 @@ def test_compare_digest(self):
self.assertTrue(hmac.compare_digest(a, b))
self.assertTrue(hmac.compare_digest(b, a))
- # Testing byte bytearray of diffeent lengths
+ # Testing byte bytearray of different lengths
a, b = bytearray(b"foobar"), b"foo"
self.assertFalse(hmac.compare_digest(a, b))
self.assertFalse(hmac.compare_digest(b, a))
@@ -472,7 +472,7 @@ def test_compare_digest(self):
a, b = "foobar", "foobar"
self.assertTrue(hmac.compare_digest(a, b))
- # Testing str of diffeent lengths
+ # Testing str of different lengths
a, b = "foo", "foobar"
self.assertFalse(hmac.compare_digest(a, b))
diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py
index 3ffb2aa1e60a..ab44722146e3 100644
--- a/Lib/test/test_importlib/source/test_file_loader.py
+++ b/Lib/test/test_importlib/source/test_file_loader.py
@@ -325,7 +325,7 @@ def test_unchecked_hash_based_pyc(self):
)
@util.writes_bytecode_files
- def test_overiden_unchecked_hash_based_pyc(self):
+ def test_overridden_unchecked_hash_based_pyc(self):
with util.create_modules('_temp') as mapping, \
unittest.mock.patch('_imp.check_hash_based_pycs', 'always'):
source = mapping['_temp']
diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py
index bc42b83ee291..3d7da819b343 100644
--- a/Lib/test/test_importlib/test_main.py
+++ b/Lib/test/test_importlib/test_main.py
@@ -32,7 +32,7 @@ def test_new_style_classes(self):
class ImportTests(fixtures.DistInfoPkg, unittest.TestCase):
def test_import_nonexistent_module(self):
# Ensure that the MetadataPathFinder does not crash an import of a
- # non-existant module.
+ # non-existent module.
with self.assertRaises(ImportError):
importlib.import_module('does_not_exist')
diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py
index 913db4bb3b71..5aaf277e1f37 100644
--- a/Lib/test/test_importlib/util.py
+++ b/Lib/test/test_importlib/util.py
@@ -443,7 +443,7 @@ def contents(self):
yield entry
name = 'testingpackage'
- # Unforunately importlib.util.module_from_spec() was not introduced until
+ # Unfortunately importlib.util.module_from_spec() was not introduced until
# Python 3.5.
module = types.ModuleType(name)
loader = Reader()
diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py
index 23dd96e365a8..01b317c3281e 100644
--- a/Lib/test/test_statistics.py
+++ b/Lib/test/test_statistics.py
@@ -1810,13 +1810,13 @@ def test_bimodal_data(self):
# Test mode with bimodal data.
data = [1, 1, 2, 2, 2, 2, 3, 4, 5, 6, 6, 6, 6, 7, 8, 9, 9]
assert data.count(2) == data.count(6) == 4
- # mode() should return 2, the first encounted mode
+ # mode() should return 2, the first encountered mode
self.assertEqual(self.func(data), 2)
def test_unique_data(self):
# Test mode when data points are all unique.
data = list(range(10))
- # mode() should return 0, the first encounted mode
+ # mode() should return 0, the first encountered mode
self.assertEqual(self.func(data), 0)
def test_none_data(self):
diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py
index c3866483b8aa..4b9bf4ed5da1 100644
--- a/Lib/test/test_tracemalloc.py
+++ b/Lib/test/test_tracemalloc.py
@@ -885,7 +885,7 @@ def check_env_var_invalid(self, nframe):
return
if b'PYTHONTRACEMALLOC: invalid number of frames' in stderr:
return
- self.fail(f"unexpeced output: {stderr!a}")
+ self.fail(f"unexpected output: {stderr!a}")
def test_env_var_invalid(self):
@@ -914,7 +914,7 @@ def check_sys_xoptions_invalid(self, nframe):
return
if b'-X tracemalloc=NFRAME: invalid number of frames' in stderr:
return
- self.fail(f"unexpeced output: {stderr!a}")
+ self.fail(f"unexpected output: {stderr!a}")
def test_sys_xoptions_invalid(self):
for nframe in INVALID_NFRAME:
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py
index be848b2f9b6c..d1031829514b 100644
--- a/Lib/test/test_warnings/__init__.py
+++ b/Lib/test/test_warnings/__init__.py
@@ -714,7 +714,7 @@ def test_showwarning_not_callable(self):
self.assertRaises(TypeError, self.module.warn, "Warning!")
def test_show_warning_output(self):
- # With showarning() missing, make sure that output is okay.
+ # With showwarning() missing, make sure that output is okay.
text = 'test show_warning'
with original_warnings.catch_warnings(module=self.module):
self.module.filterwarnings("always", category=UserWarning)
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py
index dc2b46e42521..91a2bbc066b1 100644
--- a/Lib/test/test_winreg.py
+++ b/Lib/test/test_winreg.py
@@ -229,7 +229,7 @@ def test_connect_registry_to_local_machine_works(self):
h.Close()
self.assertEqual(h.handle, 0)
- def test_inexistant_remote_registry(self):
+ def test_nonexistent_remote_registry(self):
connect = lambda: ConnectRegistry("abcdefghijkl", HKEY_CURRENT_USER)
self.assertRaises(OSError, connect)
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index bce33291c566..6af45145a792 100644
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -586,10 +586,10 @@ def testEnviron(self):
expected.update({
# X doesn't exist in os_environ
"X": "Y",
- # HOME is overriden by TestHandler
+ # HOME is overridden by TestHandler
'HOME': "/override/home",
- # overriden by setup_testing_defaults()
+ # overridden by setup_testing_defaults()
"SCRIPT_NAME": "",
"SERVER_NAME": "127.0.0.1",
diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py
index dbb97dd5777e..3ed93eb8c163 100644
--- a/Lib/tkinter/filedialog.py
+++ b/Lib/tkinter/filedialog.py
@@ -469,7 +469,7 @@ def test():
except (ImportError, AttributeError):
pass
- # dialog for openening files
+ # dialog for opening files
openfilename=askopenfilename(filetypes=[("all files", "*")])
try:
diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/unittest/test/testmock/testpatch.py
index 27914a9d7178..0632d95e58fe 100644
--- a/Lib/unittest/test/testmock/testpatch.py
+++ b/Lib/unittest/test/testmock/testpatch.py
@@ -1651,7 +1651,7 @@ def test_patch_imports_lazily(self):
p1.stop()
self.assertEqual(squizz.squozz, 3)
- def test_patch_propogrates_exc_on_exit(self):
+ def test_patch_propagates_exc_on_exit(self):
class holder:
exc_info = None, None, None
@@ -1680,9 +1680,9 @@ def test(mock):
self.assertIs(holder.exc_info[0], RuntimeError)
self.assertIsNotNone(holder.exc_info[1],
- 'exception value not propgated')
+ 'exception value not propagated')
self.assertIsNotNone(holder.exc_info[2],
- 'exception traceback not propgated')
+ 'exception traceback not propagated')
def test_create_and_specs(self):
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 7aa01bb5c355..188e16ba14e3 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -680,7 +680,7 @@ def _random_getnode():
return random.getrandbits(48) | (1 << 40)
-# _OS_GETTERS, when known, are targetted for a specific OS or platform.
+# _OS_GETTERS, when known, are targeted for a specific OS or platform.
# The order is by 'common practice' on the specified platform.
# Note: 'posix' and 'windows' _OS_GETTERS are prefixed by a dll/dlload() method
# which, when successful, means none of these "external" methods are called.
diff --git a/Misc/HISTORY b/Misc/HISTORY
index f49960c95ada..32b2a37866bc 100644
--- a/Misc/HISTORY
+++ b/Misc/HISTORY
@@ -1231,7 +1231,7 @@ Library
- Issue #22448: Improve canceled timer handles cleanup to prevent
unbound memory usage. Patch by Joshua Moore-Oliva.
-- Issue #23009: Make sure selectors.EpollSelecrtor.select() works when no
+- Issue #23009: Make sure selectors.EpollSelector.select() works when no
FD is registered.
IDLE
@@ -16660,7 +16660,7 @@ Core and Builtins
Exception (KeyboardInterrupt, and SystemExit) propagate instead of
ignoring them.
-- #3021 Exception reraising sematics have been significantly improved. However,
+- #3021 Exception reraising semantics have been significantly improved. However,
f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
code anymore.
diff --git a/Misc/NEWS.d/3.5.0a1.rst b/Misc/NEWS.d/3.5.0a1.rst
index 99f2d1d36dbf..56d0d33decc0 100644
--- a/Misc/NEWS.d/3.5.0a1.rst
+++ b/Misc/NEWS.d/3.5.0a1.rst
@@ -1255,7 +1255,7 @@ Support wrapped callables in doctest. Patch by Claudiu Popa.
.. nonce: -sW7gk
.. section: Library
-Make sure selectors.EpollSelecrtor.select() works when no FD is registered.
+Make sure selectors.EpollSelector.select() works when no FD is registered.
..
diff --git a/Misc/NEWS.d/3.5.4rc1.rst b/Misc/NEWS.d/3.5.4rc1.rst
index f261ddb3a2d3..04a035a41e74 100644
--- a/Misc/NEWS.d/3.5.4rc1.rst
+++ b/Misc/NEWS.d/3.5.4rc1.rst
@@ -913,7 +913,7 @@ Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances.
Fixed race condition in C implementation of functools.lru_cache. KeyError
could be raised when cached function with full cache was simultaneously
-called from differen threads with the same uncached arguments.
+called from different threads with the same uncached arguments.
..
diff --git a/Misc/NEWS.d/3.6.0b1.rst b/Misc/NEWS.d/3.6.0b1.rst
index bd0e0a7c58d1..3fbae5c6a4b3 100644
--- a/Misc/NEWS.d/3.6.0b1.rst
+++ b/Misc/NEWS.d/3.6.0b1.rst
@@ -1148,7 +1148,7 @@ dict constraint in ForwardRef._eval_type (upstream #252)
.. nonce: hxh6_h
.. section: Library
-Make ``_normalize`` parameter to ``Fraction`` constuctor keyword-only, so
+Make ``_normalize`` parameter to ``Fraction`` constructor keyword-only, so
that ``Fraction(2, 3, 4)`` now raises ``TypeError``.
..
diff --git a/Misc/NEWS.d/3.6.0rc1.rst b/Misc/NEWS.d/3.6.0rc1.rst
index c44dec324d2f..15769f950db2 100644
--- a/Misc/NEWS.d/3.6.0rc1.rst
+++ b/Misc/NEWS.d/3.6.0rc1.rst
@@ -48,7 +48,7 @@ they still are deprecated and will be disabled in 3.7.
.. section: Library
Fix a regression introduced in warnings.catch_warnings(): call
-warnings.showwarning() if it was overriden inside the context manager.
+warnings.showwarning() if it was overridden inside the context manager.
..
diff --git a/Misc/NEWS.d/3.6.1rc1.rst b/Misc/NEWS.d/3.6.1rc1.rst
index 1f9fb13f6970..58fd1b0624b2 100644
--- a/Misc/NEWS.d/3.6.1rc1.rst
+++ b/Misc/NEWS.d/3.6.1rc1.rst
@@ -435,7 +435,7 @@ Fix an important omission by adding Deque to the typing module.
Fixed race condition in C implementation of functools.lru_cache. KeyError
could be raised when cached function with full cache was simultaneously
-called from differen threads with the same uncached arguments.
+called from different threads with the same uncached arguments.
..
diff --git a/Misc/NEWS.d/3.7.0a1.rst b/Misc/NEWS.d/3.7.0a1.rst
index bbd72d7f3ff8..244bb37e7c61 100644
--- a/Misc/NEWS.d/3.7.0a1.rst
+++ b/Misc/NEWS.d/3.7.0a1.rst
@@ -3651,7 +3651,7 @@ regular expression objects.
Fixed race condition in C implementation of functools.lru_cache. KeyError
could be raised when cached function with full cache was simultaneously
-called from differen threads with the same uncached arguments.
+called from different threads with the same uncached arguments.
..
diff --git a/Misc/NEWS.d/3.8.0a1.rst b/Misc/NEWS.d/3.8.0a1.rst
index 68217d31193e..c5ab5f4489c9 100644
--- a/Misc/NEWS.d/3.8.0a1.rst
+++ b/Misc/NEWS.d/3.8.0a1.rst
@@ -2418,7 +2418,7 @@ over browsers in the ``BROWSER`` environment variable.
.. nonce: eSLKBE
.. section: Library
-Avoid stripping trailing whitespace in doctest fancy diff. Orignial patch by
+Avoid stripping trailing whitespace in doctest fancy diff. Original patch by
R. David Murray & Jairo Trad. Enhanced by Sanyam Khurana.
..
diff --git a/Misc/NEWS.d/3.8.0a4.rst b/Misc/NEWS.d/3.8.0a4.rst
index 894ce0b5a341..fc952fa9dcc8 100644
--- a/Misc/NEWS.d/3.8.0a4.rst
+++ b/Misc/NEWS.d/3.8.0a4.rst
@@ -1110,7 +1110,7 @@ Add ``-fmax-type-align=8`` to CFLAGS when clang compiler is detected. The
pymalloc memory allocator aligns memory on 8 bytes. On x86-64, clang expects
alignment on 16 bytes by default and so uses MOVAPS instruction which can
lead to segmentation fault. Instruct clang that Python is limited to
-alignemnt on 8 bytes to use MOVUPS instruction instead: slower but don't
+alignment on 8 bytes to use MOVUPS instruction instead: slower but don't
trigger a SIGSEGV if the memory is not aligned on 16 bytes. Sadly, the flag
must be added to ``CFLAGS`` and not just ``CFLAGS_NODIST``, since third
party C extensions can have the same issue.
diff --git a/Misc/NEWS.d/3.8.0b1.rst b/Misc/NEWS.d/3.8.0b1.rst
index 609aa338e844..84b0350134fb 100644
--- a/Misc/NEWS.d/3.8.0b1.rst
+++ b/Misc/NEWS.d/3.8.0b1.rst
@@ -1262,7 +1262,7 @@ Reinitialize logging.Handler locks in forked child processes instead of
attempting to acquire them all in the parent before forking only to be
released in the child process. The acquire/release pattern was leading to
deadlocks in code that has implemented any form of chained logging handlers
-that depend upon one another as the lock acquision order cannot be
+that depend upon one another as the lock acquisition order cannot be
guaranteed.
..
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index bd67c6eeaeed..85fa79983ec1 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -110,7 +110,7 @@ static void pymem_destructor(PyObject *ptr)
WinDLL(..., use_last_error=True) swap the system LastError value with the
ctypes private copy.
- The values are also swapped immeditately before and after ctypes callback
+ The values are also swapped immediately before and after ctypes callback
functions are called, if the callbacks are constructed using the new
optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) or
WINFUNCTYPE(..., use_errno=True).
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index 235a4d79ad2c..8709cc5404a2 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -352,7 +352,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
int big_endian;
/* HACK Alert: I cannot be bothered to fix ctypes.com, so there has to
- be a way to use the old, broken sematics: _fields_ are not extended
+ be a way to use the old, broken semantics: _fields_ are not extended
but replaced in subclasses.
XXX Remove this in ctypes 1.0!
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index 793ce920004e..a5f4c47863df 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -841,7 +841,7 @@ bytesio_setstate(bytesio *self, PyObject *state)
/* Set carefully the position value. Alternatively, we could use the seek
method instead of modifying self->pos directly to better protect the
- object internal state against errneous (or malicious) inputs. */
+ object internal state against erroneous (or malicious) inputs. */
position_obj = PyTuple_GET_ITEM(state, 1);
if (!PyLong_Check(position_obj)) {
PyErr_Format(PyExc_TypeError,
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index 810cad6d63ce..3f7afad56347 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -899,7 +899,7 @@ stringio_setstate(stringio *self, PyObject *state)
/* Set carefully the position value. Alternatively, we could use the seek
method instead of modifying self->pos directly to better protect the
- object internal state against errneous (or malicious) inputs. */
+ object internal state against erroneous (or malicious) inputs. */
position_obj = PyTuple_GET_ITEM(state, 2);
if (!PyLong_Check(position_obj)) {
PyErr_Format(PyExc_TypeError,
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index cc3b089a0d7d..640ec5914577 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -4634,7 +4634,7 @@ check_pyobject_forbidden_bytes_is_freed(PyObject *self, PyObject *Py_UNUSED(args
/* Initialize reference count to avoid early crash in ceval or GC */
Py_REFCNT(op) = 1;
/* ob_type field is after the memory block: part of "forbidden bytes"
- when using debug hooks on memory allocatrs! */
+ when using debug hooks on memory allocators! */
return test_pyobject_is_freed("check_pyobject_forbidden_bytes_is_freed", op);
}
diff --git a/Modules/expat/loadlibrary.c b/Modules/expat/loadlibrary.c
index 35fdf98bce6c..2f80b3a379fd 100644
--- a/Modules/expat/loadlibrary.c
+++ b/Modules/expat/loadlibrary.c
@@ -53,12 +53,12 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD);
/* See function definitions in winbase.h */
#ifdef UNICODE
# ifdef _WIN32_WCE
-# define LOADLIBARYEX L"LoadLibraryExW"
+# define LOADLIBRARYEX L"LoadLibraryExW"
# else
-# define LOADLIBARYEX "LoadLibraryExW"
+# define LOADLIBRARYEX "LoadLibraryExW"
# endif
#else
-# define LOADLIBARYEX "LoadLibraryExA"
+# define LOADLIBRARYEX "LoadLibraryExA"
#endif
@@ -88,7 +88,7 @@ HMODULE _Expat_LoadLibrary(LPCTSTR filename)
/* Attempt to find LoadLibraryEx() which is only available on Windows 2000
and above */
- pLoadLibraryEx = (LOADLIBRARYEX_FN) GetProcAddress(hKernel32, LOADLIBARYEX);
+ pLoadLibraryEx = (LOADLIBRARYEX_FN) GetProcAddress(hKernel32, LOADLIBRARYEX);
/* Detect if there's already a path in the filename and load the library if
there is. Note: Both back slashes and forward slashes have been supported
diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c
index 9c0987f4f6d8..311dbc4dfb9c 100644
--- a/Modules/expat/xmlparse.c
+++ b/Modules/expat/xmlparse.c
@@ -3399,7 +3399,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
* has to have passed through the hash table lookup once
* already. That implies that an entry for it already
* exists, so the lookup above will return a pointer to
- * already allocated memory. There is no opportunaity for
+ * already allocated memory. There is no opportunity for
* the allocator to fail, so the condition above cannot be
* fulfilled.
*
diff --git a/Modules/termios.c b/Modules/termios.c
index 7601b68afda3..aee7f12c57ca 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -18,7 +18,7 @@
#include <sys/ioctl.h>
/* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR,
- * MDTR, MRI, and MRTS (appearantly used internally by some things
+ * MDTR, MRI, and MRTS (apparently used internally by some things
* defined as macros; these are not used here directly).
*/
#ifdef HAVE_SYS_MODEM_H
diff --git a/Objects/listsort.txt b/Objects/listsort.txt
index 8c877515c72e..43fe1574c323 100644
--- a/Objects/listsort.txt
+++ b/Objects/listsort.txt
@@ -328,7 +328,7 @@ found is still high in the memory hierarchy. We also can't delay merging
unmerged, and the stack has a fixed size.
What turned out to be a good compromise maintains two invariants on the
-stack entries, where A, B and C are the lengths of the three righmost not-yet
+stack entries, where A, B and C are the lengths of the three rightmost not-yet
merged slices:
1. A > B+C
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 0ca7dcb695bb..c816c3b6df23 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -117,7 +117,7 @@ find_signature(const char *name, const char *doc)
#define SIGNATURE_END_MARKER ")\n--\n\n"
#define SIGNATURE_END_MARKER_LENGTH 6
/*
- * skips past the end of the docstring's instrospection signature.
+ * skips past the end of the docstring's introspection signature.
* (assumes doc starts with a valid signature prefix.)
*/
static const char *
diff --git a/Python/ast.c b/Python/ast.c
index 8b3dbead2fdc..11524029ae26 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -5356,7 +5356,7 @@ typedef struct {
doubling the number allocated each time. Note that the f-string
f'{0}a{1}' contains 3 expr_ty's: 2 FormattedValue's, and one
Constant for the literal 'a'. So you add expr_ty's about twice as
- fast as you add exressions in an f-string. */
+ fast as you add expressions in an f-string. */
Py_ssize_t allocated; /* Number we've allocated. */
Py_ssize_t size; /* Number we've used. */
diff --git a/Python/pystate.c b/Python/pystate.c
index 3b2adf54be45..dc5240048ba0 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -729,7 +729,7 @@ PyState_RemoveModule(struct PyModuleDef* def)
return -1;
}
if (state->modules_by_index == NULL) {
- Py_FatalError("PyState_RemoveModule: Interpreters module-list not acessible.");
+ Py_FatalError("PyState_RemoveModule: Interpreters module-list not accessible.");
return -1;
}
if (index > PyList_GET_SIZE(state->modules_by_index)) {
@@ -888,7 +888,7 @@ PyThreadState_DeleteCurrent()
* Note that, if there is a current thread state, it *must* be the one
* passed as argument. Also, this won't touch any other interpreters
* than the current one, since we don't know which thread state should
- * be kept in those other interpreteres.
+ * be kept in those other interpreters.
*/
void
_PyThreadState_DeleteExcept(_PyRuntimeState *runtime, PyThreadState *tstate)
[View Less]
1
0
https://github.com/python/cpython/commit/15119bc2a7e902ae1c6988556c3bef3de8…
commit: 15119bc2a7e902ae1c6988556c3bef3de87fa789
branch: master
author: Terry Jan Reedy <tjreedy(a)udel.edu>
committer: GitHub <noreply(a)github.com>
date: 2019-08-30T16:16:37-04:00
summary:
IDLE: Fix 2 typos found by Min ho Kim. (GH-15617)
files:
M Lib/idlelib/README.txt
M Lib/idlelib/browser.py
diff --git a/Lib/idlelib/README.txt b/Lib/idlelib/README.txt
index 42c3506699ba..48a1f4a425c9 100644
--- a/…
[View More]Lib/idlelib/README.txt
+++ b/Lib/idlelib/README.txt
@@ -115,7 +115,7 @@ tooltip.py # unused
IDLE MENUS
Top level items and most submenu items are defined in mainmenu.
-Extenstions add submenu items when active. The names given are
+Extensions add submenu items when active. The names given are
found, quoted, in one of these modules, paired with a '<<pseudoevent>>'.
Each pseudoevent is bound to an event handler. Some event handlers
call another function that does the actual work. The annotations below
diff --git a/Lib/idlelib/browser.py b/Lib/idlelib/browser.py
index e5b0bc53c662..3c3a53a6599a 100644
--- a/Lib/idlelib/browser.py
+++ b/Lib/idlelib/browser.py
@@ -29,7 +29,7 @@ def transform_children(child_dict, modname=None):
The dictionary maps names to pyclbr information objects.
Filter out imported objects.
Augment class names with bases.
- The insertion order of the dictonary is assumed to have been in line
+ The insertion order of the dictionary is assumed to have been in line
number order, so sorting is not necessary.
The current tree only calls this once per child_dict as it saves
[View Less]
1
0

Aug. 30, 2019
https://github.com/python/cpython/commit/17f61ed25a856ed673ad6f2e9782c3d5e5…
commit: 17f61ed25a856ed673ad6f2e9782c3d5e556f151
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
committer: GitHub <noreply(a)github.com>
date: 2019-08-30T05:50:44-07:00
summary:
bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)
Fix a ctypes regression of Python 3.8. When a ctypes.Structure is
passed by copy to a function, ctypes internals created a …
[View More]temporary
object which had the side effect of calling the structure finalizer
(__del__) twice. The Python semantics requires a finalizer to be
called exactly once. Fix ctypes internals to no longer call the
finalizer twice.
Create a new internal StructParam_Type which is only used by
_ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument).
StructUnionType_paramfunc() creates such object.
(cherry picked from commit 96b4087ce784ee7434dffdf69c475f5b40543982)
Co-authored-by: Victor Stinner <vstinner(a)redhat.com>
files:
A Misc/NEWS.d/next/Library/2019-08-30-11-21-10.bpo-37140.cFAX-a.rst
M Lib/ctypes/test/test_structures.py
M Modules/_ctypes/_ctypes.c
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index d1ea43bc7e3b..fda104563d29 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -3,7 +3,7 @@
from ctypes.test import need_symbol
from struct import calcsize
import _ctypes_test
-import test.support
+from test import support
class SubclassesTest(unittest.TestCase):
def test_subclass(self):
@@ -202,7 +202,7 @@ class X(Structure):
"_pack_": -1}
self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
- @test.support.cpython_only
+ @support.cpython_only
def test_packed_c_limits(self):
# Issue 15989
import _testcapi
@@ -396,27 +396,66 @@ class Z(Y):
self.assertRaises(TypeError, lambda: Z(1, 2, 3, 4, 5, 6, 7))
def test_pass_by_value(self):
- # This should mirror the structure in Modules/_ctypes/_ctypes_test.c
- class X(Structure):
+ # This should mirror the Test structure
+ # in Modules/_ctypes/_ctypes_test.c
+ class Test(Structure):
_fields_ = [
('first', c_ulong),
('second', c_ulong),
('third', c_ulong),
]
- s = X()
+ s = Test()
s.first = 0xdeadbeef
s.second = 0xcafebabe
s.third = 0x0bad1dea
dll = CDLL(_ctypes_test.__file__)
func = dll._testfunc_large_struct_update_value
- func.argtypes = (X,)
+ func.argtypes = (Test,)
func.restype = None
func(s)
self.assertEqual(s.first, 0xdeadbeef)
self.assertEqual(s.second, 0xcafebabe)
self.assertEqual(s.third, 0x0bad1dea)
+ def test_pass_by_value_finalizer(self):
+ # bpo-37140: Similar to test_pass_by_value(), but the Python structure
+ # has a finalizer (__del__() method): the finalizer must only be called
+ # once.
+
+ finalizer_calls = []
+
+ class Test(Structure):
+ _fields_ = [
+ ('first', c_ulong),
+ ('second', c_ulong),
+ ('third', c_ulong),
+ ]
+ def __del__(self):
+ finalizer_calls.append("called")
+
+ s = Test(1, 2, 3)
+ # Test the StructUnionType_paramfunc() code path which copies the
+ # structure: if the stucture is larger than sizeof(void*).
+ self.assertGreater(sizeof(s), sizeof(c_void_p))
+
+ dll = CDLL(_ctypes_test.__file__)
+ func = dll._testfunc_large_struct_update_value
+ func.argtypes = (Test,)
+ func.restype = None
+ func(s)
+ # bpo-37140: Passing the structure by refrence must not call
+ # its finalizer!
+ self.assertEqual(finalizer_calls, [])
+ self.assertEqual(s.first, 1)
+ self.assertEqual(s.second, 2)
+ self.assertEqual(s.third, 3)
+
+ # The finalizer must be called exactly once
+ s = None
+ support.gc_collect()
+ self.assertEqual(finalizer_calls, ["called"])
+
def test_pass_by_value_in_register(self):
class X(Structure):
_fields_ = [
diff --git a/Misc/NEWS.d/next/Library/2019-08-30-11-21-10.bpo-37140.cFAX-a.rst b/Misc/NEWS.d/next/Library/2019-08-30-11-21-10.bpo-37140.cFAX-a.rst
new file mode 100644
index 000000000000..4eaa226147f9
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-08-30-11-21-10.bpo-37140.cFAX-a.rst
@@ -0,0 +1,5 @@
+Fix a ctypes regression of Python 3.8. When a ctypes.Structure is passed by
+copy to a function, ctypes internals created a temporary object which had
+the side effect of calling the structure finalizer (__del__) twice. The
+Python semantics requires a finalizer to be called exactly once. Fix ctypes
+internals to no longer call the finalizer twice.
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 2201c4520ad0..47288740063e 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -392,6 +392,35 @@ _ctypes_alloc_format_string_with_shape(int ndim, const Py_ssize_t *shape,
return result;
}
+/* StructParamObject and StructParam_Type are used in _ctypes_callproc()
+ for argument.keep to call PyMem_Free(ptr) on Py_DECREF(argument).
+
+ StructUnionType_paramfunc() creates such object when a ctypes Structure is
+ passed by copy to a C function. */
+typedef struct {
+ PyObject_HEAD
+ void *ptr;
+} StructParamObject;
+
+
+static void
+StructParam_dealloc(PyObject *myself)
+{
+ StructParamObject *self = (StructParamObject *)myself;
+ PyMem_Free(self->ptr);
+ Py_TYPE(self)->tp_free(myself);
+}
+
+
+static PyTypeObject StructParam_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ .tp_name = "_ctypes.StructParam_Type",
+ .tp_basicsize = sizeof(StructParamObject),
+ .tp_dealloc = StructParam_dealloc,
+ .tp_flags = Py_TPFLAGS_DEFAULT,
+};
+
+
/*
PyCStructType_Type - a meta type/class. Creating a new class using this one as
__metaclass__ will call the constructor StructUnionType_new. It replaces the
@@ -403,35 +432,47 @@ static PyCArgObject *
StructUnionType_paramfunc(CDataObject *self)
{
PyCArgObject *parg;
- CDataObject *copied_self;
+ PyObject *obj;
StgDictObject *stgdict;
+ void *ptr;
if ((size_t)self->b_size > sizeof(void*)) {
- void *new_ptr = PyMem_Malloc(self->b_size);
- if (new_ptr == NULL)
+ ptr = PyMem_Malloc(self->b_size);
+ if (ptr == NULL) {
return NULL;
- memcpy(new_ptr, self->b_ptr, self->b_size);
- copied_self = (CDataObject *)PyCData_AtAddress(
- (PyObject *)Py_TYPE(self), new_ptr);
- copied_self->b_needsfree = 1;
+ }
+ memcpy(ptr, self->b_ptr, self->b_size);
+
+ /* Create a Python object which calls PyMem_Free(ptr) in
+ its deallocator. The object will be destroyed
+ at _ctypes_callproc() cleanup. */
+ obj = (&StructParam_Type)->tp_alloc(&StructParam_Type, 0);
+ if (obj == NULL) {
+ PyMem_Free(ptr);
+ return NULL;
+ }
+
+ StructParamObject *struct_param = (StructParamObject *)obj;
+ struct_param->ptr = ptr;
} else {
- copied_self = self;
- Py_INCREF(copied_self);
+ ptr = self->b_ptr;
+ obj = (PyObject *)self;
+ Py_INCREF(obj);
}
parg = PyCArgObject_new();
if (parg == NULL) {
- Py_DECREF(copied_self);
+ Py_DECREF(obj);
return NULL;
}
parg->tag = 'V';
- stgdict = PyObject_stgdict((PyObject *)copied_self);
+ stgdict = PyObject_stgdict((PyObject *)self);
assert(stgdict); /* Cannot be NULL for structure/union instances */
parg->pffi_type = &stgdict->ffi_type_pointer;
- parg->value.p = copied_self->b_ptr;
- parg->size = copied_self->b_size;
- parg->obj = (PyObject *)copied_self;
+ parg->value.p = ptr;
+ parg->size = self->b_size;
+ parg->obj = obj;
return parg;
}
@@ -5700,6 +5741,10 @@ PyInit__ctypes(void)
if (PyType_Ready(&DictRemover_Type) < 0)
return NULL;
+ if (PyType_Ready(&StructParam_Type) < 0) {
+ return NULL;
+ }
+
#ifdef MS_WIN32
if (create_comerror() < 0)
return NULL;
[View Less]
1
0
https://github.com/python/cpython/commit/96b4087ce784ee7434dffdf69c475f5b40…
commit: 96b4087ce784ee7434dffdf69c475f5b40543982
branch: master
author: Victor Stinner <vstinner(a)redhat.com>
committer: GitHub <noreply(a)github.com>
date: 2019-08-30T14:30:33+02:00
summary:
bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)
Fix a ctypes regression of Python 3.8. When a ctypes.Structure is
passed by copy to a function, ctypes internals created a temporary
object which had the side …
[View More]effect of calling the structure finalizer
(__del__) twice. The Python semantics requires a finalizer to be
called exactly once. Fix ctypes internals to no longer call the
finalizer twice.
Create a new internal StructParam_Type which is only used by
_ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument).
StructUnionType_paramfunc() creates such object.
files:
A Misc/NEWS.d/next/Library/2019-08-30-11-21-10.bpo-37140.cFAX-a.rst
M Lib/ctypes/test/test_structures.py
M Modules/_ctypes/_ctypes.c
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index d1ea43bc7e3b..fda104563d29 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -3,7 +3,7 @@
from ctypes.test import need_symbol
from struct import calcsize
import _ctypes_test
-import test.support
+from test import support
class SubclassesTest(unittest.TestCase):
def test_subclass(self):
@@ -202,7 +202,7 @@ class X(Structure):
"_pack_": -1}
self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
- @test.support.cpython_only
+ @support.cpython_only
def test_packed_c_limits(self):
# Issue 15989
import _testcapi
@@ -396,27 +396,66 @@ class Z(Y):
self.assertRaises(TypeError, lambda: Z(1, 2, 3, 4, 5, 6, 7))
def test_pass_by_value(self):
- # This should mirror the structure in Modules/_ctypes/_ctypes_test.c
- class X(Structure):
+ # This should mirror the Test structure
+ # in Modules/_ctypes/_ctypes_test.c
+ class Test(Structure):
_fields_ = [
('first', c_ulong),
('second', c_ulong),
('third', c_ulong),
]
- s = X()
+ s = Test()
s.first = 0xdeadbeef
s.second = 0xcafebabe
s.third = 0x0bad1dea
dll = CDLL(_ctypes_test.__file__)
func = dll._testfunc_large_struct_update_value
- func.argtypes = (X,)
+ func.argtypes = (Test,)
func.restype = None
func(s)
self.assertEqual(s.first, 0xdeadbeef)
self.assertEqual(s.second, 0xcafebabe)
self.assertEqual(s.third, 0x0bad1dea)
+ def test_pass_by_value_finalizer(self):
+ # bpo-37140: Similar to test_pass_by_value(), but the Python structure
+ # has a finalizer (__del__() method): the finalizer must only be called
+ # once.
+
+ finalizer_calls = []
+
+ class Test(Structure):
+ _fields_ = [
+ ('first', c_ulong),
+ ('second', c_ulong),
+ ('third', c_ulong),
+ ]
+ def __del__(self):
+ finalizer_calls.append("called")
+
+ s = Test(1, 2, 3)
+ # Test the StructUnionType_paramfunc() code path which copies the
+ # structure: if the stucture is larger than sizeof(void*).
+ self.assertGreater(sizeof(s), sizeof(c_void_p))
+
+ dll = CDLL(_ctypes_test.__file__)
+ func = dll._testfunc_large_struct_update_value
+ func.argtypes = (Test,)
+ func.restype = None
+ func(s)
+ # bpo-37140: Passing the structure by refrence must not call
+ # its finalizer!
+ self.assertEqual(finalizer_calls, [])
+ self.assertEqual(s.first, 1)
+ self.assertEqual(s.second, 2)
+ self.assertEqual(s.third, 3)
+
+ # The finalizer must be called exactly once
+ s = None
+ support.gc_collect()
+ self.assertEqual(finalizer_calls, ["called"])
+
def test_pass_by_value_in_register(self):
class X(Structure):
_fields_ = [
diff --git a/Misc/NEWS.d/next/Library/2019-08-30-11-21-10.bpo-37140.cFAX-a.rst b/Misc/NEWS.d/next/Library/2019-08-30-11-21-10.bpo-37140.cFAX-a.rst
new file mode 100644
index 000000000000..4eaa226147f9
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-08-30-11-21-10.bpo-37140.cFAX-a.rst
@@ -0,0 +1,5 @@
+Fix a ctypes regression of Python 3.8. When a ctypes.Structure is passed by
+copy to a function, ctypes internals created a temporary object which had
+the side effect of calling the structure finalizer (__del__) twice. The
+Python semantics requires a finalizer to be called exactly once. Fix ctypes
+internals to no longer call the finalizer twice.
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index c1941c16400e..95bfe9d6348e 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -392,6 +392,35 @@ _ctypes_alloc_format_string_with_shape(int ndim, const Py_ssize_t *shape,
return result;
}
+/* StructParamObject and StructParam_Type are used in _ctypes_callproc()
+ for argument.keep to call PyMem_Free(ptr) on Py_DECREF(argument).
+
+ StructUnionType_paramfunc() creates such object when a ctypes Structure is
+ passed by copy to a C function. */
+typedef struct {
+ PyObject_HEAD
+ void *ptr;
+} StructParamObject;
+
+
+static void
+StructParam_dealloc(PyObject *myself)
+{
+ StructParamObject *self = (StructParamObject *)myself;
+ PyMem_Free(self->ptr);
+ Py_TYPE(self)->tp_free(myself);
+}
+
+
+static PyTypeObject StructParam_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ .tp_name = "_ctypes.StructParam_Type",
+ .tp_basicsize = sizeof(StructParamObject),
+ .tp_dealloc = StructParam_dealloc,
+ .tp_flags = Py_TPFLAGS_DEFAULT,
+};
+
+
/*
PyCStructType_Type - a meta type/class. Creating a new class using this one as
__metaclass__ will call the constructor StructUnionType_new. It replaces the
@@ -403,35 +432,47 @@ static PyCArgObject *
StructUnionType_paramfunc(CDataObject *self)
{
PyCArgObject *parg;
- CDataObject *copied_self;
+ PyObject *obj;
StgDictObject *stgdict;
+ void *ptr;
if ((size_t)self->b_size > sizeof(void*)) {
- void *new_ptr = PyMem_Malloc(self->b_size);
- if (new_ptr == NULL)
+ ptr = PyMem_Malloc(self->b_size);
+ if (ptr == NULL) {
return NULL;
- memcpy(new_ptr, self->b_ptr, self->b_size);
- copied_self = (CDataObject *)PyCData_AtAddress(
- (PyObject *)Py_TYPE(self), new_ptr);
- copied_self->b_needsfree = 1;
+ }
+ memcpy(ptr, self->b_ptr, self->b_size);
+
+ /* Create a Python object which calls PyMem_Free(ptr) in
+ its deallocator. The object will be destroyed
+ at _ctypes_callproc() cleanup. */
+ obj = (&StructParam_Type)->tp_alloc(&StructParam_Type, 0);
+ if (obj == NULL) {
+ PyMem_Free(ptr);
+ return NULL;
+ }
+
+ StructParamObject *struct_param = (StructParamObject *)obj;
+ struct_param->ptr = ptr;
} else {
- copied_self = self;
- Py_INCREF(copied_self);
+ ptr = self->b_ptr;
+ obj = (PyObject *)self;
+ Py_INCREF(obj);
}
parg = PyCArgObject_new();
if (parg == NULL) {
- Py_DECREF(copied_self);
+ Py_DECREF(obj);
return NULL;
}
parg->tag = 'V';
- stgdict = PyObject_stgdict((PyObject *)copied_self);
+ stgdict = PyObject_stgdict((PyObject *)self);
assert(stgdict); /* Cannot be NULL for structure/union instances */
parg->pffi_type = &stgdict->ffi_type_pointer;
- parg->value.p = copied_self->b_ptr;
- parg->size = copied_self->b_size;
- parg->obj = (PyObject *)copied_self;
+ parg->value.p = ptr;
+ parg->size = self->b_size;
+ parg->obj = obj;
return parg;
}
@@ -5700,6 +5741,10 @@ PyInit__ctypes(void)
if (PyType_Ready(&DictRemover_Type) < 0)
return NULL;
+ if (PyType_Ready(&StructParam_Type) < 0) {
+ return NULL;
+ }
+
#ifdef MS_WIN32
if (create_comerror() < 0)
return NULL;
[View Less]
1
0
To: python-checkins(a)python.org
Subject: Python 3.8.0b4
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
https://github.com/python/cpython/commit/d93605de7232da5e6a182fd1d5c220639e…
0159
commit: d93605de7232da5e6a182fd1d5c220639e900159
branch: 3.8
author: =C5=81ukasz Langa <lukasz(a)langa.pl>
committer: =C5=81ukasz Langa <lukasz(a)langa.pl>
date: 2019-08-29T23:59:20+02:00
summary:
Python 3.8.0b4
files:
A Misc/NEWS.d/3.8.0b4.…
[View More]rst
D Misc/NEWS.d/next/Build/2019-07-29-11-36-16.bpo-37707.Sm-dGk.rst
D Misc/NEWS.d/next/C API/2019-08-23-11-35-55.bpo-37926.hnI5IQ.rst
D Misc/NEWS.d/next/C API/2019-08-23-18-45-11.bpo-36763.q3Kh8Z.rst
D Misc/NEWS.d/next/Core and Builtins/2019-02-15-20-42-36.bpo-20523.rRLrvr.rst
D Misc/NEWS.d/next/Core and Builtins/2019-06-27-15-01-14.bpo-37433.amNGqr.rst
D Misc/NEWS.d/next/Core and Builtins/2019-08-02-15-01-33.bpo-36311.uY5vt-.rst
D Misc/NEWS.d/next/Core and Builtins/2019-08-05-14-22-59.bpo-37757.lRv5HX.rst
D Misc/NEWS.d/next/Core and Builtins/2019-08-06-14-03-59.bpo-32912.UDwSMJ.rst
D Misc/NEWS.d/next/Core and Builtins/2019-08-17-18-41-59.bpo-37830.fNfMbz.rst
D Misc/NEWS.d/next/Core and Builtins/2019-08-26-04-09-57.bpo-37947.mzAQtB.rst
D Misc/NEWS.d/next/Documentation/2019-04-02-19-23-00.bpo-36487.Jg6-MG.rst
D Misc/NEWS.d/next/Documentation/2019-05-22-04-30-07.bpo-37004.BRgxrt.rst
D Misc/NEWS.d/next/Documentation/2019-07-16-14-48-12.bpo-37256.qJTrBb.rst
D Misc/NEWS.d/next/Documentation/2019-07-31-11-40-06.bpo-37726.h-3o9a.rst
D Misc/NEWS.d/next/Documentation/2019-08-04-19-20-58.bpo-37759.EHRF4i.rst
D Misc/NEWS.d/next/Documentation/2019-08-29-10-40-05.bpo-37979.TAUx_E.rst
D Misc/NEWS.d/next/IDLE/2019-08-04-15-27-50.bpo-37748.0vf6pg.rst
D Misc/NEWS.d/next/IDLE/2019-08-04-17-10-01.bpo-36419.TJZqOc.rst
D Misc/NEWS.d/next/IDLE/2019-08-14-09-43-15.bpo-37849.-bcYF3.rst
D Misc/NEWS.d/next/IDLE/2019-08-24-22-00-33.bpo-37929.jb7523.rst
D Misc/NEWS.d/next/IDLE/2019-08-26-00-41-53.bpo-37824.YY5jAI.rst
D Misc/NEWS.d/next/Library/2018-09-23-03-18-52.bpo-34775.vHeuHk.rst
D Misc/NEWS.d/next/Library/2019-05-07-17-42-36.bpo-36582.L_dxR6.rst
D Misc/NEWS.d/next/Library/2019-05-12-12-58-37.bpo-36871.6xiEHZ.rst
D Misc/NEWS.d/next/Library/2019-06-18-16-29-31.bpo-37085.GeYaD6.rst
D Misc/NEWS.d/next/Library/2019-06-22-12-30-00.bpo-37372.kIKqZ6.rst
D Misc/NEWS.d/next/Library/2019-07-09-11-20-21.bpo-37482.auzvev.rst
D Misc/NEWS.d/next/Library/2019-07-09-19-38-26.bpo-37531.GX7s8S.rst
D Misc/NEWS.d/next/Library/2019-07-13-13-40-12.bpo-18378.NHcojp.rst
D Misc/NEWS.d/next/Library/2019-07-13-16-02-48.bpo-37587.fd-1aF.rst
D Misc/NEWS.d/next/Library/2019-07-19-01-46-56.bpo-16970.GEASf5.rst
D Misc/NEWS.d/next/Library/2019-07-21-20-59-31.bpo-37642.L61Bvy.rst
D Misc/NEWS.d/next/Library/2019-07-24-18-27-44.bpo-37664.o-GYZC.rst
D Misc/NEWS.d/next/Library/2019-07-25-10-28-40.bpo-37354.RT3_3H.rst
D Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rst
D Misc/NEWS.d/next/Library/2019-07-28-22-25-25.bpo-37685._3bN9f.rst
D Misc/NEWS.d/next/Library/2019-07-30-22-41-05.bpo-32178.X-IFLe.rst
D Misc/NEWS.d/next/Library/2019-07-31-16-49-01.bpo-37723.zq6tw8.rst
D Misc/NEWS.d/next/Library/2019-08-01-17-11-16.bpo-37738.A3WWcT.rst
D Misc/NEWS.d/next/Library/2019-08-02-16-44-42.bpo-18049.OA4qBL.rst
D Misc/NEWS.d/next/Library/2019-08-04-11-47-58.bpo-28292.vkihH5.rst
D Misc/NEWS.d/next/Library/2019-08-07-23-48-09.bpo-37772.hLCvdn.rst
D Misc/NEWS.d/next/Library/2019-08-10-12-33-27.bpo-37810.d4zbvB.rst
D Misc/NEWS.d/next/Library/2019-08-11-10-34-19.bpo-37819.LVJls-.rst
D Misc/NEWS.d/next/Library/2019-08-14-13-51-24.bpo-37798.AmXrik.rst
D Misc/NEWS.d/next/Library/2019-08-14-15-34-23.bpo-21131.0MMQRi.rst
D Misc/NEWS.d/next/Library/2019-08-14-21-41-07.bpo-37811.d1xYj7.rst
D Misc/NEWS.d/next/Library/2019-08-17-22-33-54.bpo-37868.hp64fi.rst
D Misc/NEWS.d/next/Library/2019-08-22-16-13-27.bpo-37915.xyoZI5.rst
D Misc/NEWS.d/next/Library/2019-08-23-00-55-19.bpo-26589.M1xyxG.rst
D Misc/NEWS.d/next/Library/2019-08-24-16-54-49.bpo-37798.7mRQCk.rst
D Misc/NEWS.d/next/Library/2019-08-25-14-56-42.bpo-36917.GBxdw2.rst
D Misc/NEWS.d/next/Library/2019-08-25-18-07-48.bpo-34679.HECzL7.rst
D Misc/NEWS.d/next/Library/2019-08-26-10-45-51.bpo-37950.-K1IKT.rst
D Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst
D Misc/NEWS.d/next/Library/2019-08-27-10-03-48.bpo-37951.MfRQgL.rst
D Misc/NEWS.d/next/Library/2019-08-27-10-52-13.bpo-37960.CTY7Lw.rst
D Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst
D Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
D Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst
D Misc/NEWS.d/next/Tests/2019-08-25-19-51-46.bpo-37805.Kl1sti.rst
D Misc/NEWS.d/next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy8.rst
D Misc/NEWS.d/next/Tools-Demos/2019-08-24-12-11-30.bpo-37942.7H8N9a.rst
D Misc/NEWS.d/next/Windows/2019-05-05-05-23-34.bpo-28269.-MOHI7.rst
D Misc/NEWS.d/next/Windows/2019-08-06-09-35-12.bpo-37734.EoJ9Nh.rst
D Misc/NEWS.d/next/Windows/2019-08-06-13-54-12.bpo-37778.AY1XhH.rst
D Misc/NEWS.d/next/Windows/2019-08-06-18-09-18.bpo-25172.Akreij.rst
D Misc/NEWS.d/next/Windows/2019-08-08-18-05-27.bpo-36266.x4eZU3.rst
D Misc/NEWS.d/next/Windows/2019-08-12-12-00-24.bpo-37834.VB2QVj.rst
D Misc/NEWS.d/next/Windows/2019-08-14-13-40-15.bpo-9949.zW45Ks.rst
D Misc/NEWS.d/next/Windows/2019-08-21-12-58-18.bpo-1311.BoW1wU.rst
D Misc/NEWS.d/next/Windows/2019-08-22-09-04-44.bpo-37549.TpKI3M.rst
D Misc/NEWS.d/next/macOS/2019-07-13-15-58-18.bpo-18049.MklhQQ.rst
M Include/patchlevel.h
M Lib/pydoc_data/topics.py
M README.rst
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
index 82181c586147..12f84b840d9f 100644
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -20,10 +20,10 @@
#define PY_MINOR_VERSION 8
#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA
-#define PY_RELEASE_SERIAL 3
+#define PY_RELEASE_SERIAL 4
=20
/* Version as a string */
-#define PY_VERSION "3.8.0b3+"
+#define PY_VERSION "3.8.0b4"
/*--end constants--*/
=20
/* Version as a single 4-byte hex number, e.g. 0x010502B2 =3D=3D 1.5.2b2.
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index c3049b95207c..8992ea9b4ea7 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Mon Jul 29 15:22:27 2019
+# Autogenerated by Sphinx on Thu Aug 29 23:57:58 2019
topics =3D {'assert': 'The "assert" statement\n'
'**********************\n'
'\n'
@@ -808,21 +808,34 @@
'whose name is\n'
'the key of the property in the owner class=E2=80=99 "_=
_dict__".\n'
'\n'
- 'object.__get__(self, instance, owner)\n'
+ 'object.__get__(self, instance, owner=3DNone)\n'
'\n'
' Called to get the attribute of the owner class (cla=
ss '
'attribute\n'
' access) or of an instance of that class (instance '
'attribute\n'
- ' access). *owner* is always the owner class, while '
- '*instance* is the\n'
- ' instance that the attribute was accessed through, o=
r '
- '"None" when\n'
- ' the attribute is accessed through the *owner*. Thi=
s '
- 'method should\n'
- ' return the (computed) attribute value or raise an '
- '"AttributeError"\n'
- ' exception.\n'
+ ' access). The optional *owner* argument is the owner=
'
+ 'class, while\n'
+ ' *instance* is the instance that the attribute was '
+ 'accessed through,\n'
+ ' or "None" when the attribute is accessed through th=
e '
+ '*owner*.\n'
+ '\n'
+ ' This method should return the computed attribute '
+ 'value or raise an\n'
+ ' "AttributeError" exception.\n'
+ '\n'
+ ' **PEP 252** specifies that "__get__()" is callable '
+ 'with one or two\n'
+ ' arguments. Python=E2=80=99s own built-in descripto=
rs support '
+ 'this\n'
+ ' specification; however, it is likely that some '
+ 'third-party tools\n'
+ ' have descriptors that require both arguments. '
+ 'Python=E2=80=99s own\n'
+ ' "__getattribute__()" implementation always passes i=
n '
+ 'both arguments\n'
+ ' whether they are required or not.\n'
'\n'
'object.__set__(self, instance, value)\n'
'\n'
@@ -830,6 +843,12 @@
'of the owner\n'
' class to a new value, *value*.\n'
'\n'
+ ' Note, adding "__set__()" or "__delete__()" changes '
+ 'the kind of\n'
+ ' descriptor to a =E2=80=9Cdata descriptor=E2=80=9D. =
See Invoking '
+ 'Descriptors for\n'
+ ' more details.\n'
+ '\n'
'object.__delete__(self, instance)\n'
'\n'
' Called to delete the attribute on an instance '
@@ -1829,6 +1848,12 @@
'all false.\n'
' This behavior is compliant with IEEE 754.\n'
'\n'
+ '* "None" and "NotImplemented" are singletons. **PEP 8** '
+ 'advises\n'
+ ' that comparisons for singletons should always be done wit=
h '
+ '"is" or\n'
+ ' "is not", never the equality operators.\n'
+ '\n'
'* Binary sequences (instances of "bytes" or "bytearray") ca=
n '
'be\n'
' compared within and across their types. They compare\n'
@@ -1854,38 +1879,13 @@
' these types raises "TypeError".\n'
'\n'
' Sequences compare lexicographically using comparison of\n'
- ' corresponding elements, whereby reflexivity of the elemen=
ts '
- 'is\n'
- ' enforced.\n'
- '\n'
- ' In enforcing reflexivity of elements, the comparison of '
- 'collections\n'
- ' assumes that for a collection element "x", "x =3D=3D x" i=
s '
- 'always true.\n'
- ' Based on that assumption, element identity is compared '
- 'first, and\n'
- ' element comparison is performed only for distinct '
- 'elements. This\n'
- ' approach yields the same result as a strict element '
- 'comparison\n'
- ' would, if the compared elements are reflexive. For '
- 'non-reflexive\n'
- ' elements, the result is different than for strict element=
\n'
- ' comparison, and may be surprising: The non-reflexive '
- 'not-a-number\n'
- ' values for example result in the following comparison '
- 'behavior when\n'
- ' used in a list:\n'
- '\n'
- " >>> nan =3D float('NaN')\n"
- ' >>> nan is nan\n'
- ' True\n'
- ' >>> nan =3D=3D nan\n'
- ' False <-- the defined non-reflexive '
- 'behavior of NaN\n'
- ' >>> [nan] =3D=3D [nan]\n'
- ' True <-- list enforces reflexivity an=
d '
- 'tests identity first\n'
+ ' corresponding elements. The built-in containers typicall=
y '
+ 'assume\n'
+ ' identical objects are equal to themselves. That lets the=
m '
+ 'bypass\n'
+ ' equality tests for identical objects to improve performan=
ce '
+ 'and to\n'
+ ' maintain their internal invariants.\n'
'\n'
' Lexicographical comparison between built-in collections '
'works as\n'
@@ -3126,13 +3126,15 @@
'returning\n'
' it.\n'
'\n'
- ' If "__new__()" returns an instance of *cls*, then the '
- 'new\n'
- ' instance=E2=80=99s "__init__()" method will be invoked=
like\n'
- ' "__init__(self[, ...])", where *self* is the new '
- 'instance and the\n'
- ' remaining arguments are the same as were passed to '
- '"__new__()".\n'
+ ' If "__new__()" is invoked during object construction a=
nd '
+ 'it returns\n'
+ ' an instance or subclass of *cls*, then the new '
+ 'instance=E2=80=99s\n'
+ ' "__init__()" method will be invoked like '
+ '"__init__(self[, ...])",\n'
+ ' where *self* is the new instance and the remaining '
+ 'arguments are\n'
+ ' the same as were passed to the object constructor.\n'
'\n'
' If "__new__()" does not return an instance of *cls*, '
'then the new\n'
@@ -3500,10 +3502,10 @@
' hashable by an "isinstance(obj, '
'collections.abc.Hashable)" call.\n'
'\n'
- ' Note: By default, the "__hash__()" values of str, byte=
s '
- 'and\n'
- ' datetime objects are =E2=80=9Csalted=E2=80=9D with a=
n unpredictable '
- 'random value.\n'
+ ' Note: By default, the "__hash__()" values of str and '
+ 'bytes\n'
+ ' objects are =E2=80=9Csalted=E2=80=9D with an unpredi=
ctable random '
+ 'value.\n'
' Although they remain constant within an individual '
'Python\n'
' process, they are not predictable between repeated '
@@ -7841,13 +7843,15 @@
'returning\n'
' it.\n'
'\n'
- ' If "__new__()" returns an instance of *cls*, then the '
- 'new\n'
- ' instance=E2=80=99s "__init__()" method will be invoked =
like\n'
- ' "__init__(self[, ...])", where *self* is the new instan=
ce '
- 'and the\n'
- ' remaining arguments are the same as were passed to '
- '"__new__()".\n'
+ ' If "__new__()" is invoked during object construction an=
d '
+ 'it returns\n'
+ ' an instance or subclass of *cls*, then the new '
+ 'instance=E2=80=99s\n'
+ ' "__init__()" method will be invoked like "__init__(self=
[, '
+ '...])",\n'
+ ' where *self* is the new instance and the remaining '
+ 'arguments are\n'
+ ' the same as were passed to the object constructor.\n'
'\n'
' If "__new__()" does not return an instance of *cls*, th=
en '
'the new\n'
@@ -8212,10 +8216,10 @@
' hashable by an "isinstance(obj, '
'collections.abc.Hashable)" call.\n'
'\n'
- ' Note: By default, the "__hash__()" values of str, bytes=
'
- 'and\n'
- ' datetime objects are =E2=80=9Csalted=E2=80=9D with an=
unpredictable '
- 'random value.\n'
+ ' Note: By default, the "__hash__()" values of str and '
+ 'bytes\n'
+ ' objects are =E2=80=9Csalted=E2=80=9D with an unpredic=
table random '
+ 'value.\n'
' Although they remain constant within an individual '
'Python\n'
' process, they are not predictable between repeated '
@@ -8440,21 +8444,34 @@
'whose name is\n'
'the key of the property in the owner class=E2=80=99 "__dic=
t__".\n'
'\n'
- 'object.__get__(self, instance, owner)\n'
+ 'object.__get__(self, instance, owner=3DNone)\n'
'\n'
' Called to get the attribute of the owner class (class '
'attribute\n'
' access) or of an instance of that class (instance '
'attribute\n'
- ' access). *owner* is always the owner class, while '
- '*instance* is the\n'
- ' instance that the attribute was accessed through, or '
- '"None" when\n'
- ' the attribute is accessed through the *owner*. This '
- 'method should\n'
- ' return the (computed) attribute value or raise an '
- '"AttributeError"\n'
- ' exception.\n'
+ ' access). The optional *owner* argument is the owner '
+ 'class, while\n'
+ ' *instance* is the instance that the attribute was '
+ 'accessed through,\n'
+ ' or "None" when the attribute is accessed through the '
+ '*owner*.\n'
+ '\n'
+ ' This method should return the computed attribute value =
or '
+ 'raise an\n'
+ ' "AttributeError" exception.\n'
+ '\n'
+ ' **PEP 252** specifies that "__get__()" is callable with=
'
+ 'one or two\n'
+ ' arguments. Python=E2=80=99s own built-in descriptors s=
upport '
+ 'this\n'
+ ' specification; however, it is likely that some '
+ 'third-party tools\n'
+ ' have descriptors that require both arguments. Python=
=E2=80=99s '
+ 'own\n'
+ ' "__getattribute__()" implementation always passes in bo=
th '
+ 'arguments\n'
+ ' whether they are required or not.\n'
'\n'
'object.__set__(self, instance, value)\n'
'\n'
@@ -8462,6 +8479,12 @@
'the owner\n'
' class to a new value, *value*.\n'
'\n'
+ ' Note, adding "__set__()" or "__delete__()" changes the '
+ 'kind of\n'
+ ' descriptor to a =E2=80=9Cdata descriptor=E2=80=9D. See=
Invoking '
+ 'Descriptors for\n'
+ ' more details.\n'
+ '\n'
'object.__delete__(self, instance)\n'
'\n'
' Called to delete the attribute on an instance *instance=
* '
@@ -10030,13 +10053,15 @@
'\n'
' Return true if there are only whitespace characters i=
n '
'the string\n'
- ' and there is at least one character, false otherwise.=
'
- 'Whitespace\n'
- ' characters are those characters defined in the Unico=
de '
- 'character\n'
- ' database as =E2=80=9COther=E2=80=9D or =E2=80=9CSepar=
ator=E2=80=9D and those with '
- 'bidirectional\n'
- ' property being one of =E2=80=9CWS=E2=80=9D, =E2=80=9C=
B=E2=80=9D, or =E2=80=9CS=E2=80=9D.\n'
+ ' and there is at least one character, false otherwise.=
\n'
+ '\n'
+ ' A character is *whitespace* if in the Unicode charact=
er '
+ 'database\n'
+ ' (see "unicodedata"), either its general category is '
+ '"Zs"\n'
+ ' (=E2=80=9CSeparator, space=E2=80=9D), or its bidirect=
ional class is one '
+ 'of "WS",\n'
+ ' "B", or "S".\n'
'\n'
'str.istitle()\n'
'\n'
@@ -10725,13 +10750,9 @@
'\n'
' Changed in version 3.6: Unrecognized escape sequences produc=
e '
'a\n'
- ' "DeprecationWarning".\n'
- '\n'
- ' Changed in version 3.8: Unrecognized escape sequences produc=
e '
+ ' "DeprecationWarning". In a future Python version they will =
be '
'a\n'
- ' "SyntaxWarning". In some future version of Python they will=
'
- 'be a\n'
- ' "SyntaxError".\n'
+ ' "SyntaxWarning" and eventually a "SyntaxError".\n'
'\n'
'Even in a raw literal, quotes can be escaped with a backslash, '
'but the\n'
diff --git a/Misc/NEWS.d/3.8.0b4.rst b/Misc/NEWS.d/3.8.0b4.rst
new file mode 100644
index 000000000000..99c914815e52
--- /dev/null
+++ b/Misc/NEWS.d/3.8.0b4.rst
@@ -0,0 +1,733 @@
+.. bpo: 34155
+.. date: 2019-05-04-13-33-37
+.. nonce: MJll68
+.. release date: 2019-08-29
+.. section: Security
+
+Fix parsing of invalid email addresses with more than one ``@`` (e.g.
+a@b@c.com.) to not return the part before 2nd ``@`` as valid email address.
+Patch by maxking & jpic.
+
+..
+
+.. bpo: 37947
+.. date: 2019-08-26-04-09-57
+.. nonce: mzAQtB
+.. section: Core and Builtins
+
+Adjust correctly the recursion level in the symtable generation for named
+expressions. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 37830
+.. date: 2019-08-17-18-41-59
+.. nonce: fNfMbz
+.. section: Core and Builtins
+
+Fixed compilation of :keyword:`break` and :keyword:`continue` in the
+:keyword:`finally` block when the corresponding :keyword:`try` block
+contains :keyword:`return` with a non-constant value.
+
+..
+
+.. bpo: 32912
+.. date: 2019-08-06-14-03-59
+.. nonce: UDwSMJ
+.. section: Core and Builtins
+
+Reverted :issue:`32912`: emitting :exc:`SyntaxWarning` instead of
+:exc:`DeprecationWarning` for invalid escape sequences in string and bytes
+literals.
+
+..
+
+.. bpo: 37757
+.. date: 2019-08-05-14-22-59
+.. nonce: lRv5HX
+.. section: Core and Builtins
+
+:pep:`572`: As described in the PEP, assignment expressions now raise
+:exc:`SyntaxError` when their interaction with comprehension scoping results
+in an ambiguous target scope.
+
+The ``TargetScopeError`` subclass originally proposed by the PEP has been
+removed in favour of just raising regular syntax errors for the disallowed
+cases.
+
+..
+
+.. bpo: 36311
+.. date: 2019-08-02-15-01-33
+.. nonce: uY5vt-
+.. section: Core and Builtins
+
+Decoding bytes objects larger than 2GiB is faster and no longer fails when a
+multibyte characters spans a chunk boundary.
+
+..
+
+.. bpo: 37433
+.. date: 2019-06-27-15-01-14
+.. nonce: amNGqr
+.. section: Core and Builtins
+
+Fix ``SyntaxError`` indicator printing too many spaces for multi-line
+strings - by Anthony Sottile.
+
+..
+
+.. bpo: 20523
+.. date: 2019-02-15-20-42-36
+.. nonce: rRLrvr
+.. section: Core and Builtins
+
+``pdb.Pdb`` supports ~/.pdbrc in Windows 7. Patch by Tim Hopper and Dan
+Lidral-Porter.
+
+..
+
+.. bpo: 37834
+.. date: 2019-08-29-16-41-36
+.. nonce: FThnsh
+.. section: Library
+
+Prevent shutil.rmtree exception when built on non-Windows system without fd
+system call support, like older versions of macOS.
+
+..
+
+.. bpo: 37965
+.. date: 2019-08-28-14-04-18
+.. nonce: 7xGE-C
+.. section: Library
+
+Fix C compiler warning caused by distutils.ccompiler.CCompiler.has_function.
+
+..
+
+.. bpo: 37960
+.. date: 2019-08-27-10-52-13
+.. nonce: CTY7Lw
+.. section: Library
+
+``repr()`` of buffered and text streams now silences only expected
+exceptions when get the value of "name" and "mode" attributes.
+
+..
+
+.. bpo: 37951
+.. date: 2019-08-27-10-03-48
+.. nonce: MfRQgL
+.. section: Library
+
+Most features of the subprocess module now work again in subinterpreters.
+Only *preexec_fn* is restricted in subinterpreters.
+
+..
+
+.. bpo: 36205
+.. date: 2019-08-27-03-53-26
+.. nonce: AfkGRl
+.. section: Library
+
+Fix the rusage implementation of time.process_time() to correctly report the
+sum of the system and user CPU time.
+
+..
+
+.. bpo: 37950
+.. date: 2019-08-26-10-45-51
+.. nonce: -K1IKT
+.. section: Library
+
+Fix :func:`ast.dump` when call with incompletely initialized node.
+
+..
+
+.. bpo: 34679
+.. date: 2019-08-25-18-07-48
+.. nonce: HECzL7
+.. section: Library
+
+Restores instantiation of Windows IOCP event loops from the non-main thread.
+
+..
+
+.. bpo: 36917
+.. date: 2019-08-25-14-56-42
+.. nonce: GBxdw2
+.. section: Library
+
+Add default implementation of the :meth:`ast.NodeVisitor.visit_Constant`
+method which emits a deprecation warning and calls corresponding methody
+``visit_Num()``, ``visit_Str()``, etc.
+
+..
+
+.. bpo: 37798
+.. date: 2019-08-24-16-54-49
+.. nonce: 7mRQCk
+.. section: Library
+
+Update test_statistics.py to verify that the statistics module works well
+for both C and Python implementations. Patch by Dong-hee Na
+
+..
+
+.. bpo: 26589
+.. date: 2019-08-23-00-55-19
+.. nonce: M1xyxG
+.. section: Library
+
+Added a new status code to the http module: 451
+UNAVAILABLE_FOR_LEGAL_REASONS
+
+..
+
+.. bpo: 37915
+.. date: 2019-08-22-16-13-27
+.. nonce: xyoZI5
+.. section: Library
+
+Fix a segmentation fault that appeared when comparing instances of
+``datetime.timezone`` and ``datetime.tzinfo`` objects. Patch by Pablo
+Galindo.
+
+..
+
+.. bpo: 37868
+.. date: 2019-08-17-22-33-54
+.. nonce: hp64fi
+.. section: Library
+
+Fix dataclasses.is_dataclass when given an instance that never raises
+AttributeError in __getattr__. That is, an object that returns something
+for __dataclass_fields__ even if it's not a dataclass.
+
+..
+
+.. bpo: 37811
+.. date: 2019-08-14-21-41-07
+.. nonce: d1xYj7
+.. section: Library
+
+Fix ``socket`` module's ``socket.connect(address)`` function being unable to
+establish connection in case of interrupted system call. The problem was
+observed on all OSes which ``poll(2)`` system call can take only
+non-negative integers and -1 as a timeout value.
+
+..
+
+.. bpo: 21131
+.. date: 2019-08-14-15-34-23
+.. nonce: 0MMQRi
+.. section: Library
+
+Fix ``faulthandler.register(chain=3DTrue)`` stack. faulthandler now allocates
+a dedicated stack of ``SIGSTKSZ*2`` bytes, instead of just ``SIGSTKSZ``
+bytes. Calling the previous signal handler in faulthandler signal handler
+uses more than ``SIGSTKSZ`` bytes of stack memory on some platforms.
+
+..
+
+.. bpo: 37798
+.. date: 2019-08-14-13-51-24
+.. nonce: AmXrik
+.. section: Library
+
+Add C fastpath for statistics.NormalDist.inv_cdf() Patch by Dong-hee Na
+
+..
+
+.. bpo: 37819
+.. date: 2019-08-11-10-34-19
+.. nonce: LVJls-
+.. section: Library
+
+Add Fraction.as_integer_ratio() to match the corresponding methods in bool,
+int, float, and decimal.
+
+..
+
+.. bpo: 37810
+.. date: 2019-08-10-12-33-27
+.. nonce: d4zbvB
+.. section: Library
+
+Fix :mod:`difflib` ``?`` hint in diff output when dealing with tabs. Patch
+by Anthony Sottile.
+
+..
+
+.. bpo: 37772
+.. date: 2019-08-07-23-48-09
+.. nonce: hLCvdn
+.. section: Library
+
+In ``zipfile.Path``, when adding implicit dirs, ensure that ancestral
+directories are added and that duplicates are excluded.
+
+..
+
+.. bpo: 28292
+.. date: 2019-08-04-11-47-58
+.. nonce: vkihH5
+.. section: Library
+
+Mark calendar.py helper functions as being private. The follows PEP 8
+guidance to maintain the style conventions in the module and it addresses a
+known case of user confusion.
+
+..
+
+.. bpo: 18049
+.. date: 2019-08-02-16-44-42
+.. nonce: OA4qBL
+.. section: Library
+
+Add definition of THREAD_STACK_SIZE for AIX in Python/thread_pthread.h The
+default thread stacksize caused crashes with the default recursion limit
+Patch by M Felt
+
+..
+
+.. bpo: 37738
+.. date: 2019-08-01-17-11-16
+.. nonce: A3WWcT
+.. section: Library
+
+Fix the implementation of curses ``addch(str, color_pair)``: pass the color
+pair to ``setcchar()``, instead of always passing 0 as the color pair.
+
+..
+
+.. bpo: 37723
+.. date: 2019-07-31-16-49-01
+.. nonce: zq6tw8
+.. section: Library
+
+Fix performance regression on regular expression parsing with huge character
+sets. Patch by Yann Vaginay.
+
+..
+
+.. bpo: 32178
+.. date: 2019-07-30-22-41-05
+.. nonce: X-IFLe
+.. section: Library
+
+Fix IndexError in :mod:`email` package when trying to parse invalid address
+fields starting with ``:``.
+
+..
+
+.. bpo: 37685
+.. date: 2019-07-28-22-25-25
+.. nonce: _3bN9f
+.. section: Library
+
+Fixed comparisons of :class:`datetime.timedelta` and
+:class:`datetime.timezone`.
+
+..
+
+.. bpo: 37695
+.. date: 2019-07-27-20-21-03
+.. nonce: QANdvg
+.. section: Library
+
+Correct :func:`curses.unget_wch` error message. Patch by Anthony Sottile.
+
+..
+
+.. bpo: 37354
+.. date: 2019-07-25-10-28-40
+.. nonce: RT3_3H
+.. section: Library
+
+Make Activate.ps1 Powershell script static to allow for signing it.
+
+..
+
+.. bpo: 37664
+.. date: 2019-07-24-18-27-44
+.. nonce: o-GYZC
+.. section: Library
+
+Update wheels bundled with ensurepip (pip 19.2.3 and setuptools 41.2.0)
+
+..
+
+.. bpo: 37642
+.. date: 2019-07-21-20-59-31
+.. nonce: L61Bvy
+.. section: Library
+
+Allowed the pure Python implementation of :class:`datetime.timezone` to
+represent sub-minute offsets close to minimum and maximum boundaries,
+specifically in the ranges (23:59, 24:00) and (-23:59, 24:00). Patch by
+Ngalim Siregar
+
+..
+
+.. bpo: 16970
+.. date: 2019-07-19-01-46-56
+.. nonce: GEASf5
+.. section: Library
+
+Adding a value error when an invalid value in passed to nargs Patch by
+Robert Leenders
+
+..
+
+.. bpo: 37587
+.. date: 2019-07-13-16-02-48
+.. nonce: fd-1aF
+.. section: Library
+
+Make json.loads faster for long strings. (Patch by Marco Paolini)
+
+..
+
+.. bpo: 18378
+.. date: 2019-07-13-13-40-12
+.. nonce: NHcojp
+.. section: Library
+
+Recognize "UTF-8" as a valid value for LC_CTYPE in locale._parse_localename.
+
+..
+
+.. bpo: 37531
+.. date: 2019-07-09-19-38-26
+.. nonce: GX7s8S
+.. section: Library
+
+"python3 -m test -jN --timeout=3DTIMEOUT" now kills a worker process if it
+runs longer than *TIMEOUT* seconds.
+
+..
+
+.. bpo: 37482
+.. date: 2019-07-09-11-20-21
+.. nonce: auzvev
+.. section: Library
+
+Fix serialization of display name in originator or destination address
+fields with both encoded words and special chars.
+
+..
+
+.. bpo: 37372
+.. date: 2019-06-22-12-30-00
+.. nonce: kIKqZ6
+.. section: Library
+
+Fix error unpickling datetime.time objects from Python 2 with seconds>=3D24.
+Patch by Justin Blanchard.
+
+..
+
+.. bpo: 37085
+.. date: 2019-06-18-16-29-31
+.. nonce: GeYaD6
+.. section: Library
+
+Add the optional Linux SocketCAN Broadcast Manager constants, used as flags
+to configure the BCM behaviour, in the socket module. Patch by Karl Ding.
+
+..
+
+.. bpo: 36871
+.. date: 2019-05-12-12-58-37
+.. nonce: 6xiEHZ
+.. section: Library
+
+Ensure method signature is used instead of constructor signature of a class
+while asserting mock object against method calls. Patch by Karthikeyan
+Singaravelan.
+
+..
+
+.. bpo: 36582
+.. date: 2019-05-07-17-42-36
+.. nonce: L_dxR6
+.. section: Library
+
+Fix ``UserString.encode()`` to correctly return ``bytes`` rather than a
+``UserString`` instance.
+
+..
+
+.. bpo: 34775
+.. date: 2018-09-23-03-18-52
+.. nonce: vHeuHk
+.. section: Library
+
+Division handling of PurePath now returns NotImplemented instead of raising
+a TypeError when passed something other than an instance of str or PurePath.
+Patch by Roger Aiudi.
+
+..
+
+.. bpo: 37979
+.. date: 2019-08-29-10-40-05
+.. nonce: TAUx_E
+.. section: Documentation
+
+Added a link to dateutil.parser.isoparse in the datetime.fromisoformat
+documentation. Patch by Paul Ganssle
+
+..
+
+.. bpo: 37759
+.. date: 2019-08-04-19-20-58
+.. nonce: EHRF4i
+.. section: Documentation
+
+Beginning edits to Whatsnew 3.8
+
+..
+
+.. bpo: 37726
+.. date: 2019-07-31-11-40-06
+.. nonce: h-3o9a
+.. section: Documentation
+
+Stop recommending getopt in the tutorial for command line argument parsing
+and promote argparse.
+
+..
+
+.. bpo: 37256
+.. date: 2019-07-16-14-48-12
+.. nonce: qJTrBb
+.. section: Documentation
+
+Fix wording of arguments for :class:`Request` in :mod:`urllib.request`
+
+..
+
+.. bpo: 37004
+.. date: 2019-05-22-04-30-07
+.. nonce: BRgxrt
+.. section: Documentation
+
+In the documentation for difflib, a note was added explicitly warning that
+the results of SequenceMatcher's ratio method may depend on the order of the
+input strings.
+
+..
+
+.. bpo: 36487
+.. date: 2019-04-02-19-23-00
+.. nonce: Jg6-MG
+.. section: Documentation
+
+Make C-API docs clear about what the "main" interpreter is.
+
+..
+
+.. bpo: 37805
+.. date: 2019-08-25-19-51-46
+.. nonce: Kl1sti
+.. section: Tests
+
+Add tests for json.dump(..., skipkeys=3DTrue). Patch by Dong-hee Na.
+
+..
+
+.. bpo: 37707
+.. date: 2019-07-29-11-36-16
+.. nonce: Sm-dGk
+.. section: Build
+
+Mark some individual tests to skip when --pgo is used. The tests marked
+increase the PGO task time significantly and likely don't help improve
+optimization of the final executable.
+
+..
+
+.. bpo: 37549
+.. date: 2019-08-22-09-04-44
+.. nonce: TpKI3M
+.. section: Windows
+
+:func:`os.dup` no longer fails for standard streams on Windows 7.
+
+..
+
+.. bpo: 1311
+.. date: 2019-08-21-12-58-18
+.. nonce: BoW1wU
+.. section: Windows
+
+The ``nul`` file on Windows now returns True from :func:`~os.path.exists`
+and a valid result from :func:`os.stat` with ``S_IFCHR`` set.
+
+..
+
+.. bpo: 9949
+.. date: 2019-08-14-13-40-15
+.. nonce: zW45Ks
+.. section: Windows
+
+Enable support for following symlinks in :func:`os.realpath`.
+
+..
+
+.. bpo: 37834
+.. date: 2019-08-12-12-00-24
+.. nonce: VB2QVj
+.. section: Windows
+
+Treat all name surrogate reparse points on Windows in :func:`os.lstat` and
+other reparse points as regular files in :func:`os.stat`.
+
+..
+
+.. bpo: 36266
+.. date: 2019-08-08-18-05-27
+.. nonce: x4eZU3
+.. section: Windows
+
+Add the module name in the formatted error message when DLL load fail
+happens during module import in ``_PyImport_FindSharedFuncptrWindows()``.
+Patch by Srinivas Nyayapati.
+
+..
+
+.. bpo: 25172
+.. date: 2019-08-06-18-09-18
+.. nonce: Akreij
+.. section: Windows
+
+Trying to import the :mod:`crypt` module on Windows will result in an
+:exc:`ImportError` with a message explaining that the module isn't supported
+on Windows. On other platforms, if the underlying ``_crypt`` module is not
+available, the ImportError will include a message explaining the problem.
+
+..
+
+.. bpo: 37778
+.. date: 2019-08-06-13-54-12
+.. nonce: AY1XhH
+.. section: Windows
+
+Fixes the icons used for file associations to the Microsoft Store package.
+
+..
+
+.. bpo: 37734
+.. date: 2019-08-06-09-35-12
+.. nonce: EoJ9Nh
+.. section: Windows
+
+Fix use of registry values to launch Python from Microsoft Store app.
+
+..
+
+.. bpo: 28269
+.. date: 2019-05-05-05-23-34
+.. nonce: -MOHI7
+.. section: Windows
+
+Replace use of :c:func:`strcasecmp` for the system function
+:c:func:`_stricmp`. Patch by Minmin Gong.
+
+..
+
+.. bpo: 18049
+.. date: 2019-07-13-15-58-18
+.. nonce: MklhQQ
+.. section: macOS
+
+Increase the default stack size of threads from 5MB to 16MB on macOS, to
+match the stack size of the main thread. This avoids crashes on deep
+recursion in threads.
+
+..
+
+.. bpo: 37824
+.. date: 2019-08-26-00-41-53
+.. nonce: YY5jAI
+.. section: IDLE
+
+Properly handle user input warnings in IDLE shell. Cease turning
+SyntaxWarnings into SyntaxErrors.
+
+..
+
+.. bpo: 37929
+.. date: 2019-08-24-22-00-33
+.. nonce: jb7523
+.. section: IDLE
+
+IDLE Settings dialog now closes properly when there is no shell window.
+
+..
+
+.. bpo: 37849
+.. date: 2019-08-14-09-43-15
+.. nonce: -bcYF3
+.. section: IDLE
+
+Fixed completions list appearing too high or low when shown above the
+current line.
+
+..
+
+.. bpo: 36419
+.. date: 2019-08-04-17-10-01
+.. nonce: TJZqOc
+.. section: IDLE
+
+Refactor IDLE autocomplete and improve testing.
+
+..
+
+.. bpo: 37748
+.. date: 2019-08-04-15-27-50
+.. nonce: 0vf6pg
+.. section: IDLE
+
+Reorder the Run menu. Put the most common choice, Run Module, at the top.
+
+..
+
+.. bpo: 37942
+.. date: 2019-08-24-12-11-30
+.. nonce: 7H8N9a
+.. section: Tools/Demos
+
+Improve ArgumentClinic converter for floats.
+
+..
+
+.. bpo: 37034
+.. date: 2019-05-27-16-13-08
+.. nonce: zbTgy8
+.. section: Tools/Demos
+
+Argument Clinic now uses the argument name on errors with keyword-only
+argument instead of their position. Patch contributed by R=C3=A9mi Lapeyre.
+
+..
+
+.. bpo: 36763
+.. date: 2019-08-23-18-45-11
+.. nonce: q3Kh8Z
+.. section: C API
+
+Options added by ``PySys_AddXOption()`` are now handled the same way than
+``PyConfig.xoptions`` and command line ``-X`` options.
+
+..
+
+.. bpo: 37926
+.. date: 2019-08-23-11-35-55
+.. nonce: hnI5IQ
+.. section: C API
+
+Fix a crash in ``PySys_SetArgvEx(0, NULL, 0)``.
diff --git a/Misc/NEWS.d/next/Build/2019-07-29-11-36-16.bpo-37707.Sm-dGk.rst =
b/Misc/NEWS.d/next/Build/2019-07-29-11-36-16.bpo-37707.Sm-dGk.rst
deleted file mode 100644
index c0d58ab747b2..000000000000
--- a/Misc/NEWS.d/next/Build/2019-07-29-11-36-16.bpo-37707.Sm-dGk.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Mark some individual tests to skip when --pgo is used. The tests marked
-increase the PGO task time significantly and likely don't help improve
-optimization of the final executable.
diff --git a/Misc/NEWS.d/next/C API/2019-08-23-11-35-55.bpo-37926.hnI5IQ.rst =
b/Misc/NEWS.d/next/C API/2019-08-23-11-35-55.bpo-37926.hnI5IQ.rst
deleted file mode 100644
index 20185330a8f4..000000000000
--- a/Misc/NEWS.d/next/C API/2019-08-23-11-35-55.bpo-37926.hnI5IQ.rst=09
+++ /dev/null
@@ -1 +0,0 @@
-Fix a crash in ``PySys_SetArgvEx(0, NULL, 0)``.
diff --git a/Misc/NEWS.d/next/C API/2019-08-23-18-45-11.bpo-36763.q3Kh8Z.rst =
b/Misc/NEWS.d/next/C API/2019-08-23-18-45-11.bpo-36763.q3Kh8Z.rst
deleted file mode 100644
index 500cdbf34117..000000000000
--- a/Misc/NEWS.d/next/C API/2019-08-23-18-45-11.bpo-36763.q3Kh8Z.rst=09
+++ /dev/null
@@ -1,2 +0,0 @@
-Options added by ``PySys_AddXOption()`` are now handled the same way than
-``PyConfig.xoptions`` and command line ``-X`` options.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-02-15-20-42-36.bpo-20523=
.rRLrvr.rst b/Misc/NEWS.d/next/Core and Builtins/2019-02-15-20-42-36.bpo-2052=
3.rRLrvr.rst
deleted file mode 100644
index 91397c243b9f..000000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-02-15-20-42-36.bpo-20523.rRLrvr=
.rst=09
+++ /dev/null
@@ -1,2 +0,0 @@
-``pdb.Pdb`` supports ~/.pdbrc in Windows 7. Patch by Tim Hopper and Dan=20
-Lidral-Porter.
\ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-06-27-15-01-14.bpo-37433=
.amNGqr.rst b/Misc/NEWS.d/next/Core and Builtins/2019-06-27-15-01-14.bpo-3743=
3.amNGqr.rst
deleted file mode 100644
index 794ddbbfec73..000000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-06-27-15-01-14.bpo-37433.amNGqr=
.rst=09
+++ /dev/null
@@ -1 +0,0 @@
-Fix ``SyntaxError`` indicator printing too many spaces for multi-line string=
s - by Anthony Sottile.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-08-02-15-01-33.bpo-36311=
.uY5vt-.rst b/Misc/NEWS.d/next/Core and Builtins/2019-08-02-15-01-33.bpo-3631=
1.uY5vt-.rst
deleted file mode 100644
index c45f2224237b..000000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-08-02-15-01-33.bpo-36311.uY5vt-=
.rst=09
+++ /dev/null
@@ -1,2 +0,0 @@
-Decoding bytes objects larger than 2GiB is faster and no longer fails when a
-multibyte characters spans a chunk boundary.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-08-05-14-22-59.bpo-37757=
.lRv5HX.rst b/Misc/NEWS.d/next/Core and Builtins/2019-08-05-14-22-59.bpo-3775=
7.lRv5HX.rst
deleted file mode 100644
index 258df0dc09bd..000000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-08-05-14-22-59.bpo-37757.lRv5HX=
.rst=09
+++ /dev/null
@@ -1,7 +0,0 @@
-:pep:`572`: As described in the PEP, assignment expressions now raise
-:exc:`SyntaxError` when their interaction with comprehension scoping results
-in an ambiguous target scope.
-
-The ``TargetScopeError`` subclass originally proposed by the PEP has been
-removed in favour of just raising regular syntax errors for the disallowed
-cases.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-08-06-14-03-59.bpo-32912=
.UDwSMJ.rst b/Misc/NEWS.d/next/Core and Builtins/2019-08-06-14-03-59.bpo-3291=
2.UDwSMJ.rst
deleted file mode 100644
index e18d8adfbee9..000000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-08-06-14-03-59.bpo-32912.UDwSMJ=
.rst=09
+++ /dev/null
@@ -1,3 +0,0 @@
-Reverted :issue:`32912`: emitting :exc:`SyntaxWarning` instead of
-:exc:`DeprecationWarning` for invalid escape sequences in string and bytes
-literals.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-08-17-18-41-59.bpo-37830=
.fNfMbz.rst b/Misc/NEWS.d/next/Core and Builtins/2019-08-17-18-41-59.bpo-3783=
0.fNfMbz.rst
deleted file mode 100644
index 76f4bf671d1c..000000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-08-17-18-41-59.bpo-37830.fNfMbz=
.rst=09
+++ /dev/null
@@ -1,3 +0,0 @@
-Fixed compilation of :keyword:`break` and :keyword:`continue` in the
-:keyword:`finally` block when the corresponding :keyword:`try` block
-contains :keyword:`return` with a non-constant value.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-08-26-04-09-57.bpo-37947=
.mzAQtB.rst b/Misc/NEWS.d/next/Core and Builtins/2019-08-26-04-09-57.bpo-3794=
7.mzAQtB.rst
deleted file mode 100644
index 2b3b72367030..000000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-08-26-04-09-57.bpo-37947.mzAQtB=
.rst=09
+++ /dev/null
@@ -1,2 +0,0 @@
-Adjust correctly the recursion level in the symtable generation for named
-expressions. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Documentation/2019-04-02-19-23-00.bpo-36487.Jg6=
-MG.rst b/Misc/NEWS.d/next/Documentation/2019-04-02-19-23-00.bpo-36487.Jg6-MG=
.rst
deleted file mode 100755
index c8eb05b6c79c..000000000000
--- a/Misc/NEWS.d/next/Documentation/2019-04-02-19-23-00.bpo-36487.Jg6-MG.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make C-API docs clear about what the "main" interpreter is.
\ No newline at end of file
diff --git a/Misc/NEWS.d/next/Documentation/2019-05-22-04-30-07.bpo-37004.BRg=
xrt.rst b/Misc/NEWS.d/next/Documentation/2019-05-22-04-30-07.bpo-37004.BRgxrt=
.rst
deleted file mode 100644
index dfc8b7ed74ca..000000000000
--- a/Misc/NEWS.d/next/Documentation/2019-05-22-04-30-07.bpo-37004.BRgxrt.rst
+++ /dev/null
@@ -1 +0,0 @@
-In the documentation for difflib, a note was added explicitly warning that t=
he results of SequenceMatcher's ratio method may depend on the order of the i=
nput strings.
\ No newline at end of file
diff --git a/Misc/NEWS.d/next/Documentation/2019-07-16-14-48-12.bpo-37256.qJT=
rBb.rst b/Misc/NEWS.d/next/Documentation/2019-07-16-14-48-12.bpo-37256.qJTrBb=
.rst
deleted file mode 100644
index 480d7c87ebc4..000000000000
--- a/Misc/NEWS.d/next/Documentation/2019-07-16-14-48-12.bpo-37256.qJTrBb.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix wording of arguments for :class:`Request` in :mod:`urllib.request`
diff --git a/Misc/NEWS.d/next/Documentation/2019-07-31-11-40-06.bpo-37726.h-3=
o9a.rst b/Misc/NEWS.d/next/Documentation/2019-07-31-11-40-06.bpo-37726.h-3o9a=
.rst
deleted file mode 100644
index 195e9755a43c..000000000000
--- a/Misc/NEWS.d/next/Documentation/2019-07-31-11-40-06.bpo-37726.h-3o9a.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Stop recommending getopt in the tutorial for command line argument parsing
-and promote argparse.
diff --git a/Misc/NEWS.d/next/Documentation/2019-08-04-19-20-58.bpo-37759.EHR=
F4i.rst b/Misc/NEWS.d/next/Documentation/2019-08-04-19-20-58.bpo-37759.EHRF4i=
.rst
deleted file mode 100644
index 90fb7213ebde..000000000000
--- a/Misc/NEWS.d/next/Documentation/2019-08-04-19-20-58.bpo-37759.EHRF4i.rst
+++ /dev/null
@@ -1 +0,0 @@
-Beginning edits to Whatsnew 3.8
diff --git a/Misc/NEWS.d/next/Documentation/2019-08-29-10-40-05.bpo-37979.TAU=
x_E.rst b/Misc/NEWS.d/next/Documentation/2019-08-29-10-40-05.bpo-37979.TAUx_E=
.rst
deleted file mode 100644
index d8d70d613706..000000000000
--- a/Misc/NEWS.d/next/Documentation/2019-08-29-10-40-05.bpo-37979.TAUx_E.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Added a link to dateutil.parser.isoparse in the datetime.fromisoformat
-documentation. Patch by Paul Ganssle
diff --git a/Misc/NEWS.d/next/IDLE/2019-08-04-15-27-50.bpo-37748.0vf6pg.rst b=
/Misc/NEWS.d/next/IDLE/2019-08-04-15-27-50.bpo-37748.0vf6pg.rst
deleted file mode 100644
index fc1d6b6bb357..000000000000
--- a/Misc/NEWS.d/next/IDLE/2019-08-04-15-27-50.bpo-37748.0vf6pg.rst
+++ /dev/null
@@ -1 +0,0 @@
-Reorder the Run menu. Put the most common choice, Run Module, at the top.
diff --git a/Misc/NEWS.d/next/IDLE/2019-08-04-17-10-01.bpo-36419.TJZqOc.rst b=
/Misc/NEWS.d/next/IDLE/2019-08-04-17-10-01.bpo-36419.TJZqOc.rst
deleted file mode 100644
index 2a5b0bd0e90c..000000000000
--- a/Misc/NEWS.d/next/IDLE/2019-08-04-17-10-01.bpo-36419.TJZqOc.rst
+++ /dev/null
@@ -1 +0,0 @@
-Refactor IDLE autocomplete and improve testing.
diff --git a/Misc/NEWS.d/next/IDLE/2019-08-14-09-43-15.bpo-37849.-bcYF3.rst b=
/Misc/NEWS.d/next/IDLE/2019-08-14-09-43-15.bpo-37849.-bcYF3.rst
deleted file mode 100644
index 9f700d9031f1..000000000000
--- a/Misc/NEWS.d/next/IDLE/2019-08-14-09-43-15.bpo-37849.-bcYF3.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed completions list appearing too high or low when shown above
-the current line.
diff --git a/Misc/NEWS.d/next/IDLE/2019-08-24-22-00-33.bpo-37929.jb7523.rst b=
/Misc/NEWS.d/next/IDLE/2019-08-24-22-00-33.bpo-37929.jb7523.rst
deleted file mode 100644
index d627b2de2a7c..000000000000
--- a/Misc/NEWS.d/next/IDLE/2019-08-24-22-00-33.bpo-37929.jb7523.rst
+++ /dev/null
@@ -1 +0,0 @@
-IDLE Settings dialog now closes properly when there is no shell window.
diff --git a/Misc/NEWS.d/next/IDLE/2019-08-26-00-41-53.bpo-37824.YY5jAI.rst b=
/Misc/NEWS.d/next/IDLE/2019-08-26-00-41-53.bpo-37824.YY5jAI.rst
deleted file mode 100644
index 1a1e8a59816a..000000000000
--- a/Misc/NEWS.d/next/IDLE/2019-08-26-00-41-53.bpo-37824.YY5jAI.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Properly handle user input warnings in IDLE shell. Cease turning
-SyntaxWarnings into SyntaxErrors.
diff --git a/Misc/NEWS.d/next/Library/2018-09-23-03-18-52.bpo-34775.vHeuHk.rs=
t b/Misc/NEWS.d/next/Library/2018-09-23-03-18-52.bpo-34775.vHeuHk.rst
deleted file mode 100644
index f99bf5b39f95..000000000000
--- a/Misc/NEWS.d/next/Library/2018-09-23-03-18-52.bpo-34775.vHeuHk.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Division handling of PurePath now returns NotImplemented instead of raising
-a TypeError when passed something other than an instance of str or PurePath.
-Patch by Roger Aiudi.
diff --git a/Misc/NEWS.d/next/Library/2019-05-07-17-42-36.bpo-36582.L_dxR6.rs=
t b/Misc/NEWS.d/next/Library/2019-05-07-17-42-36.bpo-36582.L_dxR6.rst
deleted file mode 100644
index 34f16fcde879..000000000000
--- a/Misc/NEWS.d/next/Library/2019-05-07-17-42-36.bpo-36582.L_dxR6.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix ``UserString.encode()`` to correctly return ``bytes`` rather than a ``Us=
erString`` instance.
\ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2019-05-12-12-58-37.bpo-36871.6xiEHZ.rs=
t b/Misc/NEWS.d/next/Library/2019-05-12-12-58-37.bpo-36871.6xiEHZ.rst
deleted file mode 100644
index 218795f203be..000000000000
--- a/Misc/NEWS.d/next/Library/2019-05-12-12-58-37.bpo-36871.6xiEHZ.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Ensure method signature is used instead of constructor signature of a class
-while asserting mock object against method calls. Patch by Karthikeyan
-Singaravelan.
diff --git a/Misc/NEWS.d/next/Library/2019-06-18-16-29-31.bpo-37085.GeYaD6.rs=
t b/Misc/NEWS.d/next/Library/2019-06-18-16-29-31.bpo-37085.GeYaD6.rst
deleted file mode 100644
index e8db521d7aba..000000000000
--- a/Misc/NEWS.d/next/Library/2019-06-18-16-29-31.bpo-37085.GeYaD6.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add the optional Linux SocketCAN Broadcast Manager constants, used as flags
-to configure the BCM behaviour, in the socket module. Patch by Karl Ding.
diff --git a/Misc/NEWS.d/next/Library/2019-06-22-12-30-00.bpo-37372.kIKqZ6.rs=
t b/Misc/NEWS.d/next/Library/2019-06-22-12-30-00.bpo-37372.kIKqZ6.rst
deleted file mode 100644
index b958d8fed40a..000000000000
--- a/Misc/NEWS.d/next/Library/2019-06-22-12-30-00.bpo-37372.kIKqZ6.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix error unpickling datetime.time objects from Python 2 with seconds>=3D24.
-Patch by Justin Blanchard.
diff --git a/Misc/NEWS.d/next/Library/2019-07-09-11-20-21.bpo-37482.auzvev.rs=
t b/Misc/NEWS.d/next/Library/2019-07-09-11-20-21.bpo-37482.auzvev.rst
deleted file mode 100644
index e09ff63eedc4..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-09-11-20-21.bpo-37482.auzvev.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix serialization of display name in originator or destination address field=
s with both encoded words and special chars.
diff --git a/Misc/NEWS.d/next/Library/2019-07-09-19-38-26.bpo-37531.GX7s8S.rs=
t b/Misc/NEWS.d/next/Library/2019-07-09-19-38-26.bpo-37531.GX7s8S.rst
deleted file mode 100644
index aaf1052bd3c1..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-09-19-38-26.bpo-37531.GX7s8S.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-"python3 -m test -jN --timeout=3DTIMEOUT" now kills a worker process if it r=
uns
-longer than *TIMEOUT* seconds.
diff --git a/Misc/NEWS.d/next/Library/2019-07-13-13-40-12.bpo-18378.NHcojp.rs=
t b/Misc/NEWS.d/next/Library/2019-07-13-13-40-12.bpo-18378.NHcojp.rst
deleted file mode 100644
index 6dda8abf15d5..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-13-13-40-12.bpo-18378.NHcojp.rst
+++ /dev/null
@@ -1 +0,0 @@
-Recognize "UTF-8" as a valid value for LC_CTYPE in locale._parse_localename.
diff --git a/Misc/NEWS.d/next/Library/2019-07-13-16-02-48.bpo-37587.fd-1aF.rs=
t b/Misc/NEWS.d/next/Library/2019-07-13-16-02-48.bpo-37587.fd-1aF.rst
deleted file mode 100644
index 80a89feab0ce..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-13-16-02-48.bpo-37587.fd-1aF.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make json.loads faster for long strings. (Patch by Marco Paolini)
diff --git a/Misc/NEWS.d/next/Library/2019-07-19-01-46-56.bpo-16970.GEASf5.rs=
t b/Misc/NEWS.d/next/Library/2019-07-19-01-46-56.bpo-16970.GEASf5.rst
deleted file mode 100644
index 7285b8176032..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-19-01-46-56.bpo-16970.GEASf5.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Adding a value error when an invalid value in passed to nargs
-Patch by Robert Leenders
diff --git a/Misc/NEWS.d/next/Library/2019-07-21-20-59-31.bpo-37642.L61Bvy.rs=
t b/Misc/NEWS.d/next/Library/2019-07-21-20-59-31.bpo-37642.L61Bvy.rst
deleted file mode 100644
index 09ff257597e8..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-21-20-59-31.bpo-37642.L61Bvy.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Allowed the pure Python implementation of :class:`datetime.timezone` to repr=
esent
-sub-minute offsets close to minimum and maximum boundaries, specifically in =
the
-ranges (23:59, 24:00) and (-23:59, 24:00). Patch by Ngalim Siregar
diff --git a/Misc/NEWS.d/next/Library/2019-07-24-18-27-44.bpo-37664.o-GYZC.rs=
t b/Misc/NEWS.d/next/Library/2019-07-24-18-27-44.bpo-37664.o-GYZC.rst
deleted file mode 100644
index f12590540eb7..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-24-18-27-44.bpo-37664.o-GYZC.rst
+++ /dev/null
@@ -1 +0,0 @@
-Update wheels bundled with ensurepip (pip 19.2.3 and setuptools 41.2.0)
diff --git a/Misc/NEWS.d/next/Library/2019-07-25-10-28-40.bpo-37354.RT3_3H.rs=
t b/Misc/NEWS.d/next/Library/2019-07-25-10-28-40.bpo-37354.RT3_3H.rst
deleted file mode 100644
index a314bcc9bf90..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-25-10-28-40.bpo-37354.RT3_3H.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make Activate.ps1 Powershell script static to allow for signing it.
diff --git a/Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rs=
t b/Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rst
deleted file mode 100644
index ca6c11641ed6..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-27-20-21-03.bpo-37695.QANdvg.rst
+++ /dev/null
@@ -1 +0,0 @@
-Correct :func:`curses.unget_wch` error message. Patch by Anthony Sottile.
diff --git a/Misc/NEWS.d/next/Library/2019-07-28-22-25-25.bpo-37685._3bN9f.rs=
t b/Misc/NEWS.d/next/Library/2019-07-28-22-25-25.bpo-37685._3bN9f.rst
deleted file mode 100644
index ba60057e6fb6..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-28-22-25-25.bpo-37685._3bN9f.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed comparisons of :class:`datetime.timedelta` and
-:class:`datetime.timezone`.
diff --git a/Misc/NEWS.d/next/Library/2019-07-30-22-41-05.bpo-32178.X-IFLe.rs=
t b/Misc/NEWS.d/next/Library/2019-07-30-22-41-05.bpo-32178.X-IFLe.rst
deleted file mode 100644
index 5e7a2e964d93..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-30-22-41-05.bpo-32178.X-IFLe.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix IndexError in :mod:`email` package when trying to parse invalid address =
fields starting with ``:``.
diff --git a/Misc/NEWS.d/next/Library/2019-07-31-16-49-01.bpo-37723.zq6tw8.rs=
t b/Misc/NEWS.d/next/Library/2019-07-31-16-49-01.bpo-37723.zq6tw8.rst
deleted file mode 100644
index 65507bd0dc91..000000000000
--- a/Misc/NEWS.d/next/Library/2019-07-31-16-49-01.bpo-37723.zq6tw8.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix performance regression on regular expression parsing with huge
-character sets. Patch by Yann Vaginay.
\ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2019-08-01-17-11-16.bpo-37738.A3WWcT.rs=
t b/Misc/NEWS.d/next/Library/2019-08-01-17-11-16.bpo-37738.A3WWcT.rst
deleted file mode 100644
index 7e70a9c2231a..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-01-17-11-16.bpo-37738.A3WWcT.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix the implementation of curses ``addch(str, color_pair)``: pass the color
-pair to ``setcchar()``, instead of always passing 0 as the color pair.
diff --git a/Misc/NEWS.d/next/Library/2019-08-02-16-44-42.bpo-18049.OA4qBL.rs=
t b/Misc/NEWS.d/next/Library/2019-08-02-16-44-42.bpo-18049.OA4qBL.rst
deleted file mode 100644
index 36a4de384cc0..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-02-16-44-42.bpo-18049.OA4qBL.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Add definition of THREAD_STACK_SIZE for AIX in Python/thread_pthread.h
-The default thread stacksize caused crashes with the default recursion limit
-Patch by M Felt
diff --git a/Misc/NEWS.d/next/Library/2019-08-04-11-47-58.bpo-28292.vkihH5.rs=
t b/Misc/NEWS.d/next/Library/2019-08-04-11-47-58.bpo-28292.vkihH5.rst
deleted file mode 100644
index 478a1b03c195..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-04-11-47-58.bpo-28292.vkihH5.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Mark calendar.py helper functions as being private. The follows PEP 8
-guidance to maintain the style conventions in the module and it addresses a
-known case of user confusion.
diff --git a/Misc/NEWS.d/next/Library/2019-08-07-23-48-09.bpo-37772.hLCvdn.rs=
t b/Misc/NEWS.d/next/Library/2019-08-07-23-48-09.bpo-37772.hLCvdn.rst
deleted file mode 100644
index f9ec6a33b07b..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-07-23-48-09.bpo-37772.hLCvdn.rst
+++ /dev/null
@@ -1 +0,0 @@
-In ``zipfile.Path``, when adding implicit dirs, ensure that ancestral direct=
ories are added and that duplicates are excluded.
diff --git a/Misc/NEWS.d/next/Library/2019-08-10-12-33-27.bpo-37810.d4zbvB.rs=
t b/Misc/NEWS.d/next/Library/2019-08-10-12-33-27.bpo-37810.d4zbvB.rst
deleted file mode 100644
index 3e0b31775d07..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-10-12-33-27.bpo-37810.d4zbvB.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix :mod:`difflib` ``?`` hint in diff output when dealing with tabs. Patch
-by Anthony Sottile.
diff --git a/Misc/NEWS.d/next/Library/2019-08-11-10-34-19.bpo-37819.LVJls-.rs=
t b/Misc/NEWS.d/next/Library/2019-08-11-10-34-19.bpo-37819.LVJls-.rst
deleted file mode 100644
index cfc1f1afb4f7..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-11-10-34-19.bpo-37819.LVJls-.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add Fraction.as_integer_ratio() to match the corresponding methods in bool,
-int, float, and decimal.
diff --git a/Misc/NEWS.d/next/Library/2019-08-14-13-51-24.bpo-37798.AmXrik.rs=
t b/Misc/NEWS.d/next/Library/2019-08-14-13-51-24.bpo-37798.AmXrik.rst
deleted file mode 100644
index 620f0ecdf41a..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-14-13-51-24.bpo-37798.AmXrik.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add C fastpath for statistics.NormalDist.inv_cdf() Patch by Dong-hee Na
diff --git a/Misc/NEWS.d/next/Library/2019-08-14-15-34-23.bpo-21131.0MMQRi.rs=
t b/Misc/NEWS.d/next/Library/2019-08-14-15-34-23.bpo-21131.0MMQRi.rst
deleted file mode 100644
index d330aca1c17d..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-14-15-34-23.bpo-21131.0MMQRi.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Fix ``faulthandler.register(chain=3DTrue)`` stack. faulthandler now allocate=
s a
-dedicated stack of ``SIGSTKSZ*2`` bytes, instead of just ``SIGSTKSZ`` bytes.
-Calling the previous signal handler in faulthandler signal handler uses more
-than ``SIGSTKSZ`` bytes of stack memory on some platforms.
diff --git a/Misc/NEWS.d/next/Library/2019-08-14-21-41-07.bpo-37811.d1xYj7.rs=
t b/Misc/NEWS.d/next/Library/2019-08-14-21-41-07.bpo-37811.d1xYj7.rst
deleted file mode 100644
index 662e7dc41005..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-14-21-41-07.bpo-37811.d1xYj7.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Fix ``socket`` module's ``socket.connect(address)`` function being unable to
-establish connection in case of interrupted system call. The problem was
-observed on all OSes which ``poll(2)`` system call can take only
-non-negative integers and -1 as a timeout value.
diff --git a/Misc/NEWS.d/next/Library/2019-08-17-22-33-54.bpo-37868.hp64fi.rs=
t b/Misc/NEWS.d/next/Library/2019-08-17-22-33-54.bpo-37868.hp64fi.rst
deleted file mode 100644
index 7f342e1ee354..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-17-22-33-54.bpo-37868.hp64fi.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Fix dataclasses.is_dataclass when given an instance that never raises
-AttributeError in __getattr__. That is, an object that returns something
-for __dataclass_fields__ even if it's not a dataclass.
diff --git a/Misc/NEWS.d/next/Library/2019-08-22-16-13-27.bpo-37915.xyoZI5.rs=
t b/Misc/NEWS.d/next/Library/2019-08-22-16-13-27.bpo-37915.xyoZI5.rst
deleted file mode 100644
index 1dc9ea4b8cf8..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-22-16-13-27.bpo-37915.xyoZI5.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Fix a segmentation fault that appeared when comparing instances of
-``datetime.timezone`` and ``datetime.tzinfo`` objects. Patch by Pablo
-Galindo.
diff --git a/Misc/NEWS.d/next/Library/2019-08-23-00-55-19.bpo-26589.M1xyxG.rs=
t b/Misc/NEWS.d/next/Library/2019-08-23-00-55-19.bpo-26589.M1xyxG.rst
deleted file mode 100644
index ef132dcceb2c..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-23-00-55-19.bpo-26589.M1xyxG.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Added a new status code to the http module: 451
-UNAVAILABLE_FOR_LEGAL_REASONS
diff --git a/Misc/NEWS.d/next/Library/2019-08-24-16-54-49.bpo-37798.7mRQCk.rs=
t b/Misc/NEWS.d/next/Library/2019-08-24-16-54-49.bpo-37798.7mRQCk.rst
deleted file mode 100644
index 25cfa0047886..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-24-16-54-49.bpo-37798.7mRQCk.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Update test_statistics.py to verify that the statistics module works well
-for both C and Python implementations. Patch by Dong-hee Na
diff --git a/Misc/NEWS.d/next/Library/2019-08-25-14-56-42.bpo-36917.GBxdw2.rs=
t b/Misc/NEWS.d/next/Library/2019-08-25-14-56-42.bpo-36917.GBxdw2.rst
deleted file mode 100644
index 3509a7530b89..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-25-14-56-42.bpo-36917.GBxdw2.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Add default implementation of the :meth:`ast.NodeVisitor.visit_Constant`
-method which emits a deprecation warning and calls corresponding methody
-``visit_Num()``, ``visit_Str()``, etc.
diff --git a/Misc/NEWS.d/next/Library/2019-08-25-18-07-48.bpo-34679.HECzL7.rs=
t b/Misc/NEWS.d/next/Library/2019-08-25-18-07-48.bpo-34679.HECzL7.rst
deleted file mode 100644
index 785b06b6482c..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-25-18-07-48.bpo-34679.HECzL7.rst
+++ /dev/null
@@ -1 +0,0 @@
-Restores instantiation of Windows IOCP event loops from the non-main thread.
diff --git a/Misc/NEWS.d/next/Library/2019-08-26-10-45-51.bpo-37950.-K1IKT.rs=
t b/Misc/NEWS.d/next/Library/2019-08-26-10-45-51.bpo-37950.-K1IKT.rst
deleted file mode 100644
index ded80d3b00ef..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-26-10-45-51.bpo-37950.-K1IKT.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix :func:`ast.dump` when call with incompletely initialized node.
diff --git a/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rs=
t b/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst
deleted file mode 100644
index 50cda34fbbd3..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-27-03-53-26.bpo-36205.AfkGRl.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix the rusage implementation of time.process_time() to correctly report the=
sum of the system and user CPU time.
\ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2019-08-27-10-03-48.bpo-37951.MfRQgL.rs=
t b/Misc/NEWS.d/next/Library/2019-08-27-10-03-48.bpo-37951.MfRQgL.rst
deleted file mode 100644
index 18e4c620bdea..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-27-10-03-48.bpo-37951.MfRQgL.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Most features of the subprocess module now work again in subinterpreters.
-Only *preexec_fn* is restricted in subinterpreters.
diff --git a/Misc/NEWS.d/next/Library/2019-08-27-10-52-13.bpo-37960.CTY7Lw.rs=
t b/Misc/NEWS.d/next/Library/2019-08-27-10-52-13.bpo-37960.CTY7Lw.rst
deleted file mode 100644
index 421cfb9c38e1..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-27-10-52-13.bpo-37960.CTY7Lw.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-``repr()`` of buffered and text streams now silences only expected
-exceptions when get the value of "name" and "mode" attributes.
diff --git a/Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rs=
t b/Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst
deleted file mode 100644
index 116a9e49dccc..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-28-14-04-18.bpo-37965.7xGE-C.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix C compiler warning caused by distutils.ccompiler.CCompiler.has_function.
diff --git a/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rs=
t b/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
deleted file mode 100644
index afbbb3313a5b..000000000000
--- a/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Prevent shutil.rmtree exception when built on non-Windows system without fd
-system call support, like older versions of macOS.
diff --git a/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.r=
st b/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst
deleted file mode 100644
index 50292e29ed1d..000000000000
--- a/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix parsing of invalid email addresses with more than one ``@`` (e.g. a@b@c.=
com.) to not return the part before 2nd ``@`` as valid email address. Patch b=
y maxking & jpic.
diff --git a/Misc/NEWS.d/next/Tests/2019-08-25-19-51-46.bpo-37805.Kl1sti.rst =
b/Misc/NEWS.d/next/Tests/2019-08-25-19-51-46.bpo-37805.Kl1sti.rst
deleted file mode 100644
index 478c38c3d4c5..000000000000
--- a/Misc/NEWS.d/next/Tests/2019-08-25-19-51-46.bpo-37805.Kl1sti.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add tests for json.dump(..., skipkeys=3DTrue). Patch by Dong-hee Na.
diff --git a/Misc/NEWS.d/next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy=
8.rst b/Misc/NEWS.d/next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy8.rst
deleted file mode 100644
index 3457789635b4..000000000000
--- a/Misc/NEWS.d/next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy8.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Argument Clinic now uses the argument name on errors with keyword-only
-argument instead of their position. Patch contributed by R=C3=A9mi Lapeyre.
diff --git a/Misc/NEWS.d/next/Tools-Demos/2019-08-24-12-11-30.bpo-37942.7H8N9=
a.rst b/Misc/NEWS.d/next/Tools-Demos/2019-08-24-12-11-30.bpo-37942.7H8N9a.rst
deleted file mode 100644
index 6f6431409554..000000000000
--- a/Misc/NEWS.d/next/Tools-Demos/2019-08-24-12-11-30.bpo-37942.7H8N9a.rst
+++ /dev/null
@@ -1 +0,0 @@
-Improve ArgumentClinic converter for floats.
diff --git a/Misc/NEWS.d/next/Windows/2019-05-05-05-23-34.bpo-28269.-MOHI7.rs=
t b/Misc/NEWS.d/next/Windows/2019-05-05-05-23-34.bpo-28269.-MOHI7.rst
deleted file mode 100644
index a531b98118a2..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-05-05-05-23-34.bpo-28269.-MOHI7.rst
+++ /dev/null
@@ -1 +0,0 @@
-Replace use of :c:func:`strcasecmp` for the system function :c:func:`_stricm=
p`. Patch by Minmin Gong.
diff --git a/Misc/NEWS.d/next/Windows/2019-08-06-09-35-12.bpo-37734.EoJ9Nh.rs=
t b/Misc/NEWS.d/next/Windows/2019-08-06-09-35-12.bpo-37734.EoJ9Nh.rst
deleted file mode 100644
index 51feecb076ba..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-08-06-09-35-12.bpo-37734.EoJ9Nh.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix use of registry values to launch Python from Microsoft Store app.
diff --git a/Misc/NEWS.d/next/Windows/2019-08-06-13-54-12.bpo-37778.AY1XhH.rs=
t b/Misc/NEWS.d/next/Windows/2019-08-06-13-54-12.bpo-37778.AY1XhH.rst
deleted file mode 100644
index 14d81c05ee84..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-08-06-13-54-12.bpo-37778.AY1XhH.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixes the icons used for file associations to the Microsoft Store package.
diff --git a/Misc/NEWS.d/next/Windows/2019-08-06-18-09-18.bpo-25172.Akreij.rs=
t b/Misc/NEWS.d/next/Windows/2019-08-06-18-09-18.bpo-25172.Akreij.rst
deleted file mode 100644
index 47106d887921..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-08-06-18-09-18.bpo-25172.Akreij.rst
+++ /dev/null
@@ -1 +0,0 @@
-Trying to import the :mod:`crypt` module on Windows will result in an :exc:`=
ImportError` with a message explaining that the module isn't supported on Win=
dows. On other platforms, if the underlying ``_crypt`` module is not availabl=
e, the ImportError will include a message explaining the problem.
diff --git a/Misc/NEWS.d/next/Windows/2019-08-08-18-05-27.bpo-36266.x4eZU3.rs=
t b/Misc/NEWS.d/next/Windows/2019-08-08-18-05-27.bpo-36266.x4eZU3.rst
deleted file mode 100644
index 86fdd6fe17f4..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-08-08-18-05-27.bpo-36266.x4eZU3.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add the module name in the formatted error message when DLL load fail happen=
s during module import in ``_PyImport_FindSharedFuncptrWindows()``. Patch by =
Srinivas Nyayapati.
\ No newline at end of file
diff --git a/Misc/NEWS.d/next/Windows/2019-08-12-12-00-24.bpo-37834.VB2QVj.rs=
t b/Misc/NEWS.d/next/Windows/2019-08-12-12-00-24.bpo-37834.VB2QVj.rst
deleted file mode 100644
index f2a654cac911..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-08-12-12-00-24.bpo-37834.VB2QVj.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Treat all name surrogate reparse points on Windows in :func:`os.lstat` and
-other reparse points as regular files in :func:`os.stat`.
diff --git a/Misc/NEWS.d/next/Windows/2019-08-14-13-40-15.bpo-9949.zW45Ks.rst=
b/Misc/NEWS.d/next/Windows/2019-08-14-13-40-15.bpo-9949.zW45Ks.rst
deleted file mode 100644
index e42169a927c7..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-08-14-13-40-15.bpo-9949.zW45Ks.rst
+++ /dev/null
@@ -1 +0,0 @@
-Enable support for following symlinks in :func:`os.realpath`.
diff --git a/Misc/NEWS.d/next/Windows/2019-08-21-12-58-18.bpo-1311.BoW1wU.rst=
b/Misc/NEWS.d/next/Windows/2019-08-21-12-58-18.bpo-1311.BoW1wU.rst
deleted file mode 100644
index 2ee98e450fae..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-08-21-12-58-18.bpo-1311.BoW1wU.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The ``nul`` file on Windows now returns True from :func:`~os.path.exists`
-and a valid result from :func:`os.stat` with ``S_IFCHR`` set.
diff --git a/Misc/NEWS.d/next/Windows/2019-08-22-09-04-44.bpo-37549.TpKI3M.rs=
t b/Misc/NEWS.d/next/Windows/2019-08-22-09-04-44.bpo-37549.TpKI3M.rst
deleted file mode 100644
index 5345da80781d..000000000000
--- a/Misc/NEWS.d/next/Windows/2019-08-22-09-04-44.bpo-37549.TpKI3M.rst
+++ /dev/null
@@ -1 +0,0 @@
-:func:`os.dup` no longer fails for standard streams on Windows 7.
diff --git a/Misc/NEWS.d/next/macOS/2019-07-13-15-58-18.bpo-18049.MklhQQ.rst =
b/Misc/NEWS.d/next/macOS/2019-07-13-15-58-18.bpo-18049.MklhQQ.rst
deleted file mode 100644
index 5af07cdb4119..000000000000
--- a/Misc/NEWS.d/next/macOS/2019-07-13-15-58-18.bpo-18049.MklhQQ.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Increase the default stack size of threads from 5MB to 16MB on macOS, to
-match the stack size of the main thread. This avoids crashes on deep recursi=
on
-in threads.
diff --git a/README.rst b/README.rst
index 12ecdf67ed1c..52c79d567703 100644
--- a/README.rst
+++ b/README.rst
@@ -1,4 +1,4 @@
-This is Python version 3.8.0 beta 3
+This is Python version 3.8.0 beta 4
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
.. image:: https://travis-ci.org/python/cpython.svg?branch=3Dmaster
[View Less]
1
0

bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592) (GH-15608)
by Raymond Hettinger Aug. 30, 2019
by Raymond Hettinger Aug. 30, 2019
Aug. 30, 2019
https://github.com/python/cpython/commit/27f418640cf39c035114f29cc2d628775b…
commit: 27f418640cf39c035114f29cc2d628775b43c0f9
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
committer: Raymond Hettinger <rhettinger(a)users.noreply.github.com>
date: 2019-08-29T23:23:17-07:00
summary:
bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592) (GH-15608)
(cherry picked from commit 6a650aaf7735e30636db2721247f317064c2cfd4)
Co-authored-…
[View More]by: Sergey Fedoseev <fedoseev.sergey(a)gmail.com>
files:
M Lib/test/test_builtin.py
M Lib/test/test_itertools.py
M Modules/itertoolsmodule.c
M Python/bltinmodule.c
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 61155799c44a..1100c49e9b88 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -1477,6 +1477,18 @@ def test_zip_pickle(self):
z1 = zip(a, b)
self.check_iter_pickle(z1, t, proto)
+ def test_zip_bad_iterable(self):
+ exception = TypeError()
+
+ class BadIterable:
+ def __iter__(self):
+ raise exception
+
+ with self.assertRaises(TypeError) as cm:
+ zip(BadIterable())
+
+ self.assertIs(cm.exception, exception)
+
def test_format(self):
# Test the basic machinery of the format() builtin. Don't test
# the specifics of the various formatters
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 573739fde14c..98b8c8373189 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -971,6 +971,18 @@ def test_zip_longest_pickling(self):
self.pickletest(proto, zip_longest("abc", "defgh", fillvalue=1))
self.pickletest(proto, zip_longest("", "defgh"))
+ def test_zip_longest_bad_iterable(self):
+ exception = TypeError()
+
+ class BadIterable:
+ def __iter__(self):
+ raise exception
+
+ with self.assertRaises(TypeError) as cm:
+ zip_longest(BadIterable())
+
+ self.assertIs(cm.exception, exception)
+
def test_bug_7244(self):
class Repeater:
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 00e3cbb31b53..22c04f29353e 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -4434,10 +4434,6 @@ zip_longest_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *item = PyTuple_GET_ITEM(args, i);
PyObject *it = PyObject_GetIter(item);
if (it == NULL) {
- if (PyErr_ExceptionMatches(PyExc_TypeError))
- PyErr_Format(PyExc_TypeError,
- "zip_longest argument #%zd must support iteration",
- i+1);
Py_DECREF(ittuple);
return NULL;
}
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 62502218ef4c..b85bfb2b91e3 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2549,10 +2549,6 @@ zip_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *item = PyTuple_GET_ITEM(args, i);
PyObject *it = PyObject_GetIter(item);
if (it == NULL) {
- if (PyErr_ExceptionMatches(PyExc_TypeError))
- PyErr_Format(PyExc_TypeError,
- "zip argument #%zd must support iteration",
- i+1);
Py_DECREF(ittuple);
return NULL;
}
[View Less]
1
0

Steven Bethard designated a new maintainer for argparse (GH-15605) (GH-15606)
by Raymond Hettinger Aug. 30, 2019
by Raymond Hettinger Aug. 30, 2019
Aug. 30, 2019
https://github.com/python/cpython/commit/c19d6bca5577547b3f4624d99b5f5f1db3…
commit: c19d6bca5577547b3f4624d99b5f5f1db3e5e695
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
committer: Raymond Hettinger <rhettinger(a)users.noreply.github.com>
date: 2019-08-29T21:27:33-07:00
summary:
Steven Bethard designated a new maintainer for argparse (GH-15605) (GH-15606)
(cherry picked from commit 496058f59937da478eb172c864502b5dcf67705b)
Co-…
[View More]authored-by: Raymond Hettinger <rhettinger(a)users.noreply.github.com>
files:
M Lib/argparse.py
diff --git a/Lib/argparse.py b/Lib/argparse.py
index 6f0b37c1c5ea..a6ab3b3b898d 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -1,4 +1,5 @@
# Author: Steven J. Bethard <steven.bethard(a)gmail.com>.
+# New maintainer as of 29 August 2019: Raymond Hettinger <raymond.hettinger(a)gmail.com>
"""Command-line parsing library
[View Less]
1
0

Aug. 30, 2019
https://github.com/python/cpython/commit/6a650aaf7735e30636db2721247f317064…
commit: 6a650aaf7735e30636db2721247f317064c2cfd4
branch: master
author: Sergey Fedoseev <fedoseev.sergey(a)gmail.com>
committer: Raymond Hettinger <rhettinger(a)users.noreply.github.com>
date: 2019-08-29T21:25:48-07:00
summary:
bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)
files:
M Lib/test/test_builtin.py
M Lib/test/test_itertools.py
M Modules/itertoolsmodule.c
M Python/bltinmodule.c
…
[View More]diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 61155799c44a..1100c49e9b88 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -1477,6 +1477,18 @@ def test_zip_pickle(self):
z1 = zip(a, b)
self.check_iter_pickle(z1, t, proto)
+ def test_zip_bad_iterable(self):
+ exception = TypeError()
+
+ class BadIterable:
+ def __iter__(self):
+ raise exception
+
+ with self.assertRaises(TypeError) as cm:
+ zip(BadIterable())
+
+ self.assertIs(cm.exception, exception)
+
def test_format(self):
# Test the basic machinery of the format() builtin. Don't test
# the specifics of the various formatters
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 573739fde14c..98b8c8373189 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -971,6 +971,18 @@ def test_zip_longest_pickling(self):
self.pickletest(proto, zip_longest("abc", "defgh", fillvalue=1))
self.pickletest(proto, zip_longest("", "defgh"))
+ def test_zip_longest_bad_iterable(self):
+ exception = TypeError()
+
+ class BadIterable:
+ def __iter__(self):
+ raise exception
+
+ with self.assertRaises(TypeError) as cm:
+ zip_longest(BadIterable())
+
+ self.assertIs(cm.exception, exception)
+
def test_bug_7244(self):
class Repeater:
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 101addcfd3a9..ab473e29fbd5 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -4442,10 +4442,6 @@ zip_longest_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *item = PyTuple_GET_ITEM(args, i);
PyObject *it = PyObject_GetIter(item);
if (it == NULL) {
- if (PyErr_ExceptionMatches(PyExc_TypeError))
- PyErr_Format(PyExc_TypeError,
- "zip_longest argument #%zd must support iteration",
- i+1);
Py_DECREF(ittuple);
return NULL;
}
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 7f187eacd169..63e58128651a 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2548,10 +2548,6 @@ zip_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *item = PyTuple_GET_ITEM(args, i);
PyObject *it = PyObject_GetIter(item);
if (it == NULL) {
- if (PyErr_ExceptionMatches(PyExc_TypeError))
- PyErr_Format(PyExc_TypeError,
- "zip argument #%zd must support iteration",
- i+1);
Py_DECREF(ittuple);
return NULL;
}
[View Less]
1
0

Steven Bethard designated a new maintainer for argparse (GH-15605)
by Raymond Hettinger Aug. 30, 2019
by Raymond Hettinger Aug. 30, 2019
Aug. 30, 2019
https://github.com/python/cpython/commit/496058f59937da478eb172c864502b5dcf…
commit: 496058f59937da478eb172c864502b5dcf67705b
branch: master
author: Raymond Hettinger <rhettinger(a)users.noreply.github.com>
committer: GitHub <noreply(a)github.com>
date: 2019-08-29T21:04:37-07:00
summary:
Steven Bethard designated a new maintainer for argparse (GH-15605)
files:
M Lib/argparse.py
diff --git a/Lib/argparse.py b/Lib/argparse.py
index d29f161b666a..ddfd772c1126 100644
--- a/Lib/…
[View More]argparse.py
+++ b/Lib/argparse.py
@@ -1,4 +1,5 @@
# Author: Steven J. Bethard <steven.bethard(a)gmail.com>.
+# New maintainer as of 29 August 2019: Raymond Hettinger <raymond.hettinger(a)gmail.com>
"""Command-line parsing library
[View Less]
1
0
To: python-checkins(a)python.org
Subject: [3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
https://github.com/python/cpython/commit/25a044ee6ce50a9172478cc61d91464477…
55f6
commit: 25a044ee6ce50a9172478cc61d914644778455f6
branch: 3.8
author: =C5=81ukasz Langa <lukasz(a)langa.pl>
committer: GitHub <noreply(a)github.com>
date: 2019-08-29T23:51:19+02:00
summary:
…
[View More][3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603)
when built on non-Windows system without fd system call support,
like older versions of macOS.
(cherry picked from commit 7fcc2088a50a4ecb80e5644cd195bee209c9f979)
Co-authored-by: Ned Deily <nad(a)python.org>
files:
A Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
M Lib/shutil.py
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 39f793b5f3bd..561ad71508cc 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -544,7 +544,7 @@ def copytree(src, dst, symlinks=3DFalse, ignore=3DNone, c=
opy_function=3Dcopy2,
ignore_dangling_symlinks=3Dignore_dangling_symlinks,
dirs_exist_ok=3Ddirs_exist_ok)
=20
-if hasattr(stat, 'FILE_ATTRIBUTE_REPARSE_POINT'):
+if hasattr(os.stat_result, 'st_file_attributes'):
# Special handling for directory junctions to make them behave like
# symlinks for shutil.rmtree, since in general they do not appear as
# regular links.
diff --git a/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rs=
t b/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
new file mode 100644
index 000000000000..afbbb3313a5b
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-08-29-16-41-36.bpo-37834.FThnsh.rst
@@ -0,0 +1,2 @@
+Prevent shutil.rmtree exception when built on non-Windows system without fd
+system call support, like older versions of macOS.
[View Less]
1
0