Ë
    ¹ûàgÇ	  ã                   óª   — d Z ddlZddlZddlmZ dZej                  dk(  r G d„ de«      ZeZej                  Z	yej                  Zej                  Z	y)a6  
The temp module provides a NamedTemporaryFile that can be reopened in the same
process on any platform. Most platforms use the standard Python
tempfile.NamedTemporaryFile class, but Windows users are given a custom class.

This is needed because the Python implementation of NamedTemporaryFile uses the
O_TEMPORARY flag under Windows, which prevents the file from being reopened
if the same flag is not provided [1][2]. Note that this does not address the
more general issue of opening a file for writing and reading in multiple
processes in a manner that works across platforms.

The custom version of NamedTemporaryFile doesn't support the same keyword
arguments available in tempfile.NamedTemporaryFile.

1: https://mail.python.org/pipermail/python-list/2005-December/336957.html
2: https://bugs.python.org/issue14243
é    N)ÚFileProxyMixin)ÚNamedTemporaryFileÚ
gettempdirÚntc                   óH   — e Zd ZdZdd„Zej                  Zd„ Zd„ Zd„ Z	d„ Z
y)	ÚTemporaryFilea.  
        Temporary file object constructor that supports reopening of the
        temporary file in Windows.

        Unlike tempfile.NamedTemporaryFile from the standard library,
        __init__() doesn't support the 'delete', 'buffering', 'encoding', or
        'newline' keyword arguments.
        Nc                 óŽ   — t        j                  |||¬«      \  }}|| _        t        j                  |||«      | _        d| _        y )N)ÚsuffixÚprefixÚdirF)ÚtempfileÚmkstempÚnameÚosÚfdopenÚfileÚclose_called)ÚselfÚmodeÚbufsizer
   r   r   Úfdr   s           úT/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/django/core/files/temp.pyÚ__init__zTemporaryFile.__init__*   s=   € Ü×'Ñ'¨v¸fÈ#ÔN‰HˆB�ØˆDŒIÜŸ	™	 " d¨GÓ4ˆDŒIØ %ˆDÕó    c                 óÖ   — | j                   s?d| _         	 | j                  j                  «        	 | j	                  | j
                  «       y y # t        $ r Y Œ)w xY w# t        $ r Y y w xY w)NT)r   r   ÚcloseÚOSErrorÚunlinkr   ©r   s    r   r   zTemporaryFile.close5   sg   € Ø×$Ò$Ø$(�Ô!ðØ—I‘I—O‘OÔ%ðØ—K‘K §	¡	Õ*ð %øô ò Ùðûô ò Ùðús"   •A °A Á	AÁAÁ	A(Á'A(c                 ó$   — | j                  «        y ©N)r   r   s    r   Ú__del__zTemporaryFile.__del__A   s   € Ø�J‰J�Lr   c                 ó:   — | j                   j                  «        | S r!   )r   Ú	__enter__r   s    r   r$   zTemporaryFile.__enter__D   s   € Ø�I‰I×ÑÔ!ØˆKr   c                 ó>   — | j                   j                  |||«       y r!   )r   Ú__exit__)r   ÚexcÚvalueÚtbs       r   r&   zTemporaryFile.__exit__H   s   € Ø�I‰I×Ñ˜s E¨2Õ.r   )zw+béÿÿÿÿÚ r+   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r"   r$   r&   © r   r   r   r       s+   „ ñ	ó	&ð —‘ˆò
	ò	ò	ó	/r   r   )
r/   r   r   Údjango.core.files.utilsr   Ú__all__r   r   r   r   r0   r   r   ú<module>r3      sd   ðñó$ 
Û å 2ð€ð ‡7�7ˆd‚?ô)/˜ô )/ðV 'Ðð × Ñ �
ð "×4Ñ4Ðà× Ñ �
r   