X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fcmd%2Fftp-cmd.py;h=2878c8b6954bef56bd3d67a65ec2a837fe90cc30;hb=0c1e9293dbd4135888bd67af2f8c2d87afbea9fd;hp=02a6fecef014609806e827c0c3a0b7aa222a6c1e;hpb=5ac3821c0f1fbd6a1b1742e91ffd556cd1116041;p=bup.git diff --git a/lib/cmd/ftp-cmd.py b/lib/cmd/ftp-cmd.py index 02a6fec..2878c8b 100755 --- a/lib/cmd/ftp-cmd.py +++ b/lib/cmd/ftp-cmd.py @@ -20,9 +20,12 @@ exec "$bup_python" "$0" # (e.g. ISO-8859-1). from __future__ import absolute_import, print_function -import os, fnmatch, stat, sys -sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..'] +# Intentionally replace the dirname "$0" that python prepends +import os, sys +sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..' + +import fnmatch, stat from bup import _helpers, compat, options, git, shquote, ls, vfs from bup.compat import argv_bytes, fsdecode @@ -39,8 +42,7 @@ class OptionError(Exception): def do_ls(repo, args, out): try: - opt = ls.opts_from_cmdline([fsdecode(arg) for arg in args], - onabort=OptionError) + opt = ls.opts_from_cmdline(args, onabort=OptionError) except OptionError as e: log('error: %s' % e) return