Hi, good question.
It is a very simple and straightforward answer, to be honest. Make sure you try to use the following as the URL parameter:
url='file:///path/to/file'
This will surely solve your query and you should be up and running quickly.
Here is another snippet of code:
# Python 3
import urllib, os
url = urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath("service.xml")))
This will basically let you specify the local path only and it will also get you the absolute path as well. Win-win.
Hope this helped!