]> granicus.if.org Git - python/log
python
5 years agobpo-37015: Ensure tasks created by _accept_connection2 due to AsyncMock are completed...
Xtreak [Thu, 30 May 2019 10:00:29 +0000 (15:30 +0530)]
bpo-37015: Ensure tasks created by _accept_connection2 due to AsyncMock are completed (GH-13661)

From 3.8 async functions used with mock.patch return an `AsyncMock`. `_accept_connection2` is an async function where create_task is also mocked. Don't mock `create_task` so that tasks are created out of coroutine returned by `AsyncMock` and the tasks are completed.

https://bugs.python.org/issue37015

5 years agobpo-37098: Skip memfd_create test before Linux 3.17 (GH-13677)
Christian Heimes [Thu, 30 May 2019 09:27:06 +0000 (11:27 +0200)]
bpo-37098: Skip memfd_create test before Linux 3.17 (GH-13677)

5 years agobpo-36935: Remove usage of the deprecated PyErr_SetFromWindowsErrWithUnicodeFilename...
Zackery Spytz [Thu, 30 May 2019 07:58:50 +0000 (01:58 -0600)]
bpo-36935: Remove usage of the deprecated PyErr_SetFromWindowsErrWithUnicodeFilename() (GH-13355)

In e895de3e7f3cc2f7213b87621cfe9812ea4343f0, the
deprecated function PyErr_SetFromWindowsErrWithUnicodeFilename() was
added in two functions in Modules/_winapi.c. This function was
deprecated in 3.3.

5 years agoautoreconf (GH-13651)
Inada Naoki [Thu, 30 May 2019 07:35:41 +0000 (16:35 +0900)]
autoreconf (GH-13651)

5 years agobpo-36610: shutil.copyfile(): use sendfile() on Linux only (GH-13675)
Giampaolo Rodola [Thu, 30 May 2019 06:05:41 +0000 (14:05 +0800)]
bpo-36610: shutil.copyfile(): use sendfile() on Linux only (GH-13675)

...and avoid using it on Solaris as it can raise EINVAL if offset is equal or bigger than the size of the file

5 years agobpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
Ying Wang [Thu, 30 May 2019 03:25:31 +0000 (23:25 -0400)]
bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)

5 years agoDon't crash if there exists an EGG-INFO directory on sys.path (#13667)
Anthony Sottile [Thu, 30 May 2019 00:13:12 +0000 (17:13 -0700)]
Don't crash if there exists an EGG-INFO directory on sys.path (#13667)

* Don't crash if there exists an EGG-INFO directory on sys.path

cross-port of https://gitlab.com/python-devs/importlib_metadata/merge_requests/72

* Also catch PermissionError for windows

5 years agoRegenerate topics file (GH-13642)
Pablo Galindo [Wed, 29 May 2019 21:59:00 +0000 (22:59 +0100)]
Regenerate topics file (GH-13642)

5 years agobpo-37007: Implement socket.if_nametoindex(), if_indextoname() and if_nameindex(...
Zackery Spytz [Wed, 29 May 2019 21:02:37 +0000 (15:02 -0600)]
bpo-37007: Implement socket.if_nametoindex(), if_indextoname() and if_nameindex() on Windows (GH-13522)

5 years agobpo-36974: Fix GDB integration (GH-13665)
Petr Viktorin [Wed, 29 May 2019 20:45:41 +0000 (22:45 +0200)]
bpo-36974: Fix GDB integration (GH-13665)

As it changes the way functions are called, the PEP 590 implementation
skipped the functions that the GDB integration is looking for
(by name) to find function calls.

Looking for the new helper `cfunction_call_varargs` hopefully fixes the
tests, and thus buildbots.

The changed frame nuber in test_gdb is due to there being fewer
C calls when calling a built-in method.

5 years agobpo-26836: Add ifdefs for all MFD_HUGE* constants (GH-13666)
Zackery Spytz [Wed, 29 May 2019 20:43:50 +0000 (14:43 -0600)]
bpo-26836: Add ifdefs for all MFD_HUGE* constants (GH-13666)

https://bugs.python.org/issue26836

5 years agobpo-32388: Remove cross-version binary compatibility requirement in tp_flags (GH...
Antoine Pitrou [Wed, 29 May 2019 20:12:38 +0000 (22:12 +0200)]
bpo-32388: Remove cross-version binary compatibility requirement in tp_flags (GH-4944)

It is now allowed to add new fields at the end of the PyTypeObject struct without having to allocate a dedicated compatibility flag in tp_flags.

This will reduce the risk of running out of bits in the 32-bit tp_flags value.

5 years agobpo-26836: Add os.memfd_create() (#13567)
Zackery Spytz [Wed, 29 May 2019 19:57:07 +0000 (13:57 -0600)]
bpo-26836: Add os.memfd_create() (#13567)

* bpo-26836: Add os.memfd_create()

* Use the glibc wrapper for memfd_create()

Co-Authored-By: Christian Heimes <christian@python.org>
* Fix deletions caused by autoreconf.

* Use MFD_CLOEXEC as the default value for *flags*.

* Add memset_s to configure.ac.

* Revert memset_s changes.

* Apply the requested changes.

* Tweak the docs.

5 years agobpo-22385: Support output separators in hex methods. (#13578)
Gregory P. Smith [Wed, 29 May 2019 18:46:58 +0000 (11:46 -0700)]
bpo-22385: Support output separators in hex methods. (#13578)

* bpo-22385: Support output separators in hex methods.

Also in binascii.hexlify aka b2a_hex.

The underlying implementation behind all hex generation in CPython uses the
same pystrhex.c implementation.  This adds support to bytes, bytearray,
and memoryview objects.

The binascii module functions exist rather than being slated for deprecation
because they return bytes rather than requiring an intermediate step through a
str object.

This change was inspired by MicroPython which supports sep in its binascii
implementation (and does not yet support the .hex methods).

https://bugs.python.org/issue22385

5 years agobpo-36974: implement PEP 590 (GH-13185)
Jeroen Demeyer [Wed, 29 May 2019 18:31:52 +0000 (20:31 +0200)]
bpo-36974: implement PEP 590 (GH-13185)

Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
Co-authored-by: Mark Shannon <mark@hotpy.org>
5 years agobpo-36983: Fix typing.__all__ and add test for exported names (GH-13456)
Anthony Sottile [Wed, 29 May 2019 18:19:38 +0000 (11:19 -0700)]
bpo-36983: Fix typing.__all__ and add test for exported names (GH-13456)

https://bugs.python.org/issue36983

5 years agobpo-36794: Document that Lock.acquire is fair. (GH-13082)
Hrvoje Nikšić [Wed, 29 May 2019 17:08:17 +0000 (19:08 +0200)]
bpo-36794: Document that Lock.acquire is fair. (GH-13082)

https://bugs.python.org/issue36794

5 years agoDoc: Add an optional obsolete header. (GH-13638)
Julien Palard [Wed, 29 May 2019 16:34:04 +0000 (18:34 +0200)]
Doc: Add an optional obsolete header. (GH-13638)

5 years agoAdd my to code owner for more areas (#13650)
Christian Heimes [Wed, 29 May 2019 15:45:19 +0000 (17:45 +0200)]
Add my to code owner for more areas (#13650)

5 years agobpo-36842: Fix reference leak in tests by running out-of-proc (GH-13556)
Steve Dower [Wed, 29 May 2019 15:20:35 +0000 (08:20 -0700)]
bpo-36842: Fix reference leak in tests by running out-of-proc (GH-13556)

5 years agobpo-33164: blake2 fix for HP-UX (GH-13633)
David Carlier [Wed, 29 May 2019 10:58:11 +0000 (11:58 +0100)]
bpo-33164: blake2 fix for HP-UX (GH-13633)

5 years agobpo-32972: Async test case (GH-13386)
Andrew Svetlov [Wed, 29 May 2019 09:33:59 +0000 (12:33 +0300)]
bpo-32972: Async test case (GH-13386)

Add explicit `asyncSetUp` and `asyncTearDown` methods.
The rest is the same as for #13228

`AsyncTestCase` create a loop instance for every test for the sake of test isolation.
Sometimes a loop shared between all tests can speed up tests execution time a lot but it requires control of closed resources after every test finish. Basically, it requires nested supervisors support that was discussed with @1st1 many times. Sorry, asyncio supervisors have no chance to land on Python 3.8.

The PR intentionally does not provide API for changing the used event loop or getting the test loop: use `asyncio.set_event_loop_policy()` and `asyncio.get_event_loop()` instead.

The PR adds four overridable methods to base `unittest.TestCase` class:
```
    def _callSetUp(self):
        self.setUp()

    def _callTestMethod(self, method):
        method()

    def _callTearDown(self):
        self.tearDown()

    def _callCleanup(self, function, /, *args, **kwargs):
        function(*args, **kwargs)
```
It allows using asyncio facilities with minimal influence on the unittest code.

The last but not least: the PR respects contextvars. The context variable installed by `asyncSetUp` is available on test, `tearDown` and a coroutine scheduled by `addCleanup`.

https://bugs.python.org/issue32972

5 years agoremove unnecessary tp_dealloc (GH-13647)
Inada Naoki [Wed, 29 May 2019 08:23:27 +0000 (17:23 +0900)]
remove unnecessary tp_dealloc (GH-13647)

5 years agobpo-22454: Add shlex.join() (the opposite of shlex.split()) (GH-7605)
Bo Bayles [Wed, 29 May 2019 08:06:12 +0000 (03:06 -0500)]
bpo-22454: Add shlex.join() (the opposite of shlex.split()) (GH-7605)

5 years agobpo-37070: Cleanup fstring debug handling (GH-13607)
Eric V. Smith [Wed, 29 May 2019 07:55:44 +0000 (03:55 -0400)]
bpo-37070: Cleanup fstring debug handling (GH-13607)

* Clean up some comments, fix potential memory leaks, clarify literal and expr_text.

5 years agobpo-37075: Fix string concatenation in assert_has_awaits error message (GH-13616)
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

5 years agobpo-35246: fix support for path-like args in asyncio subprocess (GH-13628)
依云 [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

5 years agobpo-36739: Update controlflow.rst (GH-12983)
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

5 years agobpo-37076: _thread.start_new_thread() calls _PyErr_WriteUnraisableMsg() (GH-13617)
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.

5 years agobpo-36540: Documentation for PEP570 - Python positional only arguments (#13202)
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

5 years agobpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL (#13634)
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

5 years agoFix markup and minor grammar improvements in Code_of_conduct.md (GH-13640)
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.

5 years agobpo-37001: Makes symtable.symtable have parity with compile for input (#13483)
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

5 years agobpo-22102: Fixes zip files with disks set to 0 (GH-5985)
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)

5 years agoFix comments in initconfig.h (GH-13636)
MandarJKulkarni [Tue, 28 May 2019 22:55:05 +0000 (04:25 +0530)]
Fix comments in initconfig.h (GH-13636)

5 years agobpo-31961: Fix support of path-like executables in subprocess. (GH-5914)
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)

5 years agoFix typo in docs for socket.CAN_RAW_FD_FRAMES (GH-13635)
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

5 years agobpo-36933: fix what's new. (GH-13627)
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

5 years agobpo-22640: Add silent mode to py_compile.compile() (GH-12976)
Joannah Nanjekye [Tue, 28 May 2019 16:29:04 +0000 (13:29 -0300)]
bpo-22640: Add silent mode to py_compile.compile() (GH-12976)

5 years agobpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980)
Zackery Spytz [Tue, 28 May 2019 15:16:33 +0000 (09:16 -0600)]
bpo-33407: Implement Py_DEPRECATED() on MSVC (GH-8980)

5 years agobpo-33725: multiprocessing uses spawn by default on macOS (GH-13603)
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.

5 years agobpo-36829: sys.excepthook and sys.unraisablehook flush (GH-13620)
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.

5 years agoDoc: Add missing forward reference in the tutorial. (GH-13499)
Julien Palard [Tue, 28 May 2019 13:10:23 +0000 (15:10 +0200)]
Doc: Add missing forward reference in the tutorial. (GH-13499)

5 years agobpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606)
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).

5 years agobpo-32299: Return patched dict when using patch.dict as a context manager (GH-11062)
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)

5 years agobpo-36922: implement PEP-590 Py_TPFLAGS_METHOD_DESCRIPTOR (GH-13338)
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>
5 years agoDoc: Space breaking whole definition. (GH-13615)
Julien Palard [Tue, 28 May 2019 12:04:42 +0000 (14:04 +0200)]
Doc: Space breaking whole definition. (GH-13615)

5 years agobpo-35279: reduce default max_workers of ThreadPoolExecutor (GH-13618)
Inada Naoki [Tue, 28 May 2019 12:02:52 +0000 (21:02 +0900)]
bpo-35279: reduce default max_workers of ThreadPoolExecutor (GH-13618)

5 years agoRemove outdated time.monotonic reference (GH-13264)
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.

5 years agobpo-36900: Fix compilation on HP-UX (GH-13614)
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().

5 years agobpo-29883: Asyncio proactor udp (GH-13440)
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

5 years agoDOC: Unnecessary plural. (GH-13613)
Julien Palard [Tue, 28 May 2019 08:35:25 +0000 (10:35 +0200)]
DOC: Unnecessary plural. (GH-13613)

5 years agobpo-37058: PEP 544: Add Protocol to typing module (GH-13585)
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.

5 years agobpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) (GH-13577)
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

5 years agobpo-36996: Handle async functions when mock.patch is used as a decorator (GH-13562)
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

5 years agoAdd @maxking to CODEOWNERS file (GH-13599)
Abhilash Raj [Tue, 28 May 2019 04:15:48 +0000 (00:15 -0400)]
Add @maxking to CODEOWNERS file (GH-13599)

5 years agobpo-36686: Improve the documentation of the std* params in loop.subprocess_exec ...
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

5 years agobpo-37054, _pyio: Fix BytesIO and TextIOWrapper __del__() (GH-13601)
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().

5 years agobpo-37039: IDLE - zoomheight fixes (GH-13576)
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.

5 years agobpo-1230540: Add threading.excepthook() (GH-13515)
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.

5 years agobpo-36889: Merge asyncio streams (GH-13251)
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

5 years agobpo-37050: Remove expr_text from FormattedValue ast node, use Constant node instead...
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.

5 years agobpo-32941: Fix test_madvise failure when page size >= 8kiB (GH-13596)
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

5 years agoFix a typo in SECURITY.md (GH-13568)
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.

5 years agobpo-37051: Refine note on what objects are hashable (GH-13587)
Raymond Hettinger [Mon, 27 May 2019 17:21:31 +0000 (10:21 -0700)]
bpo-37051: Refine note on what objects are hashable (GH-13587)

5 years agobpo-32941: Add madvise() for mmap objects (GH-6172)
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.

5 years agobpo-36763: Implement the PEP 587 (GH-13592)
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()

5 years agobpo-37027: Return a proxy socket object from transp.get_extra_info('socket') (GH...
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

5 years agobpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481)
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)

5 years agobpo-37035: Don't log OSError (GH-13548)
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

5 years agobpo-37047: Refactor AsyncMock setup logic for autospeccing (GH-13574)
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.

5 years agobpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)
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

5 years agobpo-37028: asyncio REPL; activated via 'python -m asyncio'. (GH-13472)
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.

5 years agobpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)
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().

5 years agoAdd one more test for typing.Final (GH-13588)
Ivan Levkivskyi [Sun, 26 May 2019 23:54:13 +0000 (00:54 +0100)]
Add one more test for typing.Final (GH-13588)

5 years agobpo-36772 Allow lru_cache to be used as decorator without making a function call...
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)

5 years agobpo-37053: handle strings like u"bar" correctly in Tools/parser/unparse.py (GH-13583)
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

5 years agobpo-36785: PEP 574 implementation (GH-7076)
Antoine Pitrou [Sun, 26 May 2019 15:10:09 +0000 (17:10 +0200)]
bpo-36785: PEP 574 implementation (GH-7076)

5 years agoFix highlighting in importlib.metadata docs (GH-13575)
Anthony Sottile [Sun, 26 May 2019 14:30:52 +0000 (07:30 -0700)]
Fix highlighting in importlib.metadata docs (GH-13575)

5 years agobpo-28866: No type cache for types with specialized mro, invalidation is hard. (...
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.

5 years agobpo-37049: PEP 589: Add TypedDict to typing module (GH-13573)
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`.

5 years agobpo-37046: PEP 586: Add Literal to typing module (#13572)
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`.

5 years agobpo-37045: PEP 591: Add final qualifiers to typing module (GH-13571)
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`.

5 years agobpo-37017: PyObject_CallMethodObjArgs uses LOAD_METHOD optimization (GH-13516)
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.

5 years agoDocs: FIX broken links. (GH-13491)
Julien Palard [Sat, 25 May 2019 18:02:24 +0000 (20:02 +0200)]
Docs: FIX broken links. (GH-13491)

5 years agobpo-34632 fix buildbots and remove artifact (GH-13566)
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)

5 years ago📝 Add a GitHub-specific security page (GH-13526)
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>
5 years agobpo-34632: fix installation of importlib.metadata (#13563)
Chih-Hsuan Yen [Sat, 25 May 2019 08:09:35 +0000 (16:09 +0800)]
bpo-34632: fix installation of importlib.metadata (#13563)

5 years agobpo-37038: Make idlelib.run runnable; add test clause (GH-13560)
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)

5 years agobpo-34632: Add importlib.metadata (GH-12547)
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.

5 years agobpo-36829: Document test.support.catch_unraisable_exception() (GH-13554)
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.

5 years agobpo-37032: Add CodeType.replace() method (GH-13542)
Victor Stinner [Fri, 24 May 2019 21:57:23 +0000 (23:57 +0200)]
bpo-37032: Add CodeType.replace() method (GH-13542)

5 years agobpo-37021: Port _randommodule to the argument clinic (GH-13532)
Pablo Galindo [Fri, 24 May 2019 21:09:23 +0000 (22:09 +0100)]
bpo-37021: Port _randommodule to the argument clinic (GH-13532)

5 years agobpo-35907: Fix typo in the NEWS entry (GH-13559)
Victor Stinner [Fri, 24 May 2019 21:06:25 +0000 (23:06 +0200)]
bpo-35907: Fix typo in the NEWS entry (GH-13559)

5 years agobpo-36969: Make PDB args command display positional only arguments (GH-13459)
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)

5 years agobpo-35907: Clarify the NEWS entry (GH-13523)
Victor Stinner [Fri, 24 May 2019 20:06:32 +0000 (22:06 +0200)]
bpo-35907: Clarify the NEWS entry (GH-13523)

5 years agobpo-37023: Skip test_gdb under PGO (GH-13555)
Steve Dower [Fri, 24 May 2019 20:00:04 +0000 (13:00 -0700)]
bpo-37023: Skip test_gdb under PGO (GH-13555)

5 years agobpo-8138: Initialize wsgiref's SimpleServer as single-threaded (GH-12977)
Berker Peksag [Fri, 24 May 2019 17:24:42 +0000 (20:24 +0300)]
bpo-8138: Initialize wsgiref's SimpleServer as single-threaded (GH-12977)

5 years agobpo-21536: Fix configure.ac for LIBPYTHON on Android/Cygwin (GH-13552)
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).

5 years agobpo-36721: Fix pkg-config symbolic links on "make install" (GH-13551)
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)