]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/import-duplicity-cmd.py
Prefer python 3, and mention intent to drop python 2 support
[bup.git] / lib / cmd / import-duplicity-cmd.py
index bfb51831581b2e2c56f680af1fe16545175811da..348be8cbbaa397b9620ca4b1ea3b2e67dd475d16 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     arg_i=$((arg_i + 1))
 done
 # Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
 exec "$bup_python" "$0"
 """
 # end of bup preamble
@@ -20,9 +20,12 @@ from pipes import quote
 from subprocess import check_call
 from time import strftime, strptime
 import os
+import os.path
 import sys
 import tempfile
 
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
 from bup import compat, git, helpers, options
 from bup.compat import argv_bytes, str_type
 from bup.helpers import (handle_ctrl_c,
@@ -40,7 +43,7 @@ n,dry-run  don't do anything; just print what would be done
 """
 
 def logcmd(cmd):
-    log(shstr(cmd).decode('iso-8859-1', errors='replace') + '\n')
+    log(shstr(cmd).decode(errors='backslashreplace') + '\n')
 
 def exc(cmd, shell=False):
     global opt