<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run(self, command, application):
 """Open application's history buffer in an editor. :type command: list :param command: The dot command as a list split on whitespace, e.g ``['.foo', 'arg1', 'arg2']`` :type application: AWSShell :param application: The application object. """

        with temporary_file('w') as f:
            all_commands = self._generate_edit_history(application)
            f.write(all_commands)
            f.flush()
            editor = self._get_editor_command()
            try:
                p = self._popen_cls([editor, f.name])
                p.communicate()
            except OSError:
                self._err.write("Unable to launch editor: %s\n"
                                "You can configure which editor to use by "
                                "exporting the EDITOR environment variable.\n"
                                % editor)