From 34dd39e66e5bd2b4bd08da27735a5f3184bbb0d2 Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Sat, 13 Apr 2013 14:44:23 +0000 Subject: [PATCH] rsync now works with Python 2.5 and 2.6 (not just 2.7) --- bin/weeutil/rsyncupload.py | 7 ++++--- docs/changes.txt | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/weeutil/rsyncupload.py b/bin/weeutil/rsyncupload.py index 0b5cdd78..745e1d73 100644 --- a/bin/weeutil/rsyncupload.py +++ b/bin/weeutil/rsyncupload.py @@ -79,9 +79,10 @@ class RsyncUpload(object): cmd.extend([rsyncremotespec]) try: - syslog.syslog(syslog.LOG_DEBUG, "rsyncupload: rsync invocation: %s" % " ".join(cmd)) - output = subprocess.check_output(cmd) - stroutput = output.encode("utf-8") + rsynccmd = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + + stdout = rsynccmd.communicate()[0] + stroutput = stdout.encode("utf-8") syslog.syslog(syslog.LOG_DEBUG, "rsyncupload: rsync reported:\n%s" % stroutput) except OSError, e: if e.errno == errno.ENOENT: diff --git a/docs/changes.txt b/docs/changes.txt index 134c4940..33d66f79 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -6,6 +6,8 @@ weewx change history Fixed bug that prevented Fine Offset stations from downloading archive records if the archive database had no records in it. +rsync should now work with Python 2.5 and 2.6 (not just 2.7) + 2.3.0 04/10/13