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

UTF error on NixOS #85

Closed
ciarandg opened this issue May 19, 2021 · 1 comment
Closed

UTF error on NixOS #85

ciarandg opened this issue May 19, 2021 · 1 comment

Comments

@ciarandg
Copy link

When running the example code from the readme on NixOS 20.09, I get the following output:
Error: Error { source: Custom { kind: InvalidData, error: "stream did not contain valid UTF-8" }, description: None }

I have seen the issue magically fix itself on reboot twice now, but cannot reproduce that behaviour -- it seems to happen for no reason at all. This is on a ThinkPad X1 Extreme Gen 2, I've also tested the example code on Arch Linux on the same computer and it seems to work perfectly. No idea how to troubleshoot this, I'm not particularly knowledgeable about rust (I ran into the issue because rust-battery is a dependency of dwm-status). NixOS has a pretty unique package manager that stores things at weird paths, so it might be related to that? Any help would be greatly appreciated.

Side note: I don't think this is related to #72 -- I tried using rust-battery as a local dependency after altering device.rs as described in the first post of that thread, but the error persisted.

@ciarandg
Copy link
Author

Update: I think this is the same issue as #72 after all, the unpredictability seems to come from /sys/class/power_supply/BAT0/manufacturer and cat /sys/class/power_supply/BAT0/model_name occasionally being formatted in UTF-8 upon reboot but usually being scrambled as in #72. Very bizarre, if anyone knows why that might be happening I'd love to know. Will close the issue now since I figure the unpredictability means that there's probably something I can do to fix it outside of rust-battery

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

No branches or pull requests

1 participant