From f74751459eef78734c9ac66e64f0f5e9ab264a5f Mon Sep 17 00:00:00 2001 From: schlamar Date: Tue, 25 Mar 2014 08:44:38 +0100 Subject: Limit PYTHONHASHSEED to 1024 on Windows to prevent possible MemoryErrors. See http://bugs.python.org/issue20954. --- tox/_config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tox') diff --git a/tox/_config.py b/tox/_config.py index 3644d8bd..9e16b7d4 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -123,7 +123,8 @@ def prepare_parse(pkgname): parser.add_argument("--hashseed", action="store", metavar="SEED", default=None, help="set PYTHONHASHSEED to SEED before running commands. " - "Defaults to a random integer in the range 1 to 4294967295. " + "Defaults to a random integer in the range [1, 4294967295] " + "([1, 1024] on Windows). " "Passing 'noset' suppresses this behavior.") parser.add_argument("--force-dep", action="append", metavar="REQ", default=None, @@ -200,7 +201,10 @@ def get_homedir(): return None def make_hashseed(): - return str(random.randint(1, 4294967295)) + max_seed = 4294967295 + if sys.platform == 'win32': + max_seed = 1024 + return str(random.randint(1, max_seed)) class parseini: def __init__(self, config, inipath): -- cgit v1.2.1 From aaa0d189dc3bc03259b1fd25da1c2ce1dbb0fa8b Mon Sep 17 00:00:00 2001 From: schlamar Date: Tue, 25 Mar 2014 08:51:10 +0100 Subject: Restrict PYTHONHASHSEED limitation on Windows to Python < 3.4. --- tox/_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tox') diff --git a/tox/_config.py b/tox/_config.py index 9e16b7d4..23d86f44 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -202,7 +202,7 @@ def get_homedir(): def make_hashseed(): max_seed = 4294967295 - if sys.platform == 'win32': + if sys.platform == 'win32' and sys.version_info < (3, 4): max_seed = 1024 return str(random.randint(1, max_seed)) -- cgit v1.2.1