-
Notifications
You must be signed in to change notification settings - Fork 7
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
Consistent shell command quoting #690
Consistent shell command quoting #690
Conversation
3206f05
to
c58347c
Compare
The failure on windows seems to be real. |
This commit unifies the quoting of `PurePosixPath`-instances in `datalad_next.shell.operations.posix`. It uses `shlex.quote` to quote stringified `PurePosixPath`-instances.
c58347c
to
408fa9b
Compare
408fa9b
to
5d5ee93
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #690 +/- ##
=======================================
Coverage 92.41% 92.42%
=======================================
Files 193 193
Lines 14108 14121 +13
Branches 2126 2128 +2
=======================================
+ Hits 13038 13051 +13
Misses 808 808
Partials 262 262 ☔ View full report in Codecov by Sentry. |
Yes, I overestimated the capabilities of FAT and NTFS. Everything should be fine now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes issue #661
This PR automatically quotes all path parameters provided as
Path
orPurePosixPath
-instances toshell.posix
-functions viashlex.quote
.Byte-parameter like the
command
-parameter ofShellCommandExecutor.__call__()
are never quoted. The caller has to ensure that file names are properly quoted. The are a number of reasons for this policy:bash
,PowerShell
,Python
, etc.bash
, there is no way to generally determine whether a path is contained in the command-argument.