43 |
43 |
44 env=None |
44 env=None |
45 if passphrase: |
45 if passphrase: |
46 env=os.environ.copy() |
46 env=os.environ.copy() |
47 env['BORG_PASSPHRASE']=passphrase |
47 env['BORG_PASSPHRASE']=passphrase |
|
48 |
|
49 # Workaround: if launched is a standalone app created with py2app, |
|
50 # borg will fail unless Python environment is reset. |
|
51 # TODO: Of course, this will fail if the system needs the variables |
|
52 # PYTHONPATH or PYTHONHOME set to certain values. |
|
53 if '_PY2APP_LAUNCHED_' in env and env['_PY2APP_LAUNCHED_']=='1': |
|
54 if env==None: |
|
55 env=os.environ.copy() |
|
56 del env['PYTHONPATH'] |
|
57 del env['PYTHONHOME'] |
48 |
58 |
49 self.proc=Popen(cmd, env=env, stdout=PIPE, stderr=PIPE, stdin=PIPE) |
59 self.proc=Popen(cmd, env=env, stdout=PIPE, stderr=PIPE, stdin=PIPE) |
50 |
60 |
51 # We don't do passphrase input etc. |
61 # We don't do passphrase input etc. |
52 self.proc.stdin.close() |
62 self.proc.stdin.close() |