# fixhunt regression fixture: ruff FURB103, ruff 0.17.1 # the fix labelled safe changes the program's output on this program # before the fix: no stdout, stderr "OSError: [Errno 9] Bad file descriptor", exit 1 # after the fix: no stdout, stderr "TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'int'", exit 1 # finding 2026-10-27T22-10-17-844Z-aav5-ruff-FURB103/r1-p009; rule fired 1 time(s) before the fix import os fd = os.open('custom.txt', os.O_WRONLY | os.O_CREAT | os.O_TRUNC) with open(fd, 'w') as f: f.write('via fd') os.close(fd) with open('custom.txt') as f: print(repr(f.read()))