Workaround

From RdiffBackupWiki

Jump to: navigation, search

I keep getting the deprecated message warning below using rdiff 1.2.8 and came up with the diff patch below. Don't know how solid this is, but I think it's working for me so far:

/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py:148: DeprecationWarning: os.popen2 is deprecated. Use the subprocess module.

# diff -Nr -U 3 /usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py.orig /tmp/new/SetConnections.py
--- /usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py.orig      2009-09-28 13:05:48.000000000 -0500
+++ /tmp/new/SetConnections.py  2009-09-28 13:07:37.000000000 -0500
@@ -144,6 +144,16 @@
                        (stdin, stdout) = (process.stdin, process.stdout)
                except OSError:
                        (stdin, stdout) = (None, None)
+   # tmb - Linux work around for "... os.popen2 is deprecated. "
+   if os.name == "posix":
+      import subprocess
+      try:
+         process = subprocess.Popen(remote_cmd, shell=True, 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)
        conn_number = len(Globals.connections)


Phim chieu rap Xem phim online Xem phim hot Sua chua laptop Sua chua laptop Man hinh laptop Ban phim laptop Sac laptop Pin laptop

Personal tools