B
    ?F[              	   @   s  d dl Z yd dlZW n ek
r0   d dlZY nX yd dlmZ W n  ek
rb   d dlmZ Y nX ye jd e jjZW n  e	efk
r   dd ZY nX d dl
mZ d dlmZmZ d d	lmZmZmZmZmZmZ d d
lmZ d dlmZmZmZmZmZ d dlmZ d dlm Z  ej!rHe"Z#e$Z%d dl&m'Z'm(Z(m)Z) eZ*eZ+n8e#Z#e,Z%d dl'm-Z' d dl'm(Z(m)Z) dddZ*dddZ+dS )    N)encodebytes)encodestring~c             C   s   | S )N )xr   r   *lib/python3.7/site-packages/boto/compat.py<lambda>/   s    r   )six)BytesIOStringIO)filterhttp_clientmap_threadurllibzip)Queue)parse_qsquoteunquoteurlparseurlsplit)unquote_plus)urlopen)ConfigParserNoOptionErrorNoSectionError)SafeConfigParser)r   r   utf-8c             C   s   |  |}t||S )N)encoder   decode)valueencodingZbyte_stringr   r   r   unquote_strI   s    
r#   Freplacec                st   t | tj}|r| d} t| ||}|rpi }x<| D ]0\}}	| }
 fdd|	D }|||
< q8W |S |S )z>Parse a query handling unicode arguments properly in Python 2.asciic                s   g | ]}|  qS r   )r    ).0item)r"   errorsr   r   
<listcomp>b   s   z!parse_qs_safe.<locals>.<listcomp>)
isinstancer	   Z	text_typer   r   itemsr    )ZqsZkeep_blank_valuesZstrict_parsingr"   r(   Zis_text_typeZqs_dictresultnamer!   Zdecoded_nameZdecoded_valuer   )r"   r(   r   parse_qs_safeU   s    
r.   )r   )FFr   r$   ).osZ
simplejsonZjsonImportErrorbase64r   r   path
expanduserAttributeErrorZboto.vendoredr	   Zboto.vendored.sixr
   r   Zboto.vendored.six.movesr   r   r   r   r   r   Zboto.vendored.six.moves.queuer   Z$boto.vendored.six.moves.urllib.parser   r   r   r   r   r   Z&boto.vendored.six.moves.urllib.requestr   ZPY3	ExceptionZStandardErrorintZ	long_typeZconfigparserr   r   r   r#   r.   Zlongr   r   r   r   r   <module>   sB    
 