file.replace issue when show_changes is False. Fixes #14978

Here's a pull request for the develop branch, and I have performed basic testing.