Skip to content

Commit 76c4ab3

Browse files
[3.11] gh-90300: Fix cmdline.rst (GH-116721) (GH-116725)
* 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 bccd1f6 commit 76c4ab3

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Doc/using/cmdline.rst

Lines changed: 8 additions & 5 deletions
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

@@ -383,6 +384,8 @@ Miscellaneous options
383384
Don't add the :data:`user site-packages directory <site.USER_SITE>` to
384385
:data:`sys.path`.
385386

387+
See also :envvar:`PYTHONNOUSERSITE`.
388+
386389
.. seealso::
387390

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

Python/initconfig.c

Lines changed: 2 additions & 2 deletions
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)