using urllib.parse.quote for Python 3.x