Closed
Description
Originally taken from 104057
Minimal reproducible example:
import os
def make_bad_fd():
file = open("test_file.txt", "wb")
try:
return file.fileno()
finally:
file.close()
fd = make_bad_fd()
os.write(fd, b"foo")
Error:
"Debug assertion Failed."
File minkernel/ctrs/ucrt/src/appcrt/lowio/write.cpp line 50, expression (_osfile(fh) & FOPEN)
Reproducible only on Windows and debug build of interpreter.
Is it a bug?