
    eo                        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y)    )annotationsN)IteratorSequence)datetime)Path)PYLINT_HOMEfull_versionc           
        t        t              t        j                         j	                  t        |            z  j                         }t        |d      5 }|j                         }d d d        d}|j                         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 }|j%                  |       d d d        |S # 1 sw Y   xY w# 1 sw Y   |S xY w# t&        $ r0}t)        d| d| d| dt        j*                         Y d }~|S d }~ww xY w)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strftimestrresolveopenreadexists	__class____name__	traceback
format_excr	   sysplatformsystemwrite	Exceptionprintstderr)exfilepathcrash_file_pathissue_template_pathffile_contenttemplateexcs           3/usr/lib/python3/dist-packages/pylint/lint/utils.pyprepare_crash_reportr,      s   [HLLN33C4HIIgi  
h	(  Avvx H%%'  		   ! "$!6!6 7 87 H@ 	$$&&H   
 b"# $% H6
%sV< 	GGH	 e   T	   
>?R>S T5 ?zL	
 	

 
sB   D3D6 D)D6 D&)D3.D6 3D6 6	E/?%E**E/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_messager/   k   s"    
&xj 1??R>SSU	W    c                    t        t        j                        }g }t               }| D ])  }||vs|j	                  |       |j                  |       + |t        j                  z   t        j                  d d  |S )N)listr   pathsetappendadd)additional_pathsoriginalchangesseenadditional_paths        r+   _augment_sys_pathr<   s   sg    CHH~HG5D+ &$&NN?+HH_%&
 CHH$CHHQKOr0   c              #     K   t        |       }	 d |t        j                  dd y# |t        j                  dd w xY ww)zHAugment 'sys.path' by adding non-existent entries from additional_paths.N)r<   r   r3   )r7   r8   s     r+   augmented_sys_pathr>      s5      !!12Hhs   ?' ?<?c                B    	  | j                   |  y# t        $ r Y y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)selfothers     r+   _is_relative_torD      s,    %  s    	)r#   r    r$   r   r%   r   returnr   )r$   r   r&   r   rE   r   )r7   Sequence[str]rE   z	list[str])r7   rF   rE   zIterator[None])rB   r   rC   r   rE   bool)
__future__r   
contextlibr   r   r   collections.abcr   r   r   pathlibr   pylint.constantsr   r	   r,   r/   r<   contextmanagerr>   rD   r.   r0   r+   <module>rN      sR   
 #   
  .   6Vr
  
r0   