Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,10 @@ PyConfig

Default: ``0``.

.. deprecated:: 3.15

Deprecated, will become no-op in 3.17.

.. c:member:: int warn_default_encoding

If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper`
Expand Down
9 changes: 9 additions & 0 deletions Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,15 @@ Miscellaneous options
.. versionchanged:: 3.5
Affects also comparisons of :class:`bytes` with :class:`int`.

.. deprecated-removed:: 3.15 3.17

Deprecate :option:`-b` and :option:`!-bb`
and schedule them to become no-op in Python 3.17.
These were primarily helpers for the Python 2 -> 3 transition.
Starting with Python 3.17, no :exc:`BytesWarning` will be raised
for these cases; use a type checker instead.


.. option:: -B

If given, Python won't try to write ``.pyc`` files on the
Expand Down
11 changes: 11 additions & 0 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,17 @@ module_name
Deprecated
==========

CLI
---

* Deprecate :option:`-b` and :option:`!-bb`
and schedule them to become no-op in Python 3.17.
These were primarily helpers for the Python 2 -> 3 transition.
Starting with Python 3.17, no :exc:`BytesWarning` will be raised
for these cases; use a type checker instead.

(Contributed by Nikita Sobolev in :gh:`136355`.)

hashlib
-------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deprecate :option:`-b` and :option:`!-bb` and schedule them
to become no-op in Python 3.17.
1 change: 1 addition & 0 deletions Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ static const char usage_help[] = "\
Options (and corresponding environment variables):\n\
-b : issue warnings about converting bytes/bytearray to str and comparing\n\
bytes/bytearray with str or bytes with int. (-bb: issue errors)\n\
deprecated since 3.15 and will become no-op in 3.17.\n\
-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x\n\
-c cmd : program passed in as string (terminates option list)\n\
-d : turn on parser debugging output (for experts only, only works on\n\
Expand Down
Loading