choco icon indicating copy to clipboard operation
choco copied to clipboard

Upgrade of some packages fails due to "Dotted and dotless I letter" (like inkscape)

Open hkdemiralp opened this issue 3 years ago • 2 comments

What You Are Seeing?

Doing a "choco upgrade all -y" gives this failure message for inkscape in Windows OS using Turkic languages/locales: `Failures

ınkscape - ınkscape not installed. The package was not found with the source(s) listed.
Source(s): 'https://community.chocolatey.org/api/v2/'
NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify --pre,
the package may not be found.
Please see https://docs.chocolatey.org/en-us/troubleshooting for more
assistance.`

Anything else?

I firstly opened an issue about this failure at https://github.com/chocolatey-community/chocolatey-packages/issues/1805 (thinking this is a package problem.). But I am told this is more like a problem in the choco codebase and should be handled here. My original bug report was this: I believe the problem is the package naming which exhibits the "[Dotted and dotless I" problem](https://en.wikipedia.org/wiki/Dotted_and_dotless_I). In Turkic languages, Dotted "İ i" and dotless "I ı" are distinct letters. If the name of the package would have been written in lovercase letters like "inkscape", instead of "InkScape", it would work just fine. Installing inkscape works but upgrading all packages gives the error message. Thanks.

What is Expected?

"choco upgrade all -y" command should not give the specified "ınkscape" error. The latest inkscape is already installed with chocolatey.

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

1. choco install inkscape -y
2. choco upgrade all -y
3. `Failures

ınkscape - ınkscape not installed. The package was not found with the source(s) listed.
Source(s): 'https://community.chocolatey.org/api/v2/'
NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify --pre,
the package may not be found.
Please see https://docs.chocolatey.org/en-us/troubleshooting for more
assistance.`

4. Notice: in the chocolatey error message "ınkscape" word is also written with a dotless "I", not "i")

Output Log

Full Log Output `Failures
ınkscape - ınkscape not installed. The package was not found with the source(s) listed.
Source(s): 'https://community.chocolatey.org/api/v2/'
NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify --pre,
the package may not be found.
Please see https://docs.chocolatey.org/en-us/troubleshooting for more
assistance.`

https://gist.github.com/hkdemiralp/8943e8bb26d4cd3418de92795f60adf1

https://gist.github.com/hkdemiralp/8943e8bb26d4cd3418de92795f60adf1

hkdemiralp avatar Feb 22 '22 18:02 hkdemiralp

Yeah this definitely seems like a bug, thanks for reporting! I haven't dug into the code yet but I would wager we're using a culture-sensitive comparison at some point here and we need to be using Ordinal or Invariant comparisons instead of a culture-sensitive one.

From memory the latest guidance for string comparisons that are supposed to refer to symbol names is to use Ordinal comparisons, so I think that should also apply here, package names are generally expected to not be culture-sensitive.

It's possible this might be down to code in the Nuget.Core assembly we depend on, but we'll have to investigate further to know for sure where the fix needs to be applied.

vexx32 avatar Apr 01 '22 19:04 vexx32

It looks like this is also an issue with outdated and uninstall (see #2225). I wonder if this might actually be actually in the NuGet libraries and may actually benefit from the uplift?

corbob avatar Jul 04 '22 16:07 corbob