Search code examples
pythonpython-2.7urlparse

Equivalent urllib.parse.unquote() in python 2.7


I import urlparse instead of urllib.parse in python 2.7 but getting AttributeError: 'function' object has no attribute 'unquote'

File "./URLDefenseDecode2.py", line 40, in decodev2
    htmlencodedurl = urlparse.unquote(urlencodedurl)

What is the equivalent urllib.parse.unquote() in python 2.7 ?


Solution

  • In Python 2.7, unquote is directly in urllib: urllib.unquote(string)