def upath(path):
    if six.PY2 and not isinstance(path, six.text_type):
        return path.decode(fs_encoding)
    return path


# copied from django-cms (for compatibility with Django 1.4)
Always return a unicode path.
dataset/ETHPy150Open divio/django-filer/filer/utils/compatibility.py/upath