diff --git a/src/allmydata/test/test_runner.py b/src/allmydata/test/test_runner.py index 97df7404e..a8c261214 100644 --- a/src/allmydata/test/test_runner.py +++ b/src/allmydata/test/test_runner.py @@ -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) diff --git a/src/allmydata/util/eliotutil.py b/src/allmydata/util/eliotutil.py index e49b02a5f..53354d0d5 100644 --- a/src/allmydata/util/eliotutil.py +++ b/src/allmydata/util/eliotutil.py @@ -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)