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
download-url: Fix archive path handling when in subdirectory #3850
Conversation
6f1f259
to
249d613
Compare
Codecov Report
@@ Coverage Diff @@
## master #3850 +/- ##
==========================================
- Coverage 80.76% 80.74% -0.02%
==========================================
Files 273 273
Lines 36008 36029 +21
==========================================
+ Hits 29081 29093 +12
- Misses 6927 6936 +9
Continue to review full report at Codecov.
|
f38d72c (BF: download_url: Update for new path resolution logic, 2019-06-03) didn't properly adjust path handling for downstream code that feeds the paths into AnnexRepo methods. We give these methods paths that are relative to the current directory when a dataset is not an instance, but these methods still expect paths to be either relative to the dataset or full paths. Pass AnnexRepo methods paths that are relative to the dataset. Fixes datalad#3847.
Use the resolve_path() helper rather than custom logic to resolve paths against the dataset. Using centralized logic helps avoid inconsistent behavior and allows us to take advantage of the non-trivial logic in resolve_path(). In particular, we avoid the use of normpath(), which is problematic for the reason mentioned in resolve_path's docstring and comments. Here's the pathlib documentation that resolve_path() references: Spurious slashes and single dots are collapsed, but double dots ('..') are not, since this would change the meaning of a path in the face of symbolic links: [...] (a naïve approach would make PurePosixPath('foo/../bar') equivalent to PurePosixPath('bar'), which is wrong if foo is a symbolic link to another directory) , which is problematic for the reasons mentioned in Re: datalad#3643 (comment)
249d613
to
99844ed
Compare
The codecov report doesn't match what I see locally. Travis is quiet, so I've rebased this on top of the current master and pushed hoping that it sorts itself out. |
Nope, codecov still isn't happy. Dunno. Here's what I see locally:
where the two missing lines are datalad/datalad/interface/download_url.py Lines 195 to 197 in 99844ed
|
yeah, coverage doesn't make sense - test is covered but the code is not. non-believer me even ran locally -- code is executed. so let's hope it is just a temporary glitch in coverage |
This patch fixes gh-3847.