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

Glob in quotes #64

Merged
merged 6 commits into from
May 24, 2019
Merged

Glob in quotes #64

merged 6 commits into from
May 24, 2019

Conversation

Davejkane
Copy link
Owner

This PR closes #50

Accept glob as a single value again. Quotes required. Slight refactor to make useful functions public

@Davejkane Davejkane requested a review from gurgalex May 23, 2019 22:12
Copy link
Collaborator

@gurgalex gurgalex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. The program wouldn't handle invalid utf8 paths before anyway.

if pathbuf.is_dir() {
pathbuf = pathbuf.join("*");
}
Ok(pathbuf.to_string_lossy().to_string())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

      Ok(pathbuf.to_string_lossy().to_string())

Would this mean that we only handle valid UTF-8 paths?
Seems that glob can't accept invalid utf-8 as a pattern anyway.

Because the following path would not work.

python3

invalid_utf8_file = b"\xc3\x28"
with open(invalid_utf8_file, "w+") as f:
    f.write("invalid\n")

@Davejkane Davejkane merged commit 33c5891 into development May 24, 2019
@Davejkane Davejkane deleted the glob_in_quotes branch May 25, 2019 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell independent glob expansion
2 participants