]> granicus.if.org Git - python/log
python
5 years agobpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-16406)
Victor Stinner [Thu, 26 Sep 2019 02:01:49 +0000 (04:01 +0200)]
bpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-16406)

Explicitly preinitializes with a Python preconfiguration to avoid
Py_SetPath() implicit preinitialization with a compat
preconfiguration.

Fix also test_init_setpath() and test_init_setpythonhome() on macOS:
use self.test_exe as the executable (and base_executable), rather
than shutil.which('python3').

5 years agobpo-38234: Complete init config documentation (GH-16404)
Victor Stinner [Thu, 26 Sep 2019 01:15:07 +0000 (03:15 +0200)]
bpo-38234: Complete init config documentation (GH-16404)

5 years agobpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)
Victor Stinner [Thu, 26 Sep 2019 00:22:35 +0000 (02:22 +0200)]
bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)

* Add test_embed.test_init_setpath_config(): test Py_SetPath()
  with PyConfig.
* test_init_setpath() and test_init_setpythonhome() no longer call
  Py_SetProgramName(), but use the default program name.
* _PyPathConfig: isolated, site_import  and base_executable
  fields are now only available on Windows.
* If executable is set explicitly in the configuration, ignore
  calculated base_executable: _PyConfig_InitPathConfig() copies
  executable to base_executable.
* Complete path config documentation.

5 years agobpo-38142: Updated _hashopenssl.c to be PEP 384 compliant (#16071)
Christian Heimes [Wed, 25 Sep 2019 21:03:30 +0000 (23:03 +0200)]
bpo-38142: Updated _hashopenssl.c to be PEP 384 compliant (#16071)

* Updated _hashopenssl.c to be PEP 384 compliant
* Remove refleak test from test_hashlib. The updated type no longer accepts random arguments to __init__.

5 years agobpo-22273: Removed temporary test skipping on PPC platforms. (GH-16399)
Vinay Sajip [Wed, 25 Sep 2019 19:57:20 +0000 (20:57 +0100)]
bpo-22273: Removed temporary test skipping on PPC platforms. (GH-16399)

5 years agobpo-38271: encrypt private key test files with AES256 (GH-16385)
Christian Heimes [Wed, 25 Sep 2019 15:55:02 +0000 (17:55 +0200)]
bpo-38271: encrypt private key test files with AES256 (GH-16385)

The private keys for test_ssl were encrypted with 3DES in traditional
PKCS#5 format. 3DES and the digest algorithm of PKCS#5 are blocked by
some strict crypto policies. Use PKCS#8 format with AES256 encryption
instead.

Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue38271

Automerge-Triggered-By: @tiran
5 years agobpo-38005: Remove support of string argument in InterpreterID(). (GH-16227)
Serhiy Storchaka [Wed, 25 Sep 2019 15:35:57 +0000 (18:35 +0300)]
bpo-38005: Remove support of string argument in InterpreterID(). (GH-16227)

Make negative interpreter id to raise ValueError instead of RuntimeError.

5 years agobpo-38255: super() can search attributes as well as methods (GH-16368)
Raymond Hettinger [Wed, 25 Sep 2019 15:13:19 +0000 (08:13 -0700)]
bpo-38255: super() can search attributes as well as methods (GH-16368)

Improvement suggested by Géry Ogam.

5 years agobpo-38234: Fix test_embed pathconfig tests (GH-16390)
Victor Stinner [Wed, 25 Sep 2019 14:30:36 +0000 (16:30 +0200)]
bpo-38234: Fix test_embed pathconfig tests (GH-16390)

bpo-38234: On macOS and FreeBSD, the temporary directory can be
symbolic link. For example, /tmp can be a symbolic link to /var/tmp.
Call realpath() to resolve all symbolic links.

5 years agobpo-38270: Check for hash digest algorithms and avoid MD5 (GH-16382)
Christian Heimes [Wed, 25 Sep 2019 14:30:20 +0000 (16:30 +0200)]
bpo-38270: Check for hash digest algorithms and avoid MD5 (GH-16382)

Make it easier to run and test Python on systems with restrict crypto policies:

* add requires_hashdigest to test.support to check if a hash digest algorithm is available and working
* avoid MD5 in test_hmac
* replace MD5 with SHA256 in test_tarfile
* mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5

https://bugs.python.org/issue38270

5 years agobpo-22273: Re-enabled ctypes test on ARM machines. (GH-16388)
Vinay Sajip [Wed, 25 Sep 2019 14:05:55 +0000 (15:05 +0100)]
bpo-22273: Re-enabled ctypes test on ARM machines. (GH-16388)

5 years agobpo-36046: posix_spawn() doesn't support uid/gid (GH-16384)
Victor Stinner [Wed, 25 Sep 2019 13:52:49 +0000 (15:52 +0200)]
bpo-36046: posix_spawn() doesn't support uid/gid (GH-16384)

* subprocess.Popen now longer uses posix_spawn() if uid, gid or gids are set.
* test_subprocess: add "nobody" and "nfsnobody" group names for test_group().
* test_subprocess: test_user() and test_group() are now also tested with close_fds=False.

5 years agobpo-37064: Add option -a to pathfix.py tool (GH-15717)
PatrikKopkan [Wed, 25 Sep 2019 12:26:28 +0000 (14:26 +0200)]
bpo-37064: Add option -a to pathfix.py tool (GH-15717)

Add option -a to Tools/Scripts/pathfix.py script: add flags.

5 years agobpo-38140: Document offsets in PyMemberDef (GH-16354)
Petr Viktorin [Wed, 25 Sep 2019 11:06:16 +0000 (13:06 +0200)]
bpo-38140: Document offsets in PyMemberDef (GH-16354)

bpo-38140: Document offsets in PyMemberDef

Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
5 years agobpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)
Yury Selivanov [Wed, 25 Sep 2019 10:32:08 +0000 (03:32 -0700)]
bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)

5 years agoChanged conditions for ctypes array-in-struct handling. (GH-16381)
Vinay Sajip [Wed, 25 Sep 2019 10:11:57 +0000 (11:11 +0100)]
Changed conditions for ctypes array-in-struct handling. (GH-16381)

5 years agobpo-38260: Add Docs on asyncio.run (GH-16337)
Emmanuel Arias [Wed, 25 Sep 2019 08:53:49 +0000 (05:53 -0300)]
bpo-38260: Add Docs on asyncio.run (GH-16337)

Add docs about return and raise exception on asyncio.run

https://bugs.python.org/issue38260

Automerge-Triggered-By: @asvetlov
5 years agobpo-22273: Disabled tests while investigating buildbot failures on ARM7L/PPC64. ...
Vinay Sajip [Wed, 25 Sep 2019 06:58:32 +0000 (07:58 +0100)]
bpo-22273: Disabled tests while investigating buildbot failures on ARM7L/PPC64. (GH-16377)

5 years agobpo-38219: Optimize dict creating and updating by a dict. (GH-16268)
Serhiy Storchaka [Wed, 25 Sep 2019 06:47:00 +0000 (09:47 +0300)]
bpo-38219: Optimize dict creating and updating by a dict. (GH-16268)

5 years agobpo-38265: Update os.pread to accept the length type as Py_ssize_t. (GH-16359)
Dong-hee Na [Wed, 25 Sep 2019 05:47:04 +0000 (14:47 +0900)]
bpo-38265: Update os.pread to accept the length type as Py_ssize_t. (GH-16359)

5 years agobpo-22273: Update ctypes to correctly handle arrays in small structur… (GH-15839)
Vinay Sajip [Wed, 25 Sep 2019 03:38:44 +0000 (04:38 +0100)]
bpo-22273: Update ctypes to correctly handle arrays in small structur… (GH-15839)

5 years agobpo-38234: Cleanup getpath.c (GH-16367)
Victor Stinner [Wed, 25 Sep 2019 00:54:25 +0000 (02:54 +0200)]
bpo-38234: Cleanup getpath.c (GH-16367)

* search_for_prefix() directly calls reduce() if found is greater
  than 0.
* Add calculate_pybuilddir() subfunction.
* search_for_prefix(): add path string buffer for readability.
* Fix some error handling code paths: release resources on error.
* calculate_read_pyenv(): rename tmpbuffer to filename.
* test.pythoninfo now also logs windows.dll_path

5 years agobpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366)
Victor Stinner [Wed, 25 Sep 2019 00:10:35 +0000 (02:10 +0200)]
bpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366)

Add test_init_pybuilddir() and test_init_pyvenv_cfg() to test_embed
to test pyvenv.cfg and pybuilddir.txt configuration files.

Fix sysconfig._generate_posix_vars(): pybuilddir.txt uses UTF-8
encoding, not ASCII.

5 years agobpo-36871: Avoid duplicated 'Actual:' in assertion message (GH-16361)
Samuel Freilich [Tue, 24 Sep 2019 22:04:29 +0000 (18:04 -0400)]
bpo-36871: Avoid duplicated 'Actual:' in assertion message (GH-16361)

Fixes an issue caught after merge of PR 16005.

Tightened test assertions to check the entire assertion message.

5 years agobpo-36871: Handle spec errors in assert_has_calls (GH-16005)
Samuel Freilich [Tue, 24 Sep 2019 19:08:31 +0000 (15:08 -0400)]
bpo-36871: Handle spec errors in assert_has_calls (GH-16005)

The fix in PR 13261 handled the underlying issue about the spec for specific methods not being applied correctly, but it didn't fix the issue that was causing the misleading error message.

The code currently grabs a list of responses from _call_matcher (which may include exceptions). But it doesn't reach inside the list when checking if the result is an exception. This results in a misleading error message when one of the provided calls does not match the spec.

https://bugs.python.org/issue36871

Automerge-Triggered-By: @gpshead
5 years agobpo-38234: Add tests for Python init path config (GH-16358)
Victor Stinner [Tue, 24 Sep 2019 16:21:02 +0000 (18:21 +0200)]
bpo-38234: Add tests for Python init path config (GH-16358)

5 years agobpo-38234: Py_SetPath() uses the program full path (GH-16357)
Victor Stinner [Tue, 24 Sep 2019 15:44:15 +0000 (17:44 +0200)]
bpo-38234: Py_SetPath() uses the program full path (GH-16357)

Py_SetPath() now sets sys.executable to the program full path
(Py_GetProgramFullPath()), rather than to the program name
(Py_GetProgramName()).

Fix also memory leaks in pathconfig_set_from_config().

5 years agobpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
Victor Stinner [Tue, 24 Sep 2019 12:19:48 +0000 (14:19 +0200)]
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)

Multiprocessing test test_mymanager() now also expects -SIGTERM, not
only exitcode 0.

bpo-30356: BaseManager._finalize_manager() sends SIGTERM to the
manager process if it takes longer than 1 second to stop, which
happens on slow buildbots.

5 years agobpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)
Victor Stinner [Tue, 24 Sep 2019 10:47:49 +0000 (12:47 +0200)]
bpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)

Multiprocessing tests: increase test_queue_feeder_donot_stop_onexc()
timeout from 1 to 60 seconds.

5 years agobpo-38136: Updates await_count and call_count to be different things (GH-16192)
Lisa Roach [Tue, 24 Sep 2019 03:49:40 +0000 (20:49 -0700)]
bpo-38136: Updates await_count and call_count to be different things (GH-16192)

5 years agocloses bpo-16637: libpython: construct integer object directly from gdbvalue (GH...
Marc Hartmayer [Tue, 24 Sep 2019 03:34:12 +0000 (05:34 +0200)]
closes bpo-16637: libpython: construct integer object directly from gdbvalue (GH-15232)

This fixes the exception '`ValueError: invalid literal for int() with base 10`
if `str(gdbval)` returns a hexadecimal value (e.g. '0xa0'). This is the case if
the output-radix is set to 16 in gdb. See
https://sourceware.org/gdb/onlinedocs/gdb/Numbers.html for more information.

5 years agocloses bpo-38253: Fix typo of Py_SET_ERANGE_IF_OVERFLOW in pyport.h. (GH-16230)
Hai Shi [Tue, 24 Sep 2019 02:20:47 +0000 (21:20 -0500)]
closes bpo-38253: Fix typo of Py_SET_ERANGE_IF_OVERFLOW in pyport.h. (GH-16230)

5 years agobpo-38234: read_pth_file() now returns PyStatus (GH-16338)
Victor Stinner [Mon, 23 Sep 2019 22:55:48 +0000 (00:55 +0200)]
bpo-38234: read_pth_file() now returns PyStatus (GH-16338)

Refactor path configuration code:

* read_pth_file() now returns PyStatus to report errors, rather than
  calling Py_FatalError().
* Move argv0_path and zip_path buffers out of PyCalculatePath
  structures.
* On Windows, _PyPathConfig.home is now preferred over PyConfig.home.

5 years agobpo-38234: Fix _PyConfig_InitPathConfig() (GH-16335)
Victor Stinner [Mon, 23 Sep 2019 16:47:29 +0000 (18:47 +0200)]
bpo-38234: Fix _PyConfig_InitPathConfig() (GH-16335)

* _PyConfig_InitPathConfig() now starts by copying the global path
  configuration, and then override values set in PyConfig.
* _PyPathConfig_Calculate() implementations no longer override
  _PyPathConfig fields which are already computed. For example,
  if _PyPathConfig.prefix is not NULL, leave it unchanged.
* If Py_SetPath() has been called, _PyConfig_InitPathConfig() doesn't
  call _PyPathConfig_Calculate() anymore.
* _PyPathConfig_Calculate() no longer uses PyConfig,
  except to initialize PyCalculatePath structure.
* pathconfig_calculate(): remove useless temporary
  "_PyPathConfig new_config" variable.
* calculate_module_search_path(): remove hack to workaround memory
  allocation failure, call Py_FatalError() instead.
* Fix get_program_full_path(): handle memory allocation failure.

5 years agobpo-38236: Fix init_dump_ascii_wstr() (GH-16333)
Victor Stinner [Mon, 23 Sep 2019 13:35:46 +0000 (15:35 +0200)]
bpo-38236: Fix init_dump_ascii_wstr() (GH-16333)

Add missing "return;" (to not dereference NULL pointer).

5 years agobpo-38236: Dump path config at first import error (GH-16300)
Victor Stinner [Mon, 23 Sep 2019 12:45:47 +0000 (14:45 +0200)]
bpo-38236: Dump path config at first import error (GH-16300)

Python now dumps path configuration if it fails to import the Python
codecs of the filesystem and stdio encodings.

5 years agobpo-38209: Simplify dataclasses.InitVar by using __class_getitem__(). (GH-16255)
Serhiy Storchaka [Sun, 22 Sep 2019 10:32:41 +0000 (13:32 +0300)]
bpo-38209: Simplify dataclasses.InitVar by using __class_getitem__(). (GH-16255)

5 years agoUpdated incorrect level-setting code to use setLevel(). (GH-16325)
Vinay Sajip [Sun, 22 Sep 2019 02:51:51 +0000 (03:51 +0100)]
Updated incorrect level-setting code to use setLevel(). (GH-16325)

5 years agoShorter docstring (GH-16322)
Raymond Hettinger [Sat, 21 Sep 2019 19:57:44 +0000 (12:57 -0700)]
Shorter docstring (GH-16322)

5 years agoDoc: Add whatsnew entry for loop.shutdown_default_executor() (GH-16308)
Kyle Stanley [Sat, 21 Sep 2019 06:18:40 +0000 (02:18 -0400)]
Doc: Add whatsnew entry for loop.shutdown_default_executor() (GH-16308)

5 years agoDoc: Fix spelling errors of 'initial' in enum.py (GH-16314)
HongWeipeng [Sat, 21 Sep 2019 05:22:54 +0000 (13:22 +0800)]
Doc: Fix spelling errors of 'initial' in enum.py (GH-16314)

5 years agoMinor code and comment cleanup (GH-16315)
Raymond Hettinger [Sat, 21 Sep 2019 04:46:52 +0000 (21:46 -0700)]
Minor code and comment cleanup (GH-16315)

5 years agobpo-38237: Make pow's arguments have more descriptive names and be keyword passable...
Ammar Askar [Sat, 21 Sep 2019 04:28:49 +0000 (00:28 -0400)]
bpo-38237: Make pow's arguments have more descriptive names and be keyword passable (GH-16302)

Edit: `math.pow` changes removed on Mark's request.

https://bugs.python.org/issue38237

Automerge-Triggered-By: @rhettinger
5 years agobpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298)
Victor Stinner [Fri, 20 Sep 2019 23:50:16 +0000 (01:50 +0200)]
bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298)

* If Py_SetPath() has been called, _PyConfig_InitPathConfig() now
  uses its value.
* Py_Initialize() now longer copies path configuration from PyConfig
  to the global path configuration (_Py_path_config).

5 years agoDoc: Remove provisional note for asyncio.run() (GH-16310)
Kyle Stanley [Fri, 20 Sep 2019 23:46:21 +0000 (19:46 -0400)]
Doc: Remove provisional note for asyncio.run() (GH-16310)

Based on a comment from @asvetlov https://github.com/python/cpython/pull/15735#discussion_r323619076, this removes the provisional note for ``asyncio.run()`` in the documentation.

Automerge-Triggered-By: @1st1
5 years agobpo-38234: Remove _PyPathConfig.dll_path (GH-16307)
Victor Stinner [Fri, 20 Sep 2019 23:02:56 +0000 (01:02 +0200)]
bpo-38234: Remove _PyPathConfig.dll_path (GH-16307)

The DLL path is not computed from any user configuration and cannot
be configured by PyConfig. Instead, add a new _Py_dll_path global variable.

Remove _PyConfig_SetPathConfig(): replaced with _PyPathConfig_Init().

Py_Initialize() now longer sets the "global path configuration",
but only initialize _Py_dll_path.

5 years agobpo-38205: Py_UNREACHABLE() calls Py_FatalError() (GH-16290)
Victor Stinner [Fri, 20 Sep 2019 21:10:16 +0000 (23:10 +0200)]
bpo-38205: Py_UNREACHABLE() calls Py_FatalError() (GH-16290)

5 years agobpo-33694: Remove test_asyncio ProactorDatagramTransportTests (GH-16288)
Victor Stinner [Fri, 20 Sep 2019 21:07:59 +0000 (23:07 +0200)]
bpo-33694: Remove test_asyncio ProactorDatagramTransportTests (GH-16288)

ProactorDatagramTransportTests tests are too close to the
implementation.

5 years agobpo-6559: Update _posixsubprocess.fork_exec doc (GH-16283)
Orivej Desh [Fri, 20 Sep 2019 17:01:10 +0000 (17:01 +0000)]
bpo-6559: Update _posixsubprocess.fork_exec doc (GH-16283)

It did not list the argument added in d4cc7bf993eda4149a05ed25f2f33e18e43fd7c1.

https://bugs.python.org/issue6559

Automerge-Triggered-By: @gpshead
5 years agobpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439)
Ram Rachum [Fri, 20 Sep 2019 15:19:02 +0000 (18:19 +0300)]
bpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439)

Mention frame.f_trace in sys.settrace docs, as well as the fact you still
need to call `sys.settrace` to enable the tracing machinery before setting
`frame.f_trace` will have any effect.

5 years agobpo-37353: Updated parser note about source code compatibility(GH-14277)
Prateek Nayak [Fri, 20 Sep 2019 13:55:26 +0000 (19:25 +0530)]
bpo-37353: Updated parser note about source code compatibility(GH-14277)

5 years agobpo-38093: Correctly returns AsyncMock for async subclasses. (GH-15947)
Lisa Roach [Fri, 20 Sep 2019 04:04:18 +0000 (21:04 -0700)]
bpo-38093: Correctly returns AsyncMock for async subclasses. (GH-15947)

5 years agobpo-34002: Minor efficiency and clarity improvements in email package. (GH-7999)
Michael Selik [Fri, 20 Sep 2019 03:25:55 +0000 (20:25 -0700)]
bpo-34002: Minor efficiency and clarity improvements in email package. (GH-7999)

* Check intersection of two sets explicitly

Comparing ``len(a) > ``len(a - b)`` is essentially looking for an
intersection between the two sets. If set ``b`` does not intersect ``a``
then ``len(a - b)`` will be equal to ``len(a)``. This logic is more
clearly expressed as ``a & b``.

* Change while/pop to a for-loop

Copying the list, then repeatedly popping the first element was
unnecessarily slow. I also cleaned up a couple other inefficiencies.
There's no need to unpack a tuple, then re-pack and append it. The list
can be created with the first element instead of empty. Secondly, the
``endswith`` method returns a bool, so there's no need for an if-
statement to set ``encoding`` to True or False.

* Use set.intersection to check for intersections

``a.intersection(b)`` method is more clear of purpose than ``not
a.isdisjoint(b)`` and avoids an unnecessary set construction that ``a &
set(b)`` performs.

* Use not isdisjoint instead of intersection

While it reads slightly worse, the isdisjoint method will stop when it
finds a counterexample and returns a bool, rather than looping over the
entire iterable and constructing a new set.

5 years agobpo-38140: Make dict and weakref offsets opaque for C heap types (#16076)
Eddie Elizondo [Thu, 19 Sep 2019 16:29:05 +0000 (09:29 -0700)]
bpo-38140: Make dict and weakref offsets opaque for C heap types (#16076)

* Make dict and weakref offsets opaque for C heap types

* Add news

5 years agobpo-34037: test_asyncio uses shutdown_default_executor() (GH-16284)
Victor Stinner [Thu, 19 Sep 2019 14:45:06 +0000 (16:45 +0200)]
bpo-34037: test_asyncio uses shutdown_default_executor() (GH-16284)

5 years agobpo-37531: Skip test_regrtest.test_multiprocessing_timeout() on all platforms (GH...
Victor Stinner [Thu, 19 Sep 2019 14:38:13 +0000 (16:38 +0200)]
bpo-37531: Skip test_regrtest.test_multiprocessing_timeout() on all platforms (GH-16282)

5 years agobpo-38155: Add __all__ to datetime module (GH-16203)
t k [Thu, 19 Sep 2019 13:34:41 +0000 (09:34 -0400)]
bpo-38155: Add __all__ to datetime module (GH-16203)

https://bugs.python.org/issue38155

5 years agobpo-34037: Fix test_asyncio failure and add loop.shutdown_default_executor() (GH...
Kyle Stanley [Thu, 19 Sep 2019 12:47:22 +0000 (08:47 -0400)]
bpo-34037: Fix test_asyncio failure and add loop.shutdown_default_executor() (GH-15735)

5 years agoDoc: Clarify dict equality irrespective of ordering. (GH-16266)
toonarmycaptain [Thu, 19 Sep 2019 05:51:24 +0000 (00:51 -0500)]
Doc: Clarify dict equality irrespective of ordering. (GH-16266)

5 years agoDoc: Corrected syntax for return annotation (GH-16265)
Jason Plurad [Thu, 19 Sep 2019 05:24:29 +0000 (01:24 -0400)]
Doc: Corrected syntax for return annotation (GH-16265)

Signed-off-by: Jason Plurad <pluradj@us.ibm.com>
5 years agobpo-35696: Simplify long_compare() (GH-16146)
HongWeipeng [Wed, 18 Sep 2019 15:10:15 +0000 (23:10 +0800)]
bpo-35696: Simplify long_compare() (GH-16146)

5 years agoFix _PyTraceMalloc_Fini() definition (GH-16259)
Victor Stinner [Wed, 18 Sep 2019 12:39:20 +0000 (14:39 +0200)]
Fix _PyTraceMalloc_Fini() definition (GH-16259)

The function return type is void, not int.

5 years agobpo-38203: faulthandler.dump_traceback_later() is always available (GH-16249)
Victor Stinner [Wed, 18 Sep 2019 12:15:10 +0000 (14:15 +0200)]
bpo-38203: faulthandler.dump_traceback_later() is always available (GH-16249)

dump_traceback_later() and cancel_dump_traceback_later() functions of
the faulthandler module are always available since Python 3.7.

5 years agobpo-38203: regrtest: put a 2 min timeout on Python exit (GH-16250)
Victor Stinner [Wed, 18 Sep 2019 06:29:25 +0000 (08:29 +0200)]
bpo-38203: regrtest: put a 2 min timeout on Python exit (GH-16250)

5 years agobpo-36546: No longer a need to make "data" positional only (GH-16252)
Raymond Hettinger [Wed, 18 Sep 2019 03:45:05 +0000 (20:45 -0700)]
bpo-36546: No longer a need to make "data" positional only (GH-16252)

5 years agobpo-37531: Skip test_regrtest.test_multiprocessing_timeout() on Windows (GH-16247)
Victor Stinner [Tue, 17 Sep 2019 23:58:29 +0000 (01:58 +0200)]
bpo-37531: Skip test_regrtest.test_multiprocessing_timeout() on Windows (GH-16247)

It is a known and tracked bug: disable the test until it's fixed.

5 years agobpo-38070: Py_FatalError() logs runtime state (GH-16246)
Victor Stinner [Tue, 17 Sep 2019 23:35:33 +0000 (01:35 +0200)]
bpo-38070: Py_FatalError() logs runtime state (GH-16246)

5 years agobpo-38070: Add _PyRuntimeState.preinitializing (GH-16245)
Victor Stinner [Tue, 17 Sep 2019 21:59:51 +0000 (23:59 +0200)]
bpo-38070: Add _PyRuntimeState.preinitializing (GH-16245)

Add _PyRuntimeState.preinitializing field: set to 1 while
Py_PreInitialize() is running.

_PyRuntimeState: rename also pre_initialized field to preinitialized.

5 years agobpo-38070: Enhance _PyObject_Dump() (GH-16243)
Victor Stinner [Tue, 17 Sep 2019 21:36:28 +0000 (23:36 +0200)]
bpo-38070: Enhance _PyObject_Dump() (GH-16243)

_PyObject_Dump() now dumps the object address for freed objects and
objects with ob_type=NULL.

5 years agobpo-38070: _Py_DumpTraceback() writes <no Python frame> (GH-16244)
Victor Stinner [Tue, 17 Sep 2019 21:36:16 +0000 (23:36 +0200)]
bpo-38070: _Py_DumpTraceback() writes <no Python frame> (GH-16244)

When a Python thread has no frame, _Py_DumpTraceback() and
_Py_DumpTracebackThreads() now write "<no Python frame>", rather than
writing nothing.

5 years agobpo-38191: Turn warnings into errors in NamedTuple() and TypedDict(). (GH-16238)
Serhiy Storchaka [Tue, 17 Sep 2019 19:41:55 +0000 (22:41 +0300)]
bpo-38191: Turn warnings into errors in NamedTuple() and TypedDict(). (GH-16238)

5 years agobpo-38191: Accept arbitrary keyword names in NamedTuple() and TypedDict(). (GH-16222)
Serhiy Storchaka [Tue, 17 Sep 2019 18:22:00 +0000 (21:22 +0300)]
bpo-38191: Accept arbitrary keyword names in NamedTuple() and TypedDict(). (GH-16222)

This includes such names as "cls", "self", "typename", "_typename",
"fields" and "_fields".
Passing positional arguments by keyword is deprecated.

5 years agobpo-37904: Edition on python tutorial - section 4 (GH-16169)
Diego Alberto Barriga Martínez [Tue, 17 Sep 2019 16:57:55 +0000 (11:57 -0500)]
bpo-37904: Edition on python tutorial - section 4 (GH-16169)

A little change on first paragraph of python tutorial to be more clearly

https://bugs.python.org/issue37904

Automerge-Triggered-By: @ericvsmith
5 years agobpo-38187: Fix reference leak in test_tools (GH-16233)
Pablo Galindo [Tue, 17 Sep 2019 16:04:46 +0000 (17:04 +0100)]
bpo-38187: Fix reference leak in test_tools (GH-16233)

5 years agobpo-38013: make async_generator_athrow object tolerant to throwing exceptions (GH...
Andrew Svetlov [Tue, 17 Sep 2019 12:59:49 +0000 (15:59 +0300)]
bpo-38013: make async_generator_athrow object tolerant to throwing exceptions (GH-16070)

Even when the helper is not started yet.

This behavior follows conventional generator one.
There is no reason for `async_generator_athrow` to handle `gen.throw()` differently.

https://bugs.python.org/issue38013

5 years agobpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)
Abraham Toriz Cruz [Tue, 17 Sep 2019 11:16:08 +0000 (06:16 -0500)]
bpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)

In the format string for assert_called the evaluation order is incorrect and hence for mock's without name, 'None' is printed whereas it should be 'mock' like for other messages. The error message is ("Expected '%s' to have been called." % self._mock_name or 'mock').

5 years agoDoc: Fix grammar/spelling in ssl.VERIFY_CRL_CHECK_LEAF docs (GH-16221)
Jörn Heissler [Tue, 17 Sep 2019 10:42:30 +0000 (12:42 +0200)]
Doc: Fix grammar/spelling in ssl.VERIFY_CRL_CHECK_LEAF docs (GH-16221)

5 years agobpo-37531: regrtest main process uses shorter timeout (GH-16220)
Victor Stinner [Tue, 17 Sep 2019 08:08:19 +0000 (10:08 +0200)]
bpo-37531: regrtest main process uses shorter timeout (GH-16220)

When using multiprocesss (-jN), the main process now uses a timeout
of 60 seconds instead of the double of the --timeout value. The
buildbot server stops a job which does not produce any output in 1200
seconds.

5 years agobpo-38192: Fix remaining passing of "loop" in the protocol examples (GH-16202)
Hrvoje Nikšić [Tue, 17 Sep 2019 07:16:43 +0000 (09:16 +0200)]
bpo-38192: Fix remaining passing of "loop" in the protocol examples (GH-16202)

See https://bugs.python.org/issue38192 .

https://bugs.python.org/issue38192

5 years agobpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH...
Serhiy Storchaka [Tue, 17 Sep 2019 06:20:56 +0000 (09:20 +0300)]
bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190)

5 years agobpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)
Terry Jan Reedy [Tue, 17 Sep 2019 06:05:04 +0000 (02:05 -0400)]
bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)

One happens when EditorWindow.close is called twice.
Printing a traceback, when IDLE is run from a terminal,
is useless and annoying.

5 years agoDoc: Add list(dict) in stdtypes library (GH-16209)
Adorilson Bezerra [Tue, 17 Sep 2019 04:57:14 +0000 (01:57 -0300)]
Doc: Add list(dict) in stdtypes library (GH-16209)

5 years agobpo-38183: Test_idle ignores user config directory GH-16198)
Terry Jan Reedy [Mon, 16 Sep 2019 23:04:21 +0000 (19:04 -0400)]
bpo-38183: Test_idle ignores user config directory GH-16198)

It no longer tries to create or access .idlerc or any files within.
Users must run IDLE to discover problems with saving settings.

5 years agobpo-28556: Update the opening note in typing docs (GH-16204)
Ivan Levkivskyi [Mon, 16 Sep 2019 22:04:06 +0000 (23:04 +0100)]
bpo-28556: Update the opening note in typing docs (GH-16204)

This PR replaces the old note mentioning that `typing` is a provisional module with a new one mentioning types are not enforced at runtime. I am not sure if there was any official announcement about making `typing` non-provisional, but _de-facto_ no new features were added during Python 3.7, and no backwards incompatible changes were made except for few small things that were considered bugs.

5 years agobpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)
Christian Heimes [Mon, 16 Sep 2019 19:10:05 +0000 (21:10 +0200)]
bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)

``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``.

https://bugs.python.org/issue33936

5 years agoDoc: Fix Wikipedia link for functools.lru_cache (GH-16183)
amist [Mon, 16 Sep 2019 18:36:14 +0000 (21:36 +0300)]
Doc: Fix Wikipedia link for functools.lru_cache (GH-16183)

5 years agobpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)
Serhiy Storchaka [Mon, 16 Sep 2019 17:15:18 +0000 (20:15 +0300)]
bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)

5 years agobpo-38100: Fix spelling error in unittest.mock code (GH-16168)
marcoramirezmx [Mon, 16 Sep 2019 16:34:46 +0000 (11:34 -0500)]
bpo-38100: Fix spelling error in unittest.mock code (GH-16168)

5 years agoDoc: Add link of GNU Readline library to interpreter tutorial (GH-16152)
Adorilson Bezerra [Mon, 16 Sep 2019 16:18:04 +0000 (13:18 -0300)]
Doc: Add link of GNU Readline library to interpreter tutorial (GH-16152)

5 years agobpo-38081: Add more non-fatal error codes for ntpath.realpath (GH-16156)
Steve Dower [Mon, 16 Sep 2019 14:25:11 +0000 (15:25 +0100)]
bpo-38081: Add more non-fatal error codes for ntpath.realpath (GH-16156)

5 years agobpo-38117: Update bundled Windows OpenSSL to 1.1.1d (GH-16184)
Steve Dower [Mon, 16 Sep 2019 14:21:16 +0000 (15:21 +0100)]
bpo-38117: Update bundled Windows OpenSSL to 1.1.1d (GH-16184)

5 years agoDoc: remove duplicate word in controlflow tutorial (GH-16163)
Adorilson Bezerra [Mon, 16 Sep 2019 07:04:58 +0000 (04:04 -0300)]
Doc: remove duplicate word in controlflow tutorial (GH-16163)

5 years agoFix a possbile refleak in setint() of mmapmodule.c (GH-16136)
Hai Shi [Mon, 16 Sep 2019 05:56:57 +0000 (00:56 -0500)]
Fix a possbile refleak in setint() of mmapmodule.c (GH-16136)

5 years agobpo-38117: Updated OpenSSL to 1.1.1d in macOS installer. (GH-16170)
Ned Deily [Mon, 16 Sep 2019 02:38:27 +0000 (03:38 +0100)]
bpo-38117: Updated OpenSSL to 1.1.1d in macOS installer. (GH-16170)

5 years agobpo-38178: Don't explicitly pass "loop" to EchoClientProtocol. (GH-16159)
Hrvoje Nikšić [Sun, 15 Sep 2019 17:06:02 +0000 (19:06 +0200)]
bpo-38178: Don't explicitly pass "loop" to EchoClientProtocol. (GH-16159)

https://bugs.python.org/issue38178

5 years agobpo-37798: Prevent undefined behavior in direct calls to the C helper function. ...
Raymond Hettinger [Sun, 15 Sep 2019 16:36:38 +0000 (09:36 -0700)]
bpo-37798: Prevent undefined behavior in direct calls to the C helper function. (#16149)

5 years agoFix missing dec ref (#16158)
Dino Viehland [Sun, 15 Sep 2019 14:51:44 +0000 (15:51 +0100)]
Fix missing dec ref (#16158)

5 years agobpo38158: Removing nonexistant member "doc" from PyType_Spec documentation (GH-16142)
t k [Sun, 15 Sep 2019 06:50:05 +0000 (02:50 -0400)]
bpo38158: Removing nonexistant member "doc" from PyType_Spec documentation (GH-16142)

5 years agobpo-37635: Update arg name for seek() in IO tutorial (GH-16147)
Kyle Stanley [Sat, 14 Sep 2019 20:29:23 +0000 (16:29 -0400)]
bpo-37635: Update arg name for seek() in IO tutorial (GH-16147)

Typically, the second positional argument for ``seek()`` is *whence*. That is the POSIX standard name (http://man7.org/linux/man-pages/man3/lseek.3p.html) and the name listed in the documentation for ``io`` module (https://docs.python.org/3/library/io.html#io.IOBase.seek).

The tutorial for IO is the only location where the second positional argument for ``seek()`` is referred to as *from_what*. I suspect this was created at an early point in Python's history, and was never updated (as this section predates the GitHub repository):

```
$ git grep "from_what"
Doc/tutorial/inputoutput.rst:To change the file object's position, use ``f.seek(offset, from_what)``.  The position is computed
Doc/tutorial/inputoutput.rst:the *from_what* argument.  A *from_what* value of 0 measures from the beginning
Doc/tutorial/inputoutput.rst:the reference point.  *from_what* can be omitted and defaults to 0, using the
```

For consistency, I am suggesting that the tutorial be updated to use the same argument name as the IO documentation and POSIX standard for ``seek()``, particularly since this is the only location where *from_what* is being used.

Note: In the POSIX standard, *whence* is technically the third positional argument, but the first argument *fildes* (file descriptor) is implicit in Python.

https://bugs.python.org/issue37635

5 years agobpo-38153: detect shake independently from sha3 (GH-16143)
Christian Heimes [Sat, 14 Sep 2019 15:29:54 +0000 (17:29 +0200)]
bpo-38153: detect shake independently from sha3 (GH-16143)

XOF digests (SHAKE) are not available in OpenSSL 1.1.0 but SHA3 fixed-length digests are.

Signed-off-by: Christian Heimes <christian@python.org>