]> granicus.if.org Git - python/log
python
5 years agobpo-32411: IDLE: Remove line number sort in browser.py (#5011)
Cheryl Sabella [Sat, 1 Jun 2019 21:03:22 +0000 (17:03 -0400)]
bpo-32411: IDLE: Remove line number sort in browser.py (#5011)

Insertion in line order makes sorting keys by line order unneeded.

5 years agobpo-34303: Micro-optimizations in functools.reduce() (GH-8598)
Sergey Fedoseev [Sat, 1 Jun 2019 20:32:18 +0000 (01:32 +0500)]
bpo-34303: Micro-optimizations in functools.reduce() (GH-8598)

5 years agobpo-36842: Pass positional only parameters to code_new audit hook (GH-13707)
Pablo Galindo [Sat, 1 Jun 2019 20:18:48 +0000 (21:18 +0100)]
bpo-36842: Pass positional only parameters to code_new audit hook (GH-13707)

5 years agoFix compiler warnings in the pystrehex module (GH-13730)
Pablo Galindo [Sat, 1 Jun 2019 20:02:08 +0000 (21:02 +0100)]
Fix compiler warnings in the pystrehex module (GH-13730)

5 years agoClean up and reduce visual clutter in the makeunicode.py script. (GH-7558)
Stefan Behnel [Sat, 1 Jun 2019 19:49:03 +0000 (21:49 +0200)]
Clean up and reduce visual clutter in the makeunicode.py script. (GH-7558)

5 years agobpo-28595: Allow shlex whitespace_split with punctuation_chars (GH-2071)
Evan [Sat, 1 Jun 2019 19:09:22 +0000 (05:09 +1000)]
bpo-28595: Allow shlex whitespace_split with punctuation_chars (GH-2071)

5 years agobpo-35431: Refactor math.comb() implementation. (GH-13725)
Serhiy Storchaka [Sat, 1 Jun 2019 19:09:02 +0000 (22:09 +0300)]
bpo-35431: Refactor math.comb() implementation. (GH-13725)

* Fixed some bugs.
* Added support for index-likes objects.
* Improved error messages.
* Cleaned up and optimized the code.
* Added more tests.

5 years agoImprove exception message for str.format (GH-12675)
Francisco Couzo [Sat, 1 Jun 2019 17:14:00 +0000 (14:14 -0300)]
Improve exception message for str.format (GH-12675)

5 years agobpo-37122: Make co->co_argcount represent the total number of positonal arguments...
Pablo Galindo [Sat, 1 Jun 2019 17:08:04 +0000 (18:08 +0100)]
bpo-37122: Make co->co_argcount represent the total number of positonal arguments in the code object (GH-13726)

5 years agobpo-31968: Documentation -- add clarification on the globals dict for exec() (GH...
Anthony Shaw [Sat, 1 Jun 2019 15:51:58 +0000 (01:51 +1000)]
bpo-31968: Documentation -- add clarification on the globals dict for exec() (GH-13140)

5 years agoDoc: Correct the creation year and the credits of the Logo Programming language ...
Stéphane Wirtel [Sat, 1 Jun 2019 11:41:33 +0000 (13:41 +0200)]
Doc: Correct the creation year and the credits of the Logo Programming language (GH-13520)

5 years agoMove whats-new entry for math.factorial to the math module section. (GH-13723)
Mark Dickinson [Sat, 1 Jun 2019 11:21:53 +0000 (12:21 +0100)]
Move whats-new entry for math.factorial to the math module section. (GH-13723)

5 years agobpo-36813: Fix QueueListener to call task_done() upon termination. (GH-13113)
Bar Harel [Sat, 1 Jun 2019 09:19:09 +0000 (12:19 +0300)]
bpo-36813: Fix QueueListener to call task_done() upon termination. (GH-13113)

Fixed QueueListener in order to avoid random deadlocks.
Unable to add regression tests atm due to time constraints, will add it in a bit.
Regarding implementation, although it's nested, it does not cause performance issues whatsoever, and does not call task_done() in case of an exception (which is the right thing to do IMHO).

https://bugs.python.org/issue36813

5 years agoUse more PEP 570 syntax in the documentation. (GH-13720)
Serhiy Storchaka [Sat, 1 Jun 2019 08:38:24 +0000 (11:38 +0300)]
Use more PEP 570 syntax in the documentation. (GH-13720)

5 years agobpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)
Serhiy Storchaka [Sat, 1 Jun 2019 08:00:15 +0000 (11:00 +0300)]
bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)

5 years agobpo-35431: Implemented math.comb (GH-11414)
Yash Aggarwal [Sat, 1 Jun 2019 07:21:27 +0000 (12:51 +0530)]
bpo-35431: Implemented math.comb (GH-11414)

5 years agobpo-18911: clarify that the minidom XML writer receives texts but not bytes (GH-13352)
Windson yang [Sat, 1 Jun 2019 06:33:16 +0000 (14:33 +0800)]
bpo-18911: clarify that the minidom XML writer receives texts but not bytes (GH-13352)

5 years agoAdd option to trace to run modules (GH-5134)
Mario Corchero [Sat, 1 Jun 2019 04:49:10 +0000 (05:49 +0100)]
Add option to trace to run modules (GH-5134)

Adds a new option in trace that allows tracing runnable modules. It is
exposed as `--module module_name` as `-m` is already in use for another
argument.

5 years agobpo-29984: Improve 'heapq' test coverage (GH-992)
Rob Day [Sat, 1 Jun 2019 04:13:57 +0000 (05:13 +0100)]
bpo-29984: Improve 'heapq' test coverage (GH-992)

5 years agoImprove docstring of list.sort (GH-8516)
Tim Hoffmann [Sat, 1 Jun 2019 04:10:02 +0000 (06:10 +0200)]
Improve docstring of list.sort (GH-8516)

5 years agobpo-36818: Add PyInterpreterState.runtime field. (gh-13129)
Eric Snow [Sat, 1 Jun 2019 03:16:47 +0000 (21:16 -0600)]
bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)

https://bugs.python.org/issue36818

5 years agobpo-37029: keep usable_arenas in sorted order without searching (#13612)
Tim Peters [Sat, 1 Jun 2019 02:16:04 +0000 (21:16 -0500)]
bpo-37029:  keep usable_arenas in sorted order without searching (#13612)

This adds a vector of "search fingers" so that usable_arenas can be kept in sorted order (by number of free pools) via constant-time operations instead of linear search.

This should reduce worst-case time for reclaiming a great many objects from O(A**2) to O(A), where A is the number of arenas.  See bpo-37029.

5 years agobpo-12202: Properly check MsiSummaryInfoGetProperty() calls in msilib (GH-13711)
Zackery Spytz [Sat, 1 Jun 2019 00:16:20 +0000 (18:16 -0600)]
bpo-12202: Properly check MsiSummaryInfoGetProperty() calls in msilib (GH-13711)

5 years agobpo-37105: Add deprecated-remove information on stream doc (#13672)
Emmanuel Arias [Fri, 31 May 2019 20:48:57 +0000 (17:48 -0300)]
bpo-37105: Add deprecated-remove information on stream doc (#13672)

* Add deprecated-remove information on stream doc

According to the code on streams.py the functions:
``open_connection()``, ``start_server()``, ``open_unix_connection()``,
``start_unix_server()`` are deprecated. I infor that on
documentation.

5 years agobpo-15115: Document deprecation of email.encoders in Python 3 (GH-5354)
Cheryl Sabella [Fri, 31 May 2019 20:18:41 +0000 (16:18 -0400)]
bpo-15115: Document deprecation of email.encoders in Python 3 (GH-5354)

5 years agobpo-33361: Fix bug with seeking in StreamRecoders (GH-8278)
Ammar Askar [Fri, 31 May 2019 19:44:01 +0000 (12:44 -0700)]
bpo-33361: Fix bug with seeking in StreamRecoders (GH-8278)

5 years agobpo-26826: Expose copy_file_range in the os module (GH-7255)
Pablo Galindo [Fri, 31 May 2019 18:39:47 +0000 (19:39 +0100)]
bpo-26826: Expose copy_file_range in the os module (GH-7255)

5 years agoDocument changes for PyCode_New regarding PEP570 (GH-13706)
Pablo Galindo [Fri, 31 May 2019 18:33:41 +0000 (19:33 +0100)]
Document changes for PyCode_New regarding PEP570 (GH-13706)

5 years agobpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (GH...
Zackery Spytz [Fri, 31 May 2019 16:43:13 +0000 (10:43 -0600)]
bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (GH-13688)

msilib.Directory.start_component() was passing an extra argument to CAB.gen_id().

5 years agobpo-25735: math.factorial doc should mention integer return type (GH-6420)
Akshay Sharma [Fri, 31 May 2019 16:41:17 +0000 (22:11 +0530)]
bpo-25735: math.factorial doc should mention integer return type (GH-6420)

5 years agobpo-26835: Add file sealing constants to fcntl (GH-13694)
Christian Heimes [Fri, 31 May 2019 16:32:33 +0000 (18:32 +0200)]
bpo-26835: Add file sealing constants to fcntl (GH-13694)

Co-authored-by: nanjekyejoannah <nanjekyejoannah@gmail.com>
5 years agobpo-37094: Add example for TestCase.skipTest in unittest doc (GH-13645)
Makdon [Fri, 31 May 2019 16:19:12 +0000 (00:19 +0800)]
bpo-37094: Add example for TestCase.skipTest in unittest doc (GH-13645)

Also includes other minor test skipping doc improvements.

https://bugs.python.org/issue37094

5 years agobpo-37115: Support annotations in positional-only arguments (GH-13698)
Pablo Galindo [Fri, 31 May 2019 14:19:50 +0000 (15:19 +0100)]
bpo-37115: Support annotations in positional-only arguments (GH-13698)

5 years agobpo-37112: Allow compile to work on AST with positional only arguments with defaults...
Pablo Galindo [Fri, 31 May 2019 13:09:49 +0000 (14:09 +0100)]
bpo-37112: Allow compile to work on AST with positional only arguments with defaults (GH-13697)

5 years agoUpdate data model docs to include missing attributes for code objects (GH-13696)
Pablo Galindo [Fri, 31 May 2019 11:13:04 +0000 (12:13 +0100)]
Update data model docs to include missing attributes for code objects (GH-13696)

Include and document co_posonlyargcount and co_kwonlyargcount

5 years agobpo-37108: Support super with methods that use positional-only arguments (GH-13695)
Pablo Galindo [Fri, 31 May 2019 11:07:56 +0000 (12:07 +0100)]
bpo-37108: Support super with methods that use positional-only arguments (GH-13695)

5 years agobpo-36379: __ipow__ must be a ternaryfunc, not a binaryfunc (GH-13546)
Zackery Spytz [Fri, 31 May 2019 09:46:36 +0000 (03:46 -0600)]
bpo-36379: __ipow__ must be a ternaryfunc, not a binaryfunc (GH-13546)

If a type's __ipow__ method was implemented in C, attempting to use
the *modulo* parameter would cause crashes.

https://bugs.python.org/issue36379

5 years agobpo-34271: Add ssl debugging helpers (GH-10031)
Christian Heimes [Fri, 31 May 2019 09:44:05 +0000 (11:44 +0200)]
bpo-34271: Add ssl debugging helpers (GH-10031)

The ssl module now can dump key material to a keylog file and trace TLS
protocol messages with a tracing callback. The default and stdlib
contexts also support SSLKEYLOGFILE env var.

The msg_callback and related enums are private members. The feature
is designed for internal debugging and not for end users.

Signed-off-by: Christian Heimes <christian@python.org>
5 years agobpo-26660, bpo-35144: Fix permission errors in TemporaryDirectory cleanup. (GH-10320)
Serhiy Storchaka [Fri, 31 May 2019 08:30:37 +0000 (11:30 +0300)]
bpo-26660, bpo-35144: Fix permission errors in TemporaryDirectory cleanup. (GH-10320)

TemporaryDirectory.cleanup() failed when non-writeable or non-searchable
files or directories were created inside a temporary directory.

5 years agobpo-31829: Make protocol 0 pickles be loadable in text mode in Python 2. (GH-11859)
Serhiy Storchaka [Fri, 31 May 2019 08:29:39 +0000 (11:29 +0300)]
bpo-31829: Make protocol 0 pickles be loadable in text mode in Python 2. (GH-11859)

Escape ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) in Unicode strings.

5 years agoIDLE - Capitalize search dialogs' 'Close' button label. (#13691)
Terry Jan Reedy [Fri, 31 May 2019 08:26:35 +0000 (04:26 -0400)]
IDLE - Capitalize search dialogs' 'Close' button label. (#13691)

It seems to be the only widget label not capitalized.

5 years agobpo-36548: Improve the repr of re flags. (GH-12715)
Serhiy Storchaka [Fri, 31 May 2019 07:39:47 +0000 (10:39 +0300)]
bpo-36548: Improve the repr of re flags. (GH-12715)

5 years agobpo-339827: Do not swallow exceptions in the _ssl module. (GH-12756)
Serhiy Storchaka [Fri, 31 May 2019 07:39:15 +0000 (10:39 +0300)]
bpo-339827: Do not swallow exceptions in the _ssl module. (GH-12756)

5 years agobpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)
Jeroen Demeyer [Fri, 31 May 2019 02:13:39 +0000 (04:13 +0200)]
bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)

Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async

5 years agobpo-29262: Add get_origin() and get_args() introspection helpers to typing (GH-13685)
Ivan Levkivskyi [Thu, 30 May 2019 23:10:07 +0000 (00:10 +0100)]
bpo-29262: Add get_origin() and get_args() introspection helpers to typing (GH-13685)

This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in `typing_inspect` on PyPI, I propose to add these two most commonly used functions: `get_origin()` and `get_args()`. These are essentially thin public wrappers around private APIs: `__origin__` and `__args__`.

As discussed in the issue and on the typing tracker, exposing some public helpers instead of `__origin__` and `__args__` directly will give us more flexibility if we will decide to update the internal representation, while still maintaining backwards compatibility.

The implementation is very simple an is essentially a copy from `typing_inspect` with one exception: `ClassVar` was special-cased in `typing_inspect`, but I think this special-casing doesn't really help and only makes things more complicated.

5 years agobpo-5028: Fix up rest of documentation for tokenize documenting line (GH-13686)
Anthony Sottile [Thu, 30 May 2019 22:06:32 +0000 (15:06 -0700)]
bpo-5028: Fix up rest of documentation for tokenize documenting line (GH-13686)

https://bugs.python.org/issue5028

5 years agobpo-36953: Delay removal of ABCs from collections. (GH-13409)
Matthias Bussonnier [Thu, 30 May 2019 21:45:48 +0000 (14:45 -0700)]
bpo-36953: Delay removal of ABCs from collections. (GH-13409)

Bump the removal to 3.9, indicate collections.abc available since 3.3,
replace version-changed directive to deprecated-removed.

https://bugs.python.org/issue36953

5 years agobpo-36342: Fix test_multiprocessing in test_venv (GH-12513)
xdegaye [Thu, 30 May 2019 21:42:29 +0000 (23:42 +0200)]
bpo-36342: Fix test_multiprocessing in test_venv (GH-12513)

when platform lacks a functioning sem_open implementation

https://bugs.python.org/issue36342

5 years agobpo-30969: Fix docs about the comparison in absence of __contains__ (GH-2761)
Antti Haapala [Thu, 30 May 2019 20:19:29 +0000 (23:19 +0300)]
bpo-30969: Fix docs about the comparison in absence of __contains__ (GH-2761)

5 years agobpo-5028: fix doc bug for tokenize (GH-11683)
Andrew Carr [Thu, 30 May 2019 19:31:51 +0000 (13:31 -0600)]
bpo-5028: fix doc bug for tokenize (GH-11683)

https://bugs.python.org/issue5028

5 years agoFix audit event typo : urllib.request -> urllib.Request (GH-13550)
Xtreak [Thu, 30 May 2019 17:58:28 +0000 (23:28 +0530)]
Fix audit event typo : urllib.request -> urllib.Request (GH-13550)

As per the PEP and the [audit event raised](https://github.com/python/cpython/blob/13d4e6a4a090031f8214e058ed3c8fd47767e05f/Lib/urllib/request.py#L524) in urllib.request this should be `urllib.Request`

cc: @zooba

5 years agobpo-36999: Add asyncio.Task.get_coro() (GH-13680)
Alex Grönholm [Thu, 30 May 2019 15:30:09 +0000 (18:30 +0300)]
bpo-36999: Add asyncio.Task.get_coro() (GH-13680)

https://bugs.python.org/issue36999

5 years agoRevert adding @maxking to CODEOWNERS file (GH-13660)
Brett Cannon [Thu, 30 May 2019 14:59:01 +0000 (07:59 -0700)]
Revert adding @maxking to CODEOWNERS file (GH-13660)

This reverts commit 71dc7c5fbd856df83202f39c1f41ccd07c6eceb7. Turns out you must have write access for CODEOWNERS to work.

5 years agobpo-36974: rename _FastCallKeywords -> _Vectorcall (GH-13653)
Jeroen Demeyer [Thu, 30 May 2019 13:11:22 +0000 (15:11 +0200)]
bpo-36974: rename _FastCallKeywords -> _Vectorcall (GH-13653)

5 years agobpo-37099: Silence DeprecationWarning in test_inspect (GH-13679)
Xtreak [Thu, 30 May 2019 12:01:39 +0000 (17:31 +0530)]
bpo-37099: Silence DeprecationWarning in test_inspect (GH-13679)

Fix DeprecationWarning introduced in aee19f54f6fe45f6b3c906987941e5a8af4468e9

https://bugs.python.org/issue37099

5 years agobpo-20602: Do not clear sys.flags and sys.float_info during shutdown (GH-8096)
Zackery Spytz [Thu, 30 May 2019 11:08:24 +0000 (05:08 -0600)]
bpo-20602: Do not clear sys.flags and sys.float_info during shutdown (GH-8096)

There is no need to clear these immutable objects during shutdown.

5 years agobpo-36974: remove _PyObject_HasFastCall (GH-13460)
Jeroen Demeyer [Thu, 30 May 2019 10:43:59 +0000 (12:43 +0200)]
bpo-36974: remove _PyObject_HasFastCall (GH-13460)

5 years agobpo-36974: inherit the vectorcall protocol (GH-13498)
Jeroen Demeyer [Thu, 30 May 2019 10:43:19 +0000 (12:43 +0200)]
bpo-36974: inherit the vectorcall protocol (GH-13498)

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.