def _save_script(script_text, filename): # pylint: disable=no-member file_path = py.path.local(greasemonkey._scripts_dir()) / filename # pylint: enable=no-member file_path.write_text(script_text, encoding='utf-8', ensure=True)