
    yIfo                        d dl mZ d dlZd dlZd dlZd dlZd dlmZmZ d dl	m	Z	 d dl
mZ d dlmZmZ ddZddZddZej        dd            ZddZdS )     )annotationsN)IteratorSequence)datetime)Path)PYLINT_HOMEfull_versionex	Exceptionfilepathstrcrash_file_pathreturnr   c           
        t          t                    t          j                                        t          |                    z                                  }t          |d          5 }|                                }d d d            n# 1 swxY w Y   d}|	                                sd}|d|  d| d| j
        j         dz  }|t          j                    z  }|d	t           d
t          j         dt!          j                     dz  }	 t          |dd          5 }|                    |           d d d            n# 1 swxY w Y   n<# t&          $ r/}t)          d| d| d| dt          j                   Y d }~nd }~ww xY w|S )Nutf8)encoding u   First, please verify that the bug is not already filled:
https://github.com/pylint-dev/pylint/issues/

Then create a new issue:
https://github.com/pylint-dev/pylint/issues/new?labels=Crash 💥%2CNeeds triage 📥


z
Issue title:
Crash ``a  `` (if possible, be more specific about what made pylint crash)

### Bug description

When parsing the following ``a.py``:

<!--
 If sharing the code is not an option, please state so,
 but providing only the stacktrace would still be helpful.
 -->

```python
z
```

### Command used

```shell
pylint a.py
```

### Pylint output

<details open>
    <summary>
        pylint crashed with a ``z@`` and with the following stacktrace:
    </summary>

```python
zR
```


</details>

### Expected behavior

No crash.

### Pylint version

```shell
z
```

### OS / Environment

z (z)

### Additional dependencies

<!--
Please remove this part if you're not using any of
your dependencies in the example.
 -->
az0Can't write the issue template for the crash in z because of: 'z'
Here's the content anyway:
.)file)r   r   r   nowstrftimer   resolveopenreadexists	__class____name__	traceback
format_excr	   sysplatformsystemwriter   printstderr)r
   r   r   issue_template_pathffile_contenttemplateexcs           E/var/www/piapp/venv/lib/python3.11/site-packages/pylint/lint/utils.pyprepare_crash_reportr-      s   [HLNN33C4H4HIIIgii  
h	(	(	(  Avvxx                             H%%'' 	  	   6 "$!67   H@ 	$&&&H   $ % $ ""%   H6
%sV<<< 	GGH	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 
 
 
L?R L LL L@HL L L	
 	
 	
 	
 	
 	
 	
 	
 	

 sN   ,BBBE !E7E EE 
EE 
F%FFr'   c                    d|  d| dS )NzFatal error while checking 'zs'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in 'z'. )r   r'   s     r,   get_fatal_error_messager0   k   s0    	Wx 	W 	W?R	W 	W 	W    additional_pathsSequence[str]	list[str]c                    t          t          j                  }g }t                      }| D ]0}||vr*|                    |           |                    |           1|t          j        z   t          j        d d <   |S )N)listr!   pathsetappendadd)r2   originalchangesseenadditional_paths        r,   _augment_sys_pathr?   s   sw    CH~~HG55D+ & &$&&NN?+++HH_%%%CH$CHQQQKOr1   Iterator[None]c              #     K   t          |           }	 dV  |t          j        dd<   dS # |t          j        dd<   w xY w)zHAugment 'sys.path' by adding non-existent entries from additional_paths.N)r?   r!   r7   )r2   r;   s     r,   augmented_sys_pathrB      sR       !!122Hhs   * =selfotherboolc                >    	  | j         |  dS # t          $ r Y dS w xY w)zChecks if self is relative to other.

    Backport of pathlib.Path.is_relative_to for Python <3.9
    TODO: py39: Remove this backport and use stdlib function.
    TF)relative_to
ValueError)rC   rD   s     r,   _is_relative_torI      s>    %  t   uus   
 
)r
   r   r   r   r   r   r   r   )r   r   r'   r   r   r   )r2   r3   r   r4   )r2   r3   r   r@   )rC   r   rD   r   r   rE   )
__future__r   
contextlibr"   r!   r   collections.abcr   r   r   pathlibr   pylint.constantsr   r	   r-   r0   r?   contextmanagerrB   rI   r/   r1   r,   <module>rP      s  
 # " " " " "      



     . . . . . . . .             6 6 6 6 6 6 6 6V V V Vr   
 
 
 
    
 
 
 
 
 
r1   