[issue42279] replacements function corrupts file

2020-11-06 Thread Zachary Ware
Change by Zachary Ware : -- components: -IDLE ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue42279] replacements function corrupts file

2020-11-06 Thread Zachary Ware
Zachary Ware added the comment: That's because you're writing an output line once per replacement rather than once per input line. For usage questions such as this, you'll be better off on a forum such as discuss.python.org, the python-l...@python.org mailing list, or the Python Discord com

[issue42279] replacements function corrupts file

2020-11-06 Thread John Dutcher
New submission from John Dutcher : If the file below 0f 239 records is processed by the code below it throws no errors and writes the output...but the output has 615 records instead of 239 seemingly having written any revised ones three times instead of only once. replacements = {'/1':'/01',