/usr/share/doc/python-paste-doc/html/modules/lint.html is in python-paste-doc 2.0.3+dfsg-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>paste.lint – Check for the validity of WSGI requests and responses — Paste 1.7.5.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.7.5.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
<link rel="stylesheet" type="text/css"
href="../_static/paste.css.html">
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-paste.lint">
<span id="paste-lint-check-for-the-validity-of-wsgi-requests-and-responses"></span><h1><a class="reference internal" href="#module-paste.lint" title="paste.lint"><code class="xref py py-mod docutils literal"><span class="pre">paste.lint</span></code></a> – Check for the validity of WSGI requests and responses<a class="headerlink" href="#module-paste.lint" title="Permalink to this headline">¶</a></h1>
<p>Middleware to check for obedience to the WSGI specification.</p>
<p>Some of the things this checks:</p>
<ul class="simple">
<li>Signature of the application and start_response (including that
keyword arguments are not used).</li>
<li>Environment checks:<ul>
<li>Environment is a dictionary (and not a subclass).</li>
<li>That all the required keys are in the environment: REQUEST_METHOD,
SERVER_NAME, SERVER_PORT, wsgi.version, wsgi.input, wsgi.errors,
wsgi.multithread, wsgi.multiprocess, wsgi.run_once</li>
<li>That HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH are not in the
environment (these headers should appear as CONTENT_LENGTH and
CONTENT_TYPE).</li>
<li>Warns if QUERY_STRING is missing, as the cgi module acts
unpredictably in that case.</li>
<li>That CGI-style variables (that don’t contain a .) have
(non-unicode) string values</li>
<li>That wsgi.version is a tuple</li>
<li>That wsgi.url_scheme is ‘http’ or ‘https’ (@@: is this too
restrictive?)</li>
<li>Warns if the REQUEST_METHOD is not known (@@: probably too
restrictive).</li>
<li>That SCRIPT_NAME and PATH_INFO are empty or start with /</li>
<li>That at least one of SCRIPT_NAME or PATH_INFO are set.</li>
<li>That CONTENT_LENGTH is a positive integer.</li>
<li>That SCRIPT_NAME is not ‘/’ (it should be ‘’, and PATH_INFO should
be ‘/’).</li>
<li>That wsgi.input has the methods read, readline, readlines, and
__iter__</li>
<li>That wsgi.errors has the methods flush, write, writelines</li>
</ul>
</li>
<li>The status is a string, contains a space, starts with an integer,
and that integer is in range (> 100).</li>
<li>That the headers is a list (not a subclass, not another kind of
sequence).</li>
<li>That the items of the headers are tuples of strings.</li>
<li>That there is no ‘status’ header (that is used in CGI, but not in
WSGI).</li>
<li>That the headers don’t contain newlines or colons, end in _ or -, or
contain characters codes below 037.</li>
<li>That Content-Type is given if there is content (CGI often has a
default content type, but WSGI does not).</li>
<li>That no Content-Type is given when there is no content (@@: is this
too restrictive?)</li>
<li>That the exc_info argument to start_response is a tuple or None.</li>
<li>That all calls to the writer are with strings, and no other methods
on the writer are accessed.</li>
<li>That wsgi.input is used properly:<ul>
<li>.read() is called with zero or one argument</li>
<li>That it returns a string</li>
<li>That readline, readlines, and __iter__ return strings</li>
<li>That .close() is not called</li>
<li>No other methods are provided</li>
</ul>
</li>
<li>That wsgi.errors is used properly:<ul>
<li>.write() and .writelines() is called with a string</li>
<li>That .close() is not called, and no other methods are provided.</li>
</ul>
</li>
<li>The response iterator:<ul>
<li>That it is not a string (it should be a list of a single string; a
string will work, but perform horribly).</li>
<li>That .next() returns a string</li>
<li>That the iterator is not iterated over until start_response has
been called (that can signal either a server or application
error).</li>
<li>That .close() is called (doesn’t raise exception, only prints to
sys.stderr, because we only know it isn’t called when the object
is garbage collected).</li>
</ul>
</li>
</ul>
<div class="section" id="module-contents">
<h2>Module Contents<a class="headerlink" href="#module-contents" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="paste.lint.middleware">
<code class="descclassname">paste.lint.</code><code class="descname">middleware</code><span class="sig-paren">(</span><em>application</em>, <em>global_conf=None</em><span class="sig-paren">)</span><a class="headerlink" href="#paste.lint.middleware" title="Permalink to this definition">¶</a></dt>
<dd><p>When applied between a WSGI server and a WSGI application, this
middleware will check for WSGI compliancy on a number of levels.
This middleware does not modify the request or response in any
way, but will throw an AssertionError if anything seems off
(except for a failure to close the application iterator, which
will be printed to stderr – there’s no way to throw an exception
at that point).</p>
</dd></dl>
<dl class="exception">
<dt id="paste.lint.WSGIWarning">
<em class="property">exception </em><code class="descclassname">paste.lint.</code><code class="descname">WSGIWarning</code><a class="headerlink" href="#paste.lint.WSGIWarning" title="Permalink to this definition">¶</a></dt>
<dd><p>Raised in response to WSGI-spec-related warnings</p>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="http://pythonpaste.org/" class="invisible-link">Python Paste</a></h3>
<ul>
<li><a href="https://bitbucket.org/ianb/pastescript/issues/">Issue tracker</a></li>
<li><a href="http://pythonpaste.org/">Paste core</a></li>
<li><a href="http://webob.org/">WebOb</a></li>
<li><a href="http://pythonpaste.org/deploy/">Paste Deploy</a></li>
<li><a href="http://pythonpaste.org/script/">Paste Script</a></li>
<li><a href="http://webtest.pythonpaste.org/">WebTest</a></li>
<li><a href="http://pythonpaste.org/scripttest/">ScriptType</a></li>
<li><a href="http://pythonpaste.org/initools/">INITools</a></li>
<li><a href="http://pythonpaste.org/tempita/">Tempita</a></li>
<li><a href="http://pythonpaste.org/waitforit/">WaitForIt</a></li>
<li><a href="http://pythonpaste.org/wphp/">WPHP</a></li>
<li><a href="http://pythonpaste.org/wsgifilter/">WSGIFilter</a></li>
<li><a href="http://pythonpaste.org/wsgiproxy/">WSGIProxy</a></li>
</ul>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#"><code class="docutils literal"><span class="pre">paste.lint</span></code> – Check for the validity of WSGI requests and responses</a><ul>
<li><a class="reference internal" href="#module-contents">Module Contents</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/modules/lint.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2017, Ian Bicking.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.5.6</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
|
<a href="../_sources/modules/lint.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>
|