Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.3 bin/test --no-subprocess says hash randomization is off #7184 #12308

Closed
wants to merge 2 commits into from

Conversation

SaiHarsh
Copy link

Currently, ./bin/test --no-subprocess in the python3 hash seed is off instead of on, this fixes the issue.

@asmeurer
Copy link
Member

This sets the environment variable, but it won't be what is actually used, since Python is already started.

@SaiHarsh
Copy link
Author

@asmeurer It means I need to set the environment variable before python gets invoke, could you suggest me what I need to read to solve this problem, is it related to the python subprocess.

@SaiHarsh
Copy link
Author

@asmeurer I feel line 98 is the correct place to set the PYTHONHASHSEED value as environment variable SYMPY_USE_CACHE and SYMPY_GROUND_TYPES is set.
Correct me if I am wrong.

@asmeurer
Copy link
Member

The subprocess is the way it is set before Python gets invoked. With --no-subprocess, hash randomization is still enabled (for Python 3.3+), but you don't know the seed, so it should just say hash randomization: on (seed unknown) or something to that effect.

@asmeurer
Copy link
Member

Also, use a branch other than master, so that you don't mix unrelated changes. You should never commit to the master branch.

@oscarbenjamin oscarbenjamin added the Testing Related to the test runner. Do not use for test failures unless it relates to the test runner itself label Feb 4, 2019
@czgdp1807
Copy link
Member

ping @SaiHarsh @asmeurer Please provide your updates on this PR.

@czgdp1807
Copy link
Member

czgdp1807 commented Oct 9, 2019

I tested this PR on my system, it is producing the following error,

python3 ./bin/test --no-subprocess 
Traceback (most recent call last):
  File "./bin/test", line 101, in <module>
    import sympy
  File "/home/gagandeep/sympy/sympy/__init__.py", line 60, in <module>
    from .polys import *
  File "/home/gagandeep/sympy/sympy/polys/__init__.py", line 5, in <module>
    from . import polytools
  File "/home/gagandeep/sympy/sympy/polys/polytools.py", line 54, in <module>
    from sympy.polys.domains import FF, QQ, ZZ
  File "/home/gagandeep/sympy/sympy/polys/domains/__init__.py", line 9, in <module>
    from . import finitefield
  File "/home/gagandeep/sympy/sympy/polys/domains/finitefield.py", line 7, in <module>
    from sympy.polys.domains.groundtypes import SymPyInteger
  File "/home/gagandeep/sympy/sympy/polys/domains/groundtypes.py", line 13, in <module>
    from .pythonrational import PythonRational
  File "/home/gagandeep/sympy/sympy/polys/domains/pythonrational.py", line 13, in <module>
    from sympy.printing.defaults import DefaultPrinting
  File "/home/gagandeep/sympy/sympy/printing/__init__.py", line 3, in <module>
    from .pretty import pager_print, pretty, pretty_print, pprint, \
  File "/home/gagandeep/sympy/sympy/printing/pretty/__init__.py", line 3, in <module>
    from .pretty import (pretty, pretty_print, pprint, pprint_use_unicode,
  File "/home/gagandeep/sympy/sympy/printing/pretty/pretty.py", line 26, in <module>
    from .pretty_symbology import xstr, hobj, vobj, xobj, xsym, pretty_symbol, \
ImportError: cannot import name unicode_strings

@czgdp1807
Copy link
Member

Closing this PR due to inactivity and unavailability of sufficient reviews. Thanks for the contributions. Feel free to re-open it or request in the comments to do so.

@czgdp1807 czgdp1807 closed this Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Could Close Testing Related to the test runner. Do not use for test failures unless it relates to the test runner itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants