]> granicus.if.org Git - python/log
python
5 years agoUpdate What's New in Python 3.8 (GH-14239)
Victor Stinner [Wed, 19 Jun 2019 23:44:58 +0000 (01:44 +0200)]
Update What's New in Python 3.8 (GH-14239)

* Mention issue in which ByByteArray_Init() has been removed.
* Fix typo

5 years agobpo-36710: Use tstate in pylifecycle.c (GH-14249)
Victor Stinner [Wed, 19 Jun 2019 22:05:23 +0000 (00:05 +0200)]
bpo-36710: Use tstate in pylifecycle.c (GH-14249)

In pylifecycle.c: pass tstate argument, rather than interp argument,
to functions.

5 years agoAdd missing single quote in io.TextIOWrapper.reconfigure documentation (GH-14246)
Harmon [Wed, 19 Jun 2019 21:01:27 +0000 (16:01 -0500)]
Add missing single quote in io.TextIOWrapper.reconfigure documentation (GH-14246)

Add a missing single quote character in the documentation for `io.TextIOWrapper.reconfigure`.

5 years agobpo-36511: Add buildbot scripts and fix tests for Windows ARM32 buildbot (GH-13454)
Paul Monson [Wed, 19 Jun 2019 20:09:54 +0000 (13:09 -0700)]
bpo-36511: Add buildbot scripts and fix tests for Windows ARM32 buildbot (GH-13454)

5 years agobpo-37333: Ensure IncludeTkinter has a value (GH-14240)
Steve Dower [Wed, 19 Jun 2019 20:07:23 +0000 (13:07 -0700)]
bpo-37333: Ensure IncludeTkinter has a value (GH-14240)

5 years agobpo-37331: Clarify format of socket handler messages in the documentation. (GH-14234)
Vinay Sajip [Wed, 19 Jun 2019 14:29:57 +0000 (15:29 +0100)]
bpo-37331: Clarify format of socket handler messages in the documentation. (GH-14234)

5 years agobpo-37258: Not a bug, but added a unit test and updated documentation. (GH-14229)
Vinay Sajip [Wed, 19 Jun 2019 10:46:53 +0000 (11:46 +0100)]
bpo-37258: Not a bug, but added a unit test and updated documentation. (GH-14229)

5 years agobpo-36710: Remove PyImport_Cleanup() function (GH-14221)
Victor Stinner [Wed, 19 Jun 2019 08:36:10 +0000 (10:36 +0200)]
bpo-36710: Remove PyImport_Cleanup() function (GH-14221)

* Rename PyImport_Cleanup() to _PyImport_Cleanup() and move it to the
  internal C API. Add 'tstate' parameters.
* Remove documentation of _PyImport_Init(), PyImport_Cleanup(),
  _PyImport_Fini(). All three were documented as "For internal use
  only.".

5 years agoFix name of '\0'. (GH-14222)
Benjamin Peterson [Wed, 19 Jun 2019 04:37:58 +0000 (21:37 -0700)]
Fix name of '\0'. (GH-14222)

'\0' is the NUL byte not NULL.

5 years agobpo-36710: Add tstate parameter in import.c (GH-14218)
Victor Stinner [Wed, 19 Jun 2019 00:54:39 +0000 (02:54 +0200)]
bpo-36710: Add tstate parameter in import.c (GH-14218)

* Add 'tstate' parameter to many internal import.c functions.
* _PyImportZip_Init() now gets 'tstate' parameter rather than
  'interp'.
* Add 'interp' parameter to _PyState_ClearModules() and rename it
  to _PyInterpreterState_ClearModules().
* Move private _PyImport_FindBuiltin() to the internal C API; add
  'tstate' parameter to it.
* Remove private _PyImport_AddModuleObject() from the C API:
  use public PyImport_AddModuleObject() instead.
* Remove private _PyImport_FindExtensionObjectEx() from the C API:
  use private _PyImport_FindExtensionObject() instead.

5 years agoDocument typing.ForwardRef (GH-14216)
Ivan Levkivskyi [Wed, 19 Jun 2019 00:31:51 +0000 (01:31 +0100)]
Document typing.ForwardRef (GH-14216)

5 years agoDocument changes in PyNode_AddChild and PyParser_AddToken (GH-14214)
Ivan Levkivskyi [Wed, 19 Jun 2019 00:17:47 +0000 (01:17 +0100)]
Document changes in PyNode_AddChild and PyParser_AddToken (GH-14214)

I didn't find any entries in the docs about these functions, so I just mentioned them, in "What's New".

5 years agobpo-35134: Add Include/cpython/import.h header file (GH-14213)
Victor Stinner [Tue, 18 Jun 2019 22:48:09 +0000 (00:48 +0200)]
bpo-35134: Add Include/cpython/import.h header file (GH-14213)

* Add Include/cpython/import.h and Include/internal/pycore_import.h
  header files.
* Move _PyImport_ReInitLock() to the internal C API. Don't export the
  symbol anymore.

5 years agobpo-37325: Fix focus traversal for 2 IDLE dialogs (#14209)
Terry Jan Reedy [Tue, 18 Jun 2019 21:08:24 +0000 (17:08 -0400)]
bpo-37325: Fix focus traversal for 2 IDLE dialogs (#14209)

Tab now moves focus across and down for Help Source and Custom Run.

5 years agoAdd pganssle to CODEOWNERS and ACKS (GH-14138)
Paul Ganssle [Tue, 18 Jun 2019 18:57:45 +0000 (19:57 +0100)]
Add pganssle to CODEOWNERS and ACKS (GH-14138)

Also adds abalkin to CODEOWNERS for date and time related files.

5 years agobpo-34903: Document that some strptime formats only require 1 digit (GH-14149)
Mike Gleen [Tue, 18 Jun 2019 18:14:57 +0000 (19:14 +0100)]
bpo-34903: Document that some strptime formats only require 1 digit (GH-14149)

For datetime.datetime.strptime(), the leading zero for some two-digit formats is optional.

This adds a footnote to the strftime/strptime documentation to reflect this fact, and adds some tests to ensure that it is true.

bpo-34903

5 years agobpo-37151: remove _PyFunction_FastCallDict (GH-13864)
Jeroen Demeyer [Tue, 18 Jun 2019 11:05:41 +0000 (13:05 +0200)]
bpo-37151: remove _PyFunction_FastCallDict (GH-13864)

5 years agobpo-35360: Update macOS installer to use SQLite 3.28.0 (GH-14180)
animalize [Tue, 18 Jun 2019 09:25:19 +0000 (17:25 +0800)]
bpo-35360: Update macOS installer to use SQLite 3.28.0 (GH-14180)

5 years agobpo-37233: use _PY_FASTCALL_SMALL_STACK in method_vectorcall (GH-13974)
Jeroen Demeyer [Tue, 18 Jun 2019 08:56:53 +0000 (10:56 +0200)]
bpo-37233: use _PY_FASTCALL_SMALL_STACK in method_vectorcall (GH-13974)

5 years agobpo-37151: use PyVectorcall_Call for all calls of "method" (GH-13972)
Jeroen Demeyer [Tue, 18 Jun 2019 08:50:28 +0000 (10:50 +0200)]
bpo-37151: use PyVectorcall_Call for all calls of "method" (GH-13972)

5 years agobpo-35031: also disable TLS 1.3 for test_start_tls_server_1 on macOS (GH-14188)
Ned Deily [Tue, 18 Jun 2019 08:37:13 +0000 (04:37 -0400)]
bpo-35031: also disable TLS 1.3 for test_start_tls_server_1 on macOS (GH-14188)

5 years agobpo-34631: Updated OpenSSL to 1.1.1c in macOS installer (GH-14187)
Ned Deily [Tue, 18 Jun 2019 08:17:33 +0000 (04:17 -0400)]
bpo-34631: Updated OpenSSL to 1.1.1c in macOS installer (GH-14187)

5 years agoremove dead code (GH-14104)
David Carlier [Tue, 18 Jun 2019 06:36:34 +0000 (07:36 +0100)]
remove dead code (GH-14104)

default case ought to handle the "unexpected".

5 years agobpo-5680: IDLE: Customize running a module (GH-13763)
Cheryl Sabella [Tue, 18 Jun 2019 02:24:10 +0000 (22:24 -0400)]
bpo-5680: IDLE: Customize running a module (GH-13763)

The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.

5 years agoAdd sponsorship details for GitHub Sponsor button (GH-14181)
Brett Cannon [Tue, 18 Jun 2019 01:30:56 +0000 (18:30 -0700)]
Add sponsorship details for GitHub Sponsor button (GH-14181)

5 years agoImprove release build performance using new artifacts tasks (GH-14175)
Steve Dower [Mon, 17 Jun 2019 22:27:36 +0000 (15:27 -0700)]
Improve release build performance using new artifacts tasks (GH-14175)

5 years agobpo-37189: Export old PyRun_XXX() functions (#14142)
Victor Stinner [Mon, 17 Jun 2019 22:15:13 +0000 (00:15 +0200)]
bpo-37189: Export old PyRun_XXX() functions (#14142)

Many PyRun_XXX() functions like PyRun_String() were no longer
exported in libpython38.dll by mistake. Export them again to fix the
ABI compatibiliy.

5 years agoFix test_embed.test_pre_initialization_sys_options() env vars (GH-14172)
Victor Stinner [Mon, 17 Jun 2019 22:11:00 +0000 (00:11 +0200)]
Fix test_embed.test_pre_initialization_sys_options() env vars (GH-14172)

test_pre_initialization_sys_options() of test_embed now removes
PYTHON* environment variables like PYTHONWARNINGS.

5 years agobpo-37320: Remove openfp() of aifc, sunau and wave (GH-14169)
Victor Stinner [Mon, 17 Jun 2019 22:00:24 +0000 (00:00 +0200)]
bpo-37320: Remove openfp() of aifc, sunau and wave (GH-14169)

aifc.openfp() alias to aifc.open(), sunau.openfp() alias to
sunau.open(), and wave.openfp() alias to wave.open() have been
removed. They were deprecated since Python 3.7.

5 years ago bpo-37321: Edit IDLE subprocess connection error messages. (#14170)
Terry Jan Reedy [Mon, 17 Jun 2019 21:23:28 +0000 (17:23 -0400)]
 bpo-37321: Edit IDLE subprocess connection error messages. (#14170)

Mainly, add a doc reference to message in pyshell.

5 years agobpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678)
Tal Einat [Mon, 17 Jun 2019 19:41:00 +0000 (22:41 +0300)]
bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678)

Measure required height by quickly maximizing once per screen.
A search for a better method failed.

5 years agobpo-34631: Updated OpenSSL to 1.1.1c in Windows installer (GH-14163)
Steve Dower [Mon, 17 Jun 2019 18:36:08 +0000 (11:36 -0700)]
bpo-34631: Updated OpenSSL to 1.1.1c in Windows installer (GH-14163)

5 years agobpo-34556: Add --upgrade-deps to venv module (#13100)
Cooper Lees [Mon, 17 Jun 2019 18:18:14 +0000 (11:18 -0700)]
bpo-34556: Add --upgrade-deps to venv module (#13100)

Add --upgrade-deps to venv module
- This allows for pip + setuptools to be automatically upgraded to the latest version on PyPI
- Update documentation to represent this change

bpo-34556: Add --upgrade to venv module

5 years agobpo-37111: Add 'encoding' and 'errors' parameters to logging.basicCon… (GH-14008)
Vinay Sajip [Mon, 17 Jun 2019 16:40:52 +0000 (17:40 +0100)]
bpo-37111: Add 'encoding' and 'errors' parameters to logging.basicCon… (GH-14008)

5 years agobpo-37288: Fix Windows build when --no-tkinter is specified (GH-14096)
Paul Monson [Mon, 17 Jun 2019 15:21:28 +0000 (08:21 -0700)]
bpo-37288: Fix Windows build when --no-tkinter is specified (GH-14096)

5 years agobpo-37194: Add PyObject_CallNoArgs() rationale (GH-14159)
Victor Stinner [Mon, 17 Jun 2019 15:15:36 +0000 (17:15 +0200)]
bpo-37194: Add PyObject_CallNoArgs() rationale (GH-14159)

Explain in the doc why PyObject_CallNoArgs() should be preferred over
other existing ways to call a function without any arguments.

5 years agobpo-35431: Test math.comb() and math.perm() for OverflowError only on CPython. (GH...
Serhiy Storchaka [Mon, 17 Jun 2019 13:58:32 +0000 (16:58 +0300)]
bpo-35431: Test math.comb() and math.perm() for OverflowError only on CPython. (GH-14146)

Other implementation can raise MemoryError, but it can takes hours.

5 years agobpo-37315: Deprecate accepting floats in math.factorial(). (GH-14147)
Serhiy Storchaka [Mon, 17 Jun 2019 13:57:27 +0000 (16:57 +0300)]
bpo-37315: Deprecate accepting floats in math.factorial(). (GH-14147)

5 years agobpo-37194: Complete PyObject_CallXXX() docs (GH-14156)
Victor Stinner [Mon, 17 Jun 2019 12:58:10 +0000 (14:58 +0200)]
bpo-37194: Complete PyObject_CallXXX() docs (GH-14156)

Mention explicitly that PyObject_CallXXX() functions raise an
exception an failure.

5 years agobpo-37194: Add a new public PyObject_CallNoArgs() function (GH-13890)
Victor Stinner [Mon, 17 Jun 2019 12:27:23 +0000 (14:27 +0200)]
bpo-37194: Add a new public PyObject_CallNoArgs() function (GH-13890)

Add a new public PyObject_CallNoArgs() function to the C API: call a
callable Python object without any arguments.

It is the most efficient way to call a callback without any argument.
On x86-64, for example, PyObject_CallFunctionObjArgs(func, NULL)
allocates 960 bytes on the stack per call, whereas
PyObject_CallNoArgs(func) only allocates 624 bytes per call.

It is excluded from stable ABI 3.8.

Replace private _PyObject_CallNoArg() with public
PyObject_CallNoArgs() in C extensions: _asyncio, _datetime,
_elementtree, _pickle, _tkinter and readline.

5 years agobpo-37312: Remove _dummy_thread and dummy_threading modules (GH-14143)
Victor Stinner [Mon, 17 Jun 2019 12:18:43 +0000 (14:18 +0200)]
bpo-37312: Remove _dummy_thread and dummy_threading modules (GH-14143)

Remove _dummy_thread and dummy_threading modules. These modules
were deprecated since Python 3.7 which requires threading support.

5 years agobpo-36922: use Py_TPFLAGS_METHOD_DESCRIPTOR in lookup_maybe_method() (GH-13865)
Jeroen Demeyer [Mon, 17 Jun 2019 11:53:21 +0000 (13:53 +0200)]
bpo-36922: use Py_TPFLAGS_METHOD_DESCRIPTOR in lookup_maybe_method() (GH-13865)

5 years agobpo-37231: remove _PyObject_FastCall_Prepend (GH-14153)
Jeroen Demeyer [Mon, 17 Jun 2019 11:41:33 +0000 (13:41 +0200)]
bpo-37231: remove _PyObject_FastCall_Prepend (GH-14153)

5 years agobpo-35031, test_asycio: disable TLS 1.3 in test_start_tls_server_1() (GH-14148)
Victor Stinner [Mon, 17 Jun 2019 09:47:49 +0000 (11:47 +0200)]
bpo-35031, test_asycio: disable TLS 1.3 in test_start_tls_server_1() (GH-14148)

bpo-35031, bpo-35998: Reintroduce workaround on Windows and FreeBSD
in test_start_tls_server_1() of test_asyncio: disable TLS v1.3 on the
client context.

5 years agobpo-36688: Adding an implementation of RLock in _dummy_thread (GH-12943)
Joost Lek [Mon, 17 Jun 2019 08:10:17 +0000 (10:10 +0200)]
bpo-36688: Adding an implementation of RLock in _dummy_thread (GH-12943)

5 years agobpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051)
Zackery Spytz [Mon, 17 Jun 2019 07:17:14 +0000 (01:17 -0600)]
bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051)

On Windows, os.dup() no longer creates an inheritable fd when handling a
character file.

5 years agobpo-37220: Fix 2.7 test -R crash on Windows. (GH-13957)
Terry Jan Reedy [Sun, 16 Jun 2019 20:33:56 +0000 (16:33 -0400)]
bpo-37220: Fix 2.7 test -R crash on Windows. (GH-13957)

The patch needed for 2.7 should make the test more stable on 3.x also.

5 years agocloses bpo-37300: Remove unnecessary Py_XINCREF in classobject.c. (GH-14120)
Hai Shi [Sun, 16 Jun 2019 20:19:19 +0000 (04:19 +0800)]
closes bpo-37300: Remove unnecessary Py_XINCREF in classobject.c. (GH-14120)

5 years agobpo-28805: document METH_FASTCALL (GH-14079)
Jeroen Demeyer [Sun, 16 Jun 2019 17:03:23 +0000 (19:03 +0200)]
bpo-28805: document METH_FASTCALL (GH-14079)

5 years agoTurn math.isqrt assertion into a comment to clarify its purpose. (GH-14131)
Mark Dickinson [Sun, 16 Jun 2019 16:53:21 +0000 (17:53 +0100)]
Turn math.isqrt assertion into a comment to clarify its purpose. (GH-14131)

5 years agoSimplify negativity checks in math.comb and math.perm. (GH-13870)
Mark Dickinson [Sun, 16 Jun 2019 10:06:06 +0000 (11:06 +0100)]
Simplify negativity checks in math.comb and math.perm. (GH-13870)

5 years agoDoc: Remove an ugly space before a dot. (GH-14123)
Julien Palard [Sun, 16 Jun 2019 08:25:05 +0000 (10:25 +0200)]
Doc: Remove an ugly space before a dot. (GH-14123)

5 years agobpo-35922: Fix RobotFileParser when robots.txt has no relevant crawl delay or request...
Rémi Lapeyre [Sun, 16 Jun 2019 06:48:57 +0000 (08:48 +0200)]
bpo-35922: Fix RobotFileParser when robots.txt has no relevant crawl delay or request rate (GH-11791)

Co-Authored-By: Tal Einat <taleinat+github@gmail.com>
5 years agobpo-28009: Fix uuid SkipUnless logic to be based on platform programs capable of...
Michael Felt [Sat, 15 Jun 2019 15:52:29 +0000 (17:52 +0200)]
bpo-28009: Fix uuid SkipUnless logic to be based on platform programs capable of introspection (GH-12777)

uuid could try fallback methods that had no chance of working on a particular
platform, and this could cause spurious test failures, as well as degraded
performance as fallback options were tried and failed.

This fixes both the uuid module and its test's SkipUnless logic to use a
prefiltered list of techniques that may at least potentially work on that platform.

Patch by Michael Felt (aixtools).

5 years agobpo-37289: Remove 'if False' handling in the peephole optimizer (GH-14099)
Pablo Galindo [Sat, 15 Jun 2019 14:58:00 +0000 (15:58 +0100)]
bpo-37289: Remove 'if False' handling in the peephole optimizer (GH-14099)

5 years agoDoc: Deprecation header: More precise wording. (GH-14109)
Julien Palard [Sat, 15 Jun 2019 14:21:37 +0000 (16:21 +0200)]
Doc: Deprecation header: More precise wording. (GH-14109)

5 years agoUpdate link in colorsys docs to be https (GH-14062)
Alex Gaynor [Sat, 15 Jun 2019 14:09:36 +0000 (10:09 -0400)]
Update link in colorsys docs to be https (GH-14062)

5 years agoDoc: Bump Sphinx verison. (#13785)
Julien Palard [Sat, 15 Jun 2019 13:41:58 +0000 (15:41 +0200)]
Doc: Bump Sphinx verison. (#13785)

To reflect the one we're using in production.

5 years agoFix typo in Lib/concurrent/futures/thread.py (GH-13953)
ubordignon [Sat, 15 Jun 2019 11:43:10 +0000 (13:43 +0200)]
Fix typo in Lib/concurrent/futures/thread.py (GH-13953)

5 years agoUpdate weakref.rst (GH-14098)
Géry Ogam [Sat, 15 Jun 2019 11:33:23 +0000 (13:33 +0200)]
Update weakref.rst (GH-14098)

5 years agoUse threadpool for reading from file in sendfile fallback mode (#14076)
Andrew Svetlov [Sat, 15 Jun 2019 11:05:35 +0000 (14:05 +0300)]
Use threadpool for reading from file in sendfile fallback mode (#14076)

5 years agobpo-37279: Fix asyncio sendfile support when extra data are sent in fallback mode...
Andrew Svetlov [Sat, 15 Jun 2019 11:05:08 +0000 (14:05 +0300)]
bpo-37279: Fix asyncio sendfile support when  extra data are sent in fallback mode. (GH-14075)

5 years agobpo-36707: Document "m" removal from sys.abiflags (GH-14090)
Victor Stinner [Sat, 15 Jun 2019 01:24:41 +0000 (03:24 +0200)]
bpo-36707: Document "m" removal from sys.abiflags (GH-14090)

5 years agoFix Windows release build issues (GH-14091)
Steve Dower [Fri, 14 Jun 2019 21:19:25 +0000 (14:19 -0700)]
Fix Windows release build issues (GH-14091)

* Increase timeout for PGO builds in Windows release
* Fix test step failures
* Disable MinGW step properly
* Fix embeddable distro name

5 years agoDocument C API changes in What's New in Python 3.8 (GH-14092)
Victor Stinner [Fri, 14 Jun 2019 17:43:43 +0000 (19:43 +0200)]
Document C API changes in What's New in Python 3.8 (GH-14092)

5 years agobpo-35537: Rewrite setsid test for os.posix_spawn (GH-11721)
Victor Stinner [Fri, 14 Jun 2019 17:31:43 +0000 (19:31 +0200)]
bpo-35537: Rewrite setsid test for os.posix_spawn (GH-11721)

bpo-35537, bpo-35876: Fix also test_start_new_session() of
test_subprocess: use os.getsid() rather than os.getpgid().

5 years agobpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)
Victor Stinner [Fri, 14 Jun 2019 16:55:22 +0000 (18:55 +0200)]
bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)

In a subinterpreter, spawning a daemon thread now raises an
exception. Daemon threads were never supported in subinterpreters.
Previously, the subinterpreter finalization crashed with a Pyton
fatal error if a daemon thread was still running.

* Add _thread._is_main_interpreter()
* threading.Thread.start() now raises RuntimeError if the thread is a
  daemon thread and the method is called from a subinterpreter.
* The _thread module now uses Argument Clinic for the new function.
* Use textwrap.dedent() in test_threading.SubinterpThreadingTests

5 years agobpo-37261: Document sys.unraisablehook corner cases (GH-14059)
Victor Stinner [Fri, 14 Jun 2019 16:03:22 +0000 (18:03 +0200)]
bpo-37261: Document sys.unraisablehook corner cases (GH-14059)

Document reference cycle and resurrected objects issues in
sys.unraisablehook() and threading.excepthook() documentation.

Fix test.support.catch_unraisable_exception(): __exit__() no longer
ignores unraisable exceptions.

Fix test_io test_writer_close_error_on_close(): use a second
catch_unraisable_exception() to catch the BufferedWriter unraisable
exception.

5 years agobpo-19865: ctypes.create_unicode_buffer() supports non-BMP strings on Windows (GH...
Zackery Spytz [Fri, 14 Jun 2019 15:53:59 +0000 (09:53 -0600)]
bpo-19865: ctypes.create_unicode_buffer() supports non-BMP strings on Windows (GH-14081)

5 years agoImplement Windows release builds in Azure Pipelines (GH-14065)
Steve Dower [Fri, 14 Jun 2019 15:29:20 +0000 (08:29 -0700)]
Implement Windows release builds in Azure Pipelines (GH-14065)

5 years agobpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1() (GH-14080)
Andrew Svetlov [Fri, 14 Jun 2019 15:26:24 +0000 (18:26 +0300)]
bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1() (GH-14080)

5 years agoUpdate concurrent.futures.rst (GH-14061)
Géry Ogam [Fri, 14 Jun 2019 14:39:43 +0000 (16:39 +0200)]
Update concurrent.futures.rst (GH-14061)

This PR adds missing details in the [`concurrent.futures`](https://docs.python.org/3/library/concurrent.futures.html) documentation:

* the mention that `Future.cancel` also returns `False` if the call finished running;
* the mention of the states for `Future` that did not complete: pending or running.

5 years agobpo-37278: Fix test_asyncio ProactorLoopCtrlC (GH-14074)
Victor Stinner [Fri, 14 Jun 2019 11:02:51 +0000 (13:02 +0200)]
bpo-37278: Fix test_asyncio ProactorLoopCtrlC (GH-14074)

Join the thread to prevent leaking a running thread and leaking a
reference.

Cleanup also the test:

* asyncioWindowsProactorEventLoopPolicy became the default policy,
  there is no need to set it manually.
* Only start the thread once the loop is running.
* Use a shorter sleep in the thread (100 ms rather than 1 sec).
* Use close_loop(loop) rather than loop.close().
* Use longer variable names.

5 years agobpo-37249: add declaration of _PyObject_GetMethod (GH-14015)
Jeroen Demeyer [Fri, 14 Jun 2019 10:37:15 +0000 (12:37 +0200)]
bpo-37249: add declaration of _PyObject_GetMethod (GH-14015)

5 years agobpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)
Pablo Galindo [Fri, 14 Jun 2019 05:54:53 +0000 (06:54 +0100)]
bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)

Fix a regression introduced by af8646c8054d0f4180a2013383039b6a472f9698 that was causing code of the form:

if True and False:
   do_something()

to be optimized incorrectly, eliminating the block.

5 years agobpo-37077: Add native thread ID (TID) for AIX (GH-13624)
Michael Felt [Thu, 13 Jun 2019 22:34:46 +0000 (00:34 +0200)]
bpo-37077: Add native thread ID (TID) for AIX (GH-13624)

This is the followup  for issue36084

https://bugs.python.org/issue37077

5 years agobpo-36710: Pass explicitly tstate in sysmodule.c (GH-14060)
Victor Stinner [Thu, 13 Jun 2019 20:41:23 +0000 (22:41 +0200)]
bpo-36710: Pass explicitly tstate in sysmodule.c (GH-14060)

* Replace global var Py_VerboseFlag with interp->config.verbose.
* Add _PyErr_NoMemory(tstate) function.
* Add tstate parameter to _PyEval_SetCoroutineOriginTrackingDepth()
  and move the function to the internal API.
* Replace _PySys_InitMain(runtime, interp)
  with _PySys_InitMain(runtime, tstate).

5 years agobpo-37213: Handle negative line deltas correctly in the peephole optimizer (GH-13969)
Pablo Galindo [Thu, 13 Jun 2019 18:16:22 +0000 (19:16 +0100)]
bpo-37213: Handle negative line deltas correctly in the peephole optimizer (GH-13969)

The peephole optimizer was not optimizing correctly bytecode after negative deltas were introduced. This is due to the fact that some special values (255) were being searched for in both instruction pointer delta and line number deltas.

5 years agobpo-6689: os.path.commonpath raises ValueError for different drives isn't documented...
Makdon [Thu, 13 Jun 2019 13:59:49 +0000 (21:59 +0800)]
bpo-6689: os.path.commonpath raises ValueError for different drives isn't documented (GH-14045)

It would raise ValueError("Paths don't have the same drive") if the paths on different drivers, which is not documented.

os.path.commonpath raises ValueError when the *paths* are in different drivers, but it is not documented.
Update the document according @Windsooon 's suggestion.
It actually raise ValueError according line 355 of [test of path](https://github.com/python/cpython/blob/master/Lib/test/test_ntpath.py)

https://bugs.python.org/issue6689

5 years agobpo-37261: Fix support.catch_unraisable_exception() (GH-14052)
Victor Stinner [Thu, 13 Jun 2019 12:44:54 +0000 (14:44 +0200)]
bpo-37261: Fix support.catch_unraisable_exception() (GH-14052)

The __exit__() method of test.support.catch_unraisable_exception
context manager now ignores unraisable exception raised when clearing
self.unraisable attribute.

5 years agobpo-37210: Fix pure Python pickle when _pickle is unavailable (GH-14016)
Victor Stinner [Thu, 13 Jun 2019 11:58:51 +0000 (13:58 +0200)]
bpo-37210: Fix pure Python pickle when _pickle is unavailable (GH-14016)

Allow pure Python implementation of pickle to work
even when the C _pickle module is unavailable.

Fix test_pickle when _pickle is missing: declare PyPicklerHookTests
outside "if has_c_implementation:" block.

5 years agotbpo-36402: Fix threading.Thread._stop() (GH-14047)
Victor Stinner [Thu, 13 Jun 2019 10:06:24 +0000 (12:06 +0200)]
tbpo-36402: Fix threading.Thread._stop() (GH-14047)

Remove the _tstate_lock from _shutdown_locks, don't remove None.

5 years agobpo-37231: optimize calls of special methods (GH-13973)
Jeroen Demeyer [Thu, 13 Jun 2019 09:26:44 +0000 (11:26 +0200)]
bpo-37231: optimize calls of special methods (GH-13973)

5 years agobpo-37253: Remove PyAST_obj2mod_ex() function (GH-14020)
Victor Stinner [Thu, 13 Jun 2019 07:18:45 +0000 (09:18 +0200)]
bpo-37253: Remove PyAST_obj2mod_ex() function (GH-14020)

PyAST_obj2mod_ex() is similar to PyAST_obj2mod() with an additional
'feature_version' parameter which is unused.

5 years agobpo-35070: test_getgrouplist may fail on macOS if too many groups (GH-13071)
Jeffrey Kintscher [Thu, 13 Jun 2019 07:01:29 +0000 (00:01 -0700)]
bpo-35070: test_getgrouplist may fail on macOS if too many groups (GH-13071)

5 years agobpo-37216: update version to 3.9 in mac using document (GH-13966)
Makdon [Thu, 13 Jun 2019 05:04:13 +0000 (13:04 +0800)]
bpo-37216: update version to 3.9 in mac using document (GH-13966)

5 years agobpo-37257: obmalloc: stop simple arena thrashing (#14039)
Tim Peters [Thu, 13 Jun 2019 03:41:03 +0000 (22:41 -0500)]
bpo-37257:  obmalloc:  stop simple arena thrashing (#14039)

GH-14039:  allow (no more than) one wholly empty arena on the usable_arenas list.

This prevents thrashing in some easily-provoked simple cases that could end up creating and destroying an arena on each loop iteration in client code.   Intuitively, if the only arena on the list becomes empty, it makes scant sense to give it back to the system unless we know we'll never need another free pool again before another arena frees a pool.  If the latter obtains, then - yes - this will "waste" an arena.

5 years agoAdd 3.9 whatsnew file (GH-14040)
Ned Deily [Thu, 13 Jun 2019 03:31:45 +0000 (23:31 -0400)]
Add 3.9 whatsnew file (GH-14040)

5 years agobpo-37253: Fix typo in PyCompilerFlags doc (GH-14036)
Victor Stinner [Thu, 13 Jun 2019 00:17:14 +0000 (02:17 +0200)]
bpo-37253: Fix typo in PyCompilerFlags doc (GH-14036)

Remove ";" to fix Sphinx formatting.

5 years agobpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)
Victor Stinner [Thu, 13 Jun 2019 00:16:41 +0000 (02:16 +0200)]
bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)

Add a new _PyCompilerFlags_INIT macro to initialize PyCompilerFlags
variables, rather than initializing cf_flags and cf_feature_version
explicitly in each variable.

5 years agobpo-37253: Document PyCompilerFlags.cf_feature_version (GH-14019)
Victor Stinner [Thu, 13 Jun 2019 00:01:29 +0000 (02:01 +0200)]
bpo-37253: Document PyCompilerFlags.cf_feature_version (GH-14019)

* Update PyCompilerFlags structure documentation.
* Document the new cf_feature_version field in the Changes in the C
  API section of the What's New in Python 3.8 doc.

5 years agobpo-36402: Fix threading._shutdown() race condition (GH-13948)
Victor Stinner [Wed, 12 Jun 2019 23:30:17 +0000 (01:30 +0200)]
bpo-36402: Fix threading._shutdown() race condition (GH-13948)

Fix a race condition at Python shutdown when waiting for threads.
Wait until the Python thread state of all non-daemon threads get
deleted (join all non-daemon threads), rather than just wait until
Python threads complete.

* Add threading._shutdown_locks: set of Thread._tstate_lock locks
  of non-daemon threads used by _shutdown() to wait until all Python
  thread states get deleted. See Thread._set_tstate_lock().
* Add also threading._shutdown_locks_lock to protect access to
  threading._shutdown_locks.
* Add test_finalization_shutdown() test.

5 years agobpo-36779: time.tzname returns empty string on Windows if default cod… (GH-13073)
Paul Monson [Wed, 12 Jun 2019 23:13:27 +0000 (16:13 -0700)]
bpo-36779: time.tzname returns empty string on Windows if default cod… (GH-13073)

Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].

This causes time.tzname to be an empty string.
I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.

In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7

@zooba

https://bugs.python.org/issue36779

5 years agobpo-37069: regrtest uses sys.unraisablehook (GH-13759)
Victor Stinner [Wed, 12 Jun 2019 23:09:04 +0000 (01:09 +0200)]
bpo-37069: regrtest uses sys.unraisablehook (GH-13759)

regrtest now uses sys.unraisablehook() to mark a test as "environment
altered" (ENV_CHANGED) if it emits an "unraisable exception".
Moreover, regrtest logs a warning in this case.

Use "python3 -m test --fail-env-changed" to catch unraisable
exceptions in tests.

5 years agobpo-37223, test_io: silence last 'Exception ignored in:' (GH-14029)
Victor Stinner [Wed, 12 Jun 2019 21:57:11 +0000 (23:57 +0200)]
bpo-37223, test_io: silence last 'Exception ignored in:' (GH-14029)

Use catch_unraisable_exception() to ignore 'Exception ignored in:'
error when the internal BufferedWriter of the BufferedRWPair is
destroyed. The C implementation doesn't give access to the
internal BufferedWriter, so just ignore the warning instead.

5 years agoMake asyncio stream sendfile fail on error (was hang) (GH-14025)
Andrew Svetlov [Wed, 12 Jun 2019 18:50:23 +0000 (21:50 +0300)]
Make asyncio stream sendfile fail on error (was hang) (GH-14025)

5 years agobpo-37236: pragma optimize off for _Py_c_quot on Windows arm64 (GH-13983)
Paul Monson [Wed, 12 Jun 2019 18:08:40 +0000 (11:08 -0700)]
bpo-37236: pragma optimize off for _Py_c_quot on Windows arm64 (GH-13983)

5 years agobpo-37201: fix test_distutils failures for Windows ARM64 (GH-13902)
Paul Monson [Wed, 12 Jun 2019 17:16:49 +0000 (10:16 -0700)]
bpo-37201: fix test_distutils failures for Windows ARM64 (GH-13902)

5 years agobpo-37160: Thread native ID NetBSD support (GH-13835)
David Carlier [Wed, 12 Jun 2019 15:37:56 +0000 (15:37 +0000)]
bpo-37160: Thread native ID NetBSD support (GH-13835)

5 years agobpo-35545: Skip `test_asyncio.test_create_connection_ipv6_scope` on AIX (GH-14011)
Michael Felt [Wed, 12 Jun 2019 12:00:56 +0000 (14:00 +0200)]
bpo-35545: Skip `test_asyncio.test_create_connection_ipv6_scope` on AIX (GH-14011)

because "getaddrinfo()" behaves different on AIX

https://bugs.python.org/issue35545