Convert a filename to a file:// URL May 5, 2023 by Tarik For completeness, in Python 3.4+, you should do: import pathlib pathlib.Path(absolute_path_string).as_uri()