From b97dfea4e712bacc528a4a8d9fdeec35b011d7ac Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 15 Jul 2011 12:25:31 -0600 Subject: [PATCH] Fix #811191 (calibre crash when add any book to library) --- src/calibre/utils/ipc/launch.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/ipc/launch.py b/src/calibre/utils/ipc/launch.py index 270f43dd6b..388b353e6a 100644 --- a/src/calibre/utils/ipc/launch.py +++ b/src/calibre/utils/ipc/launch.py @@ -81,7 +81,14 @@ class Worker(object): @property def env(self): - env = dict(os.environ) + # We use this inefficient method of copying the environment variables + # because of non ascii env vars on windows. See https://bugs.launchpad.net/bugs/811191 + env = {} + for key in os.environ: + try: + env[key] = os.environ[key] + except: + pass env['CALIBRE_WORKER'] = '1' td = binascii.hexlify(cPickle.dumps(base_dir())) env['CALIBRE_WORKER_TEMP_DIR'] = td