The solution from @Jakob Bowyer doesn’t convert URL encoded characters to regular UTF-8 characters. For that you need to use urllib.parse.unquote
.
>>> from urllib.parse import unquote, urlparse
>>> unquote(urlparse('file:///home/user/some%20file.txt').path)
'/home/user/some file.txt'