-
Notifications
You must be signed in to change notification settings - Fork 533
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
[FIX] Escape metacharacters when parsing dcm2niix outputs #3417
Conversation
This looks reasonable, though I'd suggest escaping just before the glob, rather than passing around an escaped filename: def search_files(prefix, outtypes):
- return it.chain.from_iterable(iglob(prefix + outtype) for outtype in outtypes)
+ return it.chain.from_iterable(iglob(glob.escape(prefix + outtype))
+ for outtype in outtypes) |
Would you mind writing a small test for |
Yea for sure, unsure where exactly I should be putting the escape in the first place. Will modify the code and add a testing too. Thanks 🙏 |
@effigies May I know where should I put the test for |
We put tests for |
Codecov Report
@@ Coverage Diff @@
## master #3417 +/- ##
==========================================
+ Coverage 65.21% 65.23% +0.02%
==========================================
Files 307 307
Lines 40474 40538 +64
Branches 5351 5370 +19
==========================================
+ Hits 26395 26446 +51
- Misses 13004 13016 +12
- Partials 1075 1076 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@effigies I have added the test for |
LGTM. Let's make sure the tests pass... |
Summary
This PR should fix the issue with dcm2niix interface not able to parse the output files when the file name contains meta characters.
Fixes #3416 .
List of changes proposed in this PR (pull-request)
Acknowledgment