Message 186693 - Python tracker (original) (raw)
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