
_i                 @   s\   d  d l  Z  d  d l Z d  d l Z d d l m Z d d   Z d d   Z d d	   Z d S)
    N   )PY2c              C   s   d d  l  }  t t d  s d St j d  } d } x_ | d  k	 r | j j d d  j d  rw | j } | d 7} q7 | j j	 |  j
 j @r | SPq7 Wd S)Nr   	_getframer   __name__ zclick.)
__future__hasattrsysr   	f_globalsget
startswithf_backf_codeco_flagsunicode_literalscompiler_flag)r   Zfrmidx r   2/tmp/pip-build-5gj8f0j9/click/click/_unicodefun.py_find_unicode_literals_frame   s    	r   c              C   sn   t  s
 d  Sd d l m }  t s' |  r+ d  St   } | d k rD d  Sd d l m } | t d  d | d  S)Nr   ) disable_unicode_literals_warningr   )warna  Click detected the use of the unicode_literals __future__ import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see https://click.palletsprojects.com/python3/
stacklevel)	__debug__r   r   r   r   warningsr   Warning)r   Z	bad_framer   r   r   r   _check_for_unicode_literals   s    		r   c        	      C   sH  t  r
 d Sy( d d l }  t j |  j    j } Wn t k
 rL d } Yn X| d k r] d Sd } t j d k r/d d l } y5 | j	 d d g d | j
 d	 | j
 j   d } Wn t k
 r d
 } Yn Xt   } d } t | t  r | j d d  } xZ | j   D]L } | j   }  |  j   j d  r| j |   |  j   d k rd } qW| d 7} | sx| d 7} n5 | r| d 7} n" | d j d j t |    7} d } xZ t j j d  t j j d  f D]4 }  |  r|  j   j d  r|  } |  d k	 rPqW| d k	 r/| d j |  7} t d j |    d S)z=Ensures that the environment is good for unicode on Python 3.Nr   asciir   posixlocalez-astdoutstderr    Freplace.utf-8.utf8c.utf8c.utf-8Tz

zAdditional information: on this system no suitable UTF-8 locales were discovered. This most likely requires resolving by reconfiguring the locale system.zThis system supports the C.UTF-8 locale which is recommended. You might be able to resolve your issue by exporting the following environment variables:

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8zThis system lists a couple of UTF-8 supporting locales that you can pick from. The following suitable locales were discovered: {}z, LC_ALLLANGz

Click discovered that you exported a UTF-8 locale but the locale system could not pick up from it because it does not exist. The exported locale is '{}' but it is not supportedzClick will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult https://click.palletsprojects.com/python3/ for mitigation steps.{})r$   r%   )r&   r'   )r$   r%   )r   r   codecslookupgetpreferredencodingname	Exceptionos
subprocessPopenPIPEcommunicateOSErrorset
isinstancebytesdecode
splitlinesstriplowerendswithaddformatjoinsortedenvironr   RuntimeError)	r   Zfs_encextrar0   rvZgood_localesZ
has_c_utf8lineZ
bad_localer   r   r   _verify_python3_env4   sf    $	



+
rF   )r*   r/   r	   _compatr   r   r   rF   r   r   r   r   <module>   s   