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

pack - URI encodes filenames #1628

Closed
Andreas-Schommer opened this issue Aug 14, 2018 · 10 comments
Closed

pack - URI encodes filenames #1628

Andreas-Schommer opened this issue Aug 14, 2018 · 10 comments

Comments

@Andreas-Schommer
Copy link

What You Are Seeing?

Choco pack encodes filenames different to nuget. Filenames are uri encoded in choco, Nuget leaves them intact.
There was an issue fixed in nuget addressing the same issue.
The created packages can be installed without problems (with nuget as well as with chocolatey).

I used nuget 4.7.0.5148 and chocolatey v0.10.11 to do the repro.

What is Expected?

Choco pack and nuget pack should handle filenames alike, filenames with special characters and spaces should be preserviced in the nupkg.

How Did You Get This To Happen? (Steps to Reproduce)

I created a nuspec file that contains files with special characters and spaces in their names:

I used nuget pack and choco pack to create the package.

When opening the nupkg created with nuget as a ZIP archive,, the filenames are the original filenames used to create the package.
When opening the nupkg created with choco as a ZIP archive, the filenames are URI encoded.

Repro.zip

This issue has been moved over from chocolatey/chocolatey.org.

@bcurran3
Copy link

I'm not an expert on NuGet so I'm not sure if this is relevant, but keep in mind that Chocolatey is based on NuGet v2. (Someone correct me if I'm wrong!)

@ferventcoder
Copy link
Member

@Andreas-Schommer I think this would be an enhancement request. Chocolatey != NuGet, and we expect there to be differences between the two. We welcome opportunities to ensure they continue to have things that are the same, but keep in mind the expectation from us for edge cases is not that they should behave exactly alike. Does that make sense?

So far I don't really see where the issue is - opening up the archive with zips isn't a runtime scenario and isn't part of a supported installation method. But let's talk about areas where this could cause issues so we can better understand the use case.

@ferventcoder ferventcoder changed the title choco pack URI encodes filenames pack - URI encodes filenames Sep 26, 2018
@viceice
Copy link

viceice commented Jan 18, 2019

Now this is a problem.

If i pack a folder with spaces with NuGet 4.9.2.5706 then chocolatey v0.10.11 will not extract that folder.

Regards
Michael

@viceice
Copy link

viceice commented Jan 18, 2019

I found a workaround.

This does not work:

<file src="html\**\*.html" target="content/Style Library" />

This works:

<file src="html\**\*.html" target="content/Style%20Library" />

@rgl
Copy link

rgl commented Apr 22, 2019

I'm also affected by this issue. A choco pack on a directory that contains file names with white spaces (which unfortunately is common on Unity generated projects, e.g. they normally have a file named unity default resources) works; but when you try to choco install it, it simply fails without any clue about the problem.

BTW, I'm not sure where you are seeing that choco URL encodes the filenames, but it doesn't do that with white spaces.

I'm using choco 0.10.13.

@TheCakeIsNaOH
Copy link
Member

This was fixed as a part of v2.0.0, as the NuGet libraries were updated. I think this issue can be closed, as the NuGet library tests should cover this fuctionality?

@corbob
Copy link
Member

corbob commented Jul 17, 2023

This might actually be an OS issue... I do not experience this issue when testing with 1.4.0 (even with Chocolatey 0.10.11) on Windows 11... I do have the url encoding in the nupkg though...

This issue seems to actually require more repro steps. I have taken the repro.zip, put it on a 2012 R2 VM, and am unable to reproduce the issue with Chocolatey 0.10.11:
2023-07-17_13-29-12

@corbob
Copy link
Member

corbob commented Jul 17, 2023

@Andreas-Schommer, @viceice, or @rgl, I realize this is a really old issue. Are any of you able to reproduce this issue still?

@viceice
Copy link

viceice commented Jul 18, 2023

don't know, I no longer have spaces, so it's no longer an issue for me.

@pauby
Copy link
Member

pauby commented Jul 19, 2023

I'm going to go ahead and close this as stale, but we can reopen it if necessary.

@pauby pauby closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants