mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Refs #32061 -- Fixed test_crash_password_does_not_leak() crash on Windows.
When env is passed to subprocess.run() we should pass all existing environment variables. This fixes crash on Windows: Fatal Python error: failed to get random numbers to initialize Python Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python Python runtime state: preinitialized
This commit is contained in:
parent
542b4b3ab4
commit
009fddc96b
2 changed files with 6 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
@ -190,6 +191,8 @@ class MySqlDbshellCommandTestCase(SimpleTestCase):
|
|||
},
|
||||
[],
|
||||
)
|
||||
if env:
|
||||
env = {**os.environ, **env}
|
||||
fake_client = Path(__file__).with_name('fake_client.py')
|
||||
args[0:1] = [sys.executable, str(fake_client)]
|
||||
with self.assertRaises(subprocess.CalledProcessError) as ctx:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue