https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108561
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- The standard doesn't say anything about not flushing if the put (or any previous output function) failed. > Calls os.put(os.widen(ā\nā)), then os.flush().