Skip to content
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

Panics when any environment variable contains non-unicode characters #579

Closed
printfn opened this issue Oct 21, 2024 · 2 comments · Fixed by #640
Closed

Panics when any environment variable contains non-unicode characters #579

printfn opened this issue Oct 21, 2024 · 2 comments · Fixed by #640

Comments

@printfn
Copy link

printfn commented Oct 21, 2024

This crate causes a panic if any environment variable contains non-unicode characters, such as when PWD points at a non-unicode directory, e.g. when running mkdir $'\xff'.

https://github.com/mehcode/config-rs/blob/a38387955622e6b8d48a49352629cd329ad6dc29/src/env.rs#L239

This line needs to be changed to env::vars_os(), with appropriate Unicode escaping and/or filtering of unencodable environment variables.

Downstream issue: atuinsh/atuin#2428

@Jongy
Copy link
Contributor

Jongy commented Feb 5, 2025

I just hit this issue myself while working with atuin in a non-UTF8 directory 😅 just like your case. The fix is trivial but I'm unsure if it's correct in all cases. I'll push a PR with it later.

@epage
Copy link
Contributor

epage commented Feb 5, 2025

Would appreciate it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants