跳转到主要内容

Pending removal in Python 3.14

  • argparse: The type, choices, and metavar parameters of !argparse.BooleanOptionalAction are deprecated and will be removed in 3.14. (Contributed by Nikita Sobolev in 92248.)

  • ast: The following features have been deprecated in documentation since Python 3.8, now cause a DeprecationWarning to be emitted at runtime when they are accessed or used, and will be removed in Python 3.14:

    • !ast.Num
    • !ast.Str
    • !ast.Bytes
    • !ast.NameConstant
    • !ast.Ellipsis

    Use ast.Constant instead. (Contributed by Serhiy Storchaka in 90953.)

  • asyncio:

    • The child watcher classes !asyncio.MultiLoopChildWatcher, !asyncio.FastChildWatcher, !asyncio.AbstractChildWatcher and !asyncio.SafeChildWatcher are deprecated and will be removed in Python 3.14. (Contributed by Kumar Aditya in 94597.)
    • !asyncio.set_child_watcher, !asyncio.get_child_watcher, !asyncio.AbstractEventLoopPolicy.set_child_watcher and !asyncio.AbstractEventLoopPolicy.get_child_watcher are deprecated and will be removed in Python 3.14. (Contributed by Kumar Aditya in 94597.)
    • The ~asyncio.get_event_loop method of the default event loop policy now emits a DeprecationWarning if there is no current event loop set and it decides to create one. (Contributed by Serhiy Storchaka and Guido van Rossum in 100160.)
  • email: Deprecated the isdst parameter in email.utils.localtime. (Contributed by Alan Williams in 72346.)

  • importlib.abc deprecated classes:

    • !importlib.abc.ResourceReader
    • !importlib.abc.Traversable
    • !importlib.abc.TraversableResources

    Use importlib.resources.abc classes instead:

    • importlib.resources.abc.Traversable
    • importlib.resources.abc.TraversableResources

    (Contributed by Jason R. Coombs and Hugo van Kemenade in 93963.)

  • itertools had undocumented, inefficient, historically buggy, and inconsistent support for copy, deepcopy, and pickle operations. This will be removed in 3.14 for a significant reduction in code volume and maintenance burden. (Contributed by Raymond Hettinger in 101588.)

  • multiprocessing: The default start method will change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms where 'fork' is currently the default (84559). Adding a runtime warning about this was deemed too disruptive as the majority of code is not expected to care. Use the ~multiprocessing.get_context or ~multiprocessing.set_start_method APIs to explicitly specify when your code requires 'fork'. See multiprocessing-start-methods.

  • pathlib: ~pathlib.PurePath.is_relative_to and ~pathlib.PurePath.relative_to: passing additional arguments is deprecated.

  • pkgutil: !pkgutil.find_loader and !pkgutil.get_loader now raise DeprecationWarning; use importlib.util.find_spec instead. (Contributed by Nikita Sobolev in 97850.)

  • pty:

    • master_open(): use pty.openpty.
    • slave_open(): use pty.openpty.
  • sqlite3:

    • !version and !version_info.
    • ~sqlite3.Cursor.execute and ~sqlite3.Cursor.executemany if named placeholders <sqlite3-placeholders> are used and parameters is a sequence instead of a dict.
  • urllib: !urllib.parse.Quoter is deprecated: it was not intended to be a public API. (Contributed by Gregory P. Smith in 88168.)