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

2021-11-27 Thread Irit Katriel


Irit Katriel  added the comment:

This is working now (note that since 3.10 hash randomisation is enabled by 
default):

cpython % export PYTHONHASHSEED=random
cpython % ./python.exe -c "import sys; print(sys.flags.hash_randomization)"
1
cpython % export PYTHONHASHSEED=0  
cpython % ./python.exe -c "import sys; print(sys.flags.hash_randomization)"
0
cpython % export PYTHONHASHSEED=1  
cpython % ./python.exe -c "import sys; print(sys.flags.hash_randomization)"
1

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-04-15 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
nosy: +christian.heimes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17708
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-04-15 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
nosy: +dmalcolm

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17708
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-04-13 Thread Stephen Tu

Stephen Tu added the comment:

Py_HashRandomizationFlag was not getting properly set anywhere. This patch 
fixes this. Also a test case

Behavior is now:
$ cat ~/hr.py 
import sys
print(sys.flags.hash_randomization)
$ PYTHONHASHSEED=random ./python.exe ~/hr.py 
1
$ PYTHONHASHSEED=0 ./python.exe ~/hr.py 
0
$ PYTHONHASHSEED=1 ./python.exe ~/hr.py 
0

--
keywords: +patch
nosy: +Stephen.Tu
Added file: http://bugs.python.org/file29811/hashrandomization.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17708
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-04-13 Thread Masami HIRATA

Masami HIRATA added the comment:

It seems there is a misunderstanding on my part.

Python v3.3.1 documentation says,
sys.flags The struct sequence flags exposes the status of command line flags. 
The attributes are read only.

I think that sys.flags.hash_randomization should be always 1 on Python v3.3.1

because the documentation says,
-R 
Kept for compatibility. On Python 3.3 and greater, hash randomization is turned 
on by default.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17708
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-04-13 Thread Stephen Tu

Stephen Tu added the comment:

But it would seem that setting PYTHONHASHSEED != random does disable hash 
randomization. also, not sure what the semantics of the following is:

$ PYTHONHASHSEED=1 python -R ...

right now, python3 basically ignores -R.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17708
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-04-13 Thread Masami HIRATA

Masami HIRATA added the comment:

We should add 'randomization' and 'seed' attribute to sys.hash_info, I think.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17708
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-04-12 Thread Masami HIRATA

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 rep...@bugs.python.org
http://bugs.python.org/issue17708
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com