B ]7^c@sldZddlZddlmZmZmZddlZddlZdZdZddZ dd Z y e Wne k rfYnXdS) z Remote python server. Execute Python commands remotely and send output back. WARNING: This version has a gaping security hole -- it accepts requests from any host on the Internet! N)socketAF_INET SOCK_STREAMiicCsttjdkrttjd}nt}ttt}|d|f| dxd| \}\}}t d||d}x| t }|sxP||7}qhWt|}|||qFWdS)Nzconnection from)lensysargvintPORTrrrZbindZlistenZacceptprintZrecvBUFSIZEexecutedecodesendencodeclose)ZportsZconnZ remotehostZ remoteportrequestdataZreplyr8/opt/alt/python37/lib64/python3.7/Tools/demo/rpythond.pymains$      rcCsjtj}tj}tt_t_}z2yt|iiWnttdYnXWd|t_|t_X| S)Nd) r stdoutstderrioStringIOexecr traceback print_excgetvalue)rrrZfakefilerrrr(sr) __doc__r rrrrr r rrrKeyboardInterruptrrrr s