
                            d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZej                  Z
e
j                  dk7  se
j                  dk  se
j                  d	kD  r6 ej                  d
j                  e
j                  e
j                               ej                  j                  dk(  rdZndZd Zd Zej$                  j'                  ej$                  j)                  ej$                  j+                  e                  Zes ed       ej$                  j1                  ed      Zej$                  j1                  ed      ZdZ ej8                  ded        ej8                  ded       ddddddddd d!d"d#d$d%efd&d'd(d)d*d+d,d-d.d/d0gZej$                  j1                  ed      ZeD ]  \  ZZ ej$                  jC                  ej$                  j1                  ee            s ed1ed2ed3       ej$                  jE                  dej$                  j1                  eee               ej$                  j1                  ed4e      Z#ej$                  j1                  ed5      Z$	 ddl%Z%d7 Z+e,d8k(  r e+        yy# e&$ rE d6 e'ejP                        jS                         v re$ne#Z*ej$                  jE                  de*       Y Zw xY w)9zGWrapper module for running gslib.__main__.main() from the command line.    )absolute_import)print_function)division)unicode_literalsN   	      a  Error: gsutil requires Python version 3.9-3.13, but a different version is installed.
You are currently running Python {}.{}
Follow the steps below to resolve this issue:
	1. Switch to Python 3.9-3.13 using your Python version manager or install an appropriate version.
	2. If you are unsure how to manage Python versions, visit [https://cloud.google.com/storage/docs/gsutil_install#specifications] for detailed instructions.   python2python3c                 r    t         j                  j                  d| z         t        j                  d       y )Nz%s
   )sysstderrwriteexit)messages    platform/gsutil/gsutil.pyOutputAndExitr   .   s$    **6G#$((1+    c                  v    dt         j                  vryddl} | j                  t         j                  d          y)a  Reloads the google module to prefer our third_party copy.

  When Python is not invoked with the -S option, it may preload the google module via .pth file.
  This leads to the "site_packages" version being preferred over gsutil "third_party" version.
  To force the "third_party" version, insert the path at the start of sys.path and reload the google module.

  This is a hacky. Reloading is required for the rare case that users have
  google-auth already installed in their Python environment.
  Note that this reload may cause an issue for Python 3.5.3 and lower
  because of the weakref issue, fixed in Python 3.5.4:
  https://github.com/python/cpython/commit/9cd7e17640a49635d1c1f8c2989578a8fc2c1de6.
  googleNr   )r   modules	importlibreload)r   s    r   _fix_google_moduler   3   s-     S[[ 
3;;x()r   zYUnable to determine where gsutil is installed. Sorry, cannot run correctly without this.
third_partyvendoredFignorez%.* httplib2 was already imported from)categoryr   z).* oauth2client was already imported from)argcomplete )mockr"   )funcsigsr"   )zgoogle-reauth-pythonr"   )pyu2fr"   )pyasn1r"   )zpyasn1-modulesr"   )rsar"   )apitoolsr"   )zgcs-oauth2-boto-pluginr"   )	fastenersr"   )	monotonicr"   )	pyparsingr"   httplib2)zretry-decoratorr"   )sixr"   )
cachetoolssrc)urllib3r/   )charset_normalizerr"   )chardetr"   )certifir"   )idnar"   )requestsr/   )zgoogle-auth-library-pythonr"   )z#google-auth-library-python-httplib2r"   zThere is no z1 library under the gsutil third-party directory (z).
The gsutil command cannot work properly when installed this way.
Please re-install gsutil per the installation instructions.crcmod
crcmod_osxdarwinc                  z    t                dd l} t        j                  | j                  j                                y )Nr   )r   gslib.__main__r   r   __main__main)gslibs    r   RunMainr>      s$    ((5>> !r   r;   )-__doc__
__future__r   r   r   r   osr   warningsversion_infovermajorminorr   formatsubmodule_pyversr   r   pathdirnameabspathrealpath__file__
GSUTIL_DIRjoinTHIRD_PARTY_DIRVENDORED_DIRMEASURING_TIME_ACTIVEfilterwarningsUserWarningTHIRD_PARTY_LIBSlibdirsubdirisdirinsertCRCMOD_PATHCRCMOD_OSX_PATHr6   ImportErrorstrplatformlowerlocal_crcmod_pathr>   __name__ r   r   <module>rc      s    N & %  ' 	 
  
99>SYY]cii"n
#((c dj  dj  kn  kt  kt  vy  v  v  d@ Q
*& WW__RWW__RWW-=-=h-GHI
 7 8
 '',,z=9ww||OZ8     !, HJ   !, LN  "!"&/3 D '',,z=9&NFF	rww||OV<	= 
	"#
 ((//!RWW\\/66BC ' ggll?H6FG'',,=	(" z	) !  ( +3c#,,6G6M6M6O*O' ((//!&'(s   -J AKK