Python 3.12.0 alpha 1

Release date: 2022-10-25

安全性

Abstract sockets have no permissions and could allow any user on the system in the same network namespace [https://man7.org/linux/manpages/man7/network_namespaces.7.html] (often the whole system) to inject code into the multiprocessing forkserver process. This was a potential privilege escalation. Filesystem based socket permissions restrict this to the forkserver process user as was the default in Python 3.8 and earlier.

This prevents Linux CVE 2022-42919 [https://www.cve.org/CVERecord?id=CVE-2022-42919].

核心与内置函数

Also remove importlib.util.set_package() which was scheduled for removal.

POP_JUMP_IF_TRUE BACKWARD_TARGET becomes POP_JUMP_IF_FALSE NEXT_BLOCK; JUMP BACKWARD_TARGET.

All the directed conditional jump opcodes were removed: POP_JUMP_FORWARD_IF_TRUE, POP_JUMP_BACKWARD_IF_TRUE, POP_JUMP_FORWARD_IF_FALSE, POP_JUMP_BACKWARD_IF_FALSE, POP_JUMP_FORWARD_IF_NONE, POP_JUMP_BACKWARD_IF_NONE, POP_JUMP_FORWARD_IF_NOT_NONE, POP_JUMP_BACKWARD_IF_NOT_NONE.

The corresponding opcodes without direction are no longer pseudo-instructions, and they implement the forward conditional jumps.

It is safest to treat the _PyInterpreterFrame struct as opaque.

FileFinder no longer inserts a dot in the path, e.g. egg./spam is now eggspam.

The bug was discovered and fixed by Eli Libman. See MagicStack/immutables#84 [https://github.com/MagicStack/immutables/issues/84] for more details.

Importantly, PyType_FromMetaclass() is available in the Limited API, which provides a path towards migrating more binding tools onto the Stable ABI.

to

It is deprecated to return a value that is not None from a test case

This restores previous Flag behavior of allowing flags with non-sequential values to be combined; e.g.

class Skip(Flag): TWO = 2 EIGHT = 8

Skip.TWO | Skip.EIGHT ->

Contributed by Dennis Sweeney.

This makes inspect.iscoroutinefunction() consistent with the behavior of asyncio.iscoroutinefunction(). Patch by Mehdi ABAAKOUK.

Patch by Erlend E. Aasland.