[issue17708] sys.flags.hash_randomization doesn't return correct value

Masami HIRATA report at bugs.python.org
Sat Apr 13 07:46:48 CEST 2013


New submission from Masami HIRATA:

OS: Windows 7 Starter Edition SP1 (32-bit)
Python: 3.3.1 (python-3.3.1.msi)

It seems that sys.flags.hash_randomization doesn't return correct value

Output:
C:\>set PYTHONHASHSEED=random

C:\>C:\Python33\python.exe
Python 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 20:25:12) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.flags.hash_randomization
1
>>> ^Z


C:\>set PYTHONHASHSEED=1

C:\>C:\Python33\python.exe
Python 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 20:25:12) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.flags.hash_randomization
1
>>> ^Z


C:\>set PYTHONHASHSEED=12345

C:\>C:\Python33\python.exe
...
>>> import sys
>>> sys.flags.hash_randomization
12345
>>> ^Z

Output I Expected:
C:\>set PYTHONHASHSEED=random

C:\>C:\Python33\python.exe
...
>>> import sys
>>> sys.flags.hash_randomization
True
>>> ^Z


C:\>set PYTHONHASHSEED=1

C:\>C:\Python33\python.exe
...
>>> import sys
>>> sys.flags.hash_randomization
False
>>> ^Z


C:\>set PYTHONHASHSEED=12345

C:\>C:\Python33\python.exe
...
>>> import sys
>>> sys.flags.hash_randomization
False
>>> ^Z

----------
components: Library (Lib)
messages: 186693
nosy: msmhrt
priority: normal
severity: normal
status: open
title: sys.flags.hash_randomization doesn't return correct value
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17708>
_______________________________________


More information about the Python-bugs-list mailing list