def save(self, filename=None):
if filename is None:<EOL><INDENT>filename = self.filename<EOL><DEDENT>fileobj = open(filename, "<STR_LIT>")<EOL>try:<EOL><INDENT>try:<EOL><INDENT>self.tags._inject(fileobj)<EOL><DEDENT>except error as e:<EOL><INDENT>reraise(self._Error, e, sys.exc_info()[<NUM_LIT:2>])<EOL><DEDENT>except EOFError:<EOL><INDENT>raise self._Error("<STR_LIT>")<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>fileobj.close()<EOL><DEDENT>
Save a tag to a file.

        If no filename is given, the one most recently loaded is used.