
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-12-14 23:11 byvstinner, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 4873 | merged | vstinner,2017-12-14 23:16 | |
| PR 4875 | merged | vstinner,2017-12-15 00:00 | |
| PR 4884 | merged | vstinner,2017-12-15 15:00 | |
| Messages (5) | |||
|---|---|---|---|
| msg308343 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-12-14 23:11 | |
Python pretends that hash randomization is always enabled, but it's not:$ PYTHONHASHSEED=0 python3 -c 'import sys; print(sys.flags.hash_randomization)'1vstinner@apu$ PYTHONHASHSEED=0 python3 -c 'import sys; print(hash("abc"))'4596069200710135518vstinner@apu$ PYTHONHASHSEED=0 python3 -c 'import sys; print(hash("abc"))'4596069200710135518vstinner@apu$ PYTHONHASHSEED=0 python3 -c 'import sys; print(hash("abc"))'4596069200710135518=> sys.flags.hash_randomization must be zeroMoreover, the -R flag is always ignored, it's not possible to override the PYTHONHASHSEED environment variable:vstinner@apu$ PYTHONHASHSEED=0 python3 -R -c 'import sys; print(sys.flags.hash_randomization)'1vstinner@apu$ PYTHONHASHSEED=0 python3 -R -c 'import sys; print(hash("abc"))'4596069200710135518vstinner@apu$ PYTHONHASHSEED=0 python3 -R -c 'import sys; print(hash("abc"))'4596069200710135518vstinner@apu$ PYTHONHASHSEED=0 python3 -R -c 'import sys; print(hash("abc"))'4596069200710135518I expect that -R enables hash randomization and overrides PYTHONHASHSEED environment variable.Attached PR fixes these issues and adds an unit test. | |||
| msg308348 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-12-14 23:51 | |
New changeset358e5e17a51ba00742bfaee4557a94c3c4179c22 by Victor Stinner in branch 'master':bpo-32329: Fix -R option for hash randomization (#4873)https://github.com/python/cpython/commit/358e5e17a51ba00742bfaee4557a94c3c4179c22 | |||
| msg308354 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-12-15 00:39 | |
New changeset22097aaa77b4f0473552fe840358d77e5b9a253f by Victor Stinner in branch '3.6':bpo-32329: Fix sys.flags.hash_randomization (#4875)https://github.com/python/cpython/commit/22097aaa77b4f0473552fe840358d77e5b9a253f | |||
| msg308355 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-12-15 00:43 | |
"PYTHONHASHSEED=0 python3 -R" now enables hash randomization on master (Python 3.7), I also fixed the sys.flags.hash_randomization value when using PYTHONHASHSEED=0.I chose to not modify the behaviour of the -R option in Python 3.6. I dislike having to document a behaviour change in a minor Python version (3.6.x). I only fixed the value of sys.flags.hash_randomization in Python 3.6. | |||
| msg308405 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2017-12-15 15:29 | |
New changeset642d67b4f25262889b43f91ad2a96ca0e37fd5a2 by Victor Stinner in branch 'master':bpo-32329: Add versionchanged to -R option doc (#4884)https://github.com/python/cpython/commit/642d67b4f25262889b43f91ad2a96ca0e37fd5a2 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:55 | admin | set | github: 76510 |
| 2017-12-15 15:41:41 | vstinner | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017-12-15 15:29:08 | vstinner | set | messages: +msg308405 |
| 2017-12-15 15:00:39 | vstinner | set | pull_requests: +pull_request4780 |
| 2017-12-15 00:43:00 | vstinner | set | messages: +msg308355 |
| 2017-12-15 00:39:50 | vstinner | set | messages: +msg308354 |
| 2017-12-15 00:00:11 | vstinner | set | pull_requests: +pull_request4769 |
| 2017-12-14 23:51:24 | vstinner | set | messages: +msg308348 |
| 2017-12-14 23:16:46 | vstinner | set | keywords: +patch stage: patch review pull_requests: +pull_request4766 |
| 2017-12-14 23:11:20 | vstinner | create | |