]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Reject path arguments that start with '-' with a usage error.
authorDaira Hopwood <daira@jacaranda.org>
Mon, 28 Dec 2015 20:45:14 +0000 (20:45 +0000)
committermeejah <meejah@meejah.ca>
Wed, 20 Jan 2016 08:33:20 +0000 (01:33 -0700)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/util/encodingutil.py

index 1015679403ff391ecaeab33abfd1f4a4f761164e..65f5911a147515d786909aa03c05820caaba885f 100644 (file)
@@ -96,7 +96,7 @@ def argv_to_unicode(s):
         raise usage.UsageError("Argument %s cannot be decoded as %s." %
                                (quote_output(s), io_encoding))
 
-def argv_to_abspath(s, long_path=True):
+def argv_to_abspath(s, **kwargs):
     """
     Convenience function to decode an argv element to an absolute path, with ~ expanded.
     If this fails, raise a UsageError.
@@ -105,7 +105,7 @@ def argv_to_abspath(s, long_path=True):
     if decoded.startswith(u'-'):
         raise usage.UsageError("Path argument %s cannot start with '-'.\nUse %s if you intended to refer to a file."
                                % (quote_output(s), quote_output(os.path.join('.', s))))
-    return abspath_expanduser_unicode(decoded, long_path=long_path)
+    return abspath_expanduser_unicode(decoded, **kwargs)
 
 def unicode_to_argv(s, mangle=False):
     """