File tree Expand file tree Collapse file tree 6 files changed +34
-0
lines changed Expand file tree Collapse file tree 6 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1278,6 +1278,11 @@ PyConfig
12781278
12791279 Default: ``0``.
12801280
1281+ .. deprecated-removed:: 3.15 3.17
1282+
1283+ The :option:`-b` and :option:`!-bb` options will become no-op in 3.17.
1284+ :c:member:`~PyConfig.bytes_warning` member will be removed in 3.17.
1285+
12811286 .. c:member:: int warn_default_encoding
12821287
12831288 If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper`
Original file line number Diff line number Diff line change @@ -254,6 +254,15 @@ Miscellaneous options
254254 .. versionchanged :: 3.5
255255 Affects also comparisons of :class: `bytes ` with :class: `int `.
256256
257+ .. deprecated :: 3.15
258+
259+ Deprecate :option: `-b ` and :option: `!-bb ` command line options
260+ and schedule them to become no-op in Python 3.17.
261+ These were primarily helpers for the Python 2 -> 3 transition.
262+ Starting with Python 3.17, no :exc: `BytesWarning ` will be raised
263+ for these cases; use a type checker instead.
264+
265+
257266.. option :: -B
258267
259268 If given, Python won't try to write ``.pyc `` files on the
Original file line number Diff line number Diff line change @@ -537,6 +537,17 @@ module_name
537537Deprecated
538538==========
539539
540+ CLI
541+ ---
542+
543+ * Deprecate :option: `-b ` and :option: `!-bb ` command line options
544+ and schedule them to become no-op in Python 3.17.
545+ These were primarily helpers for the Python 2 -> 3 transition.
546+ Starting with Python 3.17, no :exc: `BytesWarning ` will be raised
547+ for these cases; use a type checker instead.
548+
549+ (Contributed by Nikita Sobolev in :gh: `136355 `.)
550+
540551hashlib
541552-------
542553
@@ -775,6 +786,10 @@ Deprecated C APIs
775786 :c:func: `_Py_c_abs ` are :term: `soft deprecated `.
776787 (Contributed by Sergey B Kirpichev in :gh: `128813 `.)
777788
789+ * :c:member: `~PyConfig.bytes_warning ` is deprecated
790+ since 3.15 and will be removed in 3.17.
791+ (Contributed by Nikita Sobolev in :gh: `136355 `.)
792+
778793
779794.. Add C API deprecations above alphabetically, not here at the end.
780795
Original file line number Diff line number Diff line change 1+ Deprecate :c:member: `PyConfig.bytes_warning ` field and schedule its removal
2+ in 3.17.
Original file line number Diff line number Diff line change 1+ Deprecate :option: `-b ` and :option: `!-bb ` command line options
2+ and schedule them to become no-op in Python 3.17.
Original file line number Diff line number Diff line change @@ -258,6 +258,7 @@ static const char usage_help[] = "\
258258Options (and corresponding environment variables):\n\
259259-b : issue warnings about converting bytes/bytearray to str and comparing\n\
260260 bytes/bytearray with str or bytes with int. (-bb: issue errors)\n\
261+ deprecated since 3.15 and will become no-op in 3.17.\n\
261262-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x\n\
262263-c cmd : program passed in as string (terminates option list)\n\
263264-d : turn on parser debugging output (for experts only, only works on\n\
You can’t perform that action at this time.
0 commit comments