ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python2.7/Tools/scripts/pysource.pyo
ó
fc@sãdZdZddddgZddlZddlZejdƒZeZd	„Z	d
„Z
d„Zd„Zd
„Z
edd„ZedkrßxedgƒD]ZeGHq£WdGHx%edgde
ƒD]ZeGHqÍWndS(sCList python source files.

There are three functions to check whether a file is a Python source, listed
here with increasing complexity:

- has_python_ext() checks whether a file name ends in '.py[w]'.
- look_like_python() checks whether the file is not binary and either has
  the '.py[w]' extension or the first line contains the word 'python'.
- can_be_compiled() checks whether the file can be compiled by compile().

The file also must be of appropriate size - not bigger than a megabyte.

walk_python_files() recursively lists all Python files under the given directories.
sOleg Broytmann, Georg Brandlthas_python_exttlooks_like_pythontcan_be_compiledtwalk_python_filesiÿÿÿÿNs	[--]cCstr|GHndS(N(tdebug(tmsg((s./usr/lib64/python2.7/Tools/scripts/pysource.pytprint_debugscCs¥ytj|ƒj}Wn(tk
r@}td||fƒdSX|dkretd||fƒdSyt|dƒSWn(tk
r }td||fƒdSXdS(Ns%s: permission denied: %sis!%s: the file is too big: %d bytestrUs%s: access denied: %si(toststattst_sizetOSErrorRtNonetopentIOError(tfullpathtsizeterr((s./usr/lib64/python2.7/Tools/scripts/pysource.pyt_open!scCs|jdƒp|jdƒS(Ns.pys.pyw(tendswith(R((s./usr/lib64/python2.7/Tools/scripts/pysource.pyR2scCs‰t|ƒ}|dkrtS|jƒ}|jƒtj|ƒrStd|ƒtS|jdƒsq|jdƒrut	Sd|kr…t	StS(Ns%s: appears to be binarys.pys.pywtpython(
RRtFalsetreadlinetcloset	binary_retsearchRRtTrue(Rtinfiletline((s./usr/lib64/python2.7/Tools/scripts/pysource.pyR5s
cCsut|ƒ}|dkrtS|jƒ}|jƒyt||dƒWn(tk
rp}td||fƒtSXtS(Ntexecs%s: cannot compile: %s(	RRRtreadRtcompilet	ExceptionRR(RRtcodeR((s./usr/lib64/python2.7/Tools/scripts/pysource.pyRJs
c
cs"|dkrg}nx|D]þ}td|ƒtjj|ƒrY||ƒr|Vqqtjj|ƒrtdƒx¢tj|ƒD]„\}}}x*|D]"}||kr›|j|ƒq›q›WxE|D]=}tjj||ƒ}	td|	ƒ||	ƒrÈ|	VqÈqÈWq…WqtdƒqWdS(s^    Recursively yield all Python source files below the given paths.

    paths: a list of files and/or directories to be checked.
    is_python: a function that takes a file name and checks whether it is a
               Python source file
    exclude_dirs: a list of directory base names that should be excluded in
                  the search
    stesting: %ss    it is a directorys    unknown typeN(	RRRtpathtisfiletisdirtwalktremovetjoin(
tpathst	is_pythontexclude_dirsR"tdirpathtdirnamest	filenamestexcludetfilenameR((s./usr/lib64/python2.7/Tools/scripts/pysource.pyR[s&
	



t__main__t.s
----------R)(t__doc__t
__author__t__all__RtreRRRRRRRRRRRt__name__R(((s./usr/lib64/python2.7/Tools/scripts/pysource.pyt<module>s"					!