fix: bad file descriptor error in windows, fix pytest errors

This commit is contained in:
nom3ad
2024-01-02 01:31:24 +05:30
committed by Brian May
parent 4a84ad3be6
commit d4d0fa945d
5 changed files with 14 additions and 5 deletions

View File

@ -432,7 +432,8 @@ class Mux(Handler):
def flush(self):
set_non_blocking_io(self.wfile.fileno())
if self.outbuf and self.outbuf[0]:
wrote = _nb_clean(os.write, self.wfile.fileno(), self.outbuf[0])
wrote = _nb_clean(self.wfile.write, self.outbuf[0])
self.wfile.flush()
debug2('mux wrote: %r/%d' % (wrote, len(self.outbuf[0])))
if wrote:
self.outbuf[0] = self.outbuf[0][wrote:]