Put back file removal. Refs #6812
Merge branch 'bugfix/6812_fix_generatepythonscript' into develop