Closed o-l-a-v closed 1 month ago
We should probably add a test to make sure this does not happen again? But you probably want another "test_modulex" rather testing by fetching Microsoft.Web.WebView2
( https://www.nuget.org/packages/Microsoft.Web.WebView2 )?
Must be a .nupkg where ZipFile.OpenRead will have entries where CompressedLength is less than 1, a.k.a a directory.
So funny enough, when I tried to create a similarly structured .nupkg I wasn't able to repro the issue-- the only entries displayed were files and not directories.
I added a version of Microsoft.Web.WebView2
that is definitely reproducing the error and added a test to the local repository test file to validate it can install properly.
Thanks for fixing this bug!
PR Summary
Fixes #1659.
I noticed that the example problematic package
Microsoft.Web.WebView2
( https://www.nuget.org/packages/Microsoft.Web.WebView2 ) mentioned by the creator of the issue, contained directories when doing ZipFile.OpenRead and looking at the entries. Non-problematic packages, likeNuGet.Versioning
( https://www.nuget.org/packages/NuGet.Versioning ) did not.Solution: Filter out entries where length is less than or equal to 0 (because they are not files).
PR Context
See previous chapter.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.