windows: handle file-like objects without isatty() method
Copying the function is not nice, but moving around stuff to avoid the
circular import didn’t seem to be worth the effort.
#require docutils gettext $ $TESTDIR/check-gendoc zh_CN checking for parse errors