| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.10/test/__pycache__/ |
Upload File : |
o
�9j� � @ s d dl Z d dlZd dlZd dlZd dlmZ d dlmZ g d�Zej dkr,e�
g d�� e jjsMe�
� ZzeD ]Ze�e� q7W n eyL e�d��w G dd � d ej�ZG d
d� de�ZG dd
� d
e�ZG dd� de�ZG dd� de�Zedkr�e�� dS dS )� N�� normalize)� os_helper)
�1_abc�2_asciiu
3_Grüß-Gottu 4_Γειά-σαςu 5_Здравствуйтеu 6_にぽんu 7_השקצץסu 8_曨曩曫u 9_曨שんдΓßu 10_΅´�darwin) u 11_΅ϓϔu 12_΅ϓϔu 13_ ̈́ΎΫu 14_ẛ῁῍῎῏῝῞῟῭u 15_΅´𣏕u
16_ Au
17_ Au
18_ Az19_ Az>only NT+ and systems with Unicode-friendly filesystem encodingc @ s� e Zd Zee�ZdZdd� Zdd� Ze dfdd�Z
d d
� Zej
dkr'ee fZneZdd
� Ze�ej
dkd�dd� �Ze�ej
dkd�dd� �Zdd� Zdd� ZdS )�UnicodeFileTestsNc C s� zt �tj� W n ty Y nw | �tjtj� t� }| jD ]6}t j �
tj| �|��}t|d��}|�
|d �d�� W d � n1 sGw Y t �|� |�|� q || _d S �N�wb�
�utf-8)�os�mkdirr �TESTFN�FileExistsError�
addCleanup�rmtree�set�files�path�join�norm�open�write�encode�stat�add)�selfr �name�f� r �7/usr/lib/python3.10/test/test_unicode_file_functions.py�setUp@ s �
�
zUnicodeFileTests.setUpc C s | j r t| j |�S |S �N)�normal_formr )r �sr r r! r P s zUnicodeFileTests.normTc C s` | � |��}||� W d � n1 sw Y |jj}|r.| �||d|j||f � d S d S )Nz>Function '%s(%a) failed with bad filename in the exception: %a)�assertRaises� exception�filename�assertEqual�__name__)r �fnr( �expected_exception�check_filename�c�exc_filenamer r r! �_apply_failureU s
�
��zUnicodeFileTests._apply_failurec C sj | j D ]/}d| }| �t|� | �tj|� | �tj|� | �tj|� | �tj|� | �tj|� qd S )N�not_) r r0 r r
r �chdir�rmdir�remove�listdir�r r r r r! �
test_failures` s
�zUnicodeFileTests.test_failures�win32c C sR | j D ]#}t|d�}|�|d �d�� |�� t�|� | �tj|| j � qd S r )
r r r r �closer
r r0 r5 �_listdir_failure)r r r r r r! � test_openq s
�zUnicodeFileTests.test_openr zirrelevant test on Mac OS Xc s� t | j�}t � }t g d��D ]� |t � fdd�|D ��O }q||8 }|D ]+}| �t|� | �tj|� | �tj|� | �tj|� | �tj|� | �tj |� q$d S )N)�NFC�NFD�NFKC�NFKDc 3 s � | ]}t � |�V qd S r# r )�.0�file��nfr r! � <genexpr>� s � z2UnicodeFileTests.test_normalize.<locals>.<genexpr>)
r r r0 r r
r r2 r3 r4 r5 )r r �othersr r rB r! �test_normalize} s
�zUnicodeFileTests.test_normalizec C s� t | j�}t�� � t�dt� t�tj �
t�� ��}W d � n1 s%w Y t�tj �}t dd� |D ��}| �
||d||f � | �
t|�t|�� d S )N�ignorec s s � | ]}t j�tj|�V qd S r# )r
r r r r )r@ r r r r! rD � s � z0UnicodeFileTests.test_listdir.<locals>.<genexpr>z%a != %a)r r �warnings�catch_warnings�simplefilter�DeprecationWarningr
r5 r r r �sys�getfilesystemencodingr) �len)r �sf0�f1�f2�sf2r r r! �test_listdir� s
��zUnicodeFileTests.test_listdirc C s( | j D ]}t�|d� t�d|� qd S )N�tmp)r r
�renamer6 r r r! �test_rename� s
�zUnicodeFileTests.test_renamec C s� t j�tjd�}d}t�|��4 t|d��}|�|d �d�� W d � n1 s*w Y t � |t j
� t �|� W d � d S 1 sFw Y d S )Nu Grüß-曨曩曫u ß-曨曩曫r
r r )r
r r r r �temp_cwdr r r �access�R_OKr4 )r �dirnamer( r r r r! �test_directory� s
��"�zUnicodeFileTests.test_directory)r* �
__module__�__qualname__r � filenamesr r$ r"