Xtreak [Wed, 29 May 2019 07:02:26 +0000 (12:32 +0530)]
bpo-37075: Fix string concatenation in assert_has_awaits error message (GH-13616)
* Fix the implicit string concatenation in `assert_has_awaits` error message.
* Use "await" instead of "call" in `assert_awaited_with` error message.
https://bugs.python.org/issue37075
依云 [Wed, 29 May 2019 06:50:59 +0000 (14:50 +0800)]
bpo-35246: fix support for path-like args in asyncio subprocess (GH-13628)
Drop isinstance checks from create_subprocess_exec function and let
subprocess module do them.
https://bugs.python.org/issue35246
https://bugs.python.org/issue35246
pbhd [Wed, 29 May 2019 03:38:03 +0000 (05:38 +0200)]
bpo-36739: Update controlflow.rst (GH-12983)
in addition to global-statement also mention nonlocal-statement
(in the paragraph describing access to variables which are non local to a function
Victor Stinner [Wed, 29 May 2019 00:57:56 +0000 (02:57 +0200)]
bpo-37076: _thread.start_new_thread() calls _PyErr_WriteUnraisableMsg() (GH-13617)
_thread.start_new_thread() now logs uncaught exception raised by the
function using sys.unraisablehook(), rather than sys.excepthook(), so
the hook gets access to the function which raised the exception.
Pablo Galindo [Tue, 28 May 2019 23:45:32 +0000 (00:45 +0100)]
bpo-36540: Documentation for PEP570 - Python positional only arguments (#13202)
* bpo-36540: Documentation for PEP570 - Python positional only arguments
* fixup! bpo-36540: Documentation for PEP570 - Python positional only arguments
* Update reference for compound statements
* Apply suggestions from Carol
Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
* Update Doc/tutorial/controlflow.rst
Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
* Add extra bullet point and minor edits
Guido van Rossum [Tue, 28 May 2019 23:44:58 +0000 (16:44 -0700)]
bpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL (#13634)
I'm confident that this fixes the reported crash. flags=NULL is treated as using the latest minor version.
https://bugs.python.org/issue37072
hydrogen-mvm [Tue, 28 May 2019 23:22:24 +0000 (19:22 -0400)]
Fix markup and minor grammar improvements in Code_of_conduct.md (GH-13640)
The old link had a > in the url which prevented the browser from jumping down to the correct section on that page.
That PSF page itself has an error: There's a duplicate "the" in that paragraph that needs to be removed: "...and conform to **the the** Python Community Code of Conduct."
While I was editing this file, I also fixed some grammar and bolded the 3 important keywords so that they catch the viewer's eyes. I can revert these changes if they are unwanted.
Thanks.
Dino Viehland [Tue, 28 May 2019 23:21:17 +0000 (16:21 -0700)]
bpo-37001: Makes symtable.symtable have parity with compile for input (#13483)
* Makes symtable.symtable have parity for accepted datatypes
for source code as compile()
* Add NEWS blurb
Francisco Facioni [Tue, 28 May 2019 23:15:11 +0000 (00:15 +0100)]
bpo-22102: Fixes zip files with disks set to 0 (GH-5985)
MandarJKulkarni [Tue, 28 May 2019 22:55:05 +0000 (04:25 +0530)]
Fix comments in initconfig.h (GH-13636)
Serhiy Storchaka [Tue, 28 May 2019 19:49:35 +0000 (22:49 +0300)]
bpo-31961: Fix support of path-like executables in subprocess. (GH-5914)
karl ding [Tue, 28 May 2019 18:35:26 +0000 (11:35 -0700)]
Fix typo in docs for socket.CAN_RAW_FD_FRAMES (GH-13635)
There is an extra "one" in the text description for the constant
socket.CAN_RAW_FD_FRAMES
Matthias Bussonnier [Tue, 28 May 2019 17:30:35 +0000 (10:30 -0700)]
bpo-36933: fix what's new. (GH-13627)
Original Pr was reformed and news not updated.
https://bugs.python.org/issue36933
Joannah Nanjekye [Tue, 28 May 2019 16:29:04 +0000 (13:29 -0300)]
bpo-22640: Add silent mode to py_compile.compile() (GH-12976)
Zackery Spytz [Tue, 28 May 2019 15:16:33 +0000 (09:16 -0600)]
bpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980)
Victor Stinner [Tue, 28 May 2019 14:02:50 +0000 (16:02 +0200)]
bpo-33725: multiprocessing uses spawn by default on macOS (GH-13603)
On macOS, the multiprocessing module now uses the "spawn" start
method by default.
Victor Stinner [Tue, 28 May 2019 14:01:17 +0000 (16:01 +0200)]
bpo-36829: sys.excepthook and sys.unraisablehook flush (GH-13620)
sys.excepthook() and sys.unraisablehook() now explicitly flush the
file (usually sys.stderr).
If file.flush() fails, sys.excepthook() silently ignores the error,
whereas sys.unraisablehook() logs the new exception.
Julien Palard [Tue, 28 May 2019 13:10:23 +0000 (15:10 +0200)]
Doc: Add missing forward reference in the tutorial. (GH-13499)
Zackery Spytz [Tue, 28 May 2019 12:55:29 +0000 (06:55 -0600)]
bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606)
Fix possible overflow in wrap_lenfunc() when
sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows).
Mario Corchero [Tue, 28 May 2019 12:53:31 +0000 (13:53 +0100)]
bpo-32299: Return patched dict when using patch.dict as a context manager (GH-11062)
Jeroen Demeyer [Tue, 28 May 2019 12:42:53 +0000 (14:42 +0200)]
bpo-36922: implement PEP-590 Py_TPFLAGS_METHOD_DESCRIPTOR (GH-13338)
Co-authored-by: Mark Shannon <mark@hotpy.org>
Julien Palard [Tue, 28 May 2019 12:04:42 +0000 (14:04 +0200)]
Doc: Space breaking whole definition. (GH-13615)
Inada Naoki [Tue, 28 May 2019 12:02:52 +0000 (21:02 +0900)]
bpo-35279: reduce default max_workers of ThreadPoolExecutor (GH-13618)
Brad [Tue, 28 May 2019 10:47:24 +0000 (06:47 -0400)]
Remove outdated time.monotonic reference (GH-13264)
Per
ae58649, time.monotonic is always available, making the old note outdated.
Victor Stinner [Tue, 28 May 2019 10:24:00 +0000 (12:24 +0200)]
bpo-36900: Fix compilation on HP-UX (GH-13614)
dynload_hpux.c: add #include "pycore_pystate.h" for
_PyInterpreterState_GET_UNSAFE().
Andrew Svetlov [Tue, 28 May 2019 09:52:15 +0000 (12:52 +0300)]
bpo-29883: Asyncio proactor udp (GH-13440)
Follow-up for #1067
https://bugs.python.org/issue29883
Julien Palard [Tue, 28 May 2019 08:35:25 +0000 (10:35 +0200)]
DOC: Unnecessary plural. (GH-13613)
Ivan Levkivskyi [Tue, 28 May 2019 07:40:15 +0000 (08:40 +0100)]
bpo-37058: PEP 544: Add Protocol to typing module (GH-13585)
I tried to get rid of the `_ProtocolMeta`, but unfortunately it didn'y work. My idea to return a generic alias from `@runtime_checkable` made runtime protocols unpickleable. I am not sure what is worse (a custom metaclass or having some classes unpickleable), so I decided to stick with the status quo (since there were no complains so far). So essentially this is a copy of the implementation in `typing_extensions` with two modifications:
* Rename `@runtime` to `@runtime_checkable` (plus corresponding updates).
* Allow protocols that extend `collections.abc.Iterable` etc.
Matthias Bussonnier [Tue, 28 May 2019 07:10:59 +0000 (00:10 -0700)]
bpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) (GH-13577)
It has been documented as deprecated and to be removed in 3.8;
From a comment on another thread – which I can't find ; leave get_coro_wrapper() for now, but always return `None`.
https://bugs.python.org/issue36933
Xtreak [Tue, 28 May 2019 07:07:39 +0000 (12:37 +0530)]
bpo-36996: Handle async functions when mock.patch is used as a decorator (GH-13562)
Return a coroutine while patching async functions with a decorator.
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
https://bugs.python.org/issue36996
Abhilash Raj [Tue, 28 May 2019 04:15:48 +0000 (00:15 -0400)]
Add @maxking to CODEOWNERS file (GH-13599)
sbstp [Mon, 27 May 2019 23:51:19 +0000 (19:51 -0400)]
bpo-36686: Improve the documentation of the std* params in loop.subprocess_exec (GH-13586)
https://bugs.python.org/issue36686
Victor Stinner [Mon, 27 May 2019 23:44:21 +0000 (01:44 +0200)]
bpo-37054, _pyio: Fix BytesIO and TextIOWrapper __del__() (GH-13601)
Fix destructor _pyio.BytesIO and _pyio.TextIOWrapper: initialize
their _buffer attribute as soon as possible (in the class body),
because it's used by __del__() which calls close().
Terry Jan Reedy [Mon, 27 May 2019 23:16:46 +0000 (19:16 -0400)]
bpo-37039: IDLE - zoomheight fixes (GH-13576)
Move doc entry to match menu and refactor zoom function.
A followup patch will include a blurb.
Victor Stinner [Mon, 27 May 2019 22:39:52 +0000 (00:39 +0200)]
bpo-
1230540: Add threading.excepthook() (GH-13515)
Add a new threading.excepthook() function which handles uncaught
Thread.run() exception. It can be overridden to control how uncaught
exceptions are handled.
threading.ExceptHookArgs is not documented on purpose: it should not
be used directly.
* threading.excepthook() and threading.ExceptHookArgs.
* Add _PyErr_Display(): similar to PyErr_Display(), but accept a
'file' parameter.
* Add _thread._excepthook(): C implementation of the exception hook
calling _PyErr_Display().
* Add _thread._ExceptHookArgs: structseq type.
* Add threading._invoke_excepthook_wrapper() which handles the gory
details to ensure that everything remains alive during Python
shutdown.
* Add unit tests.
Andrew Svetlov [Mon, 27 May 2019 19:56:22 +0000 (22:56 +0300)]
bpo-36889: Merge asyncio streams (GH-13251)
https://bugs.python.org/issue36889
Eric V. Smith [Mon, 27 May 2019 19:31:52 +0000 (15:31 -0400)]
bpo-37050: Remove expr_text from FormattedValue ast node, use Constant node instead (GH-13597)
When using the "=" debug functionality of f-strings, use another Constant node (or a merged constant node) instead of adding expr_text to the FormattedValue node.
Antoine Pitrou [Mon, 27 May 2019 17:57:23 +0000 (19:57 +0200)]
bpo-32941: Fix test_madvise failure when page size >= 8kiB (GH-13596)
https://bugs.python.org/issue32941
Philippe Gagnon [Mon, 27 May 2019 17:45:24 +0000 (13:45 -0400)]
Fix a typo in SECURITY.md (GH-13568)
There is a duplicated "in" in the Supported Versions text.
Raymond Hettinger [Mon, 27 May 2019 17:21:31 +0000 (10:21 -0700)]
bpo-37051: Refine note on what objects are hashable (GH-13587)
Zackery Spytz [Mon, 27 May 2019 16:48:17 +0000 (10:48 -0600)]
bpo-32941: Add madvise() for mmap objects (GH-6172)
Allow mmap objects to access the madvise() system call.
Victor Stinner [Mon, 27 May 2019 14:39:22 +0000 (16:39 +0200)]
bpo-36763: Implement the PEP 587 (GH-13592)
* Add a whole new documentation page:
"Python Initialization Configuration"
* PyWideStringList_Append() return type is now PyStatus,
instead of int
* PyInterpreterState_New() now calls PyConfig_Clear() if
PyConfig_InitPythonConfig() fails.
* Rename files:
* Python/coreconfig.c => Python/initconfig.c
* Include/cpython/coreconfig.h => Include/cpython/initconfig.h
* Include/internal/: pycore_coreconfig.h => pycore_initconfig.h
* Rename structures
* _PyCoreConfig => PyConfig
* _PyPreConfig => PyPreConfig
* _PyInitError => PyStatus
* _PyWstrList => PyWideStringList
* Rename PyConfig fields:
* use_module_search_paths => module_search_paths_set
* module_search_path_env => pythonpath_env
* Rename PyStatus field: _func => func
* PyInterpreterState: rename core_config field to config
* Rename macros and functions:
* _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv()
* _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv()
* _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString()
* _PyInitError_Failed() => PyStatus_Exception()
* _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx
* _Py_UnixMain() => Py_BytesMain()
* _Py_ExitInitError() => Py_ExitStatusException()
* _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs()
* _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs()
* _Py_PreInitialize() => Py_PreInitialize()
* _Py_RunMain() => Py_RunMain()
* _Py_InitializeFromConfig() => Py_InitializeFromConfig()
* _Py_INIT_XXX() => _PyStatus_XXX()
* _Py_INIT_FAILED() => _PyStatus_EXCEPTION()
* Rename 'err' PyStatus variables to 'status'
* Convert RUN_CODE() macro to config_run_code() static inline function
* Remove functions:
* _Py_InitializeFromArgs()
* _Py_InitializeFromWideArgs()
* _PyInterpreterState_GetCoreConfig()
Yury Selivanov [Mon, 27 May 2019 13:57:20 +0000 (15:57 +0200)]
bpo-37027: Return a proxy socket object from transp.get_extra_info('socket') (GH-13530)
Return a safe to use proxy socket object from `transport.get_extra_info('socket')`
https://bugs.python.org/issue37027
Rémi Lapeyre [Mon, 27 May 2019 13:43:45 +0000 (15:43 +0200)]
bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481)
Andrew Svetlov [Mon, 27 May 2019 13:28:34 +0000 (16:28 +0300)]
bpo-37035: Don't log OSError (GH-13548)
https://bugs.python.org/issue37035
Xtreak [Mon, 27 May 2019 12:56:23 +0000 (18:26 +0530)]
bpo-37047: Refactor AsyncMock setup logic for autospeccing (GH-13574)
Handle late binding and attribute access in unittest.mock.AsyncMock
setup for autospeccing.
Yury Selivanov [Mon, 27 May 2019 12:45:12 +0000 (14:45 +0200)]
bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)
This will address the common mistake many asyncio users make:
an "except Exception" clause breaking Tasks cancellation.
In addition to this change, we stop inheriting asyncio.TimeoutError
and asyncio.InvalidStateError from their concurrent.futures.*
counterparts. There's no point for these exceptions to share the
inheritance chain.
In 3.9 we'll focus on implementing supervisors and cancel scopes,
which should allow better handling of all exceptions, including
SystemExit and KeyboardInterrupt
Yury Selivanov [Mon, 27 May 2019 11:42:29 +0000 (13:42 +0200)]
bpo-37028: asyncio REPL; activated via 'python -m asyncio'. (GH-13472)
This makes it easy to play with asyncio APIs with simply
using async/await in the REPL.
Victor Stinner [Mon, 27 May 2019 06:57:14 +0000 (08:57 +0200)]
bpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)
* sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs.
* Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call()
and gc delete_garbage().
Ivan Levkivskyi [Sun, 26 May 2019 23:54:13 +0000 (00:54 +0100)]
Add one more test for typing.Final (GH-13588)
Raymond Hettinger [Sun, 26 May 2019 18:27:35 +0000 (11:27 -0700)]
bpo-36772 Allow lru_cache to be used as decorator without making a function call (GH-13048)
Chih-Hsuan Yen [Sun, 26 May 2019 17:08:20 +0000 (01:08 +0800)]
bpo-37053: handle strings like u"bar" correctly in Tools/parser/unparse.py (GH-13583)
Constant.kind is added in https://bugs.python.org/issue36280.
Current possible values for Constant.kind are "u" or None.
For r'bar' and b'bar', Constant.kind value is None, so there's no need
for special handling.
https://bugs.python.org/issue37053
Antoine Pitrou [Sun, 26 May 2019 15:10:09 +0000 (17:10 +0200)]
bpo-36785: PEP 574 implementation (GH-7076)
Anthony Sottile [Sun, 26 May 2019 14:30:52 +0000 (07:30 -0700)]
Fix highlighting in importlib.metadata docs (GH-13575)
Julien Palard [Sun, 26 May 2019 14:25:47 +0000 (16:25 +0200)]
bpo-28866: No type cache for types with specialized mro, invalidation is hard. (#13157)
* No type cache for types with specialized mro, invalidation is hard.
* FIX: Don't disable method cache custom types that do not implement mro().
* fixing implem.
* Avoid storing error flags, also decref.
* news entry
* Clear as soon as we're getting an error.
* FIX: Reference leak.
Ivan Levkivskyi [Sun, 26 May 2019 08:39:24 +0000 (09:39 +0100)]
bpo-37049: PEP 589: Add TypedDict to typing module (GH-13573)
The implementation is straightforward and essentially is just copied from `typing_extensions`.
Ivan Levkivskyi [Sun, 26 May 2019 08:37:48 +0000 (09:37 +0100)]
bpo-37046: PEP 586: Add Literal to typing module (#13572)
The implementation is straightforward and essentially is just copied from `typing_extensions`.
Ivan Levkivskyi [Sun, 26 May 2019 08:37:07 +0000 (09:37 +0100)]
bpo-37045: PEP 591: Add final qualifiers to typing module (GH-13571)
The implementation is straightforward, it just mimics `ClassVar` (since the latter is also a name/access qualifier, not really a type). Also it is essentially copied from `typing_extensions`.
Michael J. Sullivan [Sun, 26 May 2019 07:23:34 +0000 (00:23 -0700)]
bpo-37017: PyObject_CallMethodObjArgs uses LOAD_METHOD optimization (GH-13516)
Update PyObject_CallMethodObjArgs and _PyObject_CallMethodIdObjArgs
to use _PyObject_GetMethod to avoid creating a bound method object
in many cases.
On a microbenchmark of PyObject_CallMethodObjArgs calling a method on
an interpreted Python class, this optimization resulted in a 1.7x
speedup.
Julien Palard [Sat, 25 May 2019 18:02:24 +0000 (20:02 +0200)]
Docs: FIX broken links. (GH-13491)
Jason R. Coombs [Sat, 25 May 2019 14:00:21 +0000 (10:00 -0400)]
bpo-34632 fix buildbots and remove artifact (GH-13566)
* bpo-34632: Also include the test data directory.
* bpo-34632: remove the framework resources artifacts, accidentally added in
1bbf7b661f (
ccbccce)
Sviatoslav Sydorenko [Sat, 25 May 2019 10:03:45 +0000 (12:03 +0200)]
📝 Add a GitHub-specific security page (GH-13526)
* 📝 Add a GitHub-specific security page
It will show up @
https://github.com/python/cpython/security/policy
allowing to navigate users who get there from "Security" tab in the
GitHub repo to the full article explaining the security vulnerability
reporting practices.
Co-Authored-By: Hugo <hugovk@users.noreply.github.com>
Chih-Hsuan Yen [Sat, 25 May 2019 08:09:35 +0000 (16:09 +0800)]
bpo-34632: fix installation of importlib.metadata (#13563)
Terry Jan Reedy [Sat, 25 May 2019 01:59:53 +0000 (21:59 -0400)]
bpo-37038: Make idlelib.run runnable; add test clause (GH-13560)
Jason R. Coombs [Fri, 24 May 2019 23:59:01 +0000 (19:59 -0400)]
bpo-34632: Add importlib.metadata (GH-12547)
Add importlib.metadata module as forward port of the standalone importlib_metadata.
Victor Stinner [Fri, 24 May 2019 22:09:38 +0000 (00:09 +0200)]
bpo-36829: Document test.support.catch_unraisable_exception() (GH-13554)
catch_unraisable_exception() now also removes its 'unraisable'
attribute at the context manager exit.
Victor Stinner [Fri, 24 May 2019 21:57:23 +0000 (23:57 +0200)]
bpo-37032: Add CodeType.replace() method (GH-13542)
Pablo Galindo [Fri, 24 May 2019 21:09:23 +0000 (22:09 +0100)]
bpo-37021: Port _randommodule to the argument clinic (GH-13532)
Victor Stinner [Fri, 24 May 2019 21:06:25 +0000 (23:06 +0200)]
bpo-35907: Fix typo in the NEWS entry (GH-13559)
Rémi Lapeyre [Fri, 24 May 2019 20:44:31 +0000 (22:44 +0200)]
bpo-36969: Make PDB args command display positional only arguments (GH-13459)
Victor Stinner [Fri, 24 May 2019 20:06:32 +0000 (22:06 +0200)]
bpo-35907: Clarify the NEWS entry (GH-13523)
Steve Dower [Fri, 24 May 2019 20:00:04 +0000 (13:00 -0700)]
bpo-37023: Skip test_gdb under PGO (GH-13555)
Berker Peksag [Fri, 24 May 2019 17:24:42 +0000 (20:24 +0300)]
bpo-8138: Initialize wsgiref's SimpleServer as single-threaded (GH-12977)
E. M. Bray [Fri, 24 May 2019 16:39:39 +0000 (18:39 +0200)]
bpo-21536: Fix configure.ac for LIBPYTHON on Android/Cygwin (GH-13552)
Add also missing AC_MSG_RESULT for AC_MSG_CHECKING(MACHDEP).
Victor Stinner [Fri, 24 May 2019 16:27:13 +0000 (18:27 +0200)]
bpo-36721: Fix pkg-config symbolic links on "make install" (GH-13551)
Paul Monson [Fri, 24 May 2019 16:15:39 +0000 (09:15 -0700)]
bpo-36511: Ensure error code propagates out of batch files (GH-13529)
E. M. Bray [Fri, 24 May 2019 15:33:47 +0000 (17:33 +0200)]
bpo-21536: On Cygwin, C extensions must be linked with libpython (GH-13549)
It is also possible to link against a library or executable with a
statically linked libpython, but not both with the same DLL. In fact
building a statically linked python is currently broken on Cygwin
for other (related) reasons.
The same problem applies to other POSIX-like layers over Windows
(MinGW, MSYS) but Python's build system does not seem to attempt
to support those platforms at the moment.
Victor Stinner [Fri, 24 May 2019 15:01:38 +0000 (17:01 +0200)]
bpo-36710: Add tstate parameter in ceval.c (GH-13547)
* Fix a possible reference leak in _PyErr_Print() if exception
is NULL.
* PyErr_BadInternalCall(): replace PyErr_Format() with _PyErr_SetString().
* Add pycore_pyerrors.h header file.
* New functions:
* _PyErr_Clear()
* _PyErr_Fetch()
* _PyErr_Print()
* _PyErr_Restore()
* _PyErr_SetObject()
* _PyErr_SetString()
* Add 'tstate' parameter to _PyEval_AddPendingCall().
Nick Sung [Fri, 24 May 2019 13:50:35 +0000 (21:50 +0800)]
Fix typos in Doc/library/email.generator.rst documentation (GH-13539)
Victor Stinner [Fri, 24 May 2019 13:20:23 +0000 (15:20 +0200)]
bpo-37031: Fix PyOS_AfterFork_Child() (GH-13537)
PyOS_AfterFork_Child(): _PyInterpreterState_DeleteExceptMain() must
be called after _PyRuntimeState_ReInitThreads().
_PyRuntimeState_ReInitThreads() resets interpreters mutex after fork,
mutex used by _PyInterpreterState_DeleteExceptMain().
Victor Stinner [Fri, 24 May 2019 13:16:08 +0000 (15:16 +0200)]
Support Py_UNUSED() on clang (GH-13544)
Victor Stinner [Fri, 24 May 2019 11:44:24 +0000 (13:44 +0200)]
bpo-36710: Add tstate parameter in errors.c (GH-13540)
Add 'PyThreadState *tstate' parameter to errors.c functions to avoid
relying on global variables (indirectly on _PyRuntime).
Victor Stinner [Fri, 24 May 2019 11:43:55 +0000 (13:43 +0200)]
bpo-37031: Reuse _PyRuntime.main_thread in signalmodule.c (GH-13538)
Remove main_thread and main_interp variables from signalmodule.c:
reuse _PyRuntime which already track the main thread and the main
interpreter.
* Remove #include <sys/types.h> which became useless: getpid() call
has been removed.
* Add runtime argument to is_main()
* is_main() now gets the interpreter from runtime.
Dan Rose [Fri, 24 May 2019 11:38:01 +0000 (06:38 -0500)]
bpo-36045: builtins.help() now prefixes `async` for async functions (GH-12010)
Previously, it was hard to tell whether a function should be awaited. It was also incorrect (per PEP 484) to put this in the type hint for coroutine functions. Added this info to the output of builtins.help and pydoc.
https://bugs.python.org/issue36045
Xtreak [Fri, 24 May 2019 11:17:48 +0000 (16:47 +0530)]
Fix typo: decription -> description (GH-13543)
Cheryl Sabella [Fri, 24 May 2019 10:43:29 +0000 (06:43 -0400)]
bpo-20285: Improve help docs for object (GH-4759)
Petr Viktorin [Fri, 24 May 2019 09:19:42 +0000 (11:19 +0200)]
bpo-34626: Document creating heap types from the C-API (GH-9154)
bpo-34626: Document creating heap types from the C-API
Add missing descriptions of PEP384's PyType_Spec and PyType_Slot,
along with some introductory prose.
Pablo Galindo [Thu, 23 May 2019 23:53:21 +0000 (00:53 +0100)]
Fix warning in _testembed.c (GH-13533)
Matěj Cepl [Thu, 23 May 2019 20:30:00 +0000 (22:30 +0200)]
bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not handled (GH-7778)
``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python.
Steve Dower [Thu, 23 May 2019 15:45:22 +0000 (08:45 -0700)]
bpo-36842: Implement PEP 578 (GH-12613)
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
Nick Coghlan [Thu, 23 May 2019 14:06:39 +0000 (00:06 +1000)]
bpo-36797: Reduce levels of indirection in outdated distutils docs (#13462)
Damien Nadé [Thu, 23 May 2019 10:03:25 +0000 (12:03 +0200)]
bpo-37008: make mock_open handle able to honor next() (GH-13492)
I've reported the issue on https://bugs.python.org/issue37008 and now I'm trying to bring a solution to this minor issue.
I think it could be trivially backported to 3.7 branch.
https://bugs.python.org/issue37008
David Carlier [Thu, 23 May 2019 04:32:44 +0000 (04:32 +0000)]
bpo-33164: update blake2 implementation (GH-6286)
Victor Stinner [Thu, 23 May 2019 02:12:27 +0000 (04:12 +0200)]
bpo-36763: Fix _PyPreConfig_InitCompatConfig() utf8_mode (GH-13518)
* _PyPreConfig_InitCompatConfig() sets utf8_mode to 0.
* Change Py_UTF8Mode default value to 0.
* Fix _PyPreConfig_Copy(): copy also _config_init attrbibute.
* _PyPreConfig_AsDict() exports _config_init
* Fix _PyPreConfig_GetGlobalConfig(): use Py_UTF8Mode if it's greater
than 0, even if utf8_mode >= 0.
* Add unit tests on environment variables using Python API.
Victor Stinner [Thu, 23 May 2019 01:45:09 +0000 (03:45 +0200)]
bpo-18748: _pyio.IOBase emits unraisable exception (GH-13512)
In development (-X dev) mode and in a debug build, IOBase finalizer
of the _pyio module now logs the exception if the close() method
fails. The exception is ignored silently by default in release build.
test_io: test_error_through_destructor() now uses
support.catch_unraisable_exception() rather than capturing stderr.
Victor Stinner [Thu, 23 May 2019 01:30:23 +0000 (03:30 +0200)]
bpo-36721: Add --embed option to python-config (GH-13500)
To embed Python into an application, a new --embed option must be
passed to "python3-config --libs --embed" to get "-lpython3.8" (link
the application to libpython). To support both 3.8 and older, try
"python3-config --libs --embed" first and fallback to "python3-config
--libs" (without --embed) if the previous command fails.
Add a pkg-config "python-3.8-embed" module to embed Python into an
application: "pkg-config python-3.8-embed --libs" includes
"-lpython3.8". To support both 3.8 and older, try "pkg-config
python-X.Y-embed --libs" first and fallback to "pkg-config python-X.Y
--libs" (without --embed) if the previous command fails (replace
"X.Y" with the Python version).
On the other hand, "pkg-config python3.8 --libs" no longer contains
"-lpython3.8". C extensions must not be linked to libpython (except
on Android, case handled by the script); this change is backward
incompatible on purpose.
"make install" now also installs "python-3.8-embed.pc".
Batuhan Taşkaya [Thu, 23 May 2019 01:13:16 +0000 (04:13 +0300)]
bpo-27737: Allow whitespace only headers encoding (#13478)
Alexey Izbyshev [Thu, 23 May 2019 00:01:08 +0000 (03:01 +0300)]
bpo-35091: Objects/listobject.c: Replace overflow checks in gallop fu… (GH-10202)
…nctions with asserts
The actual overflow can never happen because of the following:
* The size of a list can't be greater than PY_SSIZE_T_MAX / sizeof(PyObject*).
* The size of a pointer on all supported plaftorms is at least 4 bytes.
* ofs is positive and less than the list size at the beginning of each iteration.
https://bugs.python.org/issue35091
Victor Stinner [Wed, 22 May 2019 23:00:58 +0000 (01:00 +0200)]
bpo-36829: PyErr_WriteUnraisable() normalizes exception (GH-13507)
PyErr_WriteUnraisable() now creates a traceback object if there is no
current traceback. Moreover, call PyErr_NormalizeException() and
PyException_SetTraceback() to normalize the exception value. Ignore
silently any error.
Victor Stinner [Wed, 22 May 2019 22:57:57 +0000 (00:57 +0200)]
bpo-36763: Rename private Python initialization functions (GH-13511)
* Rename private C functions:
* _Py_Initialize_ReconfigureCore => pyinit_core_reconfigure
* _Py_InitializeCore_impl => pyinit_core_config
* _Py_InitializeCore = > pyinit_core
* _Py_InitializeMainInterpreter => pyinit_main
* init_python => pyinit_python
* Rename _testembed.c commands: add "test_" prefix.