]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-8264: Document hasattr and getattr behavior for private attributes (GH-23513)
Ken Jin [Tue, 2 Feb 2021 21:06:57 +0000 (05:06 +0800)] 
bpo-8264: Document hasattr and getattr behavior for private attributes (GH-23513)

Clarify ``getattr`` and ``setattr`` requirements for accessing name-mangled attributes

Co-Authored-By: Catalin Iacob <iacobcatalin@gmail.com>
4 years agobpo-43108: Fix a reference leak in the curses module (GH-24420)
Pablo Galindo [Tue, 2 Feb 2021 20:38:26 +0000 (20:38 +0000)] 
bpo-43108: Fix a reference leak in the curses module (GH-24420)

4 years agobpo-41149: Fix a bug in threading that causes fals-y threads callables to fail to...
BarneyStratford [Tue, 2 Feb 2021 20:24:24 +0000 (20:24 +0000)] 
bpo-41149: Fix a bug in threading that causes fals-y threads callables to fail to start. (GH-21201)

4 years agobpo-42997: Improve error message for missing : before suites (GH-24292)
Pablo Galindo [Tue, 2 Feb 2021 19:54:22 +0000 (19:54 +0000)] 
bpo-42997: Improve error message for missing : before suites (GH-24292)

* Add to the peg generator a new directive ('&&') that allows to expect
  a token and hard fail the parsing if the token is not found. This
  allows to quickly emmit syntax errors for missing tokens.

* Use the new grammar element to hard-fail if the ':' is missing before
  suites.

4 years agoOnly eliminate jumps to successor block if jump is unconditional. (GH-24417)
Mark Shannon [Tue, 2 Feb 2021 14:59:15 +0000 (14:59 +0000)] 
Only eliminate jumps to successor block if jump is unconditional. (GH-24417)

* Prevents elimination of the sole test of a value in statements like:
   if x or True: ...

4 years agobpo-41748: Handles unquoted attributes with commas (#24072)
Karl Dubost [Mon, 1 Feb 2021 20:32:50 +0000 (05:32 +0900)] 
bpo-41748: Handles unquoted attributes with commas (#24072)

* bpo-41748: Adds tests for unquoted attributes with comma

* bpo-41748: Handles unquoted attributes with comma

* bpo-41748: Addresses review comments

* bpo-41748: Addresses review comments

* Adds more test cases
* Simplifies the regex for handling spaces

* bpo-41748: Moves attributes tests under the right class

* bpo-41748: Addresses review about duplicate attributes

* bpo-41748: Adds NEWS.d entry for this patch

4 years agobpo-38307: Add end_lineno attribute to pyclbr Objects (GH-24348)
Aviral Srivastava [Mon, 1 Feb 2021 17:38:44 +0000 (09:38 -0800)] 
bpo-38307: Add end_lineno attribute to pyclbr Objects (GH-24348)

For back-compatibility, make the new constructor parameter for public classes Function and Class
keyword-only with a default of None.

Co-authored-by: Aviral Srivastava <aviralsrivastava@Avirals-MacBook-Air.local
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agobpo-42834: Fix _json internal caches for subinterpreters (GH-24121)
Ken Jin [Mon, 1 Feb 2021 16:26:56 +0000 (00:26 +0800)] 
bpo-42834: Fix _json internal caches for subinterpreters (GH-24121)

Make internal caches of the _json extension module
compatible with subinterpreters.

4 years agoFix typo in Lib/trace.py (GH-24309)
Yonatan Goldschmidt [Mon, 1 Feb 2021 15:46:38 +0000 (17:46 +0200)] 
Fix typo in Lib/trace.py (GH-24309)

4 years agobpo-42990: Further refactoring of PyEval_ functions. (GH-24368)
Mark Shannon [Mon, 1 Feb 2021 10:42:03 +0000 (10:42 +0000)] 
bpo-42990: Further refactoring of PyEval_ functions. (GH-24368)

* Further refactoring of PyEval_EvalCode and friends. Break into make-frame, and eval-frame parts.

* Simplify function vector call using new _PyEval_Vector.

* Remove unused internal functions: _PyEval_EvalCodeWithName and _PyEval_EvalCode.

* Don't use legacy function PyEval_EvalCodeEx.

4 years agobpo-42504: Ensure that get_config_var('MACOSX_DEPLOYMENT_TARGET') is a string (GH...
Ronald Oussoren [Mon, 1 Feb 2021 03:29:44 +0000 (04:29 +0100)] 
bpo-42504: Ensure that get_config_var('MACOSX_DEPLOYMENT_TARGET') is a string (GH-24341)

* bpo-42504: Ensure that get_config_var('MACOSX_DEPLOYMENT_TARGET') is a string

4 years agobpo-42927: Update the What's new entry for LOAD_ATTR optimizations (GH-24383)
Pablo Galindo [Sun, 31 Jan 2021 22:55:48 +0000 (22:55 +0000)] 
bpo-42927: Update the What's new entry for LOAD_ATTR optimizations (GH-24383)

4 years agobpo-43017: Improve error message for unparenthesised tuples in comprehensions (GH24314)
Pablo Galindo [Sun, 31 Jan 2021 22:52:56 +0000 (22:52 +0000)] 
bpo-43017: Improve error message for unparenthesised tuples in comprehensions (GH24314)

4 years agobpo-42986: Fix parser crash when reporting syntax errors in f-string with newlines...
Pablo Galindo [Sun, 31 Jan 2021 22:48:23 +0000 (22:48 +0000)] 
bpo-42986: Fix parser crash when reporting syntax errors in f-string with newlines (GH-24279)

4 years agobpo-43016: Fix test_curses on platform without cursesw (GH-24405)
Serhiy Storchaka [Sun, 31 Jan 2021 21:21:55 +0000 (23:21 +0200)] 
bpo-43016: Fix test_curses on platform without cursesw (GH-24405)

4 years agobpo-41604: Don't decrement the reference count of the previous user_ptr when set_pane...
Anonymous Maarten [Sun, 31 Jan 2021 17:55:15 +0000 (18:55 +0100)] 
bpo-41604: Don't decrement the reference count of the previous user_ptr when set_panel_usertpr fails (GH-21933)

4 years agobpo-43083: Fix error handling in _sqlite3 (GH-24395)
Serhiy Storchaka [Sun, 31 Jan 2021 15:42:38 +0000 (17:42 +0200)] 
bpo-43083: Fix error handling in _sqlite3 (GH-24395)

4 years agobpo-43016: Rewrite tests for curses (GH-24312)
Serhiy Storchaka [Sun, 31 Jan 2021 15:22:27 +0000 (17:22 +0200)] 
bpo-43016: Rewrite tests for curses (GH-24312)

4 years agobpo-43030: Fixed a compiler warning in Py_UNICODE_ISSPACE with signed wchar_t (GH...
Serhiy Storchaka [Sun, 31 Jan 2021 13:55:13 +0000 (15:55 +0200)] 
bpo-43030: Fixed a compiler warning in Py_UNICODE_ISSPACE with signed wchar_t (GH-24350)

4 years agoDoc: errors tutorial improvements (GH-16269)
Adorilson Bezerra [Sun, 31 Jan 2021 06:07:11 +0000 (03:07 -0300)] 
Doc: errors tutorial improvements (GH-16269)

Improvements:

- Improvements in how try clause works section
  This suggestion is because the execution continues after *except*, not after *try* but before *except*. I guess this form more clear.

- Surrounding some keywords with \*...\*
  For uniformity the highlighted terms

- Adjust the number of chars per line to 80

4 years agobpo-43059: Remove reference to legacy external sqlite3 repository (GH-24364)
L [Sun, 31 Jan 2021 05:19:07 +0000 (05:19 +0000)] 
bpo-43059: Remove reference to legacy external sqlite3 repository (GH-24364)

4 years agobpo-43077: Update bundled pip to 21.0.1 and setuptools to 52.0.0 (GH-24386)
Paul Moore [Sat, 30 Jan 2021 16:42:36 +0000 (16:42 +0000)] 
bpo-43077: Update bundled pip to 21.0.1 and setuptools to 52.0.0 (GH-24386)

Update bundled pip to 21.0.1 and setuptools to 52.0.0

4 years agobpo-40455: Fix gcc10+ warning about writing into a section of offset 0 (GH-24384)
Pablo Galindo [Sat, 30 Jan 2021 13:54:22 +0000 (13:54 +0000)] 
bpo-40455: Fix gcc10+ warning about writing into a section of offset 0 (GH-24384)

4 years agobpo-43047: logging.config formatters documentation update (GH-24358)
Ian Wienand [Sat, 30 Jan 2021 10:37:15 +0000 (21:37 +1100)] 
bpo-43047: logging.config formatters documentation update (GH-24358)

The documentation for some parts of the logging.config formatters has
fallen behind the code.  For example, the dictionary-schema section
does not list the "class" attribute, however it is discussed in the
file/ini discussion; and neither references the style argument which
has been added.

This modifies the dictionary-schema formatters documentation to list
the keys available and overall makes it clearer these are passed to
create a logging.Formatter object.

The logging.Formatter documentation describes the default values of
format/datefmt and the various formatting options.  Since we have now
more clearly described how the configuration is created via this type
of object, we remove the discussion in this document to avoid
duplication and rely on users reading the referenced logging.Formatter
documenation directly for such details.

Instead of duplicating the discussion for the two config types, the
file/ini section is modified to link back to the dictionary-schema
discussion, making it clear the same arguments are accepted.

Automerge-Triggered-By: GH:vsajip
4 years agobpo-42927: Inline cache for attributes defined with '__slots__' (#24216)
Guido van Rossum [Sat, 30 Jan 2021 02:02:29 +0000 (18:02 -0800)] 
bpo-42927: Inline cache for attributes defined with '__slots__' (#24216)

4 years agobpo-38631: Replace compiler fatal errors with exceptions (GH-24369)
Victor Stinner [Sat, 30 Jan 2021 00:46:44 +0000 (01:46 +0100)] 
bpo-38631: Replace compiler fatal errors with exceptions (GH-24369)

* Replace Py_FatalError() calls with regular SystemError exceptions.
* compiler_exit_scope() calls _PyErr_WriteUnraisableMsg() to log the
  PySequence_DelItem() failure.
* compiler_unit_check() uses _PyMem_IsPtrFreed().
* compiler_make_closure(): remove "(reftype == FREE)" comment since
  reftype can also be LOCAL or GLOBAL_EXPLICIT.

4 years agoFix a reference leak in the compiler for compiler_lambda() (GH-24382)
Pablo Galindo [Fri, 29 Jan 2021 22:40:59 +0000 (22:40 +0000)] 
Fix a reference leak in the compiler for compiler_lambda() (GH-24382)

4 years agobpo-42323: Fix math.nextafter() on AIX (GH-24381)
Victor Stinner [Fri, 29 Jan 2021 22:04:50 +0000 (23:04 +0100)] 
bpo-42323: Fix math.nextafter() on AIX (GH-24381)

math_nextafter_impl() must return a Python object, not a C double.

4 years agobpo-41282: Add deprecation warning and docs for distutils (PEP 632) (GH-24355)
Steve Dower [Fri, 29 Jan 2021 21:48:55 +0000 (21:48 +0000)] 
bpo-41282: Add deprecation warning and docs for distutils (PEP 632) (GH-24355)

4 years agoFixing typos in turtle.rst (GH-24376)
Jules Lasne [Fri, 29 Jan 2021 21:40:45 +0000 (22:40 +0100)] 
Fixing typos in turtle.rst (GH-24376)

Automerge-Triggered-By: GH:JulienPalard
4 years agobpo-43008: Add 'Patch by Ken Hilton' (GH-24370)
Terry Jan Reedy [Fri, 29 Jan 2021 18:02:05 +0000 (13:02 -0500)] 
bpo-43008: Add 'Patch by Ken Hilton' (GH-24370)

4 years agoFixed typo in turtle.rst (GH-24371)
Jules Lasne [Fri, 29 Jan 2021 17:46:39 +0000 (18:46 +0100)] 
Fixed typo in turtle.rst (GH-24371)

Found it while translating it to french πŸ€·

Automerge-Triggered-By: GH:JulienPalard
4 years agobpo-42979: Use _Py_CheckSlotResult() to check slots result (GH-24356)
Victor Stinner [Fri, 29 Jan 2021 15:53:03 +0000 (16:53 +0100)] 
bpo-42979: Use _Py_CheckSlotResult() to check slots result (GH-24356)

When Python is built in debug mode (with C assertions), calling a
type slot like sq_length (__len__() in Python) now fails with a fatal
error if the slot succeeded with an exception set, or failed with no
exception set. The error message contains the slot, the type name,
and the current exception (if an exception is set).

* Check the result of all slots using _Py_CheckSlotResult().
* No longer pass op_name to ternary_op() in release mode.
* Replace operator with dunder Python method name in error messages.
  For example, replace "*" with "__mul__".
* Fix compiler_exit_scope() when an exception is set.
* Fix bytearray.extend() when an exception is set: don't call
  bytearray_setslice() with an exception set.

4 years agobpo-42990: Introduce 'frame constructor' struct to simplify API for PyEval_CodeEval...
Mark Shannon [Fri, 29 Jan 2021 13:24:55 +0000 (13:24 +0000)] 
bpo-42990: Introduce 'frame constructor' struct to simplify API for PyEval_CodeEval and friends (GH-24298)

* Introduce 'frame constructor' to simplify API for frame creation

* Embed struct using a macro to conform to PEP 7

4 years agobpo-23544: Disable IDLE Stack Viewer when running user code (GH-17163)
Zackery Spytz [Thu, 28 Jan 2021 23:13:22 +0000 (16:13 -0700)] 
bpo-23544: Disable IDLE Stack Viewer when running user code (GH-17163)

Starting stack viewer when user code is running, including when Debugger is active, hangs or crashes IDLE.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agobpo-42955: Remove sub-packages from sys.stdlib_module_names (GH-24353)
Victor Stinner [Wed, 27 Jan 2021 23:03:23 +0000 (00:03 +0100)] 
bpo-42955: Remove sub-packages from sys.stdlib_module_names (GH-24353)

4 years agobpo-42979: Enhance abstract.c assertions checking slot result (GH-24352)
Victor Stinner [Wed, 27 Jan 2021 16:39:16 +0000 (17:39 +0100)] 
bpo-42979: Enhance abstract.c assertions checking slot result (GH-24352)

* bpo-42979: Enhance abstract.c assertions checking slot result

Add _Py_CheckSlotResult() function which fails with a fatal error if
a slot function succeeded with an exception set or failed with no
exception set: write the slot name, the type name and the current
exception (if an exception is set).

4 years agobpo-42979: _zoneinfo exec function checks for PyDateTime_IMPORT failure (GH-24333)
Hai Shi [Wed, 27 Jan 2021 10:23:33 +0000 (18:23 +0800)] 
bpo-42979: _zoneinfo exec function checks for PyDateTime_IMPORT failure (GH-24333)

Importing datetime can fail.

4 years agobpo-43031: Set a timeout when running tests in PGO build (GH-24339)
Victor Stinner [Wed, 27 Jan 2021 10:16:15 +0000 (11:16 +0100)] 
bpo-43031: Set a timeout when running tests in PGO build (GH-24339)

Pass --timeout=$(TESTTIMEOUT) option to the default profile task
"./python -m test --pgo" command.

4 years agobpo-43033: Fix the handling of PyObject_SetAttrString() in _zoneinfo.c (GH-24345)
Zackery Spytz [Wed, 27 Jan 2021 08:16:20 +0000 (01:16 -0700)] 
bpo-43033: Fix the handling of PyObject_SetAttrString() in _zoneinfo.c (GH-24345)

4 years agobpo-43008: Make IDLE respect sys.excepthook (GH-24302)
Ken [Tue, 26 Jan 2021 23:55:52 +0000 (07:55 +0800)] 
bpo-43008: Make IDLE respect sys.excepthook (GH-24302)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agobpo-38250: [Enum] only include .rst test if file available (GH-24342)
Ethan Furman [Tue, 26 Jan 2021 20:52:52 +0000 (12:52 -0800)] 
bpo-38250: [Enum] only include .rst test if file available (GH-24342)

* [Enum] only include .rst test if file available

In order to ensure the ReST documentation is up to date for Enum,
use doctest to check it -- but only if the .rst files have not
been stripped.

4 years agobpo-33387: update documentation for exception handling opcode changes (GH-24334)
Irit Katriel [Tue, 26 Jan 2021 10:17:13 +0000 (10:17 +0000)] 
bpo-33387: update documentation for exception handling opcode changes (GH-24334)

* bpo-33387: remove obsolete comment

* bpo-33387: update SETUP_WITH opcode documentation

4 years agoFix minor typo in the rest format in the enum docs (GH-24335)
Pablo Galindo [Mon, 25 Jan 2021 23:23:30 +0000 (23:23 +0000)] 
Fix minor typo in the rest format in the enum docs (GH-24335)

4 years agoDocument new parenthesized with statements (GH-24281)
Pablo Galindo [Mon, 25 Jan 2021 23:15:51 +0000 (23:15 +0000)] 
Document new parenthesized with statements (GH-24281)

4 years agoTypo in comment (GH-24199)
borispopoff [Mon, 25 Jan 2021 22:51:48 +0000 (23:51 +0100)] 
Typo in comment (GH-24199)

Automerge-Triggered-By: GH:Mariatta
4 years agobpo-38250: [Enum] single-bit flags are canonical (GH-24215)
Ethan Furman [Mon, 25 Jan 2021 22:26:19 +0000 (14:26 -0800)] 
bpo-38250: [Enum] single-bit flags are canonical (GH-24215)

Flag members are now divided by one-bit verses multi-bit, with multi-bit being treated as aliases. Iterating over a flag only returns the contained single-bit flags.

Iterating, repr(), and str() show members in definition order.

When constructing combined-member flags, any extra integer values are either discarded (CONFORM), turned into ints (EJECT) or treated as errors (STRICT). Flag classes can specify which of those three behaviors is desired:

>>> class Test(Flag, boundary=CONFORM):
...     ONE = 1
...     TWO = 2
...
>>> Test(5)
<Test.ONE: 1>

Besides the three above behaviors, there is also KEEP, which should not be used unless necessary -- for example, _convert_ specifies KEEP as there are flag sets in the stdlib that are incomplete and/or inconsistent (e.g. ssl.Options). KEEP will, as the name suggests, keep all bits; however, iterating over a flag with extra bits will only return the canonical flags contained, not the extra bits.

Iteration is now in member definition order.  If member definition order
matches increasing value order, then a more efficient method of flag
decomposition is used; otherwise, sort() is called on the results of
that method to get definition order.

``re`` module:

repr() has been modified to support as closely as possible its previous
output; the big difference is that inverted flags cannot be output as
before because the inversion operation now always returns the comparable
positive result; i.e.

   re.A|re.I|re.M|re.S is ~(re.L|re.U|re.S|re.T|re.DEBUG)

in both of the above terms, the ``value`` is 282.

re's tests have been updated to reflect the modifications to repr().

4 years agobpo-42955: Rename module_names to sys.stdlib_module_names (GH-24332)
Victor Stinner [Mon, 25 Jan 2021 22:12:50 +0000 (23:12 +0100)] 
bpo-42955: Rename module_names to sys.stdlib_module_names (GH-24332)

* Rename _Py_module_names to _Py_stdlib_module_names.
* Rename Python/module_names.h to Python/stdlib_module_names.h.

4 years agobpo-42383: pdb: do not fail to restart the target if the current directory changed...
Andrey Bienkowski [Mon, 25 Jan 2021 21:08:01 +0000 (21:08 +0000)] 
bpo-42383: pdb: do not fail to restart the target if the current directory changed (#23412)

This commit only adds tests and a news entry. The actual bug was fixed in the earlier commit.

4 years agobpo-37319: Improve documentation, code and tests of randrange. (GH-19112)
Serhiy Storchaka [Mon, 25 Jan 2021 21:02:04 +0000 (23:02 +0200)] 
bpo-37319: Improve documentation, code and tests of randrange. (GH-19112)

4 years agobpo-42869: Avoid an HTTP redirection. (GH-24174)
Julien Palard [Mon, 25 Jan 2021 14:50:14 +0000 (15:50 +0100)] 
bpo-42869: Avoid an HTTP redirection. (GH-24174)

4 years agobpo-42843: Keep Sphinx 1.8 and Sphinx 2 compatibility (GH-24282)
Julien Palard [Mon, 25 Jan 2021 14:46:06 +0000 (15:46 +0100)] 
bpo-42843: Keep Sphinx 1.8 and Sphinx 2 compatibility (GH-24282)

4 years agobpo-42955: Fix sys.module_names doc (GH-24329)
Victor Stinner [Mon, 25 Jan 2021 12:59:02 +0000 (13:59 +0100)] 
bpo-42955: Fix sys.module_names doc (GH-24329)

Replace versionchanged markup with versionadded.

4 years agobpo-42955: Add sys.modules_names (GH-24238)
Victor Stinner [Mon, 25 Jan 2021 12:24:42 +0000 (13:24 +0100)] 
bpo-42955: Add sys.modules_names (GH-24238)

Add sys.module_names, containing the list of the standard library
module names.

4 years agobpo-43013: Fix old tkinter module names in idlelib (GH-24326)
Terry Jan Reedy [Mon, 25 Jan 2021 11:33:18 +0000 (06:33 -0500)] 
bpo-43013: Fix old tkinter module names in idlelib (GH-24326)

Lowercase 'tkColorChooser', 'tkFileDialog', 'tkSimpleDialog', and
'tkMessageBox' and remove 'tk'.  Just lowercase 'tkFont' as 'font'
is already used.  Adjust import.

4 years agobpo-27772: Make preceding width with 0 valid in string format. (GH-11270)
Serhiy Storchaka [Mon, 25 Jan 2021 09:56:33 +0000 (11:56 +0200)] 
bpo-27772: Make preceding width with 0 valid in string format. (GH-11270)

Previously it was an error with confusing error message.

4 years ago bpo-43013: Update idlelib code to 3.x (GH-24315)
Terry Jan Reedy [Sun, 24 Jan 2021 19:08:50 +0000 (14:08 -0500)] 
 bpo-43013: Update idlelib code to 3.x  (GH-24315)

Remove 9 remaining '(object)' occurrences in class headers in idlelib
and 25 '()' occurrences in idlelib.idle_test class headers.

4 years agobpo-43014: Improve performance of tokenize.tokenize by 20-30%
Anthony Sottile [Sun, 24 Jan 2021 09:23:17 +0000 (01:23 -0800)] 
bpo-43014: Improve performance of tokenize.tokenize by 20-30%

4 years agoRemove full stop from a bytes-related SyntaxError message (GH-24300)
numbermaniac [Sat, 23 Jan 2021 22:56:57 +0000 (09:56 +1100)] 
Remove full stop from a bytes-related SyntaxError message (GH-24300)

4 years agocloses bpo-43011: Fix DeprecationWarnings in test_ctypes (GH-24305)
Zackery Spytz [Sat, 23 Jan 2021 16:34:01 +0000 (09:34 -0700)] 
closes bpo-43011: Fix DeprecationWarnings in test_ctypes (GH-24305)

4 years agobpo-42996: Update a reference to PKCS #5 in hashlib docs to version 2.1 (GH-24289) 12244/head
Illia Volochii [Fri, 22 Jan 2021 12:06:00 +0000 (14:06 +0200)] 
bpo-42996: Update a reference to PKCS #5 in hashlib docs to version 2.1 (GH-24289)

RFC 8018 superseded RFC 8018.

Automerge-Triggered-By: GH:tiran
4 years agobpo-41798: Allocate the _curses._C_API on the heap memory (GH-24186)
Hai Shi [Fri, 22 Jan 2021 10:06:43 +0000 (18:06 +0800)] 
bpo-41798: Allocate the _curses._C_API on the heap memory (GH-24186)

4 years agobpo-40304: Correct type(name, bases, dict) doc (GH-19553)
Борис ВСрховский [Fri, 22 Jan 2021 05:47:23 +0000 (00:47 -0500)] 
bpo-40304: Correct type(name, bases, dict) doc (GH-19553)

Co-authored-by: Γ‰ric Araujo <merwok@netwok.org>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tal Einat <532281+taleinat@users.noreply.github.com>
4 years agobpo-42384: pdb: correctly populate sys.path[0] (GH-23338)
Andrey Bienkowski [Fri, 22 Jan 2021 01:19:51 +0000 (01:19 +0000)] 
bpo-42384: pdb: correctly populate sys.path[0] (GH-23338)

Automerge-Triggered-By: GH:gvanrossum
4 years agobpo-31904: setup.py: fix cross-compilation on VxWorks (GH-24191)
pxinwr [Fri, 22 Jan 2021 00:55:52 +0000 (08:55 +0800)] 
bpo-31904: setup.py: fix cross-compilation on VxWorks (GH-24191)

Add library search path by wr-cc in add_cross_compiling_paths().

4 years agobpo-33289: Return RGB triplet of ints instead of floats from tkinter.colorchooser...
Cheryl Sabella [Thu, 21 Jan 2021 19:14:04 +0000 (14:14 -0500)] 
bpo-33289: Return RGB triplet of ints instead of floats from tkinter.colorchooser (GH-6578)

4 years agoAdd a What's New entry for the new parser error improvements (GH-24280)
Pablo Galindo [Thu, 21 Jan 2021 17:36:35 +0000 (17:36 +0000)] 
Add a What's New entry for the new parser error improvements (GH-24280)

4 years agoFix typo in what's new. bidst_wheel -> bdist_wheel (GH-24234)
ravcio [Thu, 21 Jan 2021 10:23:46 +0000 (11:23 +0100)] 
Fix typo in what's new. bidst_wheel -> bdist_wheel (GH-24234)

bidst_wheel -> bdist_wheel

Automerge-Triggered-By: GH:Mariatta
4 years agobpo-42392: Mention loop removal in whatsnew for 3.10 (GH-24256)
Ken Jin [Thu, 21 Jan 2021 00:16:12 +0000 (16:16 -0800)] 
bpo-42392: Mention loop removal in whatsnew for 3.10 (GH-24256)

@vstinner [noticed on python-dev](https://mail.python.org/archives/list/python-dev@python.org/thread/O3T7SK3BGMFWMLCQXDODZJSBL42AUWTR/) that there is no what's new or porting entry for removal of asyncio ``loop`` parameter.

This patch adds a basic guide.

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
4 years agobpo-40176: Improve error messages for unclosed string literals (GH-19346)
Batuhan Taskaya [Wed, 20 Jan 2021 21:38:47 +0000 (00:38 +0300)] 
bpo-40176: Improve error messages for unclosed string literals (GH-19346)

Automerge-Triggered-By: GH:isidentical
4 years agobpo-42864: Simplify the tokenizer exceptions after generic SyntaxError (GH-24273)
Pablo Galindo [Wed, 20 Jan 2021 19:11:56 +0000 (19:11 +0000)] 
bpo-42864: Simplify the tokenizer exceptions after generic SyntaxError (GH-24273)

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-42856: Add --with-wheel-pkg-dir=PATH configure option (GH-24210)
Victor Stinner [Wed, 20 Jan 2021 16:07:21 +0000 (17:07 +0100)] 
bpo-42856: Add --with-wheel-pkg-dir=PATH configure option (GH-24210)

Add --with-wheel-pkg-dir=PATH option to the ./configure script. If
specified, the ensurepip module looks for setuptools and pip wheel
packages in this directory: if both are present, these wheel packages
are used instead of ensurepip bundled wheel packages.

Some Linux distribution packaging policies recommend against bundling
dependencies. For example, Fedora installs wheel packages in the
/usr/share/python-wheels/ directory and don't install the
ensurepip._bundled package.

ensurepip: Remove unused runpy import.

4 years agobpo-42323: Fix math.nextafter() for NaN on AIX (GH-24265)
Victor Stinner [Wed, 20 Jan 2021 14:20:13 +0000 (15:20 +0100)] 
bpo-42323: Fix math.nextafter() for NaN on AIX (GH-24265)

4 years agobpo-42780: Fix set_inheritable() for O_PATH file descriptors on Linux (GH-24172)
cptpcrd [Wed, 20 Jan 2021 14:05:51 +0000 (09:05 -0500)] 
bpo-42780: Fix set_inheritable() for O_PATH file descriptors on Linux (GH-24172)

4 years agoFix typos in unittest documentation (GH-24194)
Conchylicultor [Wed, 20 Jan 2021 13:08:37 +0000 (14:08 +0100)] 
Fix typos in unittest documentation (GH-24194)

* addCleanupClass  -> addClassCleanup
* doCleanupsClass -> doClassCleanups

4 years agobpo-42864: Fix compiler warning in the tokenizer with the new paren stack for column...
Pablo Galindo [Wed, 20 Jan 2021 12:53:52 +0000 (12:53 +0000)] 
bpo-42864: Fix compiler warning in the tokenizer with the new paren stack for column numbers (GH-24266)

4 years agobpo-42048: Clinic Howto: Document AC's defining_class converter (GH-23978)
Erlend Egeberg Aasland [Wed, 20 Jan 2021 11:19:57 +0000 (12:19 +0100)] 
bpo-42048: Clinic Howto: Document AC's defining_class converter (GH-23978)

4 years agobpo-41798: Allocate unicodedata CAPI on the heap (GH-24128)
Erlend Egeberg Aasland [Wed, 20 Jan 2021 11:03:53 +0000 (12:03 +0100)] 
bpo-41798: Allocate unicodedata CAPI on the heap (GH-24128)

4 years agoDoc: os.path.abspath and Path.resolve are also different (GH-23276)
Hong Xu [Wed, 20 Jan 2021 10:20:00 +0000 (02:20 -0800)] 
Doc: os.path.abspath and Path.resolve are also different (GH-23276)

4 years agobpo-42005: profile and cProfile catch BrokenPipeError (GH-22643)
Zhiming Wang [Wed, 20 Jan 2021 08:56:21 +0000 (16:56 +0800)] 
bpo-42005: profile and cProfile catch BrokenPipeError (GH-22643)

4 years agobpo-41995: Handle allocation failure in _tracemalloc and _zoneinfo (GH-22635)
Yunlongs [Wed, 20 Jan 2021 08:38:28 +0000 (16:38 +0800)] 
bpo-41995: Handle allocation failure in _tracemalloc and _zoneinfo (GH-22635)

4 years agobpo-42864: Improve error messages regarding unclosed parentheses (GH-24161)
Pablo Galindo [Tue, 19 Jan 2021 23:59:33 +0000 (23:59 +0000)] 
bpo-42864: Improve error messages regarding unclosed parentheses (GH-24161)

4 years agobpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)
Victor Stinner [Tue, 19 Jan 2021 22:35:27 +0000 (23:35 +0100)] 
bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)

4 years agobpo-42955: Add Python/module_names.h (GH-24258)
Victor Stinner [Tue, 19 Jan 2021 22:04:49 +0000 (23:04 +0100)] 
bpo-42955: Add Python/module_names.h (GH-24258)

Add a private list of all stdlib modules: _Py_module_names.

* Add Tools/scripts/generate_module_names.py script.
* Makefile: Add "make regen-module-names" command.
* setup.py: Add --list-module-names option.
* GitHub Action and Travis CI also runs "make regen-module-names",
  not ony "make regen-all", to ensure that the module names remains
  up to date.

4 years agobpo-41713: Remove PyOS_InitInterrupts() from python3dll.c (GH-24257)
Victor Stinner [Tue, 19 Jan 2021 17:27:01 +0000 (18:27 +0100)] 
bpo-41713: Remove PyOS_InitInterrupts() from python3dll.c (GH-24257)

4 years agoAdd a clarification for the object-domain allocators regarding pointer validity ...
Pablo Galindo [Tue, 19 Jan 2021 13:09:06 +0000 (13:09 +0000)] 
Add a clarification for the object-domain allocators regarding pointer validity (GH-24253)

4 years agobpo-41818: Close file descriptors in test_openpty (#GH-24119)
Petr Viktorin [Tue, 19 Jan 2021 13:03:12 +0000 (14:03 +0100)] 
bpo-41818: Close file descriptors in test_openpty (#GH-24119)

When stdin is a TTY, the test added in commit c13d89955d9a2942c6355d6839d7096323244136
is expected to fail. However, when it failed, it did not close
its file descriptors. This is flagged by the refleak tests (but
only when stdin is a TTY, which doesn't seem to be the case on CI).

4 years agoAdd a paragraph about allocation domains to the C-API docs (GH-24252)
Pablo Galindo [Mon, 18 Jan 2021 22:20:57 +0000 (22:20 +0000)] 
Add a paragraph about allocation domains to the C-API docs (GH-24252)

4 years agocloses bpo-42938: Replace snprintf with Python unicode formatting in ctypes param...
Benjamin Peterson [Mon, 18 Jan 2021 20:47:05 +0000 (14:47 -0600)] 
closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. (24239)

4 years agobpo-36143: make regen-all now also runs regen-keyword (GH-24245)
Victor Stinner [Mon, 18 Jan 2021 20:23:35 +0000 (21:23 +0100)] 
bpo-36143: make regen-all now also runs regen-keyword (GH-24245)

4 years agobpo-42923: Dump extension modules on fatal error (GH-24207)
Victor Stinner [Mon, 18 Jan 2021 19:47:13 +0000 (20:47 +0100)] 
bpo-42923: Dump extension modules on fatal error (GH-24207)

The Py_FatalError() function and the faulthandler module now dump the
list of extension modules on a fatal error.

Add _Py_DumpExtensionModules() and _PyModule_IsExtension() internal
functions.

4 years agobpo-42944 Fix Random.sample when counts is not None (GH-24235)
jonanifranco [Mon, 18 Jan 2021 18:04:29 +0000 (19:04 +0100)] 
bpo-42944 Fix Random.sample when counts is not None (GH-24235)

4 years agobpo-42923: Py_FatalError() avoids fprintf() (GH-24242)
Victor Stinner [Mon, 18 Jan 2021 17:34:56 +0000 (18:34 +0100)] 
bpo-42923: Py_FatalError() avoids fprintf() (GH-24242)

* Replace buffered fprintf() with unbuffered _Py_write_noraise()
  in Py_FatalError().
* _Py_DumpHexadecimal() now accepts uintptr_t.

4 years agobpo-42923: Add Py_FatalError() test in test_capi (GH-24240)
Victor Stinner [Mon, 18 Jan 2021 17:24:29 +0000 (18:24 +0100)] 
bpo-42923: Add Py_FatalError() test in test_capi (GH-24240)

Move faulthandler._fatal_error() to _testcapi.fatal_error().

4 years agobpo-42931: randbytes missing from random.__all__ (GH-24219)
Setrak Balian [Fri, 15 Jan 2021 17:50:42 +0000 (17:50 +0000)] 
bpo-42931: randbytes missing from random.__all__ (GH-24219)

4 years agobpo-42934: use TracebackException(compact=True) in unittest.TestResult (GH-24221)
Irit Katriel [Fri, 15 Jan 2021 15:59:44 +0000 (15:59 +0000)] 
bpo-42934: use TracebackException(compact=True) in unittest.TestResult (GH-24221)

4 years agoMark instructions at end of class scope as artificial. (GH-24222)
Mark Shannon [Fri, 15 Jan 2021 13:52:00 +0000 (13:52 +0000)] 
Mark instructions at end of class scope as artificial. (GH-24222)

4 years agobpo-42877: add the 'compact' param to TracebackException's __init__ (#24179)
Irit Katriel [Fri, 15 Jan 2021 02:45:02 +0000 (02:45 +0000)] 
bpo-42877: add the 'compact' param to TracebackException's __init__ (#24179)

Use it to reduce the time and memory taken up by several of traceback's module-level functions.

4 years agobpo-42827: Fix crash on SyntaxError in multiline expressions (GH-24140)
Lysandros Nikolaou [Thu, 14 Jan 2021 21:36:30 +0000 (23:36 +0200)] 
bpo-42827: Fix crash on SyntaxError in multiline expressions (GH-24140)

When trying to extract the error line for the error message there
are two distinct cases:

1. The input comes from a file, which means that we can extract the
   error line by using `PyErr_ProgramTextObject` and which we already
   do.
2. The input does not come from a file, at which point we need to get
   the source code from the tokenizer:
   * If the tokenizer's current line number is the same with the line
     of the error, we get the line from `tok->buf` and we're ready.
   * Else, we can extract the error line from the source code in the
     following two ways:
     * If the input comes from a string we have all the input
       in `tok->str` and we can extract the error line from it.
     * If the input comes from stdin, i.e. the interactive prompt, we
       do not have access to the previous line. That's why a new
       field `tok->stdin_content` is added which holds the whole input for the
       current (multiline) statement or expression. We can then extract the
       error line from `tok->stdin_content` like we do in the string case above.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
4 years agoDocs: Remove stray semicolon in init.rst (GH-23974)
Ken Jin [Thu, 14 Jan 2021 15:57:08 +0000 (23:57 +0800)] 
Docs: Remove stray semicolon in init.rst (GH-23974)

Removed stray semicolon which was causing the docs to render weirdly (it's the function right under the one [here](https://docs.python.org/3/c-api/init.html#c._PyInterpreterState_GetEvalFrameFunc)).