[pypy-commit] pypy stdlib-2.7.3: We won't support hash randomization in the short term.

amauryfa noreply at buildbot.pypy.org
Thu Sep 6 22:00:08 CEST 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: stdlib-2.7.3
Changeset: r57196:745fdd104890
Date: 2012-09-06 21:59 +0200
http://bitbucket.org/pypy/pypy/changeset/745fdd104890/

Log:	We won't support hash randomization in the short term. Add a
	warning, and a note in the documentation.

diff --git a/pypy/doc/cpython_differences.rst b/pypy/doc/cpython_differences.rst
--- a/pypy/doc/cpython_differences.rst
+++ b/pypy/doc/cpython_differences.rst
@@ -285,6 +285,10 @@
 Miscellaneous
 -------------
 
+* Hash randomization is not supported in PyPy.  Passing ``-R`` to the
+  command line, or setting the ``PYTHONHASHSEED`` environment variable
+  will display a warning message.
+
 * ``sys.setrecursionlimit()`` is ignored (and not needed) on
   PyPy.  On CPython it would set the maximum number of nested
   calls that can occur before a RuntimeError is raised; on PyPy
diff --git a/pypy/translator/goal/app_main.py b/pypy/translator/goal/app_main.py
--- a/pypy/translator/goal/app_main.py
+++ b/pypy/translator/goal/app_main.py
@@ -444,6 +444,10 @@
         (not options["ignore_environment"] and os.getenv('PYTHONINSPECT'))):
         options["inspect"] = 1
 
+    if (options["hash_randomization"] or os.getenv('PYTHONHASHSEED')):
+        print >> sys.stderr, (
+            "Warning: pypy does not implement hash randomization")
+
     if PYTHON26 and we_are_translated():
         flags = [options[flag] for flag in sys_flags]
         sys.flags = type(sys.flags)(flags)


More information about the pypy-commit mailing list