| Server IP : 217.160.0.135 / Your IP : 216.73.217.25 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/IPython/utils/__pycache__/ |
Upload File : |
�
�@�cK � �b � d Z ddlZddlmZ ddlmZ G d� de� � Z G d� de� � Z dS ) 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 Zd d�Zd� ZeZd� Zd� ZdS )
�NamedFileInTemporaryDirectory�w+b���Fc � � t di |��| _ t | j j � � |z }d|v rdnd}t ||||�� � | _ dS )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__
s] � � *�1�1�D�1�1����D�L�%�&�&��1���$�;�;�4�4�G����t�W�x�@�@�@�� � � � c �j � | j � � � | j � � � d S �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�r c �. � | � � � d S r )r )r �type�value� tracebacks r �__exit__z&NamedFileInTemporaryDirectory.__exit__&