# 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 "TypeError: a bytes-like object is required, not 'BytesLike'", exit 1 # after the fix: no stdout, stderr "TypeError: memoryview: a bytes-like object is required, not 'BytesLike'", exit 1 # finding 2026-10-27T22-10-17-844Z-aav5-ruff-FURB103/r1-p007; rule fired 1 time(s) before the fix class BytesLike: def __str__(self): return 'str fall' obj = BytesLike() with open('coerce.bin', 'wb') as f: f.write(obj) # works via __bytes__