-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
open
and from yaml
fail on files with byte-order-mark
#13925
Comments
This is the entire point of the |
I have no issue in general with having to pass through The issue here, specifically, is about One thing that may be coming into play, though, is that some commands (like So we may very well be passing things that are not valid utf-8 strings to things that are expecting them, and contributing to the issue (regardless that it's very convenient most of the time). This is not the first time I've been a bit confused about how the signature checking actually works in practice as part of all this. |
I've made up my mind. I don't think we should implicitly do any conversion in open. If people need to decode a file, that's why we have decode. Maybe it should be made clearer in an error message though? One other thing that's related, I noticed that nushell does have a problem with anything non-utf8 and sometimes decode is the wrong answer. I was looking at some ansi art and couldn't really find any way to open and display the files in nushell because they had some non-utf8 characters in them. Not sure what to do about this. I ended up running them through decode but it wasn't a perfect solution. |
Describe the bug
parsing yaml files with a leading UTF-8 byte order mark fails.
Note: I expect this is an upstream issue in the
serde_yaml
crate. However, there's no way to raise the issue there as the repo has been archived and is no longer maintained.I have raised an issue in the
serde_norway
fork: cafkafk/serde-norway#8There are best-effort maintenance efforts being done there, with important caveats about long-term committment; perhaps nushell should consider switching to that fork, or consider what else to do about that problem. I didn't find an open issue relating to that directly, or I'd have just added the link above there.
How to reproduce
Expected behavior
parse all my yaml files with just
open **/*.yaml
rather than needing toglob **/*.yaml | each { open --raw $in | decode utf8 | from yaml }
Configuration
The text was updated successfully, but these errors were encountered: