Skip to content

Commit 12bfd4f

Browse files
serhiy-storchakaadorilson
authored andcommitted
pythongh-90300: Fix cmdline.rst (pythonGH-116721)
* Fix the description of the "-b" option. * Add references to environment variables for "-s" and "-X dev" options.
1 parent b18b775 commit 12bfd4f

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
@@ -142,8 +142,8 @@ static const char usage_line[] =
142142
/* Lines sorted by option name; keep in sync with usage_envvars* below */
143143
static const char usage_help[] = "\
144144
Options (and corresponding environment variables):\n\
145-
-b : issue warnings about str(bytes_instance), str(bytearray_instance)\n\
146-
and comparing bytes/bytearray with str. (-bb: issue errors)\n\
145+
-b : issue warnings about converting bytes/bytearray to str and comparing\n\
146+
bytes/bytearray with str or bytes with int. (-bb: issue errors)\n\
147147
-B : don't write .pyc files on import; also PYTHONDONTWRITEBYTECODE=x\n\
148148
-c cmd : program passed in as string (terminates option list)\n\
149149
-d : turn on parser debugging output (for experts only, only works on\n\

0 commit comments

Comments
 (0)