-
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
Conversation
Pull Request Test Coverage Report for Build 13248291345Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
aebb717
to
871c500
Compare
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
3f67a01
to
d6a5735
Compare
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. |
(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