-
Notifications
You must be signed in to change notification settings - Fork 46
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
Why is the colon in the name not translated? #105
Comments
like this pkg:generic/SuSE%20Linux%20Enterprise%20Server%2012%20SP5:[email protected]%2Bgit20140911.61c1681-38.13.1.x86_64 |
It seems to have been translated in the Java package. |
Is it a colon that doesn't need to be translated anywhere? |
It seems there is a unnecessary step for encoding, it is against spec, is it a bug? def quote(s):
"""
Return a percent-encoded unicode string, except for colon :, given an `s`
byte or unicode string.
"""
if isinstance(s, unicode):
s = s.encode('utf-8')
quoted = _percent_quote(s)
if not isinstance(quoted, unicode):
quoted = quoted.decode('utf-8')
quoted = quoted.replace('%3A', ':') # there is unnecessary by spec
return quoted |
This is not a bug. The spec does not say to escape ':', and the test suite gives examples of not escaping ':'. |
What about a use case where the is url with port as part of the name.. For example Would you expect the ':' to be encoded when going in to toString func? It seems to recognize the 'index.myregistry.io' as a url scheme and fail with a a bit misleading error. packageurl-python/src/packageurl/__init__.py Line 507 in 0d33368
If you prefer I can open a seperate issue. I can prepare a pr depending on the discussion. |
Ok after taking previous advice I see you expect Such a purl to be Did I understand correctly, can you elaborate on this logic or point me the the related spec, I tried it with the golang library and i did not see this limitation . |
The spec says "the ':' scheme and type separator does not need to and must NOT be encoded. It is unambiguous unencoded elsewhere," meaning it does not need to be encoded here. However:
|
Why is the colon in the name not translated?
The text was updated successfully, but these errors were encountered: