This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add CLI flag to disable hash randomization
Type: Stage:
Components: Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: FFY00
Priority: normal Keywords:

Created on 2021-08-05 18:28 by FFY00, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg399026 - (view) Author: Filipe Laíns (FFY00) * (Python triager) Date: 2021-08-05 18:28
There are select use-cases where hash randomization is undesirable, having a CLI option to switch it off would be very helpful.
One example would be packaging, where hash randomization will make the bytecode unreproducible.

Currently, we have to set PYTHONHASHSEED to a constant value. Having a CLI option (lets say -Z) would allow use to do

  python -Zm install artifact.whl

instead of

  PYTHONHASHSEED=0 python -m install artifact.whl

Which is something that I have to do lots of places.
History
Date User Action Args
2022-04-11 14:59:48adminsetgithub: 89006
2021-08-05 18:28:53FFY00create