stdout raises EINVAL when flush() is called on a closed pipe under win32.
Maybe the exception should be caught and translated at raise location instead (sshserver.py).
#!/bin/sh
hg init
echo "Is there an error message when trying to diff non-existing files?"
hg diff not found
echo "Is there an error message when trying to add non-existing files?"
hg add not found