file.replace issue when show_changes is False. Fixes #14978 (2014.1 branch)

Here's the same fix for the 2014.1 branch, as #15372 (the fix for develop) doesn't apply cleanly here.