View Single Post
Old 12-10-2012, 06:36 AM   #168
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,910
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You'd need to create the lpEnvironment and pass it to createprocess. Something like

env = os.environ.copy()
# remove the calibre path from env['PATH']

raw = u'\0'.join(u'%s=%s'%(k, v) for k, v in env.iteritems())

Then pass raw as lpEnvironment to CreateProcess and remember to set CREATE_UNICODE_ENVIRONMENT in the dwCreationFlags
kovidgoyal is offline   Reply With Quote