-
Notifications
You must be signed in to change notification settings - Fork 223
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
Handle non Unicode env keys/values #640
Merged
Merged
+111
−6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
epage
reviewed
Feb 5, 2025
epage
reviewed
Feb 5, 2025
Pull Request Test Coverage Report for Build 13209377001Details
💛 - Coveralls |
aebb717
to
871c500
Compare
Jongy
commented
Feb 6, 2025
Jongy
commented
Feb 6, 2025
Jongy
commented
Feb 6, 2025
epage
reviewed
Feb 6, 2025
epage
reviewed
Feb 6, 2025
Jongy
commented
Feb 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
871c500
to
bb77333
Compare
epage
reviewed
Feb 7, 2025
3f67a01
to
d6a5735
Compare
epage
reviewed
Feb 10, 2025
Return an error instead of panicking.
d6a5735
to
b5d342e
Compare
Thanks! |
Thanks again for the review, and thanks for releasing, I'll proceed to update atuin to use the new version. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(disregard the code / commit message - I'll clean up & add tests once we agree on the implementation 😄 )
I hit the same issue as described in the linked ticket - with key
PWD
having a non-UTF-8 value ("invalid" from now on).Technically, keys can be invalid too in Linux. The naive implementation I provided here filters out all invalid keys & values. Keys in config-rs are
String
s so it always makes sense to filter invalid ones, as they won't be used by this library AFAIU.As for values - I'm unsure if plainly ignoring invalid values is okay. If the value is set in a key that would have been used by the current config consumer, then ignoring it (as if the user did not provide a value through env) is not okay.
Ideally - the logic would be:
Let me know what you think :) I can try looking into point 3.
Resolves: #579