summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2016-01-05 08:00:35 +0100
committerFlorian Bruhin <git@the-compiler.org>2016-01-05 08:00:35 +0100
commite60347026051e7d1af1c1d5aec4799475f36ecbb (patch)
tree5f5d381151beba91140d9ddbaa762b89157c1632
parent814e6f5959e47eb8cfc42e16ff807d2664a9e3f5 (diff)
downloadqutebrowser-e60347026051e7d1af1c1d5aec4799475f36ecbb.tar.gz
qutebrowser-e60347026051e7d1af1c1d5aec4799475f36ecbb.zip
Fix asciidoc2html on Windows.
Windows needs the SystemRoot environment variable set to initialize the crypto API, what running Python in a subprocess does. However, we did override the whole environment instead of extending it, which means this broke on Windows when calling asciidoc: Traceback (most recent call last): File "C:\asciidoc-8.6.9\asciidoc.py", line 9, in <module> import sys, os, re, time, traceback, tempfile, subprocess, codecs, locale, unicodedata, copy File "C:\Python27\lib\tempfile.py", line 35, in <module> from random import Random as _Random File "C:\Python27\lib\random.py", line 885, in <module> _inst = Random() File "C:\Python27\lib\random.py", line 97, in __init__ self.seed(x) File "C:\Python27\lib\random.py", line 113, in seed a = long(_hexlify(_urandom(2500)), 16) WindowsError: [Error -2146893795] Provider DLL failed to initialize correctly
-rwxr-xr-xscripts/asciidoc2html.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index 5a0f46d99..7ef118c4f 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -226,7 +226,9 @@ class AsciiDoc:
cmdline += args
cmdline.append(src)
try:
- subprocess.check_call(cmdline, env={'HOME': self._homedir})
+ env = os.environ.copy()
+ env['HOME'] = self._homedir
+ subprocess.check_call(cmdline, env=env)
self._failed = True
except (subprocess.CalledProcessError, OSError) as e:
self._failed = True