Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cherrypy/test/__pycache__/modwsgi.cpython-39.pyc
Ðазад
a v�h� � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlZddl m Z ej�ej� e��Zddd�Zejdkrzd Znd ZdZdZG d d� de j�Zdadd� ZdS )aC Wrapper for mod_wsgi, for use as a CherryPy HTTP server. To autostart modwsgi, the "apache" executable or script must be on your system path, or you must override the global APACHE_PATH. On some platforms, "apache" may be called "apachectl" or "apache2ctl"-- create a symlink to them if needed. KNOWN BUGS ========== 1. Apache processes Range headers automatically; CherryPy's truncated output is then truncated again by Apache. See test_core.testRanges. This was worked around in http://www.cherrypy.org/changeset/1319. 2. Apache does not allow custom HTTP methods like CONNECT as per the spec. See test_core.testHTTPMethods. 3. Max request header and body settings do not work with Apache. 4. Apache replaces status "reason phrases" automatically. For example, CherryPy may set "304 Not modified" but Apache will write out "304 Not Modified" (capital "M"). 5. Apache does not allow custom error codes as per the spec. 6. Apache (or perhaps modpython, or modpython_gateway) unquotes %xx in the Request-URI too early. 7. mod_wsgi will not read request bodies which use the "chunked" transfer-coding (it passes REQUEST_CHUNKED_ERROR to ap_setup_client_block instead of REQUEST_CHUNKED_DECHUNK, see Apache2's http_protocol.c and mod_python's requestobject.c). 8. When responding with 204 No Content, mod_wsgi adds a Content-Length header for you. 9. When an error is raised, mod_wsgi has no facility for printing a traceback as the response content (it's sent to the Apache log instead). 10. Startup and shutdown of Apache when running mod_wsgi seems slow. � N)�webtest)�helper� c C sb t �d| |f �\}}z<|�� }t�d|tj�r<td| ��||�� }W |�� n |�� 0 |S )Nz%s %sz'(not recognized|No such file|not found)z%s must be on your system path.) �osZpopen4�readline�re�search� IGNORECASE�IOError�read�close)�cmd�argsZpipeinZpipeout� firstline�output� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cherrypy/test/modwsgi.py�read_process2 s �r �win32Zhttpd�apacheztest_mw.confa� # Apache2 server conf file for testing CherryPy with modpython_gateway. ServerName 127.0.0.1 DocumentRoot "/" Listen %(port)s AllowEncodedSlashes On LoadModule rewrite_module modules/mod_rewrite.so RewriteEngine on RewriteMap escaping int:escape LoadModule log_config_module modules/mod_log_config.so LogFormat "%%h %%l %%u %%t \"%%r\" %%>s %%b \"%%{Referer}i\" \"%%{User-agent}i\"" combined CustomLog "%(curdir)s/apache.access.log" combined ErrorLog "%(curdir)s/apache.error.log" LogLevel debug LoadModule wsgi_module modules/mod_wsgi.so LoadModule env_module modules/mod_env.so WSGIScriptAlias / "%(curdir)s/modwsgi.py" SetEnv testmod %(testmod)s c @ s4 e Zd ZdZdZdZeZdd� Zdd� Z dd� Z d S ) �ModWSGISupervisorz+Server Controller for ModWSGI and CherryPy.Tc C s d| j | jf S )NzModWSGI Server on %s:%s)�host�port��selfr r r �__str__h s zModWSGISupervisor.__str__c C s� t }tj�|�stj�t|�}t|d�}z*| j| j|td� }|� |� W |� � n |� � 0 ttd| �}|rxt |� tjd| jdd� tjd| jd� t�d � d S ) N�wb)r �testmod�curdirz-k start -f %sz 127.0.0.1� )�timeoutz/ihopetheresnodefault)r � )� CONF_PATHr �path�isabs�joinr �open�templater �writer r �APACHE_PATH�print�portendZoccupiedr ZopenURL�time�sleep)r � modulenameZmpconf�fr �resultr r r �startk s$ ��zModWSGISupervisor.startc C s t td� dS )z5Gracefully shutdown a server that is serving forever.z-k stopN)r r) r r r r �stop� s zModWSGISupervisor.stopN)�__name__� __module__�__qualname__�__doc__Zusing_apacheZ using_wsgi�conf_modwsgir'