Uncaught exception in builtins.toJSON
#12060
Labels
bug
good first issue
Quick win for first-time contributors
idea approved
The given proposal has been discussed and approved by the Nix team. An implementation is welcome.
language
The Nix expression language; parser, interpreter, primops, evaluation, etc
Describe the bug
builtins.toJSON
throws an exception, when an input string is not a valid UTF-8 string, e.g.nix repl
quits (crashes?).Steps To Reproduce
nix repl
:Expected behavior
Catch exception and display proper error message.
Or it should be enforced that the file read by
builtins.readFile
is UTF-8 encoded because these issues propagate to other parts of Nix and Nix assumes implicitly that strings are UTF-8 encoded.Checklist
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: