Commit graph

109744 commits

Author SHA1 Message Date
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
Andre Delfino
743e2bae10
[doc] Remove duplicated operator.itemgetter example (GH-24178)
* Remove duplicated itemgetter example
* Add spaces
2021-04-26 21:15:31 -07:00
Inada Naoki
9dfefbe3e2
bpo-43651: Fix EncodingWarning in pydoc. (GH-25644) 2021-04-27 12:46:20 +09:00
Dennis Sweeney
284c52da09
bpo-38530: Require 50% similarity in NameError and AttributeError suggestions (GH-25584) 2021-04-27 01:22:27 +01:00
Erlend Egeberg Aasland
7244c0060d
bpo-43762: Add audit events for loading of sqlite3 extensions (GH-25246) 2021-04-27 00:16:46 +01:00
Andre Delfino
52cd6d5e1b
Use the zero argument form of super() in examples for Python3 docs. (GH-22314) 2021-04-26 15:13:54 -07:00
Ken Jin
425434dadc
bpo-40432: Use python 3.8 or higher to compile CPython on Windows (#25389) 2021-04-26 20:11:43 +01:00
Llandy Riveron Del Risco
8a307e488d
bpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603) 2021-04-26 14:53:28 -04:00
Ken Jin
1b1f9852bd
bpo-42904: Change search order of typing.get_type_hints eval (#25632)
While surprising (searching globals before locals in one specific case), this is needed for backwards compatibility.
2021-04-26 10:31:21 -07:00
Eric V. Smith
94549ee728
Add additional keyword-only tests. (GH-25633) 2021-04-26 13:14:28 -04:00
Adorilson Bezerra
bd25bcd37a
Doc: Fix the array.fromfile method doc (GH-22037)
The check about the f argument type was removed in this commit:
2c94aa567e

Thanks for Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) by the help with
this bug.
2021-04-26 07:19:21 -07:00
Christian Heimes
5f87915d4a
bpo-43466: Link with libz in PY_UNSUPPORTED_OPENSSL_BUILD path (GH-25587)
Some OpenSSL build flavors need libz for compression support.
2021-04-26 15:13:34 +02:00
Christian Heimes
666991fc59
bpo-18233: Add internal methods to access peer chain (GH-25467)
The internal `_ssl._SSLSocket` object now provides methods to retrieve
the peer cert chain and verified cert chain as a list of Certificate
objects. Certificate objects have methods to convert the cert to a dict,
PEM, or DER (ASN.1).

These are private APIs for now. There is a slim chance to stabilize the
approach and provide a public API for 3.10. Otherwise I'll provide a
stable API in 3.11.

Signed-off-by: Christian Heimes <christian@python.org>
2021-04-26 15:01:40 +02:00