]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/util/encodingutil.py
Add long_path=False option to abspath_expanduser_unicode.
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / util / encodingutil.py
index f97c4822c1a7b072f3181f9f3019efd288864333..e18b854f2c5462de432cc81d16c16dda0ecdec37 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):
+def argv_to_abspath(s, long_path=True):
     """
     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):
     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)
+    return abspath_expanduser_unicode(decoded, long_path=long_path)
 
 def unicode_to_argv(s, mangle=False):
     """