
    h*
                     >    S SK r S SKrS SKJr  SS jr " S S5      rg)    N)SuspiciousFileOperationc                    [         R                  R                  U 5      S;   a  [        SU -  5      eU(       ae  [        R
                  " [        U 5      R                  SS5      5      nUR                  5       (       d  SUR                  ;   a  [        SU -  5      e U $ U [         R                  R                  U 5      :w  a  [        SU -  5      eU $ )N>    ...z$Could not derive file name from '%s'\/r   z'Detected path traversal attempt in '%s'z%File name '%s' includes path elements)
ospathbasenamer   pathlibPurePosixPathstrreplaceis_absoluteparts)nameallow_relative_pathr   s      I/var/www/html/env/lib/python3.13/site-packages/django/core/files/utils.pyvalidate_file_namer      s    	ww0%&Lt&STT $$SY%6%6tS%AB!3)9D@  "4 K 
!!$'	'%&MPT&TUUK    c                   <   \ rS rSrSr\" S 5      r\" S 5      r\" S 5      r\" S 5      r	\" S 5      r
\" S 5      r\" S	 5      r\" S
 5      r\" S 5      r\" S 5      r\" S 5      r\" S 5      r\" S 5      r\" S 5      r\S 5       rS rS rS rS rSrg)FileProxyMixin   z
A mixin class used to forward file methods to an underlying file
object.  The internal file object has to be called "file"::

    class FileProxy(FileProxyMixin):
        def __init__(self, file):
            self.file = file
c                 .    U R                   R                  $ N)fileencodingselfs    r   <lambda>FileProxyMixin.<lambda>$       TYY%7%7r   c                 .    U R                   R                  $ r   )r   filenor   s    r   r!   r"   %       499#3#3r   c                 .    U R                   R                  $ r   )r   flushr   s    r   r!   r"   &       $))//r   c                 .    U R                   R                  $ r   )r   isattyr   s    r   r!   r"   '   r&   r   c                 .    U R                   R                  $ r   )r   newlinesr   s    r   r!   r"   (   r#   r   c                 .    U R                   R                  $ r   )r   readr   s    r   r!   r"   )       r   c                 .    U R                   R                  $ r   )r   readintor   s    r   r!   r"   *   r#   r   c                 .    U R                   R                  $ r   )r   readliner   s    r   r!   r"   +   r#   r   c                 .    U R                   R                  $ r   )r   	readlinesr   s    r   r!   r"   ,   s    dii&9&9r   c                 .    U R                   R                  $ r   )r   seekr   s    r   r!   r"   -   r0   r   c                 .    U R                   R                  $ r   )r   tellr   s    r   r!   r"   .   r0   r   c                 .    U R                   R                  $ r   )r   truncater   s    r   r!   r"   /   r#   r   c                 .    U R                   R                  $ r   )r   writer   s    r   r!   r"   0   r)   r   c                 .    U R                   R                  $ r   )r   
writelinesr   s    r   r!   r"   1   s    tyy';';r   c                 ^    U R                   (       + =(       d    U R                   R                  $ r   )r   closedr   s    r   rB   FileProxyMixin.closed3   s    99}0		 0 00r   c                     U R                   (       a  g[        U R                  S5      (       a  U R                  R                  5       $ g)NFreadableT)rB   hasattrr   rE   r   s    r   rE   FileProxyMixin.readable7   3    ;;499j))99%%''r   c                     U R                   (       a  g[        U R                  S5      (       a  U R                  R                  5       $ S[	        U R                  SS5      ;   $ )NFwritablewmoder   )rB   rF   r   rJ   getattrr   s    r   rJ   FileProxyMixin.writable>   sH    ;;499j))99%%''gdii444r   c                     U R                   (       a  g[        U R                  S5      (       a  U R                  R                  5       $ g)NFseekableT)rB   rF   r   rP   r   s    r   rP   FileProxyMixin.seekableE   rH   r   c                 ,    [        U R                  5      $ r   )iterr   r   s    r   __iter__FileProxyMixin.__iter__L   s    DIIr    N)__name__
__module____qualname____firstlineno____doc__propertyr   r%   r(   r+   r-   r/   r2   r4   r6   r8   r:   r<   r>   r@   rB   rE   rJ   rP   rT   __static_attributes__rV   r   r   r   r      s     78H34F12E34F78H/0D78H78H9:I/0D/0D78H12E;<J1 15r   r   )F)r
   r   django.core.exceptionsr   r   r   rV   r   r   <module>r_      s    	  :&3 3r   