Changeset d203fde in trunk


Ignore:
Timestamp:
2019-02-27T00:06:35Z (6 years ago)
Author:
Jean-Paul Calderone <exarkun@…>
Branches:
master
Children:
1b55a7f
Parents:
25a6200
Message:

Change away from the Windows directory separator for the escape char

Location:
src/allmydata
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/test/test_runner.py

    r25a6200 rd203fde  
    207207    def test_escape_in_eliot_destination(self):
    208208        out, err, rc_or_sig = yield self.run_bintahoe([
    209             "--eliot-destination=file:\\foo",
     209            "--eliot-destination=file:@foo",
    210210        ])
    211211        self.assertEqual(1, rc_or_sig)
  • TabularUnified src/allmydata/util/eliotutil.py

    r25a6200 rd203fde  
    433433
    434434    def _parse_file(self, kind, arg_text):
    435         # Reserve the possibility of an escape character in the future.
    436         if u"\\" in arg_text:
     435        # Reserve the possibility of an escape character in the future.  \ is
     436        # the standard choice but it's the path separator on Windows which
     437        # pretty much ruins it in this context.  Most other symbols already
     438        # have some shell-assigned meaning which makes them treacherous to use
     439        # in a CLI interface.  Eliminating all such dangerous symbols leaves
     440        # approximately @.
     441        if u"@" in arg_text:
    437442            raise ValueError(
    438                 u"Unsupported escape character (\\) in destination text ({!r}).".format(arg_text),
     443                u"Unsupported escape character (@) in destination text ({!r}).".format(arg_text),
    439444            )
    440445        arg_list = arg_text.split(u":")
Note: See TracChangeset for help on using the changeset viewer.