Should error messages end up in output file when redirecting "dump" to stdout?

rather new restic user here.

I’ve just stumbled over this problem:

restic -r my_backup dump latest some_file > outfile

also includes “wrong password” and “Fatal: an empty password is not a password” error messages in the output file when mistyping the password initially. since in my case it was a binary file (jpeg photo) outfile simply looked corrupted and of course did not open in the jpeg viewer.

question: should those (and possibly other) error messages not be directed to stderr rather than to stdout?

thank you,

Which restic version are you using? The latest restic version, I only see the “wrong password” line ending up on stdout, where it doesn’t belong.

I’ve opened Print password error message on stderr by MichaelEischer · Pull Request #3716 · restic/restic · GitHub to fix this.

initially 0.12.1 but I’ve seen the same behaviour with 0.13.1 (I checked before posting first … ;)).

regarding which error messages end up on stdout:

at least the “wrong password” and the “empty password is not a password” messages.