I wanted to ask this on the mailing list, subscribed and everything, but the mails do not go through:
I’m working on a frontend to Borg backup. For using the keychain, etc., it would be useful to turn the frontend into a standalone app. So I tried to do that with py2app, but when running my app this way, borg subprocesses fail: module ‘borg’ not found. If I pass a modified environment to subprocess.Popen, as follow, then things will work:
env=os.environ.copy()
del env['PYTHONPATH']
del env['PYTHONHOME']
But of course this also will fail on system where the variables are set in the default environment. My question then is, is there a clean way to restore the original environment, before py2app changed it?
I wanted to ask this on the mailing list, subscribed and everything, but the mails do not go through:
I’m working on a frontend to Borg backup. For using the keychain, etc., it would be useful to turn the frontend into a standalone app. So I tried to do that with py2app, but when running my app this way, borg subprocesses fail: module ‘borg’ not found. If I pass a modified environment to subprocess.Popen, as follow, then things will work:
But of course this also will fail on system where the variables are set in the default environment. My question then is, is there a clean way to restore the original environment, before py2app changed it?