mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 11:16:24 +00:00
Change away from the Windows directory separator for the escape char
This commit is contained in:
parent
25a62001dd
commit
d203fde9f6
@ -206,7 +206,7 @@ class BinTahoe(common_util.SignalMixin, unittest.TestCase, RunBinTahoeMixin):
|
||||
@inlineCallbacks
|
||||
def test_escape_in_eliot_destination(self):
|
||||
out, err, rc_or_sig = yield self.run_bintahoe([
|
||||
"--eliot-destination=file:\\foo",
|
||||
"--eliot-destination=file:@foo",
|
||||
])
|
||||
self.assertEqual(1, rc_or_sig)
|
||||
self.assertIn("Unsupported escape character", out)
|
||||
|
@ -432,10 +432,15 @@ class _DestinationParser(object):
|
||||
)
|
||||
|
||||
def _parse_file(self, kind, arg_text):
|
||||
# Reserve the possibility of an escape character in the future.
|
||||
if u"\\" in arg_text:
|
||||
# Reserve the possibility of an escape character in the future. \ is
|
||||
# the standard choice but it's the path separator on Windows which
|
||||
# pretty much ruins it in this context. Most other symbols already
|
||||
# have some shell-assigned meaning which makes them treacherous to use
|
||||
# in a CLI interface. Eliminating all such dangerous symbols leaves
|
||||
# approximately @.
|
||||
if u"@" in arg_text:
|
||||
raise ValueError(
|
||||
u"Unsupported escape character (\\) in destination text ({!r}).".format(arg_text),
|
||||
u"Unsupported escape character (@) in destination text ({!r}).".format(arg_text),
|
||||
)
|
||||
arg_list = arg_text.split(u":")
|
||||
path_name = arg_list.pop(0)
|
||||
|
Loading…
Reference in New Issue
Block a user