]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-35134, Include: Move pytime.h to cpython/pytime.h (GH-23988)
Nicholas Sim [Tue, 16 Feb 2021 12:04:38 +0000 (20:04 +0800)] 
bpo-35134, Include: Move pytime.h to cpython/pytime.h (GH-23988)

This change is backward compatible since C extension modules
must not include "pytime.h" directly, but only include "Python.h".

4 years agobpo-40170: Convert PyDescr_IsData() to static inline function (GH-24535)
Erlend Egeberg Aasland [Tue, 16 Feb 2021 07:50:00 +0000 (08:50 +0100)] 
bpo-40170: Convert PyDescr_IsData() to static inline function (GH-24535)

4 years agobpo-43155: Add PyCMethod_New to PC/python3dll.c (GH-24500)
Zackery Spytz [Tue, 16 Feb 2021 00:14:13 +0000 (17:14 -0700)] 
bpo-43155: Add PyCMethod_New to PC/python3dll.c (GH-24500)

4 years agobpo-42819, readline: Disable bracketed paste (GH-24108)
Dustin Rodrigues [Mon, 15 Feb 2021 23:28:24 +0000 (18:28 -0500)] 
bpo-42819, readline: Disable bracketed paste (GH-24108)

4 years agoAdd a warning block around the get_referrers() documentation (GH-24511)
Pablo Galindo [Mon, 15 Feb 2021 23:03:38 +0000 (23:03 +0000)] 
Add a warning block around the get_referrers() documentation (GH-24511)

4 years agobpo-43231: Correctly calculate the curses color pair limit when checking for it ...
Pablo Galindo [Mon, 15 Feb 2021 22:15:49 +0000 (22:15 +0000)] 
bpo-43231: Correctly calculate the curses color pair limit when checking for it (GH-24541)

4 years agobpo-43231: Fix test.test_curses.TestCurses.test_init_pair when running under -R ...
Pablo Galindo [Mon, 15 Feb 2021 21:35:48 +0000 (21:35 +0000)] 
bpo-43231: Fix test.test_curses.TestCurses.test_init_pair when running under -R (GH-24539)

4 years agobpo-42967: Fix urllib.parse docs and make logic clearer (GH-24536)
Ken Jin [Mon, 15 Feb 2021 17:00:20 +0000 (01:00 +0800)] 
bpo-42967: Fix urllib.parse docs and make logic clearer (GH-24536)

4 years agobpo-43181: Convert PyObject_TypeCheck to static inline function (GH-24533)
Erlend Egeberg Aasland [Mon, 15 Feb 2021 16:19:24 +0000 (17:19 +0100)] 
bpo-43181: Convert PyObject_TypeCheck to static inline function (GH-24533)

4 years agobpo-42967: only use '&' as a query string separator (#24297)
Adam Goldschmidt [Sun, 14 Feb 2021 22:41:57 +0000 (00:41 +0200)] 
bpo-42967: only use '&' as a query string separator (#24297)

bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl().

urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator.

Co-authored-by: Éric Araujo <merwok@netwok.org>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Éric Araujo <merwok@netwok.org>
4 years agobpo-43210: Fix byteswap comment in sha512.module.c (GH-24518)
Erlend Egeberg Aasland [Sun, 14 Feb 2021 14:14:26 +0000 (15:14 +0100)] 
bpo-43210: Fix byteswap comment in sha512.module.c (GH-24518)

4 years agobpo-43152: Update assert statement to remove unused warning (GH-24473)
Dong-hee Na [Sun, 14 Feb 2021 06:54:39 +0000 (15:54 +0900)] 
bpo-43152: Update assert statement to remove unused warning (GH-24473)

4 years agobpo-43202: More codeop._maybe_compile clean-ups (GH-24512)
Terry Jan Reedy [Sat, 13 Feb 2021 06:49:18 +0000 (01:49 -0500)] 
bpo-43202: More codeop._maybe_compile clean-ups (GH-24512)

Add comment, end others with period, remove unused variables,
initialize others only when needed, and add explicit return.

4 years agobpo-43200: Fix link to shutil.copy() in the shutil doc (GH-24505)
Zackery Spytz [Sat, 13 Feb 2021 04:57:12 +0000 (21:57 -0700)] 
bpo-43200: Fix link to shutil.copy() in the shutil doc (GH-24505)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agobpo-43172: readline now passes its tests when built against libedit (GH-24499)
Gregory P. Smith [Fri, 12 Feb 2021 20:04:46 +0000 (12:04 -0800)] 
bpo-43172: readline now passes its tests when built against libedit (GH-24499)

bpo-43172: readline now passes its tests when built against libedit.

Existing irreconcilable API differences remain in readline.get_begidx
and readline.get_endidx behavior based on libreadline vs libedit use.
A note about that has been documented.

4 years agobpo-43204: Fix LibTomCrypt URL in md5module.c and sha*module.c comments (GH-24507)
Erlend Egeberg Aasland [Fri, 12 Feb 2021 10:34:11 +0000 (11:34 +0100)] 
bpo-43204: Fix LibTomCrypt URL in md5module.c and sha*module.c comments (GH-24507)

Automerge-Triggered-By: GH:tiran
4 years agobpo-43202: Immediately return code object in codeop._maybe_compile (GH-24508)
Terry Jan Reedy [Fri, 12 Feb 2021 00:31:10 +0000 (19:31 -0500)] 
bpo-43202: Immediately return code object in codeop._maybe_compile (GH-24508)

The return used to be after code that was ignored when there was a code object.

4 years agobpo-43174: Windows: Use /utf-8 compiler option. (GH-24498)
Inada Naoki [Fri, 12 Feb 2021 00:06:47 +0000 (09:06 +0900)] 
bpo-43174: Windows: Use /utf-8 compiler option. (GH-24498)

4 years agobpo-40956: Fix segfault when Connection.backup is called without target (GH-24503)
Erlend Egeberg Aasland [Wed, 10 Feb 2021 23:04:02 +0000 (00:04 +0100)] 
bpo-40956: Fix segfault when Connection.backup is called without target (GH-24503)

4 years agoFix link to sqlite3 enable_shared_cache documentation (GH-24496)
Tom Forbes [Wed, 10 Feb 2021 17:56:16 +0000 (17:56 +0000)] 
Fix link to sqlite3 enable_shared_cache documentation (GH-24496)

4 years agobpo-42217: compiler: merge same co_code and co_linetable objects (GH-23056)
Inada Naoki [Wed, 10 Feb 2021 00:20:42 +0000 (09:20 +0900)] 
bpo-42217: compiler: merge same co_code and co_linetable objects (GH-23056)

4 years agobpo-43163: Handle unclosed parentheses in codeop (GH-24483)
Pablo Galindo [Tue, 9 Feb 2021 20:07:38 +0000 (20:07 +0000)] 
bpo-43163: Handle unclosed parentheses in codeop (GH-24483)

4 years agobpo-43166: Disable ceval.c optimisations for Windows debug builds (GH-24485)
Steve Dower [Tue, 9 Feb 2021 18:13:36 +0000 (18:13 +0000)] 
bpo-43166: Disable ceval.c optimisations for Windows debug builds (GH-24485)

This ensures that ceval.c can be debugged.
Also remove some irrelevant options from the pragma.

4 years agobpo-41824: Add versionadded for typing.ForwardRef docs (#24224)
Ken Jin [Tue, 9 Feb 2021 01:58:50 +0000 (09:58 +0800)] 
bpo-41824: Add versionadded for typing.ForwardRef docs (#24224)

4 years agoImprove docs of PEP 604 Union (#24301)
Ken Jin [Tue, 9 Feb 2021 01:57:11 +0000 (09:57 +0800)] 
Improve docs of PEP 604 Union (#24301)

4 years agobpo-43162: [Enum] deprecate enum member.member access (GH-24486)
Ethan Furman [Tue, 9 Feb 2021 01:32:38 +0000 (17:32 -0800)] 
bpo-43162: [Enum] deprecate enum member.member access (GH-24486)

In 3.5 (?) a speed optimization made it possible to access members as
attributes of other members, i.e. ``Color.RED.BLUE``.  This was always
discouraged in the docs, and other recent optimizations has made that
one no longer necessary.  Because some may be relying on it anyway, it
is being deprecated in 3.10, and will be removed in 3.11.

4 years agobpo-13501: allow choosing between readline and libedit (GH-24189)
Roland Hieber [Tue, 9 Feb 2021 01:05:25 +0000 (02:05 +0100)] 
bpo-13501: allow choosing between readline and libedit (GH-24189)

In contrast to macOS, libedit is available as its own include file and
library on Linux systems to prevent file name clashes. So if both
libraries are available on the system, readline is currently chosen by
default; and if only libedit is available, it is not found at all. This
patch adds a way to link against libedit by adding the following
arguments to configure:

  --with-readline           link against libreadline (the default)
  --with-readline=editline  link against libeditline
  --with-readline=no        disable building the readline module
  --without-readline        (same)

The runtime detection of libedit vs. readline was already done in commit
7105319ada2e66365902 (2019-12-04, serge-sans-paille: "bpo-38634: Allow
non-apple build to cope with libedit (GH-16986)").

Fixes: GH-12076 ("bpo-13501 Build or disable readline with Editline")
Fixes: bpo-13501 ("Make libedit support more generic; port readline / libedit to FreeBSD")
Co-authored-by: Enji Cooper (ngie-eign)
Co-authored-by: Martin Panter (vadmium)
Co-authored-by: Robert Marshall (kellinm)
4 years agobpo-40692: Run more test_concurrent_futures tests (GH-20239)
Asheesh Laroia [Mon, 8 Feb 2021 03:15:51 +0000 (19:15 -0800)] 
bpo-40692: Run more test_concurrent_futures tests (GH-20239)

In the case of multiprocessing.synchronize() being missing, the
test_concurrent_futures test suite now skips only the tests that
require multiprocessing.synchronize().

Validate that multiprocessing.synchronize exists as part of
_check_system_limits(), allowing ProcessPoolExecutor to raise
NotImplementedError during __init__, rather than crashing with
ImportError during __init__ when creating a lock imported from
multiprocessing.synchronize.

Use _check_system_limits() to disable tests of
ProcessPoolExecutor on systems without multiprocessing.synchronize.

Running the test suite without multiprocessing.synchronize reveals
that Lib/compileall.py crashes when it uses a ProcessPoolExecutor.
Therefore, change Lib/compileall.py to call _check_system_limits()
before creating the ProcessPoolExecutor.

Note that both Lib/compileall.py and Lib/test/test_compileall.py
were attempting to sanity-check ProcessPoolExecutor by expecting
ImportError. In multiprocessing.resource_tracker, sem_unlink() is also absent
on platforms where POSIX semaphores aren't available. Avoid using
sem_unlink() if it, too, does not exist.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
4 years agobpo-43147: Remove archaic terminology. (GH-24462)
Raymond Hettinger [Mon, 8 Feb 2021 00:44:42 +0000 (16:44 -0800)] 
bpo-43147:  Remove archaic terminology. (GH-24462)

4 years agobpo-43149: Improve error message for exception group without parentheses (GH-24467)
Pablo Galindo [Sun, 7 Feb 2021 18:42:21 +0000 (18:42 +0000)] 
bpo-43149: Improve error message for exception group without parentheses (GH-24467)

4 years agobpo-16781: In 'exec' doc, add 'nonlocal' to 'yield' and 'return' (GH-2446)
Terry Jan Reedy [Sun, 7 Feb 2021 05:28:50 +0000 (00:28 -0500)] 
bpo-16781: In 'exec' doc, add 'nonlocal' to 'yield' and 'return' (GH-2446)

These 3 statements cannot be used at module scope -- nor in exec with one namespace.

4 years agoSimple typo fix (GH-24448)
Andrew Tennikoff [Fri, 5 Feb 2021 18:17:01 +0000 (05:17 +1100)] 
Simple typo fix (GH-24448)

4 years agoFix a typo in a deprecation warning (GH-24423)
Zackery Spytz [Fri, 5 Feb 2021 13:09:17 +0000 (06:09 -0700)] 
Fix a typo in a deprecation warning (GH-24423)

4 years agobpo-43132: Fix incorrect handling of PyObject_RichCompareBool() in _zoneinfo (GH...
Zackery Spytz [Fri, 5 Feb 2021 08:25:30 +0000 (01:25 -0700)] 
bpo-43132: Fix incorrect handling of PyObject_RichCompareBool() in _zoneinfo (GH-24450)

PyObject_RichCompareBool() returns -1 on error, but this case is
not handled by the find_in_strong_cache() function.  Any exception
raised by PyObject_RichCompareBool() should be propagated.

4 years agoMinor readability improvements. Also note performance impact of __slots__. (GH-24456)
Raymond Hettinger [Fri, 5 Feb 2021 06:05:42 +0000 (22:05 -0800)] 
Minor readability improvements.  Also note performance impact of __slots__. (GH-24456)

4 years agoReduce overhead on random timings (GH-24455)
Raymond Hettinger [Fri, 5 Feb 2021 05:36:03 +0000 (21:36 -0800)] 
Reduce overhead on random timings (GH-24455)

4 years agobpo-35295: Remove outdated comment. (GH-24453)
Inada Naoki [Fri, 5 Feb 2021 04:21:28 +0000 (13:21 +0900)] 
bpo-35295: Remove outdated comment. (GH-24453)

4 years agobpo-43102: Set namedtuple __new__'s internal builtins to a dict. (GH-24439)
Raymond Hettinger [Thu, 4 Feb 2021 23:52:16 +0000 (15:52 -0800)] 
bpo-43102:  Set namedtuple __new__'s internal builtins to a dict. (GH-24439)

4 years agobpo-42882: Fix MSVC warnings in pystate.c (GH-24440)
Ken Jin [Thu, 4 Feb 2021 22:08:03 +0000 (06:08 +0800)] 
bpo-42882: Fix MSVC warnings in pystate.c (GH-24440)

_PyRuntimeState.unicode_ids.next_index type is Py_ssize_t.

4 years agoFix signed/unsigned comparison to avoid compilation warning (GH-24441)
Ken Jin [Thu, 4 Feb 2021 21:38:18 +0000 (05:38 +0800)] 
Fix signed/unsigned comparison to avoid compilation warning (GH-24441)

4 years agobuild(deps): bump actions/cache from v2.1.3 to v2.1.4 (#24446)
dependabot[bot] [Thu, 4 Feb 2021 20:57:10 +0000 (12:57 -0800)] 
build(deps): bump actions/cache from v2.1.3 to v2.1.4 (#24446)

Bumps [actions/cache](https://github.com/actions/cache) from v2.1.3 to v2.1.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.3...26968a09c0ea4f3e233fdddbafd1166051a095f6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4 years agoFix dependabot.yml file (GH-24443)
Mariatta Wijaya [Thu, 4 Feb 2021 19:22:34 +0000 (11:22 -0800)] 
Fix dependabot.yml file (GH-24443)

The `target-branch` field doesn't seem to support array.
Since it defaults to the default branch anyway, we should just remove the `target-branch` field from the config.

4 years agobpo-43106: Add os.O_EVTONLY/O_FSYNC/O_SYMLINK/O_NOFOLLOW_ANY (GH-24428)
Dong-hee Na [Wed, 3 Feb 2021 23:32:55 +0000 (08:32 +0900)] 
bpo-43106: Add os.O_EVTONLY/O_FSYNC/O_SYMLINK/O_NOFOLLOW_ANY (GH-24428)

4 years agobpo-43121: Fix incorrect SyntaxError message for missing comma (GH-24436)
Pablo Galindo [Wed, 3 Feb 2021 23:29:26 +0000 (23:29 +0000)] 
bpo-43121: Fix incorrect SyntaxError message for missing comma (GH-24436)

4 years agoFix typo (GH-23019)
Harry [Wed, 3 Feb 2021 21:25:28 +0000 (21:25 +0000)] 
Fix typo (GH-23019)

Fixed possible typo in comment

4 years agobuild(deps): bump actions/upload-artifact from v2.2.1 to v2.2.2 (GH-24411)
dependabot[bot] [Wed, 3 Feb 2021 21:22:27 +0000 (13:22 -0800)] 
build(deps): bump actions/upload-artifact from v2.2.1 to v2.2.2 (GH-24411)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from v2.2.1 to v2.2.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.1...e448a9b857ee2131e752b06002bf0e093c65e571)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4 years agoPost 3.10.0a5
Pablo Galindo [Wed, 3 Feb 2021 06:15:44 +0000 (06:15 +0000)] 
Post 3.10.0a5

4 years agoMerge tag 'v3.10.0a5'
Pablo Galindo [Wed, 3 Feb 2021 06:14:25 +0000 (06:14 +0000)] 
Merge tag 'v3.10.0a5'

Python 3.10.0a5

4 years agobpo-43082: Remove redundant 'the' in Descriptor howto (GH-24394)
diegoe [Wed, 3 Feb 2021 03:28:36 +0000 (22:28 -0500)] 
bpo-43082: Remove redundant 'the' in Descriptor howto (GH-24394)

4 years agoAdd link to Microsoft docs for limitations in Windows Store package (GH-24422)
Steve Dower [Wed, 3 Feb 2021 01:13:43 +0000 (01:13 +0000)] 
Add link to Microsoft docs for limitations in Windows Store package (GH-24422)

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 agoFix Sphynx syntax in the memory.rst document v3.10.0a5
Pablo Galindo [Tue, 2 Feb 2021 20:43:11 +0000 (20:43 +0000)] 
Fix Sphynx syntax in the memory.rst document

4 years agoPython 3.10.0a5
Pablo Galindo [Tue, 2 Feb 2021 20:41:05 +0000 (20:41 +0000)] 
Python 3.10.0a5

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.