]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-40228: More robust frame.setlineno. (GH-19437)
Mark Shannon [Wed, 29 Apr 2020 15:49:45 +0000 (16:49 +0100)] 
bpo-40228: More robust frame.setlineno. (GH-19437)

More robust frame.setlineno. Makes no assumptions about source->bytecode translation.

5 years agobpo-40436: Fix code parsing gdb version (GH-19792)
Victor Stinner [Wed, 29 Apr 2020 15:11:48 +0000 (17:11 +0200)] 
bpo-40436: Fix code parsing gdb version (GH-19792)

test_gdb and test.pythoninfo now check gdb command exit code.

5 years agobpo-40428: Cleanup free list part of C API Changes doc (GH-19793)
Victor Stinner [Wed, 29 Apr 2020 14:56:30 +0000 (16:56 +0200)] 
bpo-40428: Cleanup free list part of C API Changes doc (GH-19793)

5 years agoAdd missing sys import to socket_helper.py (GH-19791)
Pablo Galindo [Wed, 29 Apr 2020 11:32:31 +0000 (12:32 +0100)] 
Add missing sys import to socket_helper.py (GH-19791)

5 years agobpo-40334: refactor and cleanup for the PEG generators (GH-19775)
Pablo Galindo [Wed, 29 Apr 2020 09:42:21 +0000 (10:42 +0100)] 
bpo-40334: refactor and cleanup for the PEG generators (GH-19775)

5 years agobpo-40432 Fix MSBuild project for Pegen grammars (#GH-9785)
Anthony Shaw [Wed, 29 Apr 2020 09:09:09 +0000 (19:09 +1000)] 
bpo-40432 Fix MSBuild project for Pegen grammars (#GH-9785)

* Update the source path of the pegen target within the Windows regen project.
Change the path to Windows path formats.

* Use the more reliable SetEnv task for Cpp Projects in MSBuild.

5 years agobpo-40275: Move transient_internet from test.support to socket_helper (GH-19711)
Serhiy Storchaka [Wed, 29 Apr 2020 07:36:20 +0000 (10:36 +0300)] 
bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711)

5 years agobpo-40428: Remove references to Py*_ClearFreeList in the docs (GH-19783)
Zackery Spytz [Wed, 29 Apr 2020 02:41:56 +0000 (20:41 -0600)] 
bpo-40428: Remove references to Py*_ClearFreeList in the docs (GH-19783)

They were removed from the C API in commit
ae00a5a88534fd45939f86c12e038da9fa6f9ed6.

5 years agobpo-40334: Disallow invalid single statements in the new parser (GH-19774)
Lysandros Nikolaou [Wed, 29 Apr 2020 01:42:27 +0000 (04:42 +0300)] 
bpo-40334: Disallow invalid single statements in the new parser (GH-19774)

After parsing is done in single statement mode, the tokenizer buffer has to be checked for additional lines and a `SyntaxError` must be raised, in case there are any.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agobpo-39995: Fix concurrent.futures _ThreadWakeup (GH-19760)
Victor Stinner [Wed, 29 Apr 2020 01:32:06 +0000 (03:32 +0200)] 
bpo-39995: Fix concurrent.futures _ThreadWakeup (GH-19760)

Fix a race condition in concurrent.futures._ThreadWakeup: access to
_ThreadWakeup is now protected with the shutdown lock.

5 years agobpo-40421: Add PyFrame_GetBack() function (GH-19765)
Victor Stinner [Wed, 29 Apr 2020 01:28:46 +0000 (03:28 +0200)] 
bpo-40421: Add PyFrame_GetBack() function (GH-19765)

New PyFrame_GetBack() function: get the frame next outer frame.

Replace frame->f_back with PyFrame_GetBack(frame) in most code but
frameobject.c, ceval.c and genobject.c.

5 years agobpo-40275: Move requires_hashdigest() to test.support.hashlib_helper (GH-19716)
Hai Shi [Wed, 29 Apr 2020 01:11:29 +0000 (09:11 +0800)] 
bpo-40275: Move requires_hashdigest() to test.support.hashlib_helper (GH-19716)

Add a new test.support.hashlib_helper submodule.

5 years agobpo-40334: Explicitly cast to int in pegen.c to fix a compiler warning (GH-19779)
Pablo Galindo [Wed, 29 Apr 2020 01:04:06 +0000 (02:04 +0100)] 
bpo-40334: Explicitly cast to int in pegen.c to fix a compiler warning (GH-19779)

5 years agobpo-40429: PyThreadState_GetFrame() returns a strong ref (GH-19781)
Victor Stinner [Wed, 29 Apr 2020 01:01:43 +0000 (03:01 +0200)] 
bpo-40429: PyThreadState_GetFrame() returns a strong ref (GH-19781)

The PyThreadState_GetFrame() function now returns a strong reference
to the frame.

5 years agobpo-40334: Fix shifting of nested f-strings in the new parser (GH-19771)
Lysandros Nikolaou [Wed, 29 Apr 2020 00:43:50 +0000 (03:43 +0300)] 
bpo-40334: Fix shifting of nested f-strings in the new parser (GH-19771)

`JoinedStr`s and `FormattedValue also needs to be shifted, in order to correctly compute the location information of nested f-strings.

5 years agobpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769)
Victor Stinner [Wed, 29 Apr 2020 00:29:20 +0000 (02:29 +0200)] 
bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769)

Remove the following function from the C API:

* PyAsyncGen_ClearFreeLists()
* PyContext_ClearFreeList()
* PyDict_ClearFreeList()
* PyFloat_ClearFreeList()
* PyFrame_ClearFreeList()
* PyList_ClearFreeList()
* PySet_ClearFreeList()
* PyTuple_ClearFreeList()

Make these functions private, move them to the internal C API and
change their return type to void.

Call explicitly PyGC_Collect() to free all free lists.

Note: PySet_ClearFreeList() did nothing.

5 years agobpo-40429: Refactor super_init() (GH-19776)
Victor Stinner [Wed, 29 Apr 2020 00:28:23 +0000 (02:28 +0200)] 
bpo-40429: Refactor super_init() (GH-19776)

Add super_init_without_args() sub-function. Hold a strong reference
to the frame code object while calling super_init_without_args().

5 years agobpo-38880: List interpreters associated with a channel end (GH-17323)
Lewis Gaul [Wed, 29 Apr 2020 00:18:42 +0000 (01:18 +0100)] 
bpo-38880: List interpreters associated with a channel end (GH-17323)

This PR adds the functionality requested by https://github.com/ericsnowcurrently/multi-core-python/issues/52.

Automerge-Triggered-By: @ericsnowcurrently
5 years agobpo-40431: Fix syntax typo in turtledemo (GH-19777)
Miro Hrončok [Wed, 29 Apr 2020 00:00:07 +0000 (02:00 +0200)] 
bpo-40431: Fix syntax typo in turtledemo (GH-19777)

***   File "/usr/lib64/python3.9/turtledemo/__main__.py", line 275
        bg="#d00" if clear == NORMAL else"#fca")
                                        ^
    SyntaxError: invalid string prefix

5 years agobpo-40429: PyFrame_GetCode() now returns a strong reference (GH-19773)
Victor Stinner [Tue, 28 Apr 2020 23:28:13 +0000 (01:28 +0200)] 
bpo-40429: PyFrame_GetCode() now returns a strong reference (GH-19773)

5 years agobpo-32604: Add support for a "default" arg in channel_recv(). (GH-19770)
Eric Snow [Tue, 28 Apr 2020 23:11:32 +0000 (17:11 -0600)] 
bpo-32604: Add support for a "default" arg in channel_recv(). (GH-19770)

This allows the caller to avoid creation of an exception when the channel is empty (just like `dict.get()` works).  `ChannelEmptyError` is still raised if no default is provided.

Automerge-Triggered-By: @ericsnowcurrently
5 years agobpo-40429: PyFrame_GetCode() result cannot be NULL (GH-19772)
Victor Stinner [Tue, 28 Apr 2020 22:56:58 +0000 (00:56 +0200)] 
bpo-40429: PyFrame_GetCode() result cannot be NULL (GH-19772)

Add frame_nslots() to factorize duplicate code.

5 years agobpo-39966: Revert "bpo-25597: Ensure wraps' return value is used for magic methods...
Karthikeyan Singaravelan [Tue, 28 Apr 2020 19:22:31 +0000 (00:52 +0530)] 
bpo-39966: Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock" (GH-19734)

* Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock (#16029)"

This reverts commit 72b1004657e60c900e4cd031b2635b587f4b280e.

5 years agobpo-40025: Require _generate_next_value_ to be defined before members (GH-19098)
Ethan Onstott [Tue, 28 Apr 2020 17:20:55 +0000 (13:20 -0400)] 
bpo-40025: Require _generate_next_value_ to be defined before members (GH-19098)

require `_generate_next_value_` to be defined before members

5 years agobpo-40421: Add PyFrame_GetCode() function (GH-19757)
Victor Stinner [Tue, 28 Apr 2020 17:01:31 +0000 (19:01 +0200)] 
bpo-40421: Add PyFrame_GetCode() function (GH-19757)

PyFrame_GetCode(frame): return a borrowed reference to the frame
code.

Replace frame->f_code with PyFrame_GetCode(frame) in most code,
except in frameobject.c, genobject.c and ceval.c.

Also add PyFrame_GetLineNumber() to the limited C API.

5 years agobpo-40421: Add Include/cpython/code.h header file (GH-19756)
Victor Stinner [Tue, 28 Apr 2020 15:07:12 +0000 (17:07 +0200)] 
bpo-40421: Add Include/cpython/code.h header file (GH-19756)

bpo-35134, bpo-40421: Add Include/cpython/code.h header file.

code.h now defines PyCodeObject type in the limited C API. It is now
included by Python.h.

Give a name to the PyCodeObject structure: it is now called
"struct PyCodeObject". So it becomes possible to define PyCodeObject
as "struct PyCodeObject" in the limited C API without defining the
structure.

5 years agobpo-40421: Add pyframe.h header file (GH-19755)
Victor Stinner [Tue, 28 Apr 2020 14:32:48 +0000 (16:32 +0200)] 
bpo-40421: Add pyframe.h header file (GH-19755)

Add a new separated pyframe.h header file of the PyFrame public C
API: it is included by Python.h.

Add PyFrame_GetLineNumber() to the limited C API.

Replace "struct _frame" with "PyFrameObject" in header files.
PyFrameObject is now defined as struct _frame by pyframe.h which is
included early enough in Python.h.

5 years agoPost 3.9.0a6
Łukasz Langa [Tue, 28 Apr 2020 14:28:10 +0000 (16:28 +0200)] 
Post 3.9.0a6

5 years agoMerge tag 'v3.9.0a6'
Łukasz Langa [Tue, 28 Apr 2020 14:27:46 +0000 (16:27 +0200)] 
Merge tag 'v3.9.0a6'

5 years agobpo-40334: Refactor peg_generator to receive a Tokens file when building c code ...
Pablo Galindo [Tue, 28 Apr 2020 12:11:55 +0000 (13:11 +0100)] 
bpo-40334: Refactor peg_generator to receive a Tokens file when building c code (GH-19745)

5 years agobpo-40334: Don't skip test_parser:test_trigget_memory_error (GH-19744)
Lysandros Nikolaou [Tue, 28 Apr 2020 00:24:50 +0000 (03:24 +0300)] 
bpo-40334: Don't skip test_parser:test_trigget_memory_error (GH-19744)

This test has been changed to always use the old parser, so no need for it to be skipped.

5 years agobpo-40334: Catch E_EOF error, when the tokenizer returns ERRORTOKEN (GH-19743)
Lysandros Nikolaou [Tue, 28 Apr 2020 00:23:35 +0000 (03:23 +0300)] 
bpo-40334: Catch E_EOF error, when the tokenizer returns ERRORTOKEN (GH-19743)

An E_EOF error was only being caught after the parser exited before this commit. There are some cases though, where the tokenizer returns ERRORTOKEN *and* has set an E_EOF error (like when EOF directly follows a line continuation character) which weren't correctly handled before.

5 years agoPython 3.9.0a6 v3.9.0a6
Łukasz Langa [Mon, 27 Apr 2020 20:44:04 +0000 (22:44 +0200)] 
Python 3.9.0a6

5 years agobpo-39995: Split test_concurrent_futures.test_crash() into sub-tests (GH-19739)
Victor Stinner [Mon, 27 Apr 2020 19:36:51 +0000 (21:36 +0200)] 
bpo-39995: Split test_concurrent_futures.test_crash() into sub-tests (GH-19739)

Now only test_error_during_result_unpickle_in_result_handler()
captures and ignores sys.stderr in the test process.

Tools like test.bisect_cmd don't support subTest() but only
work with the granularity of one method.

Remove unused ExecutorDeadlockTest._sleep_id() method.

5 years agobpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738)
Victor Stinner [Mon, 27 Apr 2020 18:53:37 +0000 (20:53 +0200)] 
bpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738)

Process.shutdown(wait=True) of concurrent.futures now closes
explicitly the result queue.

5 years agobpo-40334: Support PyPARSE_DONT_IMPLY_DEDENT in the new parser (GH-19736)
Pablo Galindo [Mon, 27 Apr 2020 17:35:58 +0000 (18:35 +0100)] 
bpo-40334: Support PyPARSE_DONT_IMPLY_DEDENT in the new parser (GH-19736)

5 years agobpo-40334: Support CO_FUTURE_BARRY_AS_BDFL in the new parser (GH-19721)
Pablo Galindo [Mon, 27 Apr 2020 17:02:07 +0000 (18:02 +0100)] 
bpo-40334: Support CO_FUTURE_BARRY_AS_BDFL in the new parser (GH-19721)

This commit also allows to pass flags to the new parser in all interfaces and fixes a bug in the parser generator that was causing to inline rules with actions, making them disappear.

5 years agobpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735)
Victor Stinner [Mon, 27 Apr 2020 16:11:10 +0000 (18:11 +0200)] 
bpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735)

Add a new close() method to multiprocessing.SimpleQueue to explicitly
close the queue.

Automerge-Triggered-By: @pitrou
5 years agobpo-40375: Implement imaplib.IMAP4.unselect (GH-19712)
Dong-hee Na [Mon, 27 Apr 2020 14:52:55 +0000 (23:52 +0900)] 
bpo-40375: Implement imaplib.IMAP4.unselect (GH-19712)

5 years agobpo-40217: Clean code in PyType_FromSpec_Alloc and add NEWS entry (GH-19733)
Pablo Galindo [Mon, 27 Apr 2020 14:24:31 +0000 (15:24 +0100)] 
bpo-40217: Clean code in PyType_FromSpec_Alloc and add NEWS entry (GH-19733)

5 years agobpo-40217: Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec types...
Pablo Galindo [Mon, 27 Apr 2020 12:22:19 +0000 (13:22 +0100)] 
bpo-40217: Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec types (GH-19414)

5 years agoAdd files in tests/test_peg_generator to the install target lists (GH-19723)
Pablo Galindo [Mon, 27 Apr 2020 10:18:04 +0000 (11:18 +0100)] 
Add files in tests/test_peg_generator to the install target lists (GH-19723)

Update the "Makefile.pre.in" template and the "PCbuild/lib.pyproj" with the files in "Lib/test/test/test_peg_generator" so they get correctly installed along the rest of the standard library.

5 years agobpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720)
Serhiy Storchaka [Mon, 27 Apr 2020 07:27:21 +0000 (10:27 +0300)] 
bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720)

5 years agobpo-40348: Fix typos in the programming FAQ (GH-19729)
Zackery Spytz [Mon, 27 Apr 2020 03:23:52 +0000 (21:23 -0600)] 
bpo-40348: Fix typos in the programming FAQ (GH-19729)

5 years agobpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607)
Brad Solomon [Mon, 27 Apr 2020 02:31:44 +0000 (22:31 -0400)] 
bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607)

Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs.

Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvar#c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`.

Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link.

5 years agobpo-40401: Remove duplicate pyhash.h include from pythoncore.vcxproj (GH-19725)
Ammar Askar [Mon, 27 Apr 2020 02:08:17 +0000 (19:08 -0700)] 
bpo-40401: Remove duplicate pyhash.h include from pythoncore.vcxproj (GH-19725)

5 years agobpo-40387: Improve queue join() example. (GH-19724)
Raymond Hettinger [Mon, 27 Apr 2020 01:11:27 +0000 (18:11 -0700)] 
bpo-40387: Improve queue join() example. (GH-19724)

5 years agobpo-40396: Support GenericAlias in the typing functions. (GH-19718)
Serhiy Storchaka [Sun, 26 Apr 2020 18:21:08 +0000 (21:21 +0300)] 
bpo-40396: Support GenericAlias in the typing functions. (GH-19718)

5 years agoFix typo in Lib/typing.py (GH-19717)
Nickolena Fisher [Sun, 26 Apr 2020 17:49:11 +0000 (12:49 -0500)] 
Fix typo in Lib/typing.py (GH-19717)

5 years agoFix typo in object.__format__ docs (GH-19504)
Heshy Roskes [Sun, 26 Apr 2020 01:57:09 +0000 (21:57 -0400)] 
Fix typo in object.__format__ docs (GH-19504)

5 years agobpo-40275: Avoid importing logging in test.support (GH-19601)
Serhiy Storchaka [Sat, 25 Apr 2020 08:35:18 +0000 (11:35 +0300)] 
bpo-40275: Avoid importing logging in test.support (GH-19601)

Import logging lazily in assertLogs() in unittest.
Move TestHandler from test.support to logging_helper.

5 years agobpo-40275: Avoid importing socket in test.support (GH-19603)
Serhiy Storchaka [Sat, 25 Apr 2020 07:06:29 +0000 (10:06 +0300)] 
bpo-40275: Avoid importing socket in test.support (GH-19603)

* Move socket related functions from test.support to socket_helper.
* Import socket, nntplib and urllib.error lazily in transient_internet().
* Remove importing multiprocess.

5 years agobpo-40275: Avoid importing asyncio in test.support (GH-19600)
Serhiy Storchaka [Sat, 25 Apr 2020 07:04:10 +0000 (10:04 +0300)] 
bpo-40275: Avoid importing asyncio in test.support (GH-19600)

* Import asyncio lazily in unittest (only when IsolatedAsyncioTestCase is used).
* Import asyncio.events lazily in test.support.

5 years agobpo-40279: Add some error-handling to the module initialisation docs example (GH...
Cajetan Rodrigues [Sat, 25 Apr 2020 05:27:53 +0000 (07:27 +0200)] 
bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705)

5 years agocloses bpo-40385: Remove Tools/scripts/checkpyc.py (GH-19709)
Ammar Askar [Sat, 25 Apr 2020 04:33:59 +0000 (21:33 -0700)] 
closes bpo-40385: Remove Tools/scripts/checkpyc.py (GH-19709)

This is one of the few files that has intimate knowledge of the pyc file
format. Since it lacks tests it tends to become outdated fairly quickly.
At present it has been broken since the introduction of PEP 552.

5 years agobpo-40334: Add What's New sections for PEP 617 and PEP 585 (GH-19704)
Guido van Rossum [Sat, 25 Apr 2020 00:19:56 +0000 (17:19 -0700)] 
bpo-40334: Add What's New sections for PEP 617 and PEP 585 (GH-19704)

5 years agobpo-40340: Separate examples more clearly in the programming FAQ (GH-19688)
Cajetan Rodrigues [Fri, 24 Apr 2020 23:39:04 +0000 (01:39 +0200)] 
bpo-40340: Separate examples more clearly in the programming FAQ (GH-19688)

5 years agobpo-40360: Deprecate lib2to3 module in light of PEP 617 (GH-19663)
Carl Meyer [Fri, 24 Apr 2020 18:19:46 +0000 (12:19 -0600)] 
bpo-40360: Deprecate lib2to3 module in light of PEP 617 (GH-19663)

Deprecate lib2to3 module in light of PEP 617.

We anticipate removal in the 3.12 timeframe.

5 years agobpo-40334: Rewrite test_c_parser to avoid memory leaks (GH-19694)
Lysandros Nikolaou [Fri, 24 Apr 2020 13:51:09 +0000 (16:51 +0300)] 
bpo-40334: Rewrite test_c_parser to avoid memory leaks (GH-19694)

Previously every test was building an extension module and
loading it into sys.modules. The tearDown function was thus
not able to clean up correctly, resulting in memory leaks.

With this commit, every test function now builds the extension
module and runs the actual test code in a new process
(using assert_python_ok), so that sys.modules stays intact
and no memory gets leaked.

5 years agobpo-38061: subprocess uses closefrom() on FreeBSD (GH-19697)
Victor Stinner [Fri, 24 Apr 2020 10:06:58 +0000 (12:06 +0200)] 
bpo-38061: subprocess uses closefrom() on FreeBSD (GH-19697)

Optimize the subprocess module on FreeBSD using closefrom().
A single close(fd) syscall is cheap, but when sysconf(_SC_OPEN_MAX)
is high, the loop calling close(fd) on each file descriptor can take
several milliseconds.

The workaround on FreeBSD to improve performance was to load and
mount the fdescfs kernel module, but this is not enabled by default.

Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
(kevans) and Kubilay Kocak (koobs):
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274

5 years agobpo-38061: os.closerange() uses closefrom() on FreeBSD (GH-19696)
Victor Stinner [Fri, 24 Apr 2020 10:00:51 +0000 (12:00 +0200)] 
bpo-38061: os.closerange() uses closefrom() on FreeBSD (GH-19696)

On FreeBSD, os.closerange(fd_low, fd_high) now calls
closefrom(fd_low) if fd_high is greater than or equal to
sysconf(_SC_OPEN_MAX).

Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
(kevans) and Kubilay Kocak (koobs):
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274

5 years agoExpand the implementation comments (GH-19699)
Raymond Hettinger [Fri, 24 Apr 2020 09:33:07 +0000 (02:33 -0700)] 
Expand the implementation comments (GH-19699)

5 years agobpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691)
Victor Stinner [Fri, 24 Apr 2020 00:43:18 +0000 (02:43 +0200)] 
bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691)

If _PyCode_InitOpcache() fails in _PyEval_EvalFrameDefault(), use
"goto exit_eval_frame;" rather than "return NULL;" to exit the
function in a consistent state. For example, tstate->frame is now
reset properly.

5 years agoUse Py_ssize_t instead of ssize_t (GH-19685)
Pablo Galindo [Fri, 24 Apr 2020 00:13:33 +0000 (01:13 +0100)] 
Use Py_ssize_t instead of ssize_t (GH-19685)

5 years agobpo-40334: Allow to run make regen-pegen without distutils (GH-19684)
Pablo Galindo [Thu, 23 Apr 2020 23:53:29 +0000 (00:53 +0100)] 
bpo-40334: Allow to run make regen-pegen without distutils (GH-19684)

5 years agoFix broken mkdir -p call in regen-pegen (#19695)
Guido van Rossum [Thu, 23 Apr 2020 23:30:42 +0000 (16:30 -0700)] 
Fix broken mkdir -p call in regen-pegen (#19695)

We should use `$(MKDIR_P) <directory>`, not `$(MKDIR_P) -p <directory>`.

5 years agobpo-40334: Use old compiler when compile mode is func_type (GH-19692)
Guido van Rossum [Thu, 23 Apr 2020 22:42:56 +0000 (15:42 -0700)] 
bpo-40334: Use old compiler when compile mode is func_type (GH-19692)

This is invoked by mypy, using ast.parse(source, "<func_type>", "func_type"). Since the new grammar doesn't yet support the func_type_input start symbol we must use the old compiler in this case to prevent a crash.

https://bugs.python.org/issue40334

5 years agobpo-40336: Refactor typing._SpecialForm (GH-19620)
Serhiy Storchaka [Thu, 23 Apr 2020 18:26:48 +0000 (21:26 +0300)] 
bpo-40336: Refactor typing._SpecialForm (GH-19620)

5 years agobpo-39983: Add test.support.print_warning() (GH-19683)
Victor Stinner [Thu, 23 Apr 2020 17:03:52 +0000 (19:03 +0200)] 
bpo-39983: Add test.support.print_warning() (GH-19683)

Log "Warning -- ..." test warnings into sys.__stderr__ rather than
sys.stderr, to ensure to display them even if sys.stderr is captured.

test.libregrtest.utils.print_warning() now calls
test.support.print_warning().

5 years agoUpdate ga_new to use _PyArg_CheckPositional and _PyArg_NoKwnames (GH-19679)
Dong-hee Na [Thu, 23 Apr 2020 16:25:53 +0000 (01:25 +0900)] 
Update ga_new to use _PyArg_CheckPositional and _PyArg_NoKwnames (GH-19679)

5 years agobpo-40334: Improve various PEG-Parser related stuff (GH-19669)
Lysandros Nikolaou [Thu, 23 Apr 2020 15:36:06 +0000 (18:36 +0300)] 
bpo-40334: Improve various PEG-Parser related stuff (GH-19669)

The changes in this commit are all related to @vstinner's original review comments of the initial PEP 617 implementation PR.

5 years agobpo-40370: Use the same compile and link args as the interpreter used in test_peg_gen...
Pablo Galindo [Thu, 23 Apr 2020 13:46:22 +0000 (14:46 +0100)] 
bpo-40370: Use the same compile and link args as the interpreter used in test_peg_generator (GH-19674)

5 years agogdbinit: Use proper define syntax (GH-19557)
Florian Bruhin [Thu, 23 Apr 2020 12:49:26 +0000 (14:49 +0200)] 
gdbinit: Use proper define syntax (GH-19557)

Using `def` rather than `define` results in:

    Ambiguous command "def pu": define, define-prefix.

Automerge-Triggered-By: @csabella
5 years agobpo-40334: Suppress all output in test_peg_generator (GH-19675)
Lysandros Nikolaou [Thu, 23 Apr 2020 12:22:16 +0000 (15:22 +0300)] 
bpo-40334: Suppress all output in test_peg_generator (GH-19675)

5 years agobpo-40334: Fix build errors and warnings in test_peg_generator (GH-19672)
Pablo Galindo [Thu, 23 Apr 2020 11:42:13 +0000 (12:42 +0100)] 
bpo-40334: Fix build errors and warnings in test_peg_generator (GH-19672)

5 years agobpo-40334: Don't downcast from Py_ssize_t to int (GH-19671)
Pablo Galindo [Thu, 23 Apr 2020 02:43:08 +0000 (03:43 +0100)] 
bpo-40334: Don't downcast from Py_ssize_t to int (GH-19671)

5 years agoCompile extensions in test_peg_generator with C99 (GH-19668)
Pablo Galindo [Thu, 23 Apr 2020 02:24:25 +0000 (03:24 +0100)] 
Compile extensions in test_peg_generator with C99 (GH-19668)

5 years agobpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)
Victor Stinner [Thu, 23 Apr 2020 01:03:24 +0000 (03:03 +0200)] 
bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)

* Rename PyConfig.use_peg to _use_peg_parser
* Document PyConfig._use_peg_parser and mark it a deprecated
* Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated
  in the documentation.
* Add use_old_parser() and skip_if_new_parser() to test.support
* Remove sys.flags.use_peg: use_old_parser() uses
  _testinternalcapi.get_configs() instead.
* Enhance test_embed tests
* subprocess._args_from_interpreter_flags() copies -X oldparser

5 years agobpo-40334: Fix builds outside the source directory and regenerate autoconf files...
Pablo Galindo [Thu, 23 Apr 2020 00:38:11 +0000 (01:38 +0100)] 
bpo-40334: Fix builds outside the source directory and regenerate autoconf files (GH-19667)

5 years agoAdd @pablogsal as code owner for pegen-related files (GH-19665)
Pablo Galindo [Wed, 22 Apr 2020 23:47:32 +0000 (00:47 +0100)] 
Add @pablogsal as code owner for pegen-related files (GH-19665)

5 years agobpo-40334: Fix errors in parse_string.c with old compilers (GH-19666)
Pablo Galindo [Wed, 22 Apr 2020 23:13:47 +0000 (00:13 +0100)] 
bpo-40334: Fix errors in parse_string.c with old compilers (GH-19666)

5 years agoPEP 617: Only run the CI with the new parser (GH-19664)
Pablo Galindo [Wed, 22 Apr 2020 23:06:03 +0000 (00:06 +0100)] 
PEP 617: Only run the CI with the new parser (GH-19664)

5 years agobpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)
Pablo Galindo [Wed, 22 Apr 2020 22:29:27 +0000 (23:29 +0100)] 
bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)

Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
5 years agobpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)
sweeneyde [Wed, 22 Apr 2020 21:05:48 +0000 (17:05 -0400)] 
bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)

Added str.removeprefix and str.removesuffix methods and corresponding
bytes, bytearray, and collections.UserString methods to remove affixes
from a string if present. See PEP 616 for a full description.

5 years agobpo-40260: Remove unnecessary newline in compile() call (GH-19641)
Anthony Sottile [Wed, 22 Apr 2020 18:42:53 +0000 (11:42 -0700)] 
bpo-40260: Remove unnecessary newline in compile() call (GH-19641)

Because some people subclass this class and call undocumented methods, and we don't want to break them.

5 years agobpo-39562: Prevent collision of future and compiler flags (GH-19230)
Batuhan Taşkaya [Wed, 22 Apr 2020 16:09:03 +0000 (19:09 +0300)] 
bpo-39562: Prevent collision of future and compiler flags (GH-19230)

The constant values of future flags in the __future__ module
is updated in order to prevent collision with compiler flags.
Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing
with CO_FUTURE_DIVISION.

5 years agobpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652)
Steve Dower [Wed, 22 Apr 2020 16:04:46 +0000 (17:04 +0100)] 
bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652)

5 years agobpo-40138: Fix Windows os.waitpid() for large exit code (GH-19637)
Victor Stinner [Wed, 22 Apr 2020 14:30:35 +0000 (16:30 +0200)] 
bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19637)

Fix the Windows implementation of os.waitpid() for exit code
larger than "INT_MAX >> 8". The exit status is now interpreted as an
unsigned number.

os.waitstatus_to_exitcode() now accepts wait status larger than
INT_MAX.

5 years agobpo-38329: python.org macOS installers now update Current symlink (GH-19650)
Ned Deily [Wed, 22 Apr 2020 08:27:13 +0000 (04:27 -0400)] 
bpo-38329: python.org macOS installers now update Current symlink (GH-19650)

Previously, python.org macOS installers did not alter the Current version
symlink in /Library/Frameworks/Python.framework/Versions when installing
a version of Python 3.x, only when installing 2.x.  Now that Python 2 is
retired, it's time to change that.  This should make it a bit easier
to embed Python 3 into other macOS applications.

5 years agobpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
Joshua Root [Wed, 22 Apr 2020 07:44:10 +0000 (17:44 +1000)] 
bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)

It is possible to use either '-isysroot /some/path' (with a space) or
'-isysroot/some/path' (no space in between). Support both forms in
places where special handling of -isysroot is done, rather than just
the first form.
Co-authored-by: Ned Deily <nad@python.org>
5 years agobpo-38439: Add 256px IDLE icon (GH-17473)
Miro Hrončok [Wed, 22 Apr 2020 07:21:44 +0000 (09:21 +0200)] 
bpo-38439: Add 256px IDLE icon (GH-17473)

Icon author: Andrew Clover, bpo-1490384

5 years agobpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642)
Ned Deily [Wed, 22 Apr 2020 02:41:33 +0000 (22:41 -0400)] 
bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642)

5 years agobpo-40327: Improve atomicity, speed, and memory efficiency of the items() loop (GH...
Raymond Hettinger [Tue, 21 Apr 2020 23:20:52 +0000 (16:20 -0700)] 
bpo-40327: Improve atomicity, speed, and memory efficiency of the items() loop (GH-19628)

5 years agoSmall improvements to the recipes and examples. (GH-19635)
Raymond Hettinger [Tue, 21 Apr 2020 23:11:00 +0000 (16:11 -0700)] 
Small improvements to the recipes and examples. (GH-19635)

* Add underscores to long numbers to improve readability
* Use bigger dataset in the bootstrapping example
* Convert single-server queue example to more useful multi-server queue

5 years agobpo-34037: Add Python API whatsnew for loop.shutdown_default_executor() (#19634)
Kyle Stanley [Tue, 21 Apr 2020 20:50:51 +0000 (16:50 -0400)] 
bpo-34037: Add Python API whatsnew for loop.shutdown_default_executor() (#19634)

Co-Authored-By: Victor Stinner <vstinner@python.org>
5 years agobpo-40335: Correctly handle multi-line strings in tokenize error scenarios (GH-19619)
Pablo Galindo [Tue, 21 Apr 2020 00:53:04 +0000 (01:53 +0100)] 
bpo-40335: Correctly handle multi-line strings in tokenize error scenarios (GH-19619)

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
5 years agobpo-40313: speed up bytes.hex() (GH-19594)
sweeneyde [Tue, 21 Apr 2020 00:17:52 +0000 (20:17 -0400)] 
bpo-40313: speed up bytes.hex() (GH-19594)

Automerge-Triggered-By: @gpshead
5 years agoFix uninitialized struct member (GH-19589)
Raymond Hettinger [Mon, 20 Apr 2020 20:47:12 +0000 (13:47 -0700)] 
Fix uninitialized struct member (GH-19589)

5 years agobpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)
HongWeipeng [Mon, 20 Apr 2020 20:01:53 +0000 (04:01 +0800)] 
bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)

https://bugs.python.org/issue39942

5 years agobpo-40330: Fix utf-8 size check in ShareableList (GH-19606)
Antoine Pitrou [Mon, 20 Apr 2020 18:54:55 +0000 (20:54 +0200)] 
bpo-40330: Fix utf-8 size check in ShareableList (GH-19606)

The item size must be checked after encoding to bytes, not before.

Automerge-Triggered-By: @pitrou