
    Ioj                         S SK r S SKrS SKJr  SSKJr  SSKJr  S rS r	S r
S	 r\R                  4S
\S\4S jjr\R                  4S\S
\SS4S jjr " S S\5      rg)    N)RawConfigParser   )py39)SetuptoolsDeprecationWarningc                     [        U [        5      (       a  [        R                  " SU 5      $  U R	                  S5      n [        R                  " SU 5      n U R                  S5      n U $ ! [         a     U $ f = f)NNFDutf-8)
isinstancestrunicodedata	normalizedecodeencodeUnicodeError)paths    R/mnt/workspace/venv-train/lib/python3.13/site-packages/setuptools/unicode_utils.py	decomposer   
   su    $$$UD11{{7#$$UD1{{7# K  Ks   9A) )
A76A7c                 ^    [        U [        5      (       a  [        R                  " SU 5      $ U $ )a  
Return *text* in a canonical Unicode form (NFC) so that names which are
visually identical but encoded differently compare equal.

macOS APFS/HFS+ store file names in decomposed form (NFD), while patterns
in ``MANIFEST.in`` are typically authored composed (NFC). The two denote
the same file but differ byte-for-byte, so matching them directly lets an
exclusion silently fail. Normalizing both the walked path and the pattern
to a single form before matching avoids that (GHSA-h35f-9h28-mq5c).
NFC)r
   r   r   r   )texts    r   r   r      s(     2<D#1F1F;  -PDP    c                     [        U [        5      (       a  U $ [        R                  " 5       =(       d    SnUS4nU H  n U R	                  U5      s  $    g! [
         a     M'  f = f)zQ
Ensure that the given path is decoded,
``None`` when no expected encoding works
r	   N)r
   r   sysgetfilesystemencodingr   UnicodeDecodeError)r   fs_enc
candidatesencs       r   filesys_decoder   $   si     $&&(3GFJ	;;s##   " 		s    A
A$#A$c                 F     U R                  U5      $ ! [         a     gf = f)z/turn unicode encoding into a functional routineN)r   UnicodeEncodeError)stringr   s     r   
try_encoder#   9   s(    }}S!! s    
  filereturnc                 $    [        U SSS9 nUR                  5       sSSS5        $ ! , (       d  f       g= f! [         aM    [        R	                  XS9  [        U SUS9 nUR                  5       sSSS5        s $ ! , (       d  f        g= ff = f)z
First try to read the file with UTF-8, if there is an error fallback to a
different encoding ("locale" by default). Returns the content of the file.
Also useful when reading files that might have been produced by an older version of
setuptools.
rr	   encodingNr$   fallback_encoding)openreadr   _Utf8EncodingNeededemit)r$   r+   fs      r   _read_utf8_with_fallbackr1   A   sp    $g.!668 /..   d P$&78A668 9888s;   8 '	8 
58 8 (B A<0
B<
B	BBcfgc                      U R                  USS9  g! [         a5    [        R                  XS9  U R	                  5         U R                  XS9   gf = f)zSame idea as :func:`_read_utf8_with_fallback`, but for the
:meth:`RawConfigParser.read` method.

This method may call ``cfg.clear()``.
r	   r(   r*   N)r-   r   r.   r/   clear)r2   r$   r+   s      r   _cfg_read_utf8_with_fallbackr5   Q   sN    3( 3  d P		23s    <AAc                       \ rS rSrSrSrSrg)r.   a   zZ
    `encoding="utf-8"` fails with {file!r}, trying `encoding={fallback_encoding!r}`.
    a  
    Fallback behavior for UTF-8 is considered **deprecated** and future versions of
    `setuptools` may not implement it.

    Please encode {file!r} with "utf-8" to ensure future builds will succeed.

    If this file was produced by `setuptools` itself, cleaning up the cached files
    and re-building/re-installing the package with a newer version of `setuptools`
    (e.g. by updating `build-system.requires` in its `pyproject.toml`)
    might solve the problem.
     N)__name__
__module____qualname____firstlineno___SUMMARY_DETAILS__static_attributes__r8   r   r   r.   r.   a   s    H
Hr   r.   )r   r   configparserr   compatr   warningsr   r   r   r   r#   LOCALE_ENCODINGr   r1   r5   r.   r8   r   r   <module>rD      s}    
  (  2	Q* ;?:N:N 3 SV " 8<7K7K3	3 #3	3 6 r   