diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-12-14 23:51:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-14 23:51:22 (GMT) |
commit | 358e5e17a51ba00742bfaee4557a94c3c4179c22 (patch) | |
tree | 0918046bb6a75f31957b4d0aa24ca73df93d5bbf /Doc | |
parent | 96a5e50a5de3683b2afd6d680c7ecc4b525986f6 (diff) | |
download | cpython-358e5e17a51ba00742bfaee4557a94c3c4179c22.zip cpython-358e5e17a51ba00742bfaee4557a94c3c4179c22.tar.gz cpython-358e5e17a51ba00742bfaee4557a94c3c4179c22.tar.bz2 |
bpo-32329: Fix -R option for hash randomization (#4873)
bpo-32329, bpo-32030:
* The -R option now turns on hash randomization when the
PYTHONHASHSEED environment variable is set to 0 Previously, the
option was ignored.
* sys.flags.hash_randomization is now properly set to 0 when hash
randomization is turned off by PYTHONHASHSEED=0.
* _PyCoreConfig_ReadEnv() now reads the PYTHONHASHSEED environment
variable. _Py_HashRandomization_Init() now only apply the
configuration, it doesn't read PYTHONHASHSEED anymore.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/using/cmdline.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 5cb9071..598eb25 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -277,8 +277,9 @@ Miscellaneous options .. cmdoption:: -R - Kept for compatibility. On Python 3.3 and greater, hash randomization is - turned on by default. + Turn on hash randomization. This option only has an effect if the + :envvar:`PYTHONHASHSEED` environment variable is set to ``0``, since hash + randomization is enabled by default. On previous versions of Python, this option turns on hash randomization, so that the :meth:`__hash__` values of str, bytes and datetime |