From 64fa45af5a5acadb3f42a1668f99c0c3784eca69 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sun, 13 Dec 2015 13:57:50 -0800 Subject: [PATCH] Fixes issue #20954: _args_from_interpreter_flags used by multiprocessing and some tests no longer behaves incorrectly in the presence of the PYTHONHASHSEED environment variable. --- Lib/subprocess.py | 3 ++- Misc/NEWS | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index f9e9104d45..4e7b0644a6 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -498,7 +498,6 @@ def _args_from_interpreter_flags(): 'ignore_environment': 'E', 'verbose': 'v', 'bytes_warning': 'b', - 'hash_randomization': 'R', 'py3k_warning': '3', } args = [] @@ -506,6 +505,8 @@ def _args_from_interpreter_flags(): v = getattr(sys.flags, flag) if v > 0: args.append('-' + opt * v) + if getattr(sys.flags, 'hash_randomization') != 0: + args.append('-R') for opt in sys.warnoptions: args.append('-W' + opt) return args diff --git a/Misc/NEWS b/Misc/NEWS index c68e9c935b..adb4a1556b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -22,6 +22,10 @@ Core and Builtins Library ------- +- Issue #20954: _args_from_interpreter_flags used by multiprocessing and some + tests no longer behaves incorrectly in the presence of the PYTHONHASHSEED + environment variable. + - Issue #14285: When executing a package with the "python -m package" option, and package initialization raises ImportError, a proper traceback is now reported. -- 2.50.1