I'm having the exact same issue as T2358, I get an assertion in gpg-agent
(libgpg-error really) when trying to decrypt a file. The assert is
I'm using gpg 2.1.12 and libgpg-error 1.22.
I attaching a file with two relevant stack traces here, the first trace is from the
assert (I've anonymized some strings) and the second one is from where stream-
flags.writing is being set to 0 prior to the assert. The line numbers might be a
few lines off since I have some printfs in there.