summaryrefslogtreecommitdiff
path: root/Doc/using
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-15 00:51:22 +0100
committerGitHub <noreply@github.com>2017-12-15 00:51:22 +0100
commit358e5e17a51ba00742bfaee4557a94c3c4179c22 (patch)
tree0918046bb6a75f31957b4d0aa24ca73df93d5bbf /Doc/using
parent96a5e50a5de3683b2afd6d680c7ecc4b525986f6 (diff)
downloadcpython-git-358e5e17a51ba00742bfaee4557a94c3c4179c22.tar.gz
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/using')
-rw-r--r--Doc/using/cmdline.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 5cb9071770..598eb2583d 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