Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BF: run: Escape each input/output before formatting command string #2798

Merged
merged 3 commits into from Sep 8, 2018

Commits on Sep 6, 2018

  1. BF: run: Escape each input/output before formatting command string

    Our processing of inputs and outputs is broken for paths with
    spaces.  Take the inputs "foo blah.txt" and "bar.txt", and the run
    
      $ datalad run --input="a" --input="b c" CMD
    
    If CMD is a string (e.g., "./script {inputs}"), then the formatted run
    command is ultimately "./script a b c" rather than "./script a 'b c'"
    because the individual inputs aren't quoted.
    
    On the other hand, if CMD is a list (no quotes), the list is first
    converted to the string form of "./script '{inputs}'" (see 9c3a65e)
    and ultimately "./script 'a b c'".
    
    Quote each input and output so that paths with spaces work with the
    string form.  This won't work with the list form because {inputs} is
    surrounded by quotes, but at least one form will work reliably.
    kyleam committed Sep 6, 2018
    Copy the full SHA
    1e063c3 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2018

  1. TST: run: Drop unnecessary ok_file_has_content(..., strip=True)

    There aren't any newlines in the output file, so this isn't helpful
    here.
    kyleam committed Sep 7, 2018
    Copy the full SHA
    101e990 View commit details
    Browse the repository at this point in the history
  2. TST: run: Extend test_inputs_spaces with OBSCURE_FILENAME

    Note: In Python 2, this test triggers a UnicodeWarning.  That happens
    in discover_dataset_trace_to_targets() that is downstream of the
    ds.add(".") call.  This should be fixed separately.
    
    Re: datalad#2798 (review)
    kyleam committed Sep 7, 2018
    Copy the full SHA
    48d3b09 View commit details
    Browse the repository at this point in the history