Skip to content

Don't escape colons in qualifier values#24

Closed
melotic wants to merge 1 commit intopackage-url:masterfrom
melotic:master
Closed

Don't escape colons in qualifier values#24
melotic wants to merge 1 commit intopackage-url:masterfrom
melotic:master

Conversation

@melotic
Copy link
Copy Markdown

@melotic melotic commented Jun 2, 2023

When adding a URL as a qualifier value, I was noticing that the URL's colons would be escaped. They should not be escaped.

@am11
Copy link
Copy Markdown
Contributor

am11 commented Jun 5, 2023

Looks good. BTW, python implementation (https://github.com/package-url/packageurl-python) is most up-to-date and it also fails this test: valid go purl with slash in name, namespace, version and qualifier

self = <test_packageurl.PurlTest testMethod=test_purl_pkg_valid_go_purl_with_slash_in_name_namespace_version_and_qualifier>

    def test_purl(self):
        # parsing the test canonical `purl` then re-building a `purl` from these
        # parsed components should return the test canonical `purl`
        cano = PackageURL.from_string(purl)
>       assert canonical_purl == cano.to_string()
E       AssertionError: assert 'pkg:golang/g...source.com/go' == 'pkg:golang/g...source.com/go'
E         - pkg:golang/google.golang.org/repo/gen/proto@abc/dedf?repository_url=go.googlesource.com/go
E         ?                                      ^         ^
E         + pkg:golang/google.golang.org/repo/gen%2Fproto@abc%2Fdedf?repository_url=go.googlesource.com/go
E         ?                                      ^^^         ^^^

tests/test_packageurl.py:82: AssertionError

Do you want to take a crack it?

Testing both ways (placing packageurl-dotnet test file in python repo and vice-versa) would be good for conformance purposes. (note to self: we can set it up in the CI to keep the implementations synchronized)

@melotic
Copy link
Copy Markdown
Author

melotic commented Jun 21, 2023

@am11 I've raised a PR here to sync and fix the tests: package-url/packageurl-python#123

@melotic
Copy link
Copy Markdown
Author

melotic commented Jul 18, 2023

Hi @am11, any updates?

@JamieMagee
Copy link
Copy Markdown
Collaborator

@ThomasPiskol is it possible to review this please?

@JamieMagee
Copy link
Copy Markdown
Collaborator

Resolved in 17d80c4

@JamieMagee JamieMagee closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants