diff options
author | owsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2008-04-13 11:25:22 +0000 |
---|---|---|
committer | owsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2008-04-13 11:25:22 +0000 |
commit | b03c72c54cf5f650ffbc76768ce74f37bb24269b (patch) | |
tree | 85711a1467afd171f1f43b59060b648b2042b1eb /rdiff-backup/rdiff_backup/SetConnections.py | |
parent | e0169c64228d64cf857d486c897f41ed074cbab4 (diff) | |
download | rdiff-backup-b03c72c54cf5f650ffbc76768ce74f37bb24269b.tar.gz |
Handle Windows' lack of getuid(), getgid(), hardlinks and symlinks in
fs_abilities.py. Use subproces.Popen() on Windows since it does not support
os.popen2(). (Patch from Josh Nisly)
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@883 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/SetConnections.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/SetConnections.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/rdiff-backup/rdiff_backup/SetConnections.py b/rdiff-backup/rdiff_backup/SetConnections.py index 0d30cf0..176dd6a 100644 --- a/rdiff-backup/rdiff_backup/SetConnections.py +++ b/rdiff-backup/rdiff_backup/SetConnections.py @@ -132,7 +132,14 @@ def init_connection(remote_cmd): if not remote_cmd: return Globals.local_connection Log("Executing " + remote_cmd, 4) - stdin, stdout = os.popen2(remote_cmd) + if os.name == "nt": + import subprocess + process = subprocess.Popen(remote_cmd, shell=False, bufsize=0, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE) + (stdin, stdout) = (process.stdin, process.stdout) + else: + stdin, stdout = os.popen2(remote_cmd) conn_number = len(Globals.connections) conn = connection.PipeConnection(stdout, stdin, conn_number) |