Attached 02_python_2.6_deprecationwarning.dpatch (Got it from ubuntu/lucid [1])

I have just build a new version of rdiff-backup with this patch (applies 
smoothly by simply putting it on debian/patches and adding it to the 00list 
file)




[1] 
http://archive.ubuntu.com/ubuntu/pool/universe/r/rdiff-backup/rdiff-backup_1.2.8-5ubuntu2.diff.gz



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Carlos Alberto Lopez Perez                           http://neutrino.es
Igalia - Free Software Engineering                http://www.igalia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_python_2.6_deprecationwarning.dpatch by  
<andr...@pc13267v15.midgard.liu.se>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: patch adapted from the one at https://savannah.nongnu.org/bugs/?26064
## DP: This fix the following warning: "DeprecationWarning: os.popen2 is 
## DP: deprecated. Use the subprocess module."
## DP: Also, the *nix version of rdiff-backup requires shell=True instead of
## DP: shell=False in the subprocess.Popen call

@DPATCH@
diff -urNad rdiff-backup-1.2.8~/rdiff_backup/SetConnections.py 
rdiff-backup-1.2.8/rdiff_backup/SetConnections.py
--- rdiff-backup-1.2.8~/rdiff_backup/SetConnections.py  2009-03-16 
15:36:21.000000000 +0100
+++ rdiff-backup-1.2.8/rdiff_backup/SetConnections.py   2009-10-03 
19:27:54.935647306 +0200
@@ -135,10 +135,10 @@
        if not remote_cmd: return Globals.local_connection
 
        Log("Executing " + remote_cmd, 4)
-       if os.name == "nt":
+       if map(int, sys.version.split()[0].split('.')[:2]) >= [2, 6]:
                import subprocess
                try:
-                       process = subprocess.Popen(remote_cmd, shell=False, 
bufsize=0,
+                       process = subprocess.Popen(remote_cmd, shell=True, 
bufsize=0,
                                                                
stdin=subprocess.PIPE, 
                                                                
stdout=subprocess.PIPE)
                        (stdin, stdout) = (process.stdin, process.stdout)

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to