| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/IPython/utils/__pycache__/ |
Upload File : |
�
}�eK � �T � d Z ddlZddlmZ ddlmZ G d� de� Z G d� de� Z y) a This module contains classes - NamedFileInTemporaryDirectory, TemporaryWorkingDirectory.
These classes add extra features such as creating a named file in temporary directory and
creating a context manager for the working directory which is also temporary.
� N)�Path)�TemporaryDirectoryc �* � e Zd Zdd�Zd� ZeZd� Zd� Zy)�NamedFileInTemporaryDirectoryc � � t di |��| _ t | j j � |z }d|v rdnd}t ||||�� | _ y)aN
Open a file named `filename` in a temporary directory.
This context manager is preferred over `NamedTemporaryFile` in
stdlib `tempfile` when one needs to reopen the file.
Arguments `mode` and `bufsize` are passed to `open`.
Rest of the arguments are passed to `TemporaryDirectory`.
�bNzutf-8)�encoding� )r �_tmpdirr �name�open�file)�self�filename�mode�bufsize�add_to_syspath�kwds�pathr s �7/usr/lib/python3/dist-packages/IPython/utils/tempdir.py�__init__z&NamedFileInTemporaryDirectory.__init__
sK � � *�1�D�1����D�L�L�%�%�&��1���$�;�4�G����t�W�x�@�� � c �l � | j j � | j j � y �N)r �closer �cleanup�r s r r z%NamedFileInTemporaryDirectory.cleanup s � �� � ���������r c � � | j S r )r r s r � __enter__z'NamedFileInTemporaryDirectory.__enter__# s � ��y�y�r c �$ � | j � y r )r )r �type�value� tracebacks r �__exit__z&NamedFileInTemporaryDirectory.__exit__&