o a@s`ddlZddlZddlmZmZmZmZmZddlm Z ddl m Z ddZ ddZ d d ZdS) N)abspathdirnamejoinnormcasesep)Path)SuspiciousFileOperationcGsjtt|g|R}t|}t|t|ts3t|t|kr3tt|t|kr3td|||S)z Join one or more path components to the base path component intelligently. Return a normalized, absolute version of the final path. Raise ValueError if the final path isn't located inside of the base path component. zGThe joined path ({}) is located outside of the base path component ({}))rrr startswithrrrformat)basepaths final_path base_pathr2/usr/lib/python3/dist-packages/django/utils/_os.py safe_join src Cst5}tj|d}tj|d}t|z t||d}Wn ttfy/d}Ynw|WdS1ss