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

run.py and tests.py replace rather than update environment #710

Open
ian-m-carr opened this issue Oct 6, 2022 · 2 comments
Open

run.py and tests.py replace rather than update environment #710

ian-m-carr opened this issue Oct 6, 2022 · 2 comments

Comments

@ian-m-carr
Copy link

As far as I can see the line in run.py and tests.py which reads:
enviro={"BLENDER_USER_SCRIPTS": os.path.dirname(os.path.realpath(__file__))}
creates a new environment with a single variable in it.

in my case blender then fails to load with:

blender --addons io_xplane2blender --factory-startup --
found bundled python: D:\tools\blender-2.83.20-windows-x64\2.83\python
Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python

replacing this line in both file with:

enviro = os.environ.copy()
enviro["BLENDER_USER_SCRIPTS"] = os.path.dirname(os.path.realpath(__file__))

Copies the existing environment and appends the variable to it.

In my case this then allows blender to run and the unit tests to begin executing

@bsupnik
Copy link
Collaborator

bsupnik commented Dec 20, 2022

Hi -- that looks like a sane fix - do you already have a patch I can take as a pull request?

@ian-m-carr
Copy link
Author

I can see what I can come up with, currently on my feat_importer branch:
run.py and tests.py re-use existing evironment vars and can now successfully run blender on my Windows setup:
be25a64

Patch attached

patch.diff.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants