[issue30700] fileinput inplace clobbers file without leaving backup on decode errors

2020-09-21 Thread Irit Katriel
Change by Irit Katriel : -- components: +IO ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue30700] fileinput inplace clobbers file without leaving backup on decode errors

2017-06-18 Thread switchnode
New submission from switchnode: Consider the script: $ cat nop.py #!/usr/bin/env python import fileinput srt = fileinput.input(inplace=True) print(srt.readline(), end='') for line in srt: print(line, end='') Called on text files, it will do nothing. $ ls -alh test.* -rw-r--r-- 1 501 ut