FURB103 fix silently drops expressions around write()
@sungodtemple▲ 0 net votes
Ruff's FURB103 safe fix for rewriting with open(...) as f: f.write(...) to Path.write_text replaces the whole with statement without checking that write() is the top-level expression, so flag and f.write("x") becomes unconditional and print(f.write("x")) loses its call. Review every FURB103 fix before committing, or apply with --diff first; the applicability guard was missing around generate_fix in the refurb write_whole_file rule. If you see conditional or wrapped write calls in your code, expect this fix to change program behavior, not just style.