]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-38858: Reorganize pycore_init_types() (GH-17265)
Victor Stinner [Tue, 19 Nov 2019 23:38:03 +0000 (00:38 +0100)] 
bpo-38858: Reorganize pycore_init_types() (GH-17265)

* Call _PyLong_Init() and _PyExc_Init() earlier
* new_interpreter() reuses pycore_init_types()

5 years agobpo-38823: Fix refleaks in faulthandler init error path on Windows (GH-17250)
Brandt Bucher [Tue, 19 Nov 2019 23:13:05 +0000 (15:13 -0800)] 
bpo-38823: Fix refleaks in faulthandler init error path on Windows (GH-17250)

5 years agoRemove binding of captured exceptions when not used to reduce the chances of creating...
Pablo Galindo [Tue, 19 Nov 2019 21:34:03 +0000 (21:34 +0000)] 
Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246)

Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles.

See for example GH-13135

5 years agobpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088)
Jake Tesler [Tue, 19 Nov 2019 19:50:12 +0000 (11:50 -0800)] 
bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088)

This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`.

In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own).

This change forces the Process object to update its `native_id` attribute during the bootstrap process.

cc @vstinner

https://bugs.python.org/issue38707

Automerge-Triggered-By: @pitrou
5 years agobpo-38839: Fix some unused functions in tests (GH-17189)
Adam Johnson [Tue, 19 Nov 2019 19:45:20 +0000 (19:45 +0000)] 
bpo-38839: Fix some unused functions in tests (GH-17189)

5 years agobpo-38823: Clean up refleak in fcntl module initialization. (GH-17236)
Brandt Bucher [Tue, 19 Nov 2019 19:16:29 +0000 (11:16 -0800)] 
bpo-38823: Clean up refleak in fcntl module initialization. (GH-17236)

5 years agobpo-35409: Ignore GeneratorExit in async_gen_athrow_throw (GH-14755)
Vincent Michel [Tue, 19 Nov 2019 13:53:52 +0000 (05:53 -0800)] 
bpo-35409: Ignore GeneratorExit in async_gen_athrow_throw (GH-14755)

Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator.

https://bugs.python.org/issue35409

5 years agoAdded missing coma after end of list in subprocess.rst (GH-17217)
Jules Lasne (jlasne) [Tue, 19 Nov 2019 12:14:53 +0000 (13:14 +0100)] 
Added missing coma after end of list in subprocess.rst (GH-17217)

Automerge-Triggered-By: @csabella
5 years agoAdd missing comma and period in unittest docs (GH-17211)
Jules Lasne (jlasne) [Tue, 19 Nov 2019 12:05:45 +0000 (13:05 +0100)] 
Add missing comma and period in unittest docs (GH-17211)

Automerge-Triggered-By: @csabella
5 years agobpo-21767: explicitly mention abc support in functools.singledispatch docs (#17171)
Batuhan Taşkaya [Tue, 19 Nov 2019 08:16:46 +0000 (11:16 +0300)] 
bpo-21767: explicitly mention abc support in functools.singledispatch docs (#17171)

5 years agobpo-22367: Update test_fcntl.py for spawn process mode (#17154)
Dong-hee Na [Tue, 19 Nov 2019 08:12:42 +0000 (17:12 +0900)] 
bpo-22367: Update test_fcntl.py for spawn process mode (#17154)

5 years agoClean up module initialization. (GH-17215)
Brandt Bucher [Tue, 19 Nov 2019 07:16:23 +0000 (23:16 -0800)] 
Clean up module initialization. (GH-17215)

5 years agobpo-38807: Add os.PathLike to exception message raised by _check_arg_types (#17160)
Tomás Farías [Tue, 19 Nov 2019 05:54:00 +0000 (21:54 -0800)] 
bpo-38807: Add os.PathLike to exception message raised by _check_arg_types (#17160)

5 years agoAdd @pablogsal to code owners file for the garbage collector (GH-17248)
Pablo Galindo [Tue, 19 Nov 2019 02:03:55 +0000 (02:03 +0000)] 
Add @pablogsal to code owners file for the garbage collector (GH-17248)

Add myself to the codeowners file as I would like to
be automatically added as a reviewer for PRs that touch
that component and its documentation.

5 years agoMinor fixes to the formatting of the notes of Modules/gcmodule.c (GH-17247)
Pablo Galindo [Tue, 19 Nov 2019 01:36:57 +0000 (01:36 +0000)] 
Minor fixes to the formatting of the notes of Modules/gcmodule.c (GH-17247)

5 years agobpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single argument...
Steve Dower [Mon, 18 Nov 2019 21:30:01 +0000 (13:30 -0800)] 
bpo-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single argument (GH-17243)

5 years agobpo-38622: Add missing audit events for ctypes module (GH-17158)
Steve Dower [Mon, 18 Nov 2019 19:32:46 +0000 (11:32 -0800)] 
bpo-38622: Add missing audit events for ctypes module (GH-17158)

5 years agoRevert "remove a strange non-ASCII character in _iomodule.c" (GH-17240)
Tal Einat [Mon, 18 Nov 2019 19:19:51 +0000 (21:19 +0200)] 
Revert "remove a strange non-ASCII character in _iomodule.c" (GH-17240)

This reverts commit bcc1cc5c,  which removed an intentionally placed
"form feed" character.

5 years agobpo-38722: Runpy use io.open_code() (GH-17234)
jsnklln [Mon, 18 Nov 2019 19:11:13 +0000 (14:11 -0500)] 
bpo-38722: Runpy use io.open_code() (GH-17234)

https://bugs.python.org/issue38722

Automerge-Triggered-By: @taleinat
5 years agoremove a strange non-ASCII character in _iomodule.c (GH-17239)
Tal Einat [Mon, 18 Nov 2019 18:39:47 +0000 (20:39 +0200)] 
remove a strange non-ASCII character in _iomodule.c (GH-17239)

5 years agobpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
Tal Einat [Mon, 18 Nov 2019 17:32:25 +0000 (19:32 +0200)] 
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)

https://bugs.python.org/issue38809

5 years agobpo-38631: Avoid Py_FatalError() in _multibytecodec init (GH-17233)
Victor Stinner [Mon, 18 Nov 2019 16:40:07 +0000 (17:40 +0100)] 
bpo-38631: Avoid Py_FatalError() in _multibytecodec init (GH-17233)

If an exception is raised and PyInit__multibytecodec() returns NULL,
Python reports properly the exception to the user. There is no need
to crash Python with Py_FatalError().

5 years agobpo-38631: Avoid Py_FatalError() in float.__getformat__() (GH-17232)
Victor Stinner [Mon, 18 Nov 2019 16:39:48 +0000 (17:39 +0100)] 
bpo-38631: Avoid Py_FatalError() in float.__getformat__() (GH-17232)

Replace Py_FatalError() with a regular RuntimeError exception in
float.__getformat__().

5 years agoCorrect the description of the 3.7 change in urllib.parse.quote (GH-17065)
Роман Донченко [Mon, 18 Nov 2019 15:30:53 +0000 (18:30 +0300)] 
Correct the description of the 3.7 change in urllib.parse.quote (GH-17065)

`~` is now treated as an unreserved character (i.e. it doesn't get quoted), not a reserved one.

5 years agobpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)
Brandt Bucher [Mon, 18 Nov 2019 14:52:36 +0000 (06:52 -0800)] 
bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)

https://bugs.python.org/issue38823

5 years agobpo-38830: Correct slot signature in Qt example. (GH-17220)
Vinay Sajip [Mon, 18 Nov 2019 12:03:22 +0000 (12:03 +0000)] 
bpo-38830: Correct slot signature in Qt example. (GH-17220)

5 years agoRevert "bpo-38811: Check for presence of os.link method in pathlib. (GH-17170)" ...
Victor Stinner [Mon, 18 Nov 2019 11:26:37 +0000 (12:26 +0100)] 
Revert "bpo-38811: Check for presence of os.link method in pathlib. (GH-17170)" (#17219)

This reverts commit 111772fc27cfe388bc060f019d68a3e33481ec65.

5 years agobpo-38678: Improve argparse example in tutorial (GH-17207)
Raymond Hettinger [Mon, 18 Nov 2019 06:06:19 +0000 (22:06 -0800)] 
bpo-38678: Improve argparse example in tutorial (GH-17207)

5 years agobpo-25866: Minor cleanups to "sequence" in docs (GH-17177)
alclarks [Sun, 17 Nov 2019 22:00:43 +0000 (22:00 +0000)] 
bpo-25866: Minor cleanups to "sequence" in docs (GH-17177)

5 years agobpo-36589: Fix the error handling in curses.update_lines_cols(). (GH-12766)
Zackery Spytz [Sun, 17 Nov 2019 17:10:13 +0000 (10:10 -0700)] 
bpo-36589: Fix the error handling in curses.update_lines_cols(). (GH-12766)

Return None instead of 1.

5 years agobpo-38811: Check for presence of os.link method in pathlib. (GH-17170)
Toke Høiland-Jørgensen [Sun, 17 Nov 2019 17:06:38 +0000 (18:06 +0100)] 
bpo-38811: Check for presence of os.link method in pathlib. (GH-17170)

Fix also the Path.symplink() method implementation for the case when
symlinks are not supported.

5 years agobpo-38724: Implement subprocess.Popen.__repr__ (GH-17151)
Andrey Doroschenko [Sun, 17 Nov 2019 14:08:31 +0000 (17:08 +0300)] 
bpo-38724: Implement subprocess.Popen.__repr__ (GH-17151)

5 years agobpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)
Brandt Bucher [Sat, 16 Nov 2019 23:57:32 +0000 (15:57 -0800)] 
bpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)

https://bugs.python.org/issue38823

5 years agobpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)
Brandt Bucher [Sat, 16 Nov 2019 22:26:54 +0000 (14:26 -0800)] 
bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)

https://bugs.python.org/issue38823

5 years agoFix typo in Lib/socketserver.py (GH-17024)
Jason (Perry) Taylor [Sat, 16 Nov 2019 18:14:45 +0000 (05:14 +1100)] 
Fix typo in Lib/socketserver.py (GH-17024)

changed 'This is bad class design, but save some typing'
into 'This is bad class design, but saves some typing'.

5 years agobpo-28286: Deprecate opening GzipFile for writing implicitly. (GH-16417)
Serhiy Storchaka [Sat, 16 Nov 2019 16:56:57 +0000 (18:56 +0200)] 
bpo-28286: Deprecate opening GzipFile for writing implicitly. (GH-16417)

Always specify the mode argument for writing.

5 years agobpo-38650: Constify PyStructSequence_UnnamedField. (GH-17005)
Serhiy Storchaka [Sat, 16 Nov 2019 16:55:29 +0000 (18:55 +0200)] 
bpo-38650: Constify PyStructSequence_UnnamedField. (GH-17005)

Make it a constant and referring to a constant string.

5 years agobpo-38639: Optimize floor(), ceil() and trunc() for floats. (GH-16991)
Serhiy Storchaka [Sat, 16 Nov 2019 16:00:57 +0000 (18:00 +0200)] 
bpo-38639: Optimize floor(), ceil() and trunc() for floats. (GH-16991)

5 years agobpo-38644: Cleanup ceval.h (GH-17185)
Victor Stinner [Sat, 16 Nov 2019 00:04:44 +0000 (01:04 +0100)] 
bpo-38644: Cleanup ceval.h (GH-17185)

Move CPython API (Py_LIMITED_API macro not defined) from ceval.h
to cpython/ceval.h

5 years agobpo-38453: Ensure correct short path is obtained for test (GH-17184)
Steve Dower [Sat, 16 Nov 2019 00:04:00 +0000 (16:04 -0800)] 
bpo-38453: Ensure correct short path is obtained for test (GH-17184)

5 years agobpo-38644: Add _PyEval_EvalCode() (GH-17183)
Victor Stinner [Sat, 16 Nov 2019 00:03:22 +0000 (01:03 +0100)] 
bpo-38644: Add _PyEval_EvalCode() (GH-17183)

_PyFunction_Vectorcall() now pass tstate to function calls.

5 years agoUpdated missing periods in cmdline.rst (GH-17173)
Jules Lasne (jlasne) [Fri, 15 Nov 2019 22:18:17 +0000 (23:18 +0100)] 
Updated missing periods in cmdline.rst (GH-17173)

5 years agoFix the description of isdatadescriptor in inspect.rst (#16645)
HongWeipeng [Fri, 15 Nov 2019 21:47:26 +0000 (05:47 +0800)] 
Fix the description of isdatadescriptor in inspect.rst (#16645)

5 years agobpo-38816: Add notes in the C-API docs about fork in subinterpreters. (GH-17176)
Eric Snow [Fri, 15 Nov 2019 21:28:54 +0000 (13:28 -0800)] 
bpo-38816: Add notes in the C-API docs about fork in subinterpreters. (GH-17176)

The C-API docs are a bit sparse on the interplay between C `fork()` and the CPython runtime.  This change adds some more information on the subject.

https://bugs.python.org/issue38816

5 years agobpo-38453: Ensure ntpath.realpath correctly resolves relative paths (GH-16967)
Steve Dower [Fri, 15 Nov 2019 17:49:21 +0000 (09:49 -0800)] 
bpo-38453: Ensure ntpath.realpath correctly resolves relative paths (GH-16967)

Ensure isabs() is always True for \\?\ prefixed paths
Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly
Ensure shutil tests run in test directory

5 years agobpo-38778: Document that os.fork is not allowed in subinterpreters (GH-17123)
Phil Connell [Fri, 15 Nov 2019 16:56:03 +0000 (16:56 +0000)] 
bpo-38778: Document that os.fork is not allowed in subinterpreters (GH-17123)

Small docs update for [bpo-34651](https://bugs.python.org/issue34651).

Other references to fork (e.g. the PyOS.*Fork functions or discussions of fork() when embedding Python) point back to os.fork, so I don't think any other updates are needed.

https://bugs.python.org/issue38778

Automerge-Triggered-By: @ericsnowcurrently
5 years agobpo-38351: Modernize email examples from %-formatting to f-strings (GH-17162)
Andrey Doroschenko [Fri, 15 Nov 2019 09:03:47 +0000 (12:03 +0300)] 
bpo-38351: Modernize email examples from %-formatting to f-strings (GH-17162)

5 years agobpo-38677: Fix arraymodule error handling in module initialization. (GH-17039)
Marco Paolini [Fri, 15 Nov 2019 08:42:51 +0000 (08:42 +0000)] 
bpo-38677: Fix arraymodule error handling in module initialization. (GH-17039)

5 years agoAdd .pytest_cache to .gitignore (GH-16595)
Brandt Bucher [Fri, 15 Nov 2019 08:22:41 +0000 (00:22 -0800)] 
Add .pytest_cache to .gitignore (GH-16595)

5 years agobpo-38692: Add asyncio.PidfdChildWatcher to __all__ (GH-17161)
Kyle Stanley [Fri, 15 Nov 2019 02:47:56 +0000 (21:47 -0500)] 
bpo-38692: Add asyncio.PidfdChildWatcher to __all__ (GH-17161)

/cc @asvetlov @1st1

https://bugs.python.org/issue38692

Automerge-Triggered-By: @benjaminp
5 years agobpo-38644: Add _PyObject_Call() (GH-17089)
Victor Stinner [Thu, 14 Nov 2019 12:36:21 +0000 (13:36 +0100)] 
bpo-38644: Add _PyObject_Call() (GH-17089)

* Add pycore_call.h internal header file.
* Add _PyObject_Call(): PyObject_Call() with tstate
* Add _PyObject_CallNoArgTstate(): _PyObject_CallNoArg() with tstate
* Add _PyObject_FastCallDictTstate(): _PyObject_FastCallDict()
  with tstate
* _PyObject_Call_Prepend() now takes tstate
* Replace _PyObject_FastCall() calls
  with _PyObject_VectorcallTstate() calls

5 years agobpo-38644: Add _PyEval_EvalFrame() with tstate (GH-17131)
Victor Stinner [Thu, 14 Nov 2019 11:20:46 +0000 (12:20 +0100)] 
bpo-38644: Add _PyEval_EvalFrame() with tstate (GH-17131)

Add _PyEval_EvalFrame() static inline function to get eval_frame from
tstate->interp.

5 years agocloses bpo-38692: Add a pidfd child process watcher to asyncio. (GH-17069)
Benjamin Peterson [Thu, 14 Nov 2019 03:08:50 +0000 (19:08 -0800)] 
closes bpo-38692: Add a pidfd child process watcher to asyncio. (GH-17069)

5 years agobpo-38785: Prevent asyncio from crashing (GH-17144)
Andrew Svetlov [Wed, 13 Nov 2019 21:36:46 +0000 (23:36 +0200)] 
bpo-38785: Prevent asyncio from crashing  (GH-17144)

if parent `__init__` is not called from a constructor of object derived from `asyncio.Future`

https://bugs.python.org/issue38785

5 years agobpo-38786: Add parsing of https links to pydoc (GH-17143)
Kirill [Wed, 13 Nov 2019 16:13:53 +0000 (19:13 +0300)] 
bpo-38786: Add parsing of https links to pydoc (GH-17143)

5 years agobpo-38781: Clear buffer in MemoryHandler flush (GH-17132)
Daniel Andersson [Wed, 13 Nov 2019 09:03:45 +0000 (10:03 +0100)] 
bpo-38781: Clear buffer in MemoryHandler flush (GH-17132)

This makes it easier to use a custom buffer when subclassing
MemoryHandler (by avoiding the explicity empty list literal
assignment in the flush method). For example, collection.deque
can now be used without any modifications to MemoryHandler.flush.

The same applies to BufferingHandler.

5 years agobpo-4630: Add cursor no-blink option for IDLE (GH-16960)
Zackery Spytz [Wed, 13 Nov 2019 07:13:33 +0000 (00:13 -0700)] 
bpo-4630: Add cursor no-blink option for IDLE (GH-16960)

This immediately toggles shell, editor, and output windows, but does not affect other input widgets.

5 years agoFix minor typos. (GH-17095)
Shu [Wed, 13 Nov 2019 03:12:11 +0000 (22:12 -0500)] 
Fix minor typos. (GH-17095)

5 years agoAdd Ilya Kulakov to Misc/ACKS. (GH-17130)
Ilya Kulakov [Wed, 13 Nov 2019 02:33:04 +0000 (18:33 -0800)] 
Add Ilya Kulakov to Misc/ACKS. (GH-17130)

Contributions on bpo-26467 and bpo-29302.

5 years agocloses bpo-27805: Ignore ESPIPE in initializing seek of append-mode files. (GH-17112)
Benjamin Peterson [Tue, 12 Nov 2019 22:51:34 +0000 (14:51 -0800)] 
closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode files. (GH-17112)

This change, which follows the behavior of C stdio's fdopen and Python 2's file object, allows pipes to be opened in append mode.

5 years agobpo-38723: Pdb._runscript should use io.open_code() instead of open() (GH-17127)
jsnklln [Tue, 12 Nov 2019 22:42:47 +0000 (17:42 -0500)] 
bpo-38723: Pdb._runscript should use io.open_code() instead of open() (GH-17127)

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
5 years agobpo-38738: Fix formatting of True and False. (GH-17083)
Serhiy Storchaka [Tue, 12 Nov 2019 14:57:03 +0000 (16:57 +0200)] 
bpo-38738: Fix formatting of True and False. (GH-17083)

* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".

5 years agobpo-36974: expand call protocol documentation (GH-13844)
Jeroen Demeyer [Tue, 12 Nov 2019 13:08:00 +0000 (14:08 +0100)] 
bpo-36974: expand call protocol documentation (GH-13844)

CC @encukou

I'm also adding Petr Viktorin as contributor for vectorcall in the "what's new" section.

https://bugs.python.org/issue36974

Automerge-Triggered-By: @encukou
Automerge-Triggered-By: @encukou
5 years agobpo-38421: Update email.utils documentation (GH-16678)
David K [Tue, 12 Nov 2019 12:38:46 +0000 (12:38 +0000)] 
bpo-38421: Update email.utils documentation (GH-16678)

Updates documentation around email.utils.parsedate_tz().

Currently, the documentation specifies that when a string without a is timezone passed to parsedate_tz(), the last tuple is returned as ```None```.

This is no longer true since Python 3.3

https://bugs.python.org/issue38421

5 years agobpo-16576: Add checks for bitfields passed by value to functions. (GH-17097)
Vinay Sajip [Tue, 12 Nov 2019 12:29:34 +0000 (12:29 +0000)] 
bpo-16576: Add checks for bitfields passed by value to functions. (GH-17097)

5 years agobpo-26353: IDLE adds an unneeded newline when saving a shell window (GH-17103)
Zackery Spytz [Tue, 12 Nov 2019 10:54:10 +0000 (03:54 -0700)] 
bpo-26353: IDLE adds an unneeded newline when saving a shell window (GH-17103)

5 years agobpo-38385: Fix iterator/iterable terminology in statistics docs (GH-17111)
Raymond Hettinger [Tue, 12 Nov 2019 07:35:06 +0000 (23:35 -0800)] 
bpo-38385: Fix iterator/iterable terminology in statistics docs (GH-17111)

5 years agobpo-38565: add new cache_parameters method for lru_cache (GH-16916)
Manjusaka [Tue, 12 Nov 2019 07:30:18 +0000 (15:30 +0800)] 
bpo-38565: add new cache_parameters method for lru_cache (GH-16916)

6 years agobpo-38771: Explict test for None in code example (GH-17108)
Jonathan Scholbach [Tue, 12 Nov 2019 00:49:41 +0000 (01:49 +0100)] 
bpo-38771:  Explict test for None in code example (GH-17108)

6 years agobpo-38438: Simplify argparse "star nargs" usage. (GH-17106)
Brandt Bucher [Mon, 11 Nov 2019 20:47:48 +0000 (12:47 -0800)] 
bpo-38438: Simplify argparse "star nargs" usage. (GH-17106)

6 years agobpo-38761: Register WeakSet as a MutableSet (GH-17104)
Raymond Hettinger [Mon, 11 Nov 2019 04:12:04 +0000 (20:12 -0800)] 
bpo-38761: Register WeakSet as a MutableSet (GH-17104)

6 years agoMinor readability improvement for argument handling in itertools.repeat() (GH-17101)
Raymond Hettinger [Sun, 10 Nov 2019 04:28:31 +0000 (20:28 -0800)] 
Minor readability improvement for argument handling in itertools.repeat()  (GH-17101)

6 years agobpo-38635: Simplify decoding the ZIP64 extra field and make it tolerant to extra...
Serhiy Storchaka [Sat, 9 Nov 2019 11:13:36 +0000 (13:13 +0200)] 
bpo-38635: Simplify decoding the ZIP64 extra field and make it tolerant to extra data. (GH-16988)

6 years agoClarify amount of dots between package and subpackage (GH-17092)
Shu [Fri, 8 Nov 2019 20:26:35 +0000 (15:26 -0500)] 
Clarify amount of dots between package and subpackage (GH-17092)

6 years agobpo-38644: Add _PyObject_VectorcallTstate() (GH-17052)
Victor Stinner [Fri, 8 Nov 2019 09:05:17 +0000 (10:05 +0100)] 
bpo-38644: Add _PyObject_VectorcallTstate() (GH-17052)

* Add _PyObject_VectorcallTstate() function: similar to
  _PyObject_Vectorcall(), but with tstate parameter
* Add tstate parameter to _PyObject_MakeTpCall()

6 years agobpo-22367: Add tests for fcntl.lockf(). (GH-17010)
Dong-hee Na [Thu, 7 Nov 2019 20:31:41 +0000 (05:31 +0900)] 
bpo-22367: Add tests for fcntl.lockf(). (GH-17010)

6 years agobpo-38613: Optimize set operations of dict keys. (GH-16961)
Inada Naoki [Thu, 7 Nov 2019 15:59:04 +0000 (00:59 +0900)] 
bpo-38613: Optimize set operations of dict keys. (GH-16961)

6 years agobpo-38733: PyErr_Occurred() caller must hold the GIL (GH-17080)
Victor Stinner [Thu, 7 Nov 2019 11:42:07 +0000 (12:42 +0100)] 
bpo-38733: PyErr_Occurred() caller must hold the GIL (GH-17080)

bpo-3605, bpo-38733: Optimize _PyErr_Occurred(): remove "tstate ==
NULL" test.

Py_FatalError() no longer calls PyErr_Occurred() if called without
holding the GIL. So PyErr_Occurred() no longer has to support
tstate==NULL case.

_Py_CheckFunctionResult(): use directly _PyErr_Occurred() to avoid
explicit "!= NULL" test.

6 years agoupdate a deprecated assert in logging tests (GH-17079)
l0rb [Thu, 7 Nov 2019 10:13:36 +0000 (11:13 +0100)] 
update a deprecated assert in logging tests (GH-17079)

6 years agobpo-36876: Moved Parser/listnode.c statics to interpreter state. (GH-16328)
Vinay Sajip [Thu, 7 Nov 2019 10:08:58 +0000 (10:08 +0000)] 
bpo-36876: Moved Parser/listnode.c statics to interpreter state. (GH-16328)

6 years agobpo-38382: Document the early-out behavior for a zero (GH-17037)
Raymond Hettinger [Thu, 7 Nov 2019 05:50:44 +0000 (21:50 -0800)] 
bpo-38382: Document the early-out behavior for a zero (GH-17037)

6 years agobpo-38716: stop rotating handlers from setting inherited namer and rotator to None...
l0rb [Wed, 6 Nov 2019 21:21:40 +0000 (22:21 +0100)] 
bpo-38716: stop rotating handlers from setting inherited namer and rotator to None (GH-17072)

6 years agocloses bpo-38713: Expose P_PIDFD in os if it's defined. (GH-17071)
Benjamin Peterson [Wed, 6 Nov 2019 05:58:31 +0000 (21:58 -0800)] 
closes bpo-38713: Expose P_PIDFD in os if it's defined. (GH-17071)

https://bugs.python.org/issue38713

6 years agobpo-38692: Add os.pidfd_open. (GH-17063)
Benjamin Peterson [Wed, 6 Nov 2019 03:21:29 +0000 (19:21 -0800)] 
bpo-38692: Add os.pidfd_open. (GH-17063)

6 years agobpo-38696: Fix usage example of HTTPStatus (GH-17066)
Ammar Askar [Tue, 5 Nov 2019 23:29:33 +0000 (18:29 -0500)] 
bpo-38696: Fix usage example of HTTPStatus (GH-17066)

6 years agobpo-37645: add new function _PyObject_FunctionStr() (GH-14890)
Jeroen Demeyer [Tue, 5 Nov 2019 15:48:04 +0000 (16:48 +0100)] 
bpo-37645: add new function _PyObject_FunctionStr() (GH-14890)

Additional note: the `method_check_args` function in `Objects/descrobject.c` is written in such a way that it applies to all kinds of descriptors. In particular, a future re-implementation of `wrapper_descriptor` could use that code.

CC @vstinner @encukou

https://bugs.python.org/issue37645

Automerge-Triggered-By: @encukou
6 years agobpo-35381 Remove all static state from posixmodule (GH-15892)
Eddie Elizondo [Tue, 5 Nov 2019 15:16:14 +0000 (07:16 -0800)] 
bpo-35381 Remove all static state from posixmodule (GH-15892)

After #9665, this moves the remaining types in posixmodule to be heap-allocated to make it compatible with PEP384 as well as modifying all the type accessors to fully make the type opaque.

The original PR that got messed up a rebase: https://github.com/python/cpython/pull/10854. All the issues in that commit have now been addressed since https://github.com/python/cpython/pull/11661 got committed.

This change also removes any state from the data segment and onto the module state itself.

https://bugs.python.org/issue35381

Automerge-Triggered-By: @encukou
6 years agoUpdate interpreter.rst (GH-17059)
Jules Lasne (jlasne) [Tue, 5 Nov 2019 13:20:38 +0000 (14:20 +0100)] 
Update interpreter.rst (GH-17059)

Fixed what seemed to be a weird phrasing.

6 years ago_json.c: use Py_UNUSED() macro (GH-17053)
Victor Stinner [Tue, 5 Nov 2019 10:44:28 +0000 (11:44 +0100)] 
_json.c: use Py_UNUSED() macro (GH-17053)

Remove UNUSED macro: use Py_UNUSED() macro instead.

6 years agocloses bpo-37633: Reëxport some function compatibility wrappers for macros in ``pytho...
Benjamin Peterson [Tue, 5 Nov 2019 05:34:14 +0000 (21:34 -0800)] 
closes bpo-37633: Reëxport some function compatibility wrappers for macros in ``pythonrun.h``. (GH-17056)

6 years agoFix a typo in wave module docstring (GH-17009)
Michael Haas [Tue, 5 Nov 2019 04:32:10 +0000 (22:32 -0600)] 
Fix a typo in wave module docstring (GH-17009)

s/pathing/patching/

6 years agobpo-38644: Pass tstate to _Py_CheckFunctionResult() (GH-17050)
Victor Stinner [Tue, 5 Nov 2019 00:22:12 +0000 (01:22 +0100)] 
bpo-38644: Pass tstate to _Py_CheckFunctionResult() (GH-17050)

* Add tstate parameter to _Py_CheckFunctionResult()
* Add _PyErr_FormatFromCauseTstate()
* Replace PyErr_XXX(...) with _PyErr_XXX(state, ...)

6 years agobpo-38644: Pass tstate to Py_EnterRecursiveCall() (GH-16997)
Victor Stinner [Mon, 4 Nov 2019 23:51:22 +0000 (00:51 +0100)] 
bpo-38644: Pass tstate to Py_EnterRecursiveCall() (GH-16997)

* Add _Py_EnterRecursiveCall() and _Py_LeaveRecursiveCall() which
  require a tstate argument.
* Pass tstate to _Py_MakeRecCheck() and  _Py_CheckRecursiveCall().
* Convert Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() macros
  to static inline functions.

_PyThreadState_GET() is the most efficient way to get the tstate, and
so using it with _Py_EnterRecursiveCall() and
_Py_LeaveRecursiveCall() should be a little bit more efficient than
using Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() which use
the "slower" PyThreadState_GET().

6 years agobpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)
Victor Stinner [Mon, 4 Nov 2019 18:48:34 +0000 (19:48 +0100)] 
bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)

Provide Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as
regular functions for the limited API. Previously, there were defined
as macros, but these macros didn't work with the limited API which
cannot access PyThreadState.recursion_depth field.

Remove _Py_CheckRecursionLimit from the stable ABI.

Add Include/cpython/ceval.h header file.

6 years agobpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (#17043)
Alexandru Ardelean [Mon, 4 Nov 2019 14:55:56 +0000 (16:55 +0200)] 
bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (#17043)

6 years agobpo-37759: Show output from var_access_benchmark (GH-17040)
Raymond Hettinger [Mon, 4 Nov 2019 05:47:01 +0000 (21:47 -0800)] 
bpo-37759:  Show output from var_access_benchmark (GH-17040)

6 years agobpo-38388: Document pickle protocol version 5 (GH-16639)
Dima Tisnek [Sun, 3 Nov 2019 11:55:33 +0000 (20:55 +0900)] 
bpo-38388: Document pickle protocol version 5 (GH-16639)

6 years agoConvert argument to snake_case (GH-16990)
Борис Верховский [Sat, 2 Nov 2019 19:09:14 +0000 (15:09 -0400)] 
Convert argument to snake_case (GH-16990)

6 years agoYears overdue, explain why unreachable objects are moved. (GH-17030)
Tim Peters [Sat, 2 Nov 2019 17:06:31 +0000 (12:06 -0500)] 
Years overdue, explain why unreachable objects are moved. (GH-17030)

6 years agobpo-38422: Clarify docstrings of pathlib suffix(es) (GH-16679)
Ram Rachum [Sat, 2 Nov 2019 16:46:24 +0000 (18:46 +0200)] 
bpo-38422: Clarify docstrings of pathlib suffix(es) (GH-16679)

Whenever I use `path.suffix` I have to check again whether it includes the dot or not. I decided to add it to the docstring so I won't have to keep checking.

https://bugs.python.org/issue38422

Automerge-Triggered-By: @pitrou