diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-03-13 13:46:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 13:46:58 (GMT) |
commit | 89b5c5e321d84dfe5716b5b7eaa5dbda497301be (patch) | |
tree | a19c5f5c95d88207373889d19ed7bdec0d144acc | |
parent | fc81b6497b0f0025caa3a184164bc983b985609c (diff) | |
download | cpython-89b5c5e321d84dfe5716b5b7eaa5dbda497301be.zip cpython-89b5c5e321d84dfe5716b5b7eaa5dbda497301be.tar.gz cpython-89b5c5e321d84dfe5716b5b7eaa5dbda497301be.tar.bz2 |
[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 33662d4e01d73cd4f29a25efc2ef09288129023f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
-rw-r--r-- | Doc/using/cmdline.rst | 13 | ||||
-rw-r--r-- | Python/initconfig.c | 4 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 6ca3e16..3058d9b 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -242,12 +242,13 @@ Miscellaneous options .. option:: -b - Issue a warning when comparing :class:`bytes` or :class:`bytearray` with - :class:`str` or :class:`bytes` with :class:`int`. Issue an error when the - option is given twice (:option:`!-bb`). + Issue a warning when converting :class:`bytes` or :class:`bytearray` to + :class:`str` without specifying encoding or comparing :class:`!bytes` or + :class:`!bytearray` with :class:`!str` or :class:`!bytes` with :class:`int`. + Issue an error when the option is given twice (:option:`!-bb`). .. versionchanged:: 3.5 - Affects comparisons of :class:`bytes` with :class:`int`. + Affects also comparisons of :class:`bytes` with :class:`int`. .. option:: -B @@ -386,6 +387,8 @@ Miscellaneous options Don't add the :data:`user site-packages directory <site.USER_SITE>` to :data:`sys.path`. + See also :envvar:`PYTHONNOUSERSITE`. + .. seealso:: :pep:`370` -- Per user site-packages directory @@ -517,7 +520,7 @@ Miscellaneous options asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`. * ``-X dev``: enable :ref:`Python Development Mode <devmode>`, introducing additional runtime checks that are too expensive to be enabled by - default. + default. See also :envvar:`PYTHONDEVMODE`. * ``-X utf8`` enables the :ref:`Python UTF-8 Mode <utf8-mode>`. ``-X utf8=0`` explicitly disables :ref:`Python UTF-8 Mode <utf8-mode>` (even when it would otherwise activate automatically). diff --git a/Python/initconfig.c b/Python/initconfig.c index eeb76cc..3cfb39b 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -33,8 +33,8 @@ static const char usage_line[] = /* Lines sorted by option name; keep in sync with usage_envvars* below */ static const char usage_help[] = "\ Options (and corresponding environment variables):\n\ --b : issue warnings about str(bytes_instance), str(bytearray_instance)\n\ - and comparing bytes/bytearray with str. (-bb: issue errors)\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\ -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\ |