Commit graph

109756 commits

Author SHA1 Message Date
Petr Viktorin 14fc2bdfab
bpo-28254: Add PyGC_ functions to the stable ABI manifest (GH-25720)
Co-authored-by: Senthil Kumaran <senthil@uthcode.com>
Co-authored-by: scoder <stefan_ml@behnel.de>
2021-04-29 15:46:48 +02:00
Mark Shannon c76da79b37
bpo-42739: Don't use sentinels to mark end of line table. (GH-25657)
* Add length parameter to PyLineTable_InitAddressRange and doen't use sentinel values at end of table. Makes the line number table more robust.

* Update PyCodeAddressRange to match PEP 626.
2021-04-29 13:12:51 +01:00
Inada Naoki 53dd6c99b3
bpo-43651: Fix test_logging (GH-25715) 2021-04-29 20:37:32 +09:00
Victor Stinner abfd6388cd
bpo-43774: Enhance debug build documentation (GH-25712)
* Add also references to --with-trace-refs option.
* Move _ob_next and _ob_prev at the end, since they don't exist by
  default and are related to debug.
2021-04-29 13:06:59 +02:00
Terry Jan Reedy 8ec2f0dc0c
bpo-37892: Use space indents in IDLE Shell (GH-25678)
Adding a newline to the prompt moves it out of the way of
user code input, which now starts at the left margin,
along with continuation lines.
2021-04-29 06:48:18 -04:00
Petr Viktorin f6ee4dad58
bpo-43795: Generate python3dll.c and doc data from manifest (PEP 652) (GH-25315) 2021-04-29 11:33:14 +02:00
Victor Stinner 645ed62fb4
bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711)
Enhance also the documentation of debug hooks on memory allocators.
2021-04-29 10:47:47 +02:00
Victor Stinner b1f413e6cf
bpo-28254: Cleanup test_subprocess.test_preexec_gc_module_failure() (GH-25709)
Saving/restoring gc.disable and gc.isenabled is no longer needed.
2021-04-29 10:26:53 +02:00
Victor Stinner 5bd0619533
bpo-43908: Document Static Types in the C API (GH-25710)
Update also PyTypeObject structure definition in the doc.
2021-04-29 10:26:34 +02:00
Erlend Egeberg Aasland c6ad03fddf
bpo-43908: Make array.array type immutable (GH-25696)
Co-authored-by: Victor Stinner <vstinner@python.org>
2021-04-29 08:47:48 +02:00
Erlend Egeberg Aasland 5daf70b22e
bpo-43908: Make re types immutable (GH-25697)
Co-authored-by: Victor Stinner <vstinner@python.org>
2021-04-29 08:47:11 +02:00
Nick Coghlan 1e7b858575
bpo-43892: Make match patterns explicit in the AST (GH-25585)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2021-04-28 22:58:44 -07:00
Inada Naoki e52ab42ced
bpo-41139: Deprecate cgi.log() (GH-25625) 2021-04-29 11:36:04 +09:00
Inada Naoki a69256527f
bpo-43651: Fix EncodingWarning in os.fdopen() and test_os (GH-25654) 2021-04-29 11:35:36 +09:00
Inada Naoki fa51c0c448
bpo-43651: Fix EncodingWarning in tests. (GH-25655)
* test_httplib
* test_httpservers
* test_logging
2021-04-29 11:34:56 +09:00
Hristo Venev 8557edbfa8
bpo-24275: Don't downgrade unicode-only dicts to mixed on lookups (GH-25186) 2021-04-29 11:06:03 +09:00
Andre Delfino 69a733bda3
[doc] Be more clear on super() regarding multiple base classes methods (GH-21789) 2021-04-28 18:12:15 -07:00
Andre Delfino 08a4803863
[doc] Do some polishing in IDEs section (GH-22070) 2021-04-28 18:06:53 -07:00
Paul Moore b38b2fa021
Document importlib.metadata.PackagePath.locate method (GH-25669) 2021-04-28 19:27:37 -04:00
kfollstad 4a85718212
bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a class unnecessarily (GH-25699) 2021-04-28 19:01:51 -04:00
Tal Einat 15d3861856
bpo-37903: IDLE: Shell sidebar with prompts (GH-22682)
The first followup will change shell indents to spaces.
More are expected.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-04-28 18:27:55 -04:00
Victor Stinner 103d5e420d
bpo-28254: _posixsubprocess uses PyGC_Enable/PyGC_Disable (GH-25693) 2021-04-28 19:09:29 +02:00
Erlend Egeberg Aasland 3b52c8d66b
bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520)
Introduce Py_TPFLAGS_IMMUTABLETYPE flag for immutable type objects, and
modify PyType_Ready() to set it for static types.

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-04-28 19:02:42 +02:00
scoder 3cc481b9de
bpo-28254: Add a C-API for controlling the GC state (GH-25687)
Add new C-API functions to control the state of the garbage collector:
PyGC_Enable(), PyGC_Disable(), PyGC_IsEnabled(),
corresponding to the functions in the gc module.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2021-04-28 18:12:16 +02:00
Barney Gale baecfbd849
bpo-43757: Make pathlib use os.path.realpath() to resolve symlinks in a path (GH-25264)
Also adds a new "strict" argument to realpath() to avoid changing the default behaviour of pathlib while sharing the implementation.
2021-04-28 16:50:17 +01:00
Ken Jin 859577c249
bpo-41559: Change PEP 612 implementation to pure Python (#25449) 2021-04-28 08:38:14 -07:00
Steve Dower c1a9535989
bpo-43955: Handle the case where the distutils warning has already been triggered (GH-25675) 2021-04-28 16:21:55 +01:00
scoder 4c49be7668
bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671)
Automerge-Triggered-By: GH:scoder
2021-04-28 07:03:19 -07:00
Victor Stinner fe52eb6219
bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684)
Fix test_logging.test_namer_rotator_inheritance() on Windows: use
os.replace() rather than os.rename().
2021-04-28 15:47:10 +02:00
Victor Stinner 32c5a17444
bpo-43962: Fix _PyInterpreterState_IDIncref() (GH-25683)
_PyInterpreterState_IDIncref() now calls
_PyInterpreterState_IDInitref() and always increments id_refcount.
2021-04-28 13:40:44 +02:00
Irit Katriel 21b02b5f40
bpo-43960: test_pdb resets breakpoints (GH-25673)
Reset global breakpoint state at the beginning of
test_pdb_next_command_in_generator_for_loop() to make it deterministic.
2021-04-28 12:38:29 +02:00
M. Kocher db0c5b786d
bpo-43776: Remove list call from args in Popen repr (GH-25338)
Removes the `list` call in the Popen `repr`.

Current implementation:

For cmd = `python --version`,  with `shell=True`.

```bash
<Popen: returncode: None args: ['p', 'y', 't', 'h', 'o', 'n', ' ', '-', '-',...>
```

For `shell=False` and args=`['python', '--version']`, the output is correct:

```bash
<Popen: returncode: None args: ['python', '--version']>
```

With the new changes the `repr`  yields:

For cmd = `python --version`,  with `shell=True`:

```bash
<Popen: returncode: None args: 'python --version'>
```

For `shell=False` and args=`['python', '--version']`, the output:

```bash
<Popen: returncode: None args: ['python', '--version']>
```

Automerge-Triggered-By: GH:gpshead
2021-04-28 01:16:38 -07:00
Ma Lin f9bedb630e
bpo-41486: Faster bz2/lzma/zlib via new output buffering (GH-21740)
Faster bz2/lzma/zlib via new output buffering.
Also adds .readall() function to _compression.DecompressReader class
to take best advantage of this in the consume-all-output at once scenario.

Often a 5-20% speedup in common scenarios due to less data copying.

Contributed by Ma Lin.
2021-04-27 23:58:54 -07:00
Victor Stinner a5e64444e6
bpo-43963: Add _signal module state (GH-25676)
* Add signal_state_t structure and signal_global_state variable.
* Add a module state to the _signal module.
* Move and rename variables:

  * DefaultHandler becomes state->default_handler
  * IgnoreHandler becomes state->ignore_handler
  * sigint_event becomes state->sigint_event
  * ItimerError becomes modstate->itimer_error

* Rename SetHandler() to set_handler() to be consistent with
  get_handler().
2021-04-28 03:02:55 +02:00
Inada Naoki 5c84bb506a
bpo-37751: Update codecs.register() doc. (GH-25643) 2021-04-28 09:37:02 +09:00
Victor Stinner a09766deab
bpo-43963: Fix import _signal in subinterpreters (GH-25674)
Importing the _signal module in a subinterpreter has no longer side
effects.

signal_module_exec() no longer modifies Handlers and no longer attempts
to set SIGINT signal handler in subinterpreters.
2021-04-28 01:50:04 +02:00
Ethan Furman 6bd9288b80
bpo-43957: [Enum] Deprecate `TypeError` from containment checks. (GH-25670)
In 3.12 ``True`` or ``False`` will be returned for all containment checks,
with ``True`` being returned if the value is either a member of that enum
or one of its members' value.
2021-04-27 13:05:08 -07:00
Anthony Sottile 9aea31dedd
bpo-8978: improve tarfile.open error message when lzma / bz2 are missing (GH-24850)
Automerge-Triggered-By: GH:pablogsal
2021-04-27 10:39:01 -07:00
Ned Deily 8a37463989
Fix generated file name for installer builds on macOS 11+. (GH-25661) 2021-04-27 13:23:39 -04:00
Erlend Egeberg Aasland ce82781644
bpo-43492: Update macOS installer to use SQLite 3.35.5 (GH-25640) 2021-04-27 13:19:14 -04:00
Erlend Egeberg Aasland bf0c7c0147
bpo-43492: Upgrade Windows installer to use SQLite 3.35.5 (GH-25641) 2021-04-27 17:23:53 +01:00
Shreyan Avigyan e3bf179642
bpo-43864: Silence deprecation warning in test_importlib.test_module_found and test_importlib.test_module_not_found (GH-25656) 2021-04-27 16:56:08 +01:00
Ken Jin 99fdd78200
bpo-43766: Fix TypeGuard docs (#25660) 2021-04-27 08:55:08 -07:00
Ken Jin 05ab4b60ab
bpo-43766: Implement PEP 647 (User-Defined Type Guards) in typing.py (#25282) 2021-04-27 07:31:04 -07:00
Tzu-ping Chung d92513390a
bpo-43312: Functions returning default and preferred sysconfig schemes (GH-24644) 2021-04-27 09:45:55 +01:00
Ma Lin 93f411838a
Fix thread locks in zlib module may go wrong in rare case. (#22126)
Setting `next_in` before acquiring the thread lock may mix up compress/decompress state in other threads.
2021-04-27 10:37:11 +02:00
Inada Naoki 878bc8b6c2
bpo-43651: Fix EncodingWarning in fileinput and its test (GH-25648) 2021-04-27 15:47:16 +09:00
Inada Naoki caae717c29
bpo-43651: Fix EncodingWarning in zipfile (GH-25650) 2021-04-27 15:45:31 +09:00
Ethan Furman 5987b8c463
bpo-43945: [Enum] Deprecate non-standard mixin format() behavior (GH-25649)
In 3.12 the enum member, not the member's value, will be used for
format() calls.  Format specifiers can be used to retain the current
display of enum members:

Example enumeration:

    class Color(IntEnum):
        RED = 1
        GREEN = 2
        BLUE = 3

Current behavior:

    f'{Color.RED}'  -->  '1'

Future behavior:

    f'{Color.RED}'  --> 'RED'

Using d specifier:

    f'{Color.RED:d}'  --> '1'

Using specifiers can be done now and is future-compatible.
2021-04-26 22:42:57 -07:00
Inada Naoki cfe523b492
bpo-43651: PEP 597: Fix socket.makefile() (GH-25645) 2021-04-27 13:16:28 +09:00