-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
allow_invalid_utf8(true) required only in debug build #3344
Comments
Clap was more of a footgun before this existed In v2, if you did
Now, The asserts serve a couple of purposes
99% of clap's error reporting is done through debug asserts
|
As this is by design and there aren't any more comments, I'm closing this out. If there are any concerns, feel free to raise them |
- new versions of Clap panic with invalid utf8 passed to value_of_os() - clap-rs/clap#3344
* Fixed an issue with out directories and stats file params - new versions of Clap panic with invalid utf8 passed to value_of_os() - clap-rs/clap#3344 * Added comments to changes * Added tests for the command line parser - Split the parsing code into separate functions that can be tested - Moved the logger init out of the match functions so we can test the cli parsing - Added tests around the path checks. Found we weren't parsing the try -d the same and fixed it * Added additional tests for the cli parsing * Cleaned up the cli tests * Updated the cargo deny.toml - Unicode license is allowed under our current whitelist - Ignoring the time advisory since chrono should not be impacted. chronotope/chrono#602
Please complete the following tasks
Rust Version
1.58.1
Clap Version
3.0.12
Minimal reproducible code
This program fails like so:
But only in a debug build.
Steps to reproduce the bug with the above code
Succeeds:
cargo run --release -- blah
Fails:
cargo run -- blah
Actual Behaviour
Is
allow_invalid_utf8(true)
actually required? i don't knowExpected Behaviour
It should just work.
Additional Context
Why is this option even required? It's a giant footgun.
If you really want to do that check, maybe change
takes_value
totakes_string
andtakes_path
. But as it is, it serves no purpose.Debug Output
No response
The text was updated successfully, but these errors were encountered: