From 39aed3a5a04663d46dc1a1c1cec54a625405d35c Mon Sep 17 00:00:00 2001 From: Alejandro del Castillo Date: Thu, 5 Jul 2018 23:05:39 -0500 Subject: [PATCH] _ServiceSpawner: add 'SYSTEMROOT' to environment if Windows Python 3 cannot be started without SYSTEMROOT environment variable. Otherwise, CryptAcquireContext() is unable to find a dll. https://bugs.python.org/issue20614 Signed-off-by: Alejandro del Castillo --- jupyterhub/services/service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jupyterhub/services/service.py b/jupyterhub/services/service.py index f24645ad..1093c78e 100644 --- a/jupyterhub/services/service.py +++ b/jupyterhub/services/service.py @@ -41,6 +41,7 @@ A hub-managed service with no URL:: import pipes import shutil +import os from subprocess import Popen from traitlets import ( @@ -104,6 +105,8 @@ class _ServiceSpawner(LocalProcessSpawner): def start(self): """Start the process""" env = self.get_env() + if os.name == 'nt': + env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] cmd = self.cmd self.log.info("Spawning %s", ' '.join(pipes.quote(s) for s in cmd))