Fix #811191 (calibre crash when add any book to library)

This commit is contained in:
Kovid Goyal 2011-07-15 12:25:31 -06:00
parent df50559d41
commit b97dfea4e7

View File

@ -81,7 +81,14 @@ class Worker(object):
@property @property
def env(self): 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' env['CALIBRE_WORKER'] = '1'
td = binascii.hexlify(cPickle.dumps(base_dir())) td = binascii.hexlify(cPickle.dumps(base_dir()))
env['CALIBRE_WORKER_TEMP_DIR'] = td env['CALIBRE_WORKER_TEMP_DIR'] = td