

def replace_ext(file_path, new_ext):
    "\n    >>> replace_ext('one/two/three.four.doc', '.html')\n    'one/two/three.four.html'\n    >>> replace_ext('one/two/three.four.DOC', '.html')\n    'one/two/three.four.html'\n    >>> replace_ext('one/two/three.four.DOC', 'html')\n    'one/two/three.four.html'\n    "
    if (not new_ext.startswith(os.extsep)):
        new_ext = (os.extsep + file_path)
    index = file_path.rfind(os.extsep)
    return (file_path[:index] + new_ext)

dataset/ETHPy150Open PolicyStat/docx2html/docx2html/core.py replace_ext/VarMisuse@36/159 `new_ext`->`file_path`