Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Leap:42.1:Update
rdiff-backup
rdiff-backup-fix-deprecations.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File rdiff-backup-fix-deprecations.diff of Package rdiff-backup
Index: b/rdiff_backup/SetConnections.py =================================================================== --- a/rdiff_backup/SetConnections.py +++ b/rdiff_backup/SetConnections.py @@ -25,7 +25,7 @@ the related connections. """ -import os, sys +import os, sys, shlex, subprocess from log import Log import Globals, connection, rpath @@ -135,17 +135,15 @@ def init_connection(remote_cmd): if not remote_cmd: return Globals.local_connection Log("Executing " + remote_cmd, 4) - if os.name == "nt": - import subprocess - try: - process = subprocess.Popen(remote_cmd, shell=False, bufsize=0, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE) - (stdin, stdout) = (process.stdin, process.stdout) - except OSError: - (stdin, stdout) = (None, None) - else: - stdin, stdout = os.popen2(remote_cmd) + args = shlex.split(remote_cmd) + try: + process = subprocess.Popen(args, shell=False, bufsize=-1, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + close_fds=True) + (stdin, stdout) = (process.stdin, process.stdout) + except OSError: + (stdin, stdout) = (None, None) conn_number = len(Globals.connections) conn = connection.PipeConnection(stdout, stdin, conn_number)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor