def with_suffix(self, suffix):
<EOL>f = self._flavour<EOL>if f.sep in suffix or f.altsep and f.altsep in suffix:<EOL><INDENT>raise ValueError("<STR_LIT>" % (suffix))<EOL><DEDENT>if suffix and not suffix.startswith('<STR_LIT:.>') or suffix == '<STR_LIT:.>':<EOL><INDENT>raise ValueError("<STR_LIT>" % (suffix))<EOL><DEDENT>name = self.name<EOL>if not name:<EOL><INDENT>raise ValueError("<STR_LIT>" % (self,))<EOL><DEDENT>old_suffix = self.suffix<EOL>if not old_suffix:<EOL><INDENT>name = name + suffix<EOL><DEDENT>else:<EOL><INDENT>name = name[:-len(old_suffix)] + suffix<EOL><DEDENT>return self._from_parsed_parts(self._drv, self._root,<EOL>self._parts[:-<NUM_LIT:1>] + [name])<EOL>
Return a new path with the file suffix changed (or added, if
        none).