Pending Removal in Python 3.15¶
- http.server.CGIHTTPRequestHandlerwill be removed along with its related- --cgiflag to- python -m http.server. It was obsolete and rarely used. No direct replacement exists. Anything is better than CGI to interface a web server with a request handler.
- locale:- locale.getdefaultlocale()was deprecated in Python 3.11 and originally planned for removal in Python 3.13 (gh-90817), but removal has been postponed to Python 3.15. Use- locale.setlocale(),- locale.getencoding()and- locale.getlocale()instead. (Contributed by Hugo van Kemenade in gh-111187.)
- pathlib:- pathlib.PurePath.is_reserved()is deprecated and scheduled for removal in Python 3.15. From Python 3.13 onwards, use- os.path.isreservedto detect reserved paths on Windows.
- platform:- java_ver()is deprecated and will be removed in 3.15. It was largely untested, had a confusing API, and was only useful for Jython support. (Contributed by Nikita Sobolev in gh-116349.)
- threading: Passing any arguments to- threading.RLock()is now deprecated. C version allows any numbers of args and kwargs, but they are just ignored. Python version does not allow any arguments. All arguments will be removed from- threading.RLock()in Python 3.15. (Contributed by Nikita Sobolev in gh-102029.)
- 
- The undocumented keyword argument syntax for creating - NamedTupleclasses (- NT = NamedTuple("NT", x=int)) is deprecated, and will be disallowed in 3.15. Use the class-based syntax or the functional syntax instead.
- When using the functional syntax to create a - NamedTupleclass, failing to pass a value to the fields parameter (- NT = NamedTuple("NT")) is deprecated. Passing- Noneto the fields parameter (- NT = NamedTuple("NT", None)) is also deprecated. Both will be disallowed in Python 3.15. To create a- NamedTupleclass with 0 fields, use- class NT(NamedTuple): passor- NT = NamedTuple("NT", []).
 
- typing.TypedDict: When using the functional syntax to create a- TypedDictclass, failing to pass a value to the fields parameter (- TD = TypedDict("TD")) is deprecated. Passing- Noneto the fields parameter (- TD = TypedDict("TD", None)) is also deprecated. Both will be disallowed in Python 3.15. To create a- TypedDictclass with 0 fields, use- class TD(TypedDict): passor- TD = TypedDict("TD", {}).
- wave: Deprecate the- getmark(),- setmark()and- getmarkers()methods of the- wave.Wave_readand- wave.Wave_writeclasses. They will be removed in Python 3.15. (Contributed by Victor Stinner in gh-105096.)