Skip to content

Add encode kwarg to .to_string() #191

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

Merged
merged 4 commits into from
Jun 25, 2025
Merged

Conversation

jaimergp
Copy link
Contributor

Not sure if this is an acceptable submission, but I found a need to stringify some (simpler) PURL-derivatives and I'd like to have control over the encoding. Mimicking .to_dict()'s API, I propose exposing this boolean in to_string().

If you don't like to give this option in that method because you fear people misuse it, may I suggest adding a different one like to_unencoded_string() or to_unsafe_string() to discourage usage?

Thanks for taking a look!

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Thanks!

@pombredanne pombredanne merged commit 9fb5350 into package-url:main Jun 25, 2025
19 checks passed
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.

2 participants