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
1278
1278
1279
1279
Default: ``0``.
1280
1280
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
+
1281
1286
.. c:member:: int warn_default_encoding
1282
1287
1283
1288
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
254
254
.. versionchanged :: 3.5
255
255
Affects also comparisons of :class: `bytes ` with :class: `int `.
256
256
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
+
257
266
.. option :: -B
258
267
259
268
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
537
537
Deprecated
538
538
==========
539
539
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
+
540
551
hashlib
541
552
-------
542
553
@@ -775,6 +786,10 @@ Deprecated C APIs
775
786
:c:func: `_Py_c_abs ` are :term: `soft deprecated `.
776
787
(Contributed by Sergey B Kirpichev in :gh: `128813 `.)
777
788
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
+
778
793
779
794
.. Add C API deprecations above alphabetically, not here at the end.
780
795
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[] = "\
258
258
Options (and corresponding environment variables):\n\
259
259
-b : issue warnings about converting bytes/bytearray to str and comparing\n\
260
260
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\
261
262
-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x\n\
262
263
-c cmd : program passed in as string (terminates option list)\n\
263
264
-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