Skip to content

Commit 89b5c5e

Browse files
[3.12] gh-90300: Fix cmdline.rst (GH-116721) (GH-116724)
* Fix the description of the "-b" option. * Add references to environment variables for "-s" and "-X dev" options. (cherry picked from commit 33662d4) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent fc81b64 commit 89b5c5e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Doc/using/cmdline.rst

+8-5
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,13 @@ Miscellaneous options
242242

243243
.. option:: -b
244244

245-
Issue a warning when comparing :class:`bytes` or :class:`bytearray` with
246-
:class:`str` or :class:`bytes` with :class:`int`. Issue an error when the
247-
option is given twice (:option:`!-bb`).
245+
Issue a warning when converting :class:`bytes` or :class:`bytearray` to
246+
:class:`str` without specifying encoding or comparing :class:`!bytes` or
247+
:class:`!bytearray` with :class:`!str` or :class:`!bytes` with :class:`int`.
248+
Issue an error when the option is given twice (:option:`!-bb`).
248249

249250
.. versionchanged:: 3.5
250-
Affects comparisons of :class:`bytes` with :class:`int`.
251+
Affects also comparisons of :class:`bytes` with :class:`int`.
251252

252253
.. option:: -B
253254

@@ -386,6 +387,8 @@ Miscellaneous options
386387
Don't add the :data:`user site-packages directory <site.USER_SITE>` to
387388
:data:`sys.path`.
388389

390+
See also :envvar:`PYTHONNOUSERSITE`.
391+
389392
.. seealso::
390393

391394
:pep:`370` -- Per user site-packages directory
@@ -517,7 +520,7 @@ Miscellaneous options
517520
asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`.
518521
* ``-X dev``: enable :ref:`Python Development Mode <devmode>`, introducing
519522
additional runtime checks that are too expensive to be enabled by
520-
default.
523+
default. See also :envvar:`PYTHONDEVMODE`.
521524
* ``-X utf8`` enables the :ref:`Python UTF-8 Mode <utf8-mode>`.
522525
``-X utf8=0`` explicitly disables :ref:`Python UTF-8 Mode <utf8-mode>`
523526
(even when it would otherwise activate automatically).

Python/initconfig.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ static const char usage_line[] =
3333
/* Lines sorted by option name; keep in sync with usage_envvars* below */
3434
static const char usage_help[] = "\
3535
Options (and corresponding environment variables):\n\
36-
-b : issue warnings about str(bytes_instance), str(bytearray_instance)\n\
37-
and comparing bytes/bytearray with str. (-bb: issue errors)\n\
36+
-b : issue warnings about converting bytes/bytearray to str and comparing\n\
37+
bytes/bytearray with str or bytes with int. (-bb: issue errors)\n\
3838
-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x\n\
3939
-c cmd : program passed in as string (terminates option list)\n\
4040
-d : turn on parser debugging output (for experts only, only works on\n\

0 commit comments

Comments
 (0)