Edit File: sandbox.pyo
� 3�abc�����������@���s���d��d�l��Z��d��d�l�Z�d��d�l�Z�d��d�l�Z�d��d�l�Z�d��d�l�Z�d��d�l�Z�d��d�l�Z�d��d�l�Z�d��d�l �Z �d��d�l �m�Z�d��d�l�m �Z �m�Z�d��d�l�Z�e�j�j�d���r��d��d�l�j�j�j�j�Z�n�e�j�e��j�Z�y �e�Z�Wn�e�k �r d�Z�n�Xe�Z�d��d�l �m!�Z!�d��d�l�m"�Z"�d�d�d �d �g�Z#�d�d���Z$�e�j%�d�d�����Z&�e�j%�d ������Z'�e�j%�d������Z(�e�j%�d������Z)�d�e*�f�d�������YZ+�d�d!�d�������YZ,�e�j%�d������Z-�d����Z.�e�j%�d������Z/�e�j%�d������Z0�d����Z1�d����Z2�d����Z3�d�d"�d�������YZ4�e5�e��d���rNe��j6�g�Z7�n�g��Z7�d�e4�f�d�������YZ8�e�j9�e�j:�g��d�j;����D]�Z<�e=�e�e<�d���^�q���Z>�d �e!�f�d �������YZ?�d�S(#���i����N(���t���six(���t���builtinst���mapt���java(���t���DistutilsError(���t���working_sett���AbstractSandboxt���DirectorySandboxt���SandboxViolationt ���run_setupc���������B���s_���d�}�e��|��|�����}�|�j����}�Wd�QX|�d�k�r?�|�}�n��e�|�|��d���}�|�|�|�Ud�S(���s.��� Python 3 implementation of execfile. t���rbNt���exec(���t���opent���readt���Nonet���compile(���t���filenamet���globalst���localst���modet���streamt���scriptt���code(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���_execfile#���s���� c���������c���s>���t��j�}�|��d��k �r#�|��t��j�(n��z �|�VWd��|�t��j�(Xd��S(���N(���t���syst���argvR���(���t���replt���saved(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���save_argv0���s���� c����������c���s%���t��j�}��z �|��VWd��|��t��j�(Xd��S(���N(���R���t���path(���R���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���save_path;���s���� c���������c���sB���t��j�j�|��d�t��t�j�}�|��t�_�z �d�VWd�|�t�_�Xd�S(���sL��� Monkey-patch tempfile.tempdir with replacement, ensuring it exists t���exist_okN(���t ���pkg_resourcest ���py31compatt���makedirst���Truet���tempfilet���tempdir(���t���replacementR���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���override_tempD���s���� c���������c���s7���t��j����}�t��j�|����z �|�VWd��t��j�|���Xd��S(���N(���t���ost���getcwdt���chdir(���t���targetR���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���pushdU���s ���� t���UnpickleableExceptionc�����������B���s���e��Z�d��Z�e�d������Z�RS(���sP��� An exception representing another Exception that could not be pickled. c���������C���sa���y �t��j�|����t��j�|���f�SWn:�t�k �r\�d�d�l�m�}�|�j�|�|�t�|�������SXd�S(���s���� Always return a dumped (pickled) type and exc. If exc can't be pickled, wrap it in UnpickleableException first. i����(���R-���N(���t���picklet���dumpst ���Exceptiont���setuptools.sandboxR-���t���dumpt���repr(���t���typet���exct���cls(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR2���d���s ���� (���t���__name__t ���__module__t���__doc__t���staticmethodR2���(����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR-���_���s���t���ExceptionSaverc�����������B���s)���e��Z�d��Z�d����Z�d����Z�d����Z�RS(���s^��� A Context Manager that will save an exception, serialized, and restore it later. c���������C���s���|��S(���N(����(���t���self(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���__enter__x���s����c���������C���s,���|�s �d��St��j�|�|���|��_�|�|��_�t�S(���N(���R-���R2���t���_savedt���_tbR#���(���R<���R4���R5���t���tb(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���__exit__{���s ���� c���������C���sK���d�t��|����k�r�d�St�t�j�|��j���\�}�}�t�j�|�|�|��j���d�S(���s"���restore and re-raise any exceptionR>���N(���t���varsR���R.���t���loadsR>���R����t���reraiseR?���(���R<���R4���R5���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���resume����s����(���R7���R8���R9���R=���RA���RE���(����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR;���r���s��� c����������#���sg���t��j�j�������t������}�����VWd�QXt��j�j���������f�d����t��j�D��}�t�|���|��j����d�S(���s���� Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. Nc���������3���s1���|��]'�}�|����k�r�|�j��d����r�|�Vq�d�S(���s ���encodings.N(���t ���startswith(���t���.0t���mod_name(���R���(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pys ���<genexpr>����s����(���R���t���modulest���copyR;���t���updatet���_clear_modulesRE���(���t ���saved_exct���del_modules(����(���R���s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���save_modules����s���� c���������C���s%���x�t��|����D]�}�t�j�|�=q �Wd��S(���N(���t���listR���RI���(���t���module_namesRH���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRL�������s����c����������c���s*���t��j����}��z �|��VWd��t��j�|����Xd��S(���N(���R ���t���__getstate__t���__setstate__(���R���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���save_pkg_resources_state����s���� c���������c���s����t��j�j�|��d���}�t�����q�t�����a�t����t�����J�t�����:�t�|����'�t �|������t �d���d��VWd��QXWd��QXWd��QXWd��QXWd��QXWd��QXd��S(���Nt���tempt ���setuptools(���R(���R���t���joinRT���RO���t���hide_setuptoolsR���R���R'���R,���t ���__import__(���t ���setup_dirt���temp_dir(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���setup_context����s���� c���������C���s"���t��j�d���}�t�|�j�|������S(���sH�� >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True s1���(setuptools|pkg_resources|distutils|Cython)(\.|$)(���t���reR���t���boolt���match(���RH���t���pattern(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���_needs_hiding����s����c����������C���s ���t��t�t�j���}��t�|����d�S(���s%�� Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. N(���t���filterRa���R���RI���RL���(���RI���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRX�������s����c������ ���C���s��t��j�j�t��j�j�|������}�t�|������y��|��g�t�|���t�j�(t�j�j�d�|���t �j ����t �j�j�d������t �|��t���r��|��n�|��j�t�j������}�t�|����'�t�d�|�d�d���}�t�|��|���Wd�QXWn/�t�k �r}�|�j�r|�j�d�r���qn�XWd�QXd�S(���s8���Run a distutils setup script, sandboxed in its directoryi����c���������S���s ���|��j�����S(���N(���t���activate(���t���dist(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���<lambda>����t����t���__file__R7���t���__main__N(���R(���R���t���abspatht���dirnameR\���RP���R���R���t���insertR���t���__init__t ���callbackst���appendt ���isinstancet���strt���encodet���getfilesystemencodingR���t���dictR���t ���SystemExitt���args(���t���setup_scriptRu���RZ���t���dunder_filet���nst���v(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR �������s���� c�����������B���s���e��Z�d��Z�e�Z�d����Z�d����Z�d����Z�d����Z�d����Z �d����Z �x<�d�d�d �g�D]+�Z�e�e �e���rX�e �e���e����e�<qX�qX�Wd)�d ���Z�e�r��e�d�e���Z�n��e�d�e���Z�xl�d �d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�g�D]+�Z�e�e �e���r��e�e���e����e�<q��q��Wd����Z�x9�d �d!�g�D]+�Z�e�e �e���r?e�e���e����e�<q?q?Wd"����Z�x9�d#�d$�g�D]+�Z�e�e �e���r�e�e���e����e�<q�q�Wd%����Z�d&����Z�d'����Z�d(����Z�RS(*���sD���Wrap 'os' module and 'open()' builtin for virtualizing setup scriptsc���������C���sE���g��t��t���D]+�}�|�j�d���r �t�|��|���r �|�^�q �|��_�d��S(���Nt���_(���t���dirt���_osRF���t���hasattrt���_attrs(���R<���t���name(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRl�����s����c���������C���s1���x*�|��j��D]�}�t�t�|�t�|�|�����q �Wd��S(���N(���R~���t���setattrR(���t���getattr(���R<���t���sourceR���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���_copy��s����c���������C���s;���|��j��|����t�r"�|��j�t�_�n��|��j�t�_�t�|��_�d��S(���N(���R����t���_fileR���t���filet���_openR���R#���t���_active(���R<���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR=�����s ���� c���������C���s5���t��|��_�t�r�t�t�_�n��t�t�_�|��j�t���d��S(���N( ���t���FalseR����R����R���R����R����R���R����R|���(���R<���t���exc_typet ���exc_valuet ���traceback(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRA�����s ���� c���������C���s���|����|����SWd�QXd�S(���s���Run 'func' under os sandboxingN(����(���R<���t���func(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���run��s����c������������s%���t��t�������������f�d����}�|�S(���Nc������������s@���|��j��r-�|��j����|�|�|�|���\�}�}�n����|�|�|�|���S(���N(���R����t���_remap_pair(���R<���t���srct���dstRu���t���kw(���R���t���original(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���wrap&��s���� $(���R����R|���(���R���R����(����(���R���R����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���_mk_dual_path_wrapper#��s����t���renamet���linkt���symlinkc������������s+�����p�t��t�������������f�d����}�|�S(���Nc������������s4���|��j��r$�|��j����|�|�|���}�n����|�|�|���S(���N(���R����t���_remap_input(���R<���R���Ru���R����(���R���R����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR����4��s���� (���R����R|���(���R���R����R����(����(���R���R����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���_mk_single_path_wrapper1��s����R����R���t���statt���listdirR*���t���chmodt���chownt���mkdirt���removet���unlinkt���rmdirt���utimet���lchownt���chroott���lstatt ���startfilet���mkfifot���mknodt���pathconft���accessc������������s%���t��t�������������f�d����}�|�S(���Nc������������sM���|��j��r=�|��j����|�|�|���}�|��j������|�|�|�����S��|�|�|���S(���N(���R����R����t ���_remap_output(���R<���R���Ru���R����(���R���R����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR����I��s���� (���R����R|���(���R���R����(����(���R���R����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���_mk_single_with_returnF��s����t���readlinkt���tempnamc������������s%���t��t�������������f�d����}�|�S(���Nc������������s,�����|�|����}�|��j��r(�|��j����|���S|�S(���N(���R����R����(���R<���Ru���R����t���retval(���R���R����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR����X��s���� (���R����R|���(���R���R����(����(���R���R����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���_mk_queryU��s����R)���t���tmpnamc���������C���s���|�S(���s=���Called to remap or validate any path, whether input or output(����(���R<���R���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���_validate_pathd��s����c���������O���s ���|��j��|���S(���s���Called for path inputs(���R����(���R<���t ���operationR���Ru���R����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR����h��s����c���������C���s ���|��j��|���S(���s���Called for path outputs(���R����(���R<���R����R���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR����l��s����c���������O���s6���|��j��|�d�|�|�|���|��j��|�d�|�|�|���f�S(���s?���Called for path pairs like rename, link, and symlink operationss���-froms���-to(���R����(���R<���R����R����R����Ru���R����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR����p��s����N(���R7���R8���R9���R����R����Rl���R����R=���RA���R����R����R���R}���R|���R���R���R����R����R����R����R����R����R����R����R����(����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR�����sB��� t���devnullc�����������B���s����e��Z�d��Z�e�j�d�d�d�d�d�d�d�d�d �d �d�d�d �g ���Z�d�g�Z�e�d���Z�d����Z �e �ru�d�d���Z �n��d�d���Z�d����Z�d����Z �d����Z�d����Z�d����Z�d�d���Z�RS(���s<���Restrict operations to a single subdirectory - pseudo-chrootR���R����R����R����R����R����R����R����R����R����R����R����R����s���.*lib2to3.*\.pickle$c���������C���s����t��j�j�t��j�j�|�����|��_�t��j�j�|��j�d���|��_�g��|�D]$�}�t��j�j�t��j�j�|�����^�qC�|��_�t�j �|����d��S(���NRf���( ���R(���R���t���normcaset���realpatht���_sandboxRW���t���_prefixt���_exceptionsR���Rl���(���R<���t���sandboxt ���exceptionsR���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRl������s ����!1c���������O���s&���d�d�l��m�}�|�|�|�|�����d��S(���Ni����(���R���(���R1���R���(���R<���R����Ru���R����R���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt ���_violation���s����t���rc���������O���sK���|�d�k�r8�|��j��|���r8�|��j�d�|�|�|�|���n��t�|�|�|�|���S(���NR����t���rtR ���t���rUt���UR����(���R����R����R ���R����R����(���t���_okR����R����(���R<���R���R���Ru���R����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR�������s����c���������O���sK���|�d�k�r8�|��j��|���r8�|��j�d�|�|�|�|���n��t�|�|�|�|���S(���NR����R����R ���R����R����R���(���R����R����R ���R����R����(���R����R����R����(���R<���R���R���Ru���R����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR�������s����c���������C���s���|��j��d���d��S(���NR����(���R����(���R<���(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR�������s����c���������C���ss���|��j��}�zY�t�|��_��t�j�j�t�j�j�|�����}�|��j�|���p`�|�|��j�k�p`�|�j�|��j ���SWd��|�|��_��Xd��S(���N( ���R����R����R(���R���R����R����t ���_exemptedR����RF���R����(���R<���R���t���activeR����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR�������s���� c������������sN������f�d����|��j��D��}����f�d����|��j�D��}�t�j�|�|���}�t�|���S(���Nc���������3���s���|��]�}����j��|���Vq�d��S(���N(���RF���(���RG���t ���exception(���t���filepath(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pys ���<genexpr>���s���c���������3���s!���|��]�}�t��j�|������Vq�d��S(���N(���R]���R_���(���RG���R`���(���R����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pys ���<genexpr>���s���(���R����t���_exception_patternst ���itertoolst���chaint���any(���R<���R����t ���start_matchest���pattern_matchest ���candidates(����(���R����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR�������s���� c���������O���sH���|�|��j��k�rD�|��j�|���rD�|��j�|�t�j�j�|���|�|���n��|�S(���s���Called for path inputs(���t ���write_opsR����R����R(���R���R����(���R<���R����R���Ru���R����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR�������s����%c���������O���sF���|��j��|���s �|��j��|���r<�|��j�|�|�|�|�|���n��|�|�f�S(���s?���Called for path pairs like rename, link, and symlink operations(���R����R����(���R<���R����R����R����Ru���R����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR�������s���� i���c���������O���sR���|�t��@r9�|��j�|���r9�|��j�d�|�|�|�|�|���n��t�j�|�|�|�|�|���S(���s���Called for low-level os.open()s���os.open(���t���WRITE_FLAGSR����R����R|���R���(���R<���R����t���flagsR���Ru���R����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR������s����(���R7���R8���R9���Rs���t���fromkeysR����R����t���_EXCEPTIONSRl���R����R����R����R����R����R����R����R����R���(����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR���~��s ��� s4���O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYi����c�����������B���s,���e��Z�d��Z�e�j�d���j����Z�d����Z�RS(���sE���A setup script attempted to modify the filesystem outside the sandboxs�� SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. c���������C���s%���|��j��\�}�}�}�|��j�j�t�������S(���N(���Ru���t���tmplt���formatR���(���R<���t���cmdRu���t���kwargs(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���__str__���s����(���R7���R8���R9���t���textwrapt���dedentt���lstripR����R����(����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR������s��� (����(����(@���R(���R���R$���t���operatort ���functoolsR����R]���t ���contextlibR.���R����t���setuptools.externR����t���setuptools.extern.six.movesR���R���t���pkg_resources.py31compatR ���t���platformRF���t$���org.python.modules.posix.PosixModulet���pythonRI���t���posixt���PosixModuleR|���R���R����R����t ���NameErrorR���R���R����t���distutils.errorsR���R���t���__all__R���t���contextmanagerR���R���R'���R,���R0���R-���R;���RO���RL���RT���R\���Ra���RX���R ���R���R}���R����R����R���t���reducet���or_t���splitt���aR����R����R���(����(����(����s6���/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt���<module>���s^��� wV +