

def _normalize_name(self, name):
    '\n        Normalizes the name so that paths like /path/to/ignored/../foo.txt\n        work. We check to make sure that the path pointed to is not outside\n        the directory specified by the LOCATION setting.\n        '
    base_path = force_text(self.location)
    base_path = base_path.rstrip('/')
    final_path = urljoin((base_path.rstrip('/') + '/'), name)
    base_path_len = len(base_path)
    if ((not final_path.startswith(base_path)) or (final_path[base_path_len:(base_path_len + 1)] not in ('', '/'))):
        raise SuspiciousOperation(("Attempted access to '%s' denied." % name))
    return final_path.lstrip('/')

dataset/ETHPy150Open glasslion/django-qiniu-storage/qiniustorage/backends.py QiniuStorage._normalize_name/original