Commits

Nozomu Kaneko committed f79a312

add sphinx integration work

Comments (0)

Files changed (2)

+work.diff
+# HG changeset patch
+# User Nozomu Kaneko <nozom.kaneko@gmail.com>
+# Date 1297608911 -32400
+# Node ID 638447c6af64989c9f6e70e8e205e6a150b90f14
+# Parent  a94c348518684ec0e309378734424ef09948aa3c
+integrate with sphinx
+
+diff -r a94c34851868 -r 638447c6af64 index.txt
+--- a/index.txt	Sun Feb 13 23:33:39 2011 +0900
++++ b/index.txt	Sun Feb 13 23:55:11 2011 +0900
+@@ -11,6 +11,9 @@
+ .. toctree::
+    :maxdepth: 1
+ 
++   pep-0333-ja
++   pep-3333-ja
++
+ Indices and tables
+ ==================
+ 
+diff -r a94c34851868 -r 638447c6af64 pep-0333-ja.txt
+--- a/pep-0333-ja.txt	Sun Feb 13 23:33:39 2011 +0900
++++ b/pep-0333-ja.txt	Sun Feb 13 23:55:11 2011 +0900
+@@ -1,26 +1,42 @@
+-PEP: 333
+-Title: Python Web Server Gateway Interface v1.0
+-Version: $Revision:$
+-Last-Modified: $Date:$
+-Author: Phillip J. Eby <pje@telecommunity.com>
+-Discussions-To: Python Web-SIG <web-sig@python.org>
+-Status: Final
+-Type: Informational
+-Content-Type: text/x-rst
+-Created: 07-Dec-2003
+-Post-History: 07-Dec-2003, 08-Aug-2004, 20-Aug-2004, 27-Aug-2004, 27-Sep-2010
+-Replaced-By: 3333
+-
+-
+-Preface
++============================================================
++PEP 333: Python Web Server Gateway Interface v1.0
++============================================================
++
++:PEP: 333
++:Title: Python Web Server Gateway Interface v1.0
++:Version: $Revision:$
++:Last-Modified: $Date:$
++:Author: Phillip J. Eby <pje@telecommunity.com>
++:Discussions-To: Python Web-SIG <web-sig@python.org>
++:Status: Final
++:Type: Informational
++:Content-Type: text/x-rst
++:Created: 07-Dec-2003
++:Post-History: 07-Dec-2003, 08-Aug-2004, 20-Aug-2004, 27-Aug-2004, 27-Sep-2010
++:Replaced-By: 3333
++
++
++.. raw:: html
++
++  <style type="text/css">
++     div.original { color: green; }
++     div.toolbar { margin: 20px 0px; text-align: right; }
++  </style>
++  <div class="toolbar">
++  <a href="javascript:$('div.original').hide()">原文非表示</a> |
++  <a href="javascript:$('div.original').show()">原文表示</a>
++  </div>
++
++.. Preface
++
++序文
+ =======
+ 
+-序文
+-
+-
+-Note: For an updated version of this spec that supports Python 3.x and
+-includes community errata, addenda, and clarifications, please
+-see PEP 3333 instead.
++.. container:: original
++
++   Note: For an updated version of this spec that supports Python 3.x and
++   includes community errata, addenda, and clarifications, please
++   see PEP 3333 instead.
+ 
+ 注意: Python 3.x をサポートし、コミュニティ正誤表、補遺、および明確化を
+ 含むこの仕様のアップデートバージョンについては、代わりに PEP 3333 を見
+@@ -33,9 +49,11 @@
+ はじめに
+ 
+ 
+-This document specifies a proposed standard interface between web
+-servers and Python web applications or frameworks, to promote web
+-application portability across a variety of web servers.
++.. container:: original
++
++   This document specifies a proposed standard interface between web
++   servers and Python web applications or frameworks, to promote web
++   application portability across a variety of web servers.
+ 
+ この文書は、Web サーバーと Python Web アプリケーション/フレームワークの
+ 間の標準インタフェースの詳細を提案するものである。この提案によって、様々
+@@ -45,12 +63,14 @@
+ Rationale and Goals
+ ===================
+ 
+-Python currently boasts a wide variety of web application frameworks,
+-such as Zope, Quixote, Webware, SkunkWeb, PSO, and Twisted Web -- to
+-name just a few [1]_.  This wide variety of choices can be a problem
+-for new Python users, because generally speaking, their choice of web
+-framework will limit their choice of usable web servers, and vice
+-versa.
++.. container:: original
++
++   Python currently boasts a wide variety of web application frameworks,
++   such as Zope, Quixote, Webware, SkunkWeb, PSO, and Twisted Web -- to
++   name just a few [1]_.  This wide variety of choices can be a problem
++   for new Python users, because generally speaking, their choice of web
++   framework will limit their choice of usable web servers, and vice
++   versa.
+ 
+ Python には現在、いくつか例を挙げるだけでも、Zope、Quixote、Webware、
+ SkunkWeb、PSO、Twisted Web といった様々な Web アプリケーション・フレー
+@@ -59,10 +79,12 @@
+ が使用可能な Web サーバーの選択を制限して、逆もまた同様であるからだ。
+ 
+ 
+-By contrast, although Java has just as many web application frameworks
+-available, Java's "servlet" API makes it possible for applications
+-written with any Java web application framework to run in any web
+-server that supports the servlet API.
++.. container:: original
++
++   By contrast, although Java has just as many web application frameworks
++   available, Java's "servlet" API makes it possible for applications
++   written with any Java web application framework to run in any web
++   server that supports the servlet API.
+ 
+ 対照的に、 Java では同様に多くの Web アプリケーション・フレームワークが
+ あるにも関わらず、 Java "servelet" API があることで servelet API をサポー
+@@ -70,13 +92,15 @@
+ ワークで書かれたアプリケーションを動かすことができる。
+ 
+ 
+-The availability and widespread use of such an API in web servers for
+-Python -- whether those servers are written in Python (e.g. Medusa),
+-embed Python (e.g. mod_python), or invoke Python via a gateway
+-protocol (e.g. CGI, FastCGI, etc.) -- would separate choice of
+-framework from choice of web server, freeing users to choose a pairing
+-that suits them, while freeing framework and server developers to
+-focus on their preferred area of specialization.
++.. container:: original
++
++   The availability and widespread use of such an API in web servers for
++   Python -- whether those servers are written in Python (e.g. Medusa),
++   embed Python (e.g. mod_python), or invoke Python via a gateway
++   protocol (e.g. CGI, FastCGI, etc.) -- would separate choice of
++   framework from choice of web server, freeing users to choose a pairing
++   that suits them, while freeing framework and server developers to
++   focus on their preferred area of specialization.
+ 
+ Python においても同様の API が提供され、普及すれば、 Web サーバーが
+ Python で書かれているか (例えば Medusa)、埋め込み Python か (例えば
+@@ -88,19 +112,23 @@
+ るだろう。
+ 
+ 
+-This PEP, therefore, proposes a simple and universal interface between
+-web servers and web applications or frameworks: the Python Web Server
+-Gateway Interface (WSGI).
++.. container:: original
++
++   This PEP, therefore, proposes a simple and universal interface between
++   web servers and web applications or frameworks: the Python Web Server
++   Gateway Interface (WSGI).
+ 
+ そのため、この PEP では Web サーバーと Web アプリケーション/フレームワー
+ クの間の、簡単で汎用的なインタフェースを提案する: Python Web Server
+ Gateway Interface (WSGI) である。
+ 
+ 
+-But the mere existence of a WSGI spec does nothing to address the
+-existing state of servers and frameworks for Python web applications.
+-Server and framework authors and maintainers must actually implement
+-WSGI for there to be any effect.
++.. container:: original
++
++   But the mere existence of a WSGI spec does nothing to address the
++   existing state of servers and frameworks for Python web applications.
++   Server and framework authors and maintainers must actually implement
++   WSGI for there to be any effect.
+ 
+ しかし、 WSGI 仕様があるだけでは、 Python Web アプリケーションのサーバ
+ やフレームワークの現状の問題を解決することにはならない。それが何らかの
+@@ -108,10 +136,12 @@
+ 実際に WSGI を実装する必要がある。
+ 
+ 
+-However, since no existing servers or frameworks support WSGI, there
+-is little immediate reward for an author who implements WSGI support.
+-Thus, WSGI **must** be easy to implement, so that an author's initial
+-investment in the interface can be reasonably low.
++.. container:: original
++
++   However, since no existing servers or frameworks support WSGI, there
++   is little immediate reward for an author who implements WSGI support.
++   Thus, WSGI **must** be easy to implement, so that an author's initial
++   investment in the interface can be reasonably low.
+ 
+ しかしながら、今のところ WSGI をサポートする既存のサーバもフレームワー
+ クも存在しないので、 WSGI サポートを実装する作者に即時の報酬はほとんど
+@@ -119,24 +149,28 @@
+ が簡単でなければならない (**must**) 。
+ 
+ 
+-Thus, simplicity of implementation on *both* the server and framework
+-sides of the interface is absolutely critical to the utility of the
+-WSGI interface, and is therefore the principal criterion for any
+-design decisions.
++.. container:: original
++
++   Thus, simplicity of implementation on *both* the server and framework
++   sides of the interface is absolutely critical to the utility of the
++   WSGI interface, and is therefore the principal criterion for any
++   design decisions.
+ 
+ したがって、サーバとフレームワークの *両方* でインタフェースの実装が簡
+ 単であることが WSGI に関する実用性にとって絶対的に重要であり、そのため、
+ それがあらゆるデザイン決定のための主要な評価基準である。
+ 
+ 
+-Note, however, that simplicity of implementation for a framework
+-author is not the same thing as ease of use for a web application
+-author.  WSGI presents an absolutely "no frills" interface to the
+-framework author, because bells and whistles like response objects and
+-cookie handling would just get in the way of existing frameworks'
+-handling of these issues.  Again, the goal of WSGI is to facilitate
+-easy interconnection of existing servers and applications or
+-frameworks, not to create a new web framework.
++.. container:: original
++
++   Note, however, that simplicity of implementation for a framework
++   author is not the same thing as ease of use for a web application
++   author.  WSGI presents an absolutely "no frills" interface to the
++   framework author, because bells and whistles like response objects and
++   cookie handling would just get in the way of existing frameworks'
++   handling of these issues.  Again, the goal of WSGI is to facilitate
++   easy interconnection of existing servers and applications or
++   frameworks, not to create a new web framework.
+ 
+ しかしながら、フレームワーク作者のための実装の簡単さは、 Web アプリケー
+ ション作者のための使いやすさと同じものではないことに注意すること。
+@@ -148,13 +182,15 @@
+ クを作ることではない。
+ 
+ 
+-Note also that this goal precludes WSGI from requiring anything that
+-is not already available in deployed versions of Python.  Therefore,
+-new standard library modules are not proposed or required by this
+-specification, and nothing in WSGI requires a Python version greater
+-than 2.2.2.  (It would be a good idea, however, for future versions
+-of Python to include support for this interface in web servers
+-provided by the standard library.)
++.. container:: original
++
++   Note also that this goal precludes WSGI from requiring anything that
++   is not already available in deployed versions of Python.  Therefore,
++   new standard library modules are not proposed or required by this
++   specification, and nothing in WSGI requires a Python version greater
++   than 2.2.2.  (It would be a good idea, however, for future versions
++   of Python to include support for this interface in web servers
++   provided by the standard library.)
+ 
+ また、この目標によって WSGI が Python の配布バージョンでまだ利用可能で
+ ない何かを要求することが排除されるということに注意すること。したがって、
+@@ -165,12 +201,14 @@
+ スのサポートを含めるのは良いアイデアだろう。)
+ 
+ 
+-In addition to ease of implementation for existing and future
+-frameworks and servers, it should also be easy to create request
+-preprocessors, response postprocessors, and other WSGI-based
+-"middleware" components that look like an application to their
+-containing server, while acting as a server for their contained
+-applications.
++.. container:: original
++
++   In addition to ease of implementation for existing and future
++   frameworks and servers, it should also be easy to create request
++   preprocessors, response postprocessors, and other WSGI-based
++   "middleware" components that look like an application to their
++   containing server, while acting as a server for their contained
++   applications.
+ 
+ 既存のまたは将来のフレームワークとサーバにとって実装が容易であることに
+ 加えて、リクエストのプリプロセッサやレスポンスのポストプロセッサ、その
+@@ -179,16 +217,18 @@
+ て機能する)を作成するのも簡単であるべきである。
+ 
+ 
+-If middleware can be both simple and robust, and WSGI is widely
+-available in servers and frameworks, it allows for the possibility
+-of an entirely new kind of Python web application framework: one
+-consisting of loosely-coupled WSGI middleware components.  Indeed,
+-existing framework authors may even choose to refactor their
+-frameworks' existing services to be provided in this way, becoming
+-more like libraries used with WSGI, and less like monolithic
+-frameworks.  This would then allow application developers to choose
+-"best-of-breed" components for specific functionality, rather than
+-having to commit to all the pros and cons of a single framework.
++.. container:: original
++
++   If middleware can be both simple and robust, and WSGI is widely
++   available in servers and frameworks, it allows for the possibility
++   of an entirely new kind of Python web application framework: one
++   consisting of loosely-coupled WSGI middleware components.  Indeed,
++   existing framework authors may even choose to refactor their
++   frameworks' existing services to be provided in this way, becoming
++   more like libraries used with WSGI, and less like monolithic
++   frameworks.  This would then allow application developers to choose
++   "best-of-breed" components for specific functionality, rather than
++   having to commit to all the pros and cons of a single framework.
+ 
+ もしミドルウェアが簡単でかつ強健であるなら、そして WSGI がサーバとフレー
+ ムワークで広く利用可能であるなら、完全に新しい種類の Python Web アプリ
+@@ -202,24 +242,28 @@
+ 「最善の組み合わせの」コンポーネントを選ぶようになるだろう。
+ 
+ 
+-Of course, as of this writing, that day is doubtless quite far off.
+-In the meantime, it is a sufficient short-term goal for WSGI to
+-enable the use of any framework with any server.
++.. container:: original
++
++   Of course, as of this writing, that day is doubtless quite far off.
++   In the meantime, it is a sufficient short-term goal for WSGI to
++   enable the use of any framework with any server.
+ 
+ もちろん、これを書いている現在、そのような日は遥か先のことに違いない。
+ 差し当たりは、あらゆるサーバ、あらゆるフレームワークで WSGI が使用でき
+ るようにすることが短期的目標である。
+ 
+ 
+-Finally, it should be mentioned that the current version of WSGI
+-does not prescribe any particular mechanism for "deploying" an
+-application for use with a web server or server gateway.  At the
+-present time, this is necessarily implementation-defined by the
+-server or gateway.  After a sufficient number of servers and
+-frameworks have implemented WSGI to provide field experience with
+-varying deployment requirements, it may make sense to create
+-another PEP, describing a deployment standard for WSGI servers and
+-application frameworks.
++.. container:: original
++
++   Finally, it should be mentioned that the current version of WSGI
++   does not prescribe any particular mechanism for "deploying" an
++   application for use with a web server or server gateway.  At the
++   present time, this is necessarily implementation-defined by the
++   server or gateway.  After a sufficient number of servers and
++   frameworks have implemented WSGI to provide field experience with
++   varying deployment requirements, it may make sense to create
++   another PEP, describing a deployment standard for WSGI servers and
++   application frameworks.
+ 
+ 最後に、現在の WSGI ではアプリケーションを Web サーバーまたはサーバゲー
+ トウェイと共に使用するために「配備する」特定のメカニズムは定めないとい
+@@ -236,16 +280,18 @@
+ 仕様の概要
+ 
+ 
+-The WSGI interface has two sides: the "server" or "gateway" side, and
+-the "application" or "framework" side.  The server side invokes a
+-callable object that is provided by the application side.  The
+-specifics of how that object is provided are up to the server or
+-gateway.  It is assumed that some servers or gateways will require an
+-application's deployer to write a short script to create an instance
+-of the server or gateway, and supply it with the application object.
+-Other servers and gateways may use configuration files or other
+-mechanisms to specify where an application object should be
+-imported from, or otherwise obtained.
++.. container:: original
++
++   The WSGI interface has two sides: the "server" or "gateway" side, and
++   the "application" or "framework" side.  The server side invokes a
++   callable object that is provided by the application side.  The
++   specifics of how that object is provided are up to the server or
++   gateway.  It is assumed that some servers or gateways will require an
++   application's deployer to write a short script to create an instance
++   of the server or gateway, and supply it with the application object.
++   Other servers and gateways may use configuration files or other
++   mechanisms to specify where an application object should be
++   imported from, or otherwise obtained.
+ 
+ WSGI インタフェースには 2 つの側面がある: 「サーバ」または「ゲートウェ
+ イ」サイドと、「アプリケーション」または「フレームワーク」サイド。サー
+@@ -260,12 +306,14 @@
+ るかもしれない。
+ 
+ 
+-In addition to "pure" servers/gateways and applications/frameworks,
+-it is also possible to create "middleware" components that implement
+-both sides of this specification.  Such components act as an
+-application to their containing server, and as a server to a
+-contained application, and can be used to provide extended APIs,
+-content transformation, navigation, and other useful functions.
++.. container:: original
++
++   In addition to "pure" servers/gateways and applications/frameworks,
++   it is also possible to create "middleware" components that implement
++   both sides of this specification.  Such components act as an
++   application to their containing server, and as a server to a
++   contained application, and can be used to provide extended APIs,
++   content transformation, navigation, and other useful functions.
+ 
+ また、「純粋な」サーバ/ゲートウェイとアプリケーション/フレームワークに
+ 加えて、この仕様の両方の側面を実装する「ミドルウェア」コンポーネントを
+@@ -275,14 +323,16 @@
+ 機能を提供するために使用することができる。
+ 
+ 
+-Throughout this specification, we will use the term "a callable" to
+-mean "a function, method, class, or an instance with a ``__call__``
+-method".  It is up to the server, gateway, or application implementing
+-the callable to choose the appropriate implementation technique for
+-their needs.  Conversely, a server, gateway, or application that is
+-invoking a callable **must not** have any dependency on what kind of
+-callable was provided to it.  Callables are only to be called, not
+-introspected upon.
++.. container:: original
++
++   Throughout this specification, we will use the term "a callable" to
++   mean "a function, method, class, or an instance with a ``__call__``
++   method".  It is up to the server, gateway, or application implementing
++   the callable to choose the appropriate implementation technique for
++   their needs.  Conversely, a server, gateway, or application that is
++   invoking a callable **must not** have any dependency on what kind of
++   callable was provided to it.  Callables are only to be called, not
++   introspected upon.
+ 
+ この仕様の全体を通して、 "callable" という用語を、「関数、メソッド、ク
+ ラス、または ``__call__`` メソッドを持つインスタンス」という意味で用い
+@@ -293,19 +343,20 @@
+ callable は呼び出されるためだけに存在し、その中身を調べるものではない。
+ 
+ 
+-The Application/Framework Side
+-------------------------------
++.. The Application/Framework Side
+ 
+ アプリケーション/フレームワークサイド
+-
+-
+-The application object is simply a callable object that accepts
+-two arguments.  The term "object" should not be misconstrued as
+-requiring an actual object instance: a function, method, class,
+-or instance with a ``__call__`` method are all acceptable for
+-use as an application object.  Application objects must be able
+-to be invoked more than once, as virtually all servers/gateways
+-(other than CGI) will make such repeated requests.
++-------------------------------------
++
++.. container:: original
++
++   The application object is simply a callable object that accepts
++   two arguments.  The term "object" should not be misconstrued as
++   requiring an actual object instance: a function, method, class,
++   or instance with a ``__call__`` method are all acceptable for
++   use as an application object.  Application objects must be able
++   to be invoked more than once, as virtually all servers/gateways
++   (other than CGI) will make such repeated requests.
+ 
+ アプリケーションオブジェクトは、単に2つの引数を受け取る callable オブジェ
+ クトである。「オブジェクト」という用語によって、実際のオブジェクトイン
+@@ -316,13 +367,15 @@
+ サーバ/ゲートウェイ (CGI を除く) がそのような繰り返された要求をする。
+ 
+ 
+-(Note: although we refer to it as an "application" object, this
+-should not be construed to mean that application developers will use
+-WSGI as a web programming API!  It is assumed that application
+-developers will continue to use existing, high-level framework
+-services to develop their applications.  WSGI is a tool for
+-framework and server developers, and is not intended to directly
+-support application developers.)
++.. container:: original
++
++   (Note: although we refer to it as an "application" object, this
++   should not be construed to mean that application developers will use
++   WSGI as a web programming API!  It is assumed that application
++   developers will continue to use existing, high-level framework
++   services to develop their applications.  WSGI is a tool for
++   framework and server developers, and is not intended to directly
++   support application developers.)
+ 
+ (注意: ここでは「アプリケーション」オブジェクトと呼んでいるが、アプリケー
+ ション開発者が WSGI を Web プログラミング API として使用するという意味
+@@ -332,12 +385,16 @@
+ あり、直接アプリケーション開発者をサポートすることを意図していない。)
+ 
+ 
+-Here are two example application objects; one is a function, and the
+-other is a class::
++.. container:: original
++
++   Here are two example application objects; one is a function, and the
++   other is a class:
+ 
+ ここに、2 つのアプリケーションオブジェクトの例がある; 1つは関数であり、
+-もう片方がクラスである::
+-
++もう片方がクラスである:
++
++
++.. code-block:: python
+ 
+     def simple_app(environ, start_response):
+         """Simplest possible application object"""
+@@ -379,13 +436,15 @@
+ サーバー/ゲートウェイサイド
+ 
+ 
+-The server or gateway invokes the application callable once for each
+-request it receives from an HTTP client, that is directed at the
+-application.  To illustrate, here is a simple CGI gateway, implemented
+-as a function taking an application object.  Note that this simple
+-example has limited error handling, because by default an uncaught
+-exception will be dumped to ``sys.stderr`` and logged by the web
+-server.
++.. container:: original
++
++   The server or gateway invokes the application callable once for each
++   request it receives from an HTTP client, that is directed at the
++   application.  To illustrate, here is a simple CGI gateway, implemented
++   as a function taking an application object.  Note that this simple
++   example has limited error handling, because by default an uncaught
++   exception will be dumped to ``sys.stderr`` and logged by the web
++   server.
+ 
+ アプリケーションに対して HTTP クライアントから要求があると、サーバやゲー
+ トウェイは、アプリケーション callable を呼び出す。例として、ここではア
+@@ -395,7 +454,7 @@
+ Web サーバーのログに記録される。
+ 
+ 
+-::
++.. code-block:: python
+ 
+     import os, sys
+ 
+@@ -458,16 +517,17 @@
+                 result.close()
+ 
+ 
+-Middleware: Components that Play Both Sides
+--------------------------------------------
++.. Middleware: Components that Play Both Sides
+ 
+ ミドルウェア: 両サイドを演じるコンポーネント
+-
+-
+-Note that a single object may play the role of a server with respect
+-to some application(s), while also acting as an application with
+-respect to some server(s).  Such "middleware" components can perform
+-such functions as:
++--------------------------------------------
++
++.. container:: original
++
++   Note that a single object may play the role of a server with respect
++   to some application(s), while also acting as an application with
++   respect to some server(s).  Such "middleware" components can perform
++   such functions as:
+ 
+ 単一のオブジェクトが何らかのアプリケーションに関してサーバの役割を果た
+ す一方で、何らかのサーバに対してアプリケーションとして機能するかもしれ
+@@ -475,43 +535,45 @@
+ 下のような機能を実行することができる:
+ 
+ 
+-* Routing a request to different application objects based on the
+-  target URL, after rewriting the ``environ`` accordingly.
+-
+-  異なるアプリケーションオブジェクトへの要求を、適宜 ``environ`` を書き
++.. container:: original
++
++   * Routing a request to different application objects based on the
++     target URL, after rewriting the ``environ`` accordingly.
++
++   * Allowing multiple applications or frameworks to run side-by-side
++     in the same process
++
++   * Load balancing and remote processing, by forwarding requests and
++     responses over a network
++
++   * Perform content postprocessing, such as applying XSL stylesheets
++
++
++* 異なるアプリケーションオブジェクトへの要求を、適宜 ``environ`` を書き
+   換えた後で目標 URL に応じてルーティングする
+ 
+-
+-* Allowing multiple applications or frameworks to run side-by-side
+-  in the same process
+-
+-  複数のアプリケーションまたはフレームワークが同じプロセス内で並列に稼
++* 複数のアプリケーションまたはフレームワークが同じプロセス内で並列に稼
+   働できるようにする
+ 
+-
+-* Load balancing and remote processing, by forwarding requests and
+-  responses over a network
+-
+-  リクエストとレスポンスをネットワークの上に転送することによって、負荷
++* リクエストとレスポンスをネットワークの上に転送することによって、負荷
+   バランスとリモート処理を行う
+ 
+-
+-* Perform content postprocessing, such as applying XSL stylesheets
+-
+-  XSL スタイルシートの適用など、コンテンツのポストプロセスを行う
+-
+-
+-The presence of middleware in general is transparent to both the
+-"server/gateway" and the "application/framework" sides of the
+-interface, and should require no special support.  A user who
+-desires to incorporate middleware into an application simply
+-provides the middleware component to the server, as if it were
+-an application, and configures the middleware component to
+-invoke the application, as if the middleware component were a
+-server.  Of course, the "application" that the middleware wraps
+-may in fact be another middleware component wrapping another
+-application, and so on, creating what is referred to as a
+-"middleware stack".
++* XSL スタイルシートの適用など、コンテンツのポストプロセスを行う
++
++
++.. container:: original
++
++   The presence of middleware in general is transparent to both the
++   "server/gateway" and the "application/framework" sides of the
++   interface, and should require no special support.  A user who
++   desires to incorporate middleware into an application simply
++   provides the middleware component to the server, as if it were
++   an application, and configures the middleware component to
++   invoke the application, as if the middleware component were a
++   server.  Of course, the "application" that the middleware wraps
++   may in fact be another middleware component wrapping another
++   application, and so on, creating what is referred to as a
++   "middleware stack".
+ 
+ 一般に、ミドルウェアの存在はインタフェースの「サーバ/ゲートウェイ」サイ
+ ドと「アプリケーション/フレームワーク」サイドの両方に透過的であり、どん
+@@ -525,11 +587,13 @@
+ と呼ばれるものを作成する。
+ 
+ 
+-For the most part, middleware must conform to the restrictions
+-and requirements of both the server and application sides of
+-WSGI.  In some cases, however, requirements for middleware
+-are more stringent than for a "pure" server or application,
+-and these points will be noted in the specification.
++.. container:: original
++
++   For the most part, middleware must conform to the restrictions
++   and requirements of both the server and application sides of
++   WSGI.  In some cases, however, requirements for middleware
++   are more stringent than for a "pure" server or application,
++   and these points will be noted in the specification.
+ 
+ ほとんどの部分で、ミドルウェアは WSGI のサーバとアプリケーションの両サ
+ イドの制限と要件に従わなければならない。しかしながら、いくつかの場合、
+@@ -537,13 +601,15 @@
+ これらのポイントは仕様で述べられる。
+ 
+ 
+-Here is a (tongue-in-cheek) example of a middleware component that
+-converts ``text/plain`` responses to pig latin, using Joe Strout's
+-``piglatin.py``.  (Note: a "real" middleware component would
+-probably use a more robust way of checking the content type, and
+-should also check for a content encoding.  Also, this simple
+-example ignores the possibility that a word might be split across
+-a block boundary.)
++.. container:: original
++
++   Here is a (tongue-in-cheek) example of a middleware component that
++   converts ``text/plain`` responses to pig latin, using Joe Strout's
++   ``piglatin.py``.  (Note: a "real" middleware component would
++   probably use a more robust way of checking the content type, and
++   should also check for a content encoding.  Also, this simple
++   example ignores the possibility that a word might be split across
++   a block boundary.)
+ 
+ これは、 Joe Strout の ``piglatin.py`` を使用して、 ``text/plain`` レス
+ ポンスから偽ラテン語に変換する、 (tongue-in-cheek; 冗談) ミドルウェアコ
+@@ -553,7 +619,7 @@
+ 単語がブロック境界を越えて分割される可能性を無視している。)
+ 
+ 
+-::
++.. code-block:: python
+ 
+     from piglatin import piglatin
+ 
+@@ -631,12 +697,14 @@
+ 仕様の詳細
+ 
+ 
+-The application object must accept two positional arguments.  For
+-the sake of illustration, we have named them ``environ`` and
+-``start_response``, but they are not required to have these names.
+-A server or gateway **must** invoke the application object using
+-positional (not keyword) arguments.  (E.g. by calling
+-``result = application(environ, start_response)`` as shown above.)
++.. container:: original
++
++   The application object must accept two positional arguments.  For
++   the sake of illustration, we have named them ``environ`` and
++   ``start_response``, but they are not required to have these names.
++   A server or gateway **must** invoke the application object using
++   positional (not keyword) arguments.  (E.g. by calling
++   ``result = application(environ, start_response)`` as shown above.)
+ 
+ アプリケーションオブジェクトは2つの固定引数を受け取らなければならない。
+ 説明のためにそれらを ``environ`` と ``start_response`` と名付けるが、こ
+@@ -646,14 +714,16 @@
+ application(environ, start_response)`` のようにして呼び出す)
+ 
+ 
+-The ``environ`` parameter is a dictionary object, containing CGI-style
+-environment variables.  This object **must** be a builtin Python
+-dictionary (*not* a subclass, ``UserDict`` or other dictionary
+-emulation), and the application is allowed to modify the dictionary
+-in any way it desires.  The dictionary must also include certain
+-WSGI-required variables (described in a later section), and may
+-also include server-specific extension variables, named according
+-to a convention that will be described below.
++.. container:: original
++
++   The ``environ`` parameter is a dictionary object, containing CGI-style
++   environment variables.  This object **must** be a builtin Python
++   dictionary (*not* a subclass, ``UserDict`` or other dictionary
++   emulation), and the application is allowed to modify the dictionary
++   in any way it desires.  The dictionary must also include certain
++   WSGI-required variables (described in a later section), and may
++   also include server-specific extension variables, named according
++   to a convention that will be described below.
+ 
+ ``environ`` パラメータは、CGI スタイルの環境変数を含む辞書オブジェクト
+ である。このオブジェクトは、 builtin の Python 辞書でなければならない
+@@ -664,13 +734,15 @@
+ る、サーバ特有の拡張変数を含むことができる。
+ 
+ 
+-The ``start_response`` parameter is a callable accepting two
+-required positional arguments, and one optional argument.  For the sake
+-of illustration, we have named these arguments ``status``,
+-``response_headers``, and ``exc_info``, but they are not required to
+-have these names, and the application **must** invoke the
+-``start_response`` callable using positional arguments (e.g.
+-``start_response(status, response_headers)``).
++.. container:: original
++
++   The ``start_response`` parameter is a callable accepting two
++   required positional arguments, and one optional argument.  For the sake
++   of illustration, we have named these arguments ``status``,
++   ``response_headers``, and ``exc_info``, but they are not required to
++   have these names, and the application **must** invoke the
++   ``start_response`` callable using positional arguments (e.g.
++   ``start_response(status, response_headers)``).
+ 
+ ``start_response`` パラメータは、2つの必須の固定引数、および1つの任意引
+ 数を受け付ける callable である。説明のためにこれらの引数を ``status`` 、
+@@ -680,13 +752,15 @@
+ (**must**) (例えば ``start_response(status, response_headers)``)。
+ 
+ 
+-The ``status`` parameter is a status string of the form
+-``"999 Message here"``, and ``response_headers`` is a list of
+-``(header_name, header_value)`` tuples describing the HTTP response
+-header.  The optional ``exc_info`` parameter is described below in the
+-sections on `The start_response() Callable`_ and `Error Handling`_.
+-It is used only when the application has trapped an error and is
+-attempting to display an error message to the browser.
++.. container:: original
++
++   The ``status`` parameter is a status string of the form
++   ``"999 Message here"``, and ``response_headers`` is a list of
++   ``(header_name, header_value)`` tuples describing the HTTP response
++   header.  The optional ``exc_info`` parameter is described below in the
++   sections on `The start_response() Callable`_ and `Error Handling`_.
++   It is used only when the application has trapped an error and is
++   attempting to display an error message to the browser.
+ 
+ ``status`` パラメータは ``"999 Message here"`` 形式のステータス文字列で
+ あり、 ``response_headers`` は HTTP 応答ヘッダーについて記述する
+@@ -697,13 +771,15 @@
+ セージを表示しようとしたときだけである。
+ 
+ 
+-The ``start_response`` callable must return a ``write(body_data)``
+-callable that takes one positional parameter: a string to be written
+-as part of the HTTP response body.  (Note: the ``write()`` callable is
+-provided only to support certain existing frameworks' imperative output
+-APIs; it should not be used by new applications or frameworks if it
+-can be avoided.  See the `Buffering and Streaming`_ section for more
+-details.)
++.. container:: original
++
++   The ``start_response`` callable must return a ``write(body_data)``
++   callable that takes one positional parameter: a string to be written
++   as part of the HTTP response body.  (Note: the ``write()`` callable is
++   provided only to support certain existing frameworks' imperative output
++   APIs; it should not be used by new applications or frameworks if it
++   can be avoided.  See the `Buffering and Streaming`_ section for more
++   details.)
+ 
+ ``start_response`` callable は、 ``write(body_data)`` callable を返さな
+ ければならない。 ``write`` callable は1つの固定パラメータを取る: HTTP
+@@ -714,13 +790,15 @@
+ 関しては、 `Buffering and Streaming`_ セクションを参照。)
+ 
+ 
+-When called by the server, the application object must return an
+-iterable yielding zero or more strings.  This can be accomplished in a
+-variety of ways, such as by returning a list of strings, or by the
+-application being a generator function that yields strings, or
+-by the application being a class whose instances are iterable.
+-Regardless of how it is accomplished, the application object must
+-always return an iterable yielding zero or more strings.
++.. container:: original
++
++   When called by the server, the application object must return an
++   iterable yielding zero or more strings.  This can be accomplished in a
++   variety of ways, such as by returning a list of strings, or by the
++   application being a generator function that yields strings, or
++   by the application being a class whose instances are iterable.
++   Regardless of how it is accomplished, the application object must
++   always return an iterable yielding zero or more strings.
+ 
+ アプリケーションオブジェクトは、サーバによって呼ばれると、文字列を
+ yield する iterable を返さなければならない。これは、様々な方法で実現す
+@@ -732,12 +810,14 @@
+ なければならない。
+ 
+ 
+-The server or gateway must transmit the yielded strings to the client
+-in an unbuffered fashion, completing the transmission of each string
+-before requesting another one.  (In other words, applications
+-**should** perform their own buffering.  See the `Buffering and
+-Streaming`_ section below for more on how application output must be
+-handled.)
++.. container:: original
++
++   The server or gateway must transmit the yielded strings to the client
++   in an unbuffered fashion, completing the transmission of each string
++   before requesting another one.  (In other words, applications
++   **should** perform their own buffering.  See the `Buffering and
++   Streaming`_ section below for more on how application output must be
++   handled.)
+ 
+ サーバまたはゲートウェイは、yield された文字列を非バッファリング形式で
+ クライアントに伝えなければならない。それぞれの文字列の伝達を、別の 1つ
+@@ -747,14 +827,16 @@
+ Streaming`_ セクションを参照。)
+ 
+ 
+-The server or gateway should treat the yielded strings as binary byte
+-sequences: in particular, it should ensure that line endings are
+-not altered.  The application is responsible for ensuring that the
+-string(s) to be written are in a format suitable for the client.  (The
+-server or gateway **may** apply HTTP transfer encodings, or perform
+-other transformations for the purpose of implementing HTTP features
+-such as byte-range transmission.  See `Other HTTP Features`_, below,
+-for more details.)
++.. container:: original
++
++   The server or gateway should treat the yielded strings as binary byte
++   sequences: in particular, it should ensure that line endings are
++   not altered.  The application is responsible for ensuring that the
++   string(s) to be written are in a format suitable for the client.  (The
++   server or gateway **may** apply HTTP transfer encodings, or perform
++   other transformations for the purpose of implementing HTTP features
++   such as byte-range transmission.  See `Other HTTP Features`_, below,
++   for more details.)
+ 
+ サーバまたはゲートウェイは、yield された文字列をバイナリのバイト列とし
+ て扱うべきである: 特に、行末の文字が変更されないことを保証しなければな
+@@ -765,12 +847,14 @@
+ 関して以下の `Other HTTP Features`_ を参照。)
+ 
+ 
+-If a call to ``len(iterable)`` succeeds, the server must be able
+-to rely on the result being accurate.  That is, if the iterable
+-returned by the application provides a working ``__len__()``
+-method, it **must** return an accurate result.  (See
+-the `Handling the Content-Length Header`_ section for information
+-on how this would normally be used.)
++.. container:: original
++
++   If a call to ``len(iterable)`` succeeds, the server must be able
++   to rely on the result being accurate.  That is, if the iterable
++   returned by the application provides a working ``__len__()``
++   method, it **must** return an accurate result.  (See
++   the `Handling the Content-Length Header`_ section for information
++   on how this would normally be used.)
+ 
+ ``len(iterable)`` に対する呼び出しが成功する場合、サーバはその結果が正
+ 確であることを信頼できなければならない。すなわち、アプリケーションで返
+@@ -780,12 +864,14 @@
+ クションを参照)
+ 
+ 
+-If the iterable returned by the application has a ``close()`` method,
+-the server or gateway **must** call that method upon completion of the
+-current request, whether the request was completed normally, or
+-terminated early due to an error.  (This is to support resource release
+-by the application.  This protocol is intended to complement PEP 325's
+-generator support, and other common iterables with ``close()`` methods.
++.. container:: original
++
++   If the iterable returned by the application has a ``close()`` method,
++   the server or gateway **must** call that method upon completion of the
++   current request, whether the request was completed normally, or
++   terminated early due to an error.  (This is to support resource release
++   by the application.  This protocol is intended to complement PEP 325's
++   generator support, and other common iterables with ``close()`` methods.
+ 
+ もし、アプリケーションで返された iterable が ``close()`` メソッドを持っ
+ ているなら、サーバまたはゲートウェイは、現在のリクエストが完了するとき
+@@ -797,12 +883,14 @@
+ している)
+ 
+ 
+-(Note: the application **must** invoke the ``start_response()``
+-callable before the iterable yields its first body string, so that the
+-server can send the headers before any body content.  However, this
+-invocation **may** be performed by the iterable's first iteration, so
+-servers **must not** assume that ``start_response()`` has been called
+-before they begin iterating over the iterable.)
++.. container:: original
++
++   (Note: the application **must** invoke the ``start_response()``
++   callable before the iterable yields its first body string, so that the
++   server can send the headers before any body content.  However, this
++   invocation **may** be performed by the iterable's first iteration, so
++   servers **must not** assume that ``start_response()`` has been called
++   before they begin iterating over the iterable.)
+ 
+ (Note: アプリケーションは、サーバがあらゆる body content の前にヘッダー
+ を送ることができるように、 iterable が最初の body 文字列を yield する前
+@@ -812,13 +900,15 @@
+ に ``start_response()`` が呼ばれたと仮定してはならない (**must not**)。)
+ 
+ 
+-Finally, servers and gateways **must not** directly use any other
+-attributes of the iterable returned by the application, unless it is an
+-instance of a type specific to that server or gateway, such as a "file
+-wrapper" returned by ``wsgi.file_wrapper`` (see `Optional
+-Platform-Specific File Handling`_).  In the general case, only
+-attributes specified here, or accessed via e.g. the PEP 234 iteration
+-APIs are acceptable.
++.. container:: original
++
++   Finally, servers and gateways **must not** directly use any other
++   attributes of the iterable returned by the application, unless it is an
++   instance of a type specific to that server or gateway, such as a "file
++   wrapper" returned by ``wsgi.file_wrapper`` (see `Optional
++   Platform-Specific File Handling`_).  In the general case, only
++   attributes specified here, or accessed via e.g. the PEP 234 iteration
++   APIs are acceptable.
+ 
+ 最後に、サーバとゲートウェイは、アプリケーションから返された iterable
+ の他のいかなる属性も直接使用してはならない (**must not**)。例外は、
+@@ -835,11 +925,13 @@
+ ``environ`` 変数
+ 
+ 
+-The ``environ`` dictionary is required to contain these CGI
+-environment variables, as defined by the Common Gateway Interface
+-specification [2]_.  The following variables **must** be present,
+-unless their value would be an empty string, in which case they
+-**may** be omitted, except as otherwise noted below.
++.. container:: original
++
++   The ``environ`` dictionary is required to contain these CGI
++   environment variables, as defined by the Common Gateway Interface
++   specification [2]_.  The following variables **must** be present,
++   unless their value would be an empty string, in which case they
++   **may** be omitted, except as otherwise noted below.
+ 
+ ``environ`` 辞書は、Common Gateway Interface 仕様 [2]_ で定義されるよう
+ に、これらの CGI 環境変数を含まなければならない。以下の変数は存在しなけ
+@@ -848,18 +940,24 @@
+ 
+ 
+ ``REQUEST_METHOD``
+-  The HTTP request method, such as ``"GET"`` or ``"POST"``.  This
+-  cannot ever be an empty string, and so is always required.
++
++  .. container:: original
++
++     The HTTP request method, such as ``"GET"`` or ``"POST"``.  This
++     cannot ever be an empty string, and so is always required.
+ 
+   ``"GET"`` または ``"POST"`` などの HTTP リクエストメソッド。これは、
+   決して空の文字列にならないので、常に必須である。
+ 
+ 
+ ``SCRIPT_NAME``
+-  The initial portion of the request URL's "path" that corresponds to
+-  the application object, so that the application knows its virtual
+-  "location".  This **may** be an empty string, if the application
+-  corresponds to the "root" of the server.
++
++  .. container:: original
++
++     The initial portion of the request URL's "path" that corresponds to
++     the application object, so that the application knows its virtual
++     "location".  This **may** be an empty string, if the application
++     corresponds to the "root" of the server.
+ 
+   アプリケーションが仮想的な「位置」を知るための、アプリケーションオブ
+   ジェクトに対応するリクエスト URL の「パス」の最初の部分。アプリケーショ
+@@ -868,10 +966,13 @@
+ 
+ 
+ ``PATH_INFO``
+-  The remainder of the request URL's "path", designating the virtual
+-  "location" of the request's target within the application.  This
+-  **may** be an empty string, if the request URL targets the
+-  application root and does not have a trailing slash.
++
++  .. container:: original
++
++     The remainder of the request URL's "path", designating the virtual
++     "location" of the request's target within the application.  This
++     **may** be an empty string, if the request URL targets the
++     application root and does not have a trailing slash.
+ 
+   アプリケーションの中でのリクエストのターゲットの仮想的な「位置」を指
+   定する、リクエスト URL の「パス」の残りの部分。リクエスト URL がアプ
+@@ -880,36 +981,48 @@
+ 
+ 
+ ``QUERY_STRING``
+-  The portion of the request URL that follows the ``"?"``, if any.
+-  May be empty or absent.
++
++  .. container:: original
++
++     The portion of the request URL that follows the ``"?"``, if any.
++     May be empty or absent.
+ 
+   もしあるならば ``"?"`` に続くリクエスト URL の一部。空であるか、また
+   は存在しないかもしれない。
+ 
+ 
+ ``CONTENT_TYPE``
+-  The contents of any ``Content-Type`` fields in the HTTP request.
+-  May be empty or absent.
++
++  .. container:: original
++
++     The contents of any ``Content-Type`` fields in the HTTP request.
++     May be empty or absent.
+ 
+   HTTP リクエスト中の ``Content-Type`` フィールドの内容。空であるか、または
+   存在しないかもしれない。
+ 
+ 
+ ``CONTENT_LENGTH``
+-  The contents of any ``Content-Length`` fields in the HTTP request.
+-  May be empty or absent.
++
++  .. container:: original
++
++     The contents of any ``Content-Length`` fields in the HTTP request.
++     May be empty or absent.
+ 
+   HTTP リクエスト中の ``Content-Length`` フィールドの内容。空であるか、
+   または存在しないかもしれない。
+ 
+ 
+ ``SERVER_NAME``, ``SERVER_PORT``
+-  When combined with ``SCRIPT_NAME`` and ``PATH_INFO``, these variables
+-  can be used to complete the URL.  Note, however, that ``HTTP_HOST``,
+-  if present, should be used in preference to ``SERVER_NAME`` for
+-  reconstructing the request URL.  See the `URL Reconstruction`_
+-  section below for more detail.  ``SERVER_NAME`` and ``SERVER_PORT``
+-  can never be empty strings, and so are always required.
++
++  .. container:: original
++
++     When combined with ``SCRIPT_NAME`` and ``PATH_INFO``, these variables
++     can be used to complete the URL.  Note, however, that ``HTTP_HOST``,
++     if present, should be used in preference to ``SERVER_NAME`` for
++     reconstructing the request URL.  See the `URL Reconstruction`_
++     section below for more detail.  ``SERVER_NAME`` and ``SERVER_PORT``
++     can never be empty strings, and so are always required.
+ 
+   ``SCRIPT_NAME`` と ``PATH_INFO`` を結合する場合、 URL を完成するのに
+   これらの変数を使用することができる。しかし、もし存在しているなら
+@@ -920,14 +1033,17 @@
+ 
+ 
+ ``SERVER_PROTOCOL``
+-  The version of the protocol the client used to send the request.
+-  Typically this will be something like ``"HTTP/1.0"`` or ``"HTTP/1.1"``
+-  and may be used by the application to determine how to treat any
+-  HTTP request headers.  (This variable should probably be called
+-  ``REQUEST_PROTOCOL``, since it denotes the protocol used in the
+-  request, and is not necessarily the protocol that will be used in the
+-  server's response.  However, for compatibility with CGI we have to
+-  keep the existing name.)
++
++  .. container:: original
++
++     The version of the protocol the client used to send the request.
++     Typically this will be something like ``"HTTP/1.0"`` or ``"HTTP/1.1"``
++     and may be used by the application to determine how to treat any
++     HTTP request headers.  (This variable should probably be called
++     ``REQUEST_PROTOCOL``, since it denotes the protocol used in the
++     request, and is not necessarily the protocol that will be used in the
++     server's response.  However, for compatibility with CGI we have to
++     keep the existing name.)
+ 
+   クライアントがリクエストを送るのに使用したプロトコルのバージョン。通
+   常、これは ``"HTTP/1.0"`` または ``"HTTP/1.1"`` のようになる。そして、
+@@ -940,25 +1056,30 @@
+ 
+ 
+ ``HTTP_`` Variables
+-  Variables corresponding to the client-supplied HTTP request headers
+-  (i.e., variables whose names begin with ``"HTTP_"``).  The presence or
+-  absence of these variables should correspond with the presence or
+-  absence of the appropriate HTTP header in the request.
++
++  .. container:: original
++
++     Variables corresponding to the client-supplied HTTP request headers
++     (i.e., variables whose names begin with ``"HTTP_"``).  The presence or
++     absence of these variables should correspond with the presence or
++     absence of the appropriate HTTP header in the request.
+ 
+   クライアントによって提供された HTTP リクエストヘッダ (すなわち、名前
+   が ``"HTTP"`` で始まる変数) これらの変数が存在するかどうかは、リクエ
+   ストにおいて適切な HTTP ヘッダが存在するかどうかに対応するべきである。
+ 
+ 
+-A server or gateway **should** attempt to provide as many other CGI
+-variables as are applicable.  In addition, if SSL is in use, the server
+-or gateway **should** also provide as many of the Apache SSL environment
+-variables [5]_ as are applicable, such as ``HTTPS=on`` and
+-``SSL_PROTOCOL``.  Note, however, that an application that uses any CGI
+-variables other than the ones listed above are necessarily non-portable
+-to web servers that do not support the relevant extensions.  (For
+-example, web servers that do not publish files will not be able to
+-provide a meaningful ``DOCUMENT_ROOT`` or ``PATH_TRANSLATED``.)
++.. container:: original
++
++   A server or gateway **should** attempt to provide as many other CGI
++   variables as are applicable.  In addition, if SSL is in use, the server
++   or gateway **should** also provide as many of the Apache SSL environment
++   variables [5]_ as are applicable, such as ``HTTPS=on`` and
++   ``SSL_PROTOCOL``.  Note, however, that an application that uses any CGI
++   variables other than the ones listed above are necessarily non-portable
++   to web servers that do not support the relevant extensions.  (For
++   example, web servers that do not publish files will not be able to
++   provide a meaningful ``DOCUMENT_ROOT`` or ``PATH_TRANSLATED``.)
+ 
+ サーバまたはゲートウェイは、他の CGI 変数に関しても適切なものはできるだ
+ け多く提供しようと努力すべきである (**should**)。加えて、SSL が使用中な
+@@ -971,10 +1092,12 @@
+ きないだろう。)
+ 
+ 
+-A WSGI-compliant server or gateway **should** document what variables
+-it provides, along with their definitions as appropriate.  Applications
+-**should** check for the presence of any variables they require, and
+-have a fallback plan in the event such a variable is absent.
++.. container:: original
++
++   A WSGI-compliant server or gateway **should** document what variables
++   it provides, along with their definitions as appropriate.  Applications
++   **should** check for the presence of any variables they require, and
++   have a fallback plan in the event such a variable is absent.
+ 
+ WSGI 対応のサーバまたはゲートウェイは、どんな変数を提供するかをその定義
+ と共に適切に文書化すべきである (**should**)。アプリケーションは、必要と
+@@ -982,11 +1105,13 @@
+ 合の fallback プランを持つべきである (**should**)。
+ 
+ 
+-Note: missing variables (such as ``REMOTE_USER`` when no
+-authentication has occurred) should be left out of the ``environ``
+-dictionary.  Also note that CGI-defined variables must be strings,
+-if they are present at all.  It is a violation of this specification
+-for a CGI variable's value to be of any type other than ``str``.
++.. container:: original
++
++   Note: missing variables (such as ``REMOTE_USER`` when no
++   authentication has occurred) should be left out of the ``environ``
++   dictionary.  Also note that CGI-defined variables must be strings,
++   if they are present at all.  It is a violation of this specification
++   for a CGI variable's value to be of any type other than ``str``.
+ 
+ 注意: 欠けている変数 (認証が行われていない場合の ``REMOTE_USER`` など)
+ は、 ``environ`` 辞書からは除かれるべきである。また、CGI 定義変数は、も
+@@ -994,132 +1119,166 @@
+ ``str`` 以外のどんな型であっても、この仕様に対する違反である。
+ 
+ 
+-In addition to the CGI-defined variables, the ``environ`` dictionary
+-**may** also contain arbitrary operating-system "environment variables",
+-and **must** contain the following WSGI-defined variables:
++.. container:: original
++
++   In addition to the CGI-defined variables, the ``environ`` dictionary
++   **may** also contain arbitrary operating-system "environment variables",
++   and **must** contain the following WSGI-defined variables:
+ 
+ CGI 定義変数に加えて、 ``environ`` 辞書は、任意の OS「環境変数」を含ん
+ でもよい (**may**)。そして、以下の WSGI 定義変数を含まなければならない
+ (**must**):
+ 
+ 
+-=====================  ===============================================
+-Variable               Value
+-=====================  ===============================================
+-
+-``wsgi.version``       The tuple ``(1, 0)``, representing WSGI
+-                       version 1.0.
+-
+-                       WSGI version 1.0 を表す、タプル ``(1, 0)`` 。
+-
+-``wsgi.url_scheme``    A string representing the "scheme" portion of
+-                       the URL at which the application is being
+-                       invoked.  Normally, this will have the value
+-                       ``"http"`` or ``"https"``, as appropriate.
+-
+-                       アプリケーションが呼び出された URL の「スキーム」
+-                       部分を表す文字列。通常これは ``"http"`` または
+-                       ``"https"`` のどちらか適切な値を持つ。
+-
+-``wsgi.input``         An input stream (file-like object) from which
+-                       the HTTP request body can be read.  (The server
+-                       or gateway may perform reads on-demand as
+-                       requested by the application, or it may pre-
+-                       read the client's request body and buffer it
+-                       in-memory or on disk, or use any other
+-                       technique for providing such an input stream,
+-                       according to its preference.)
+-
+-                       HTTP リクエスト本体を読み出すことができる入力ス
+-                       トリーム (file-like オブジェクト)。 (サーバまた
+-                       はゲートウェイは、アプリケーションからの要求に応
+-                       じて読み出しを実行するか、またはクライアントのリ
+-                       クエスト本体を事前に読み出して、メモリまたはディ
+-                       スクの上にそれをバッファリングするか、あるいはそ
+-                       のような入力ストリームを提供するための他のいかな
+-                       るテクニックも、好みに従って使用してもよい。)
+-
+-``wsgi.errors``        An output stream (file-like object) to which
+-                       error output can be written, for the purpose of
+-                       recording program or other errors in a
+-                       standardized and possibly centralized location.
+-                       This should be a "text mode" stream; i.e.,
+-                       applications should use ``"\n"`` as a line
+-                       ending, and assume that it will be converted to
+-                       the correct line ending by the server/gateway.
+-
+-                       エラー出力を書き込むことができる出力ストリーム
+-                       (file-like オブジェクト)。プログラムや他のエラー
+-                       を、標準化された、場合によっては集約された場所に
+-                       記録する目的のために用いられる。これは「テキスト
+-                       モード」ストリームであるべきである; すなわち、ア
+-                       プリケーションは行末端として ``"\n"`` を使用して、
+-                       それがサーバ/ゲートウェイによって正しい行末端に
+-                       変換されると仮定すべきである。
+-
+-
+-                       For many servers, ``wsgi.errors`` will be the
+-                       server's main error log. Alternatively, this
+-                       may be ``sys.stderr``, or a log file of some
+-                       sort.  The server's documentation should
+-                       include an explanation of how to configure this
+-                       or where to find the recorded output.  A server
+-                       or gateway may supply different error streams
+-                       to different applications, if this is desired.
+-
+-                       多くのサーバでは、 ``wsgi.errors`` はサーバ本体
+-                       のエラーログになるだろう。代わりに、これは
+-                       ``sys.stderr`` またはある種のログファイルでもよ
+-                       い。サーバのドキュメンテーションはどのようにこれ
+-                       を設定するか、または記録された出力をどこで見つけ
+-                       られるかに関する説明を含むべきである。サーバまた
+-                       はゲートウェイは、もし望まれているなら、異なった
+-                       アプリケーションに対して異なったエラーストリーム
+-                       を供給してもよい。
+-
+-
+-``wsgi.multithread``   This value should evaluate true if the
+-                       application object may be simultaneously
+-                       invoked by another thread in the same process,
+-                       and should evaluate false otherwise.
+-
+-                       アプリケーションオブジェクトが同じプロセスの中で
+-                       同時に別のスレッドによって呼び出されることがある
+-                       なら、この値は true と評価されるべきであり、そう
+-                       でなければこの値は false と評価されるべきである。
+-
+-``wsgi.multiprocess``  This value should evaluate true if an
+-                       equivalent application object may be
+-                       simultaneously invoked by another process,
+-                       and should evaluate false otherwise.
+-
+-                       等価なアプリケーションオブジェクトが、同時に別の
+-                       プロセスによって呼び出されることがあるなら、この
+-                       値は true と評価されるべきであり、そうでなければ
+-                       false と評価されるべきである。
+-
+-``wsgi.run_once``      This value should evaluate true if the server
+-                       or gateway expects (but does not guarantee!)
+-                       that the application will only be invoked this
+-                       one time during the life of its containing
+-                       process.  Normally, this will only be true for
+-                       a gateway based on CGI (or something similar).
+-
+-                       この値は、サーバまたはゲートウェイが、プロセスの
+-                       寿命の間にアプリケーションが呼び出されるのはこの
+-                       1回だけであると期待する (しかし、保証はしない!)
+-                       場合に、true と評価されるべきである。通常、これ
+-                       は CGI (または同様の何か) に基づくゲートウェイだ
+-                       けで true になるだろう。
+-=====================  ===============================================
+-
+-
+-Finally, the ``environ`` dictionary may also contain server-defined
+-variables.  These variables should be named using only lower-case
+-letters, numbers, dots, and underscores, and should be prefixed with
+-a name that is unique to the defining server or gateway.  For
+-example, ``mod_python`` might define variables with names like
+-``mod_python.some_variable``.
++``wsgi.version``
++
++  .. container:: original
++
++     The tuple ``(1, 0)``, representing WSGI
++     version 1.0.
++
++  WSGI version 1.0 を表す、タプル ``(1, 0)`` 。
++
++
++``wsgi.url_scheme``
++
++  .. container:: original
++
++     A string representing the "scheme" portion of
++     the URL at which the application is being
++     invoked.  Normally, this will have the value
++     ``"http"`` or ``"https"``, as appropriate.
++
++  アプリケーションが呼び出された URL の「スキーム」
++  部分を表す文字列。通常これは ``"http"`` または
++  ``"https"`` のどちらか適切な値を持つ。
++
++
++``wsgi.input``
++
++  .. container:: original
++
++     An input stream (file-like object) from which
++     the HTTP request body can be read.  (The server
++     or gateway may perform reads on-demand as
++     requested by the application, or it may pre-
++     read the client's request body and buffer it
++     in-memory or on disk, or use any other
++     technique for providing such an input stream,
++     according to its preference.)
++
++  HTTP リクエスト本体を読み出すことができる入力ス
++  トリーム (file-like オブジェクト)。 (サーバまた
++  はゲートウェイは、アプリケーションからの要求に応
++  じて読み出しを実行するか、またはクライアントのリ
++  クエスト本体を事前に読み出して、メモリまたはディ
++  スクの上にそれをバッファリングするか、あるいはそ
++  のような入力ストリームを提供するための他のいかな
++  るテクニックも、好みに従って使用してもよい。)
++
++
++``wsgi.errors``
++
++  .. container:: original
++
++     An output stream (file-like object) to which
++     error output can be written, for the purpose of
++     recording program or other errors in a
++     standardized and possibly centralized location.
++     This should be a "text mode" stream; i.e.,
++     applications should use ``"\n"`` as a line
++     ending, and assume that it will be converted to
++     the correct line ending by the server/gateway.
++
++  エラー出力を書き込むことができる出力ストリーム
++  (file-like オブジェクト)。プログラムや他のエラー
++  を、標準化された、場合によっては集約された場所に
++  記録する目的のために用いられる。これは「テキスト
++  モード」ストリームであるべきである; すなわち、ア
++  プリケーションは行末端として ``"\n"`` を使用して、
++  それがサーバ/ゲートウェイによって正しい行末端に
++  変換されると仮定すべきである。
++
++
++  .. container:: original
++
++     For many servers, ``wsgi.errors`` will be the
++     server's main error log. Alternatively, this
++     may be ``sys.stderr``, or a log file of some
++     sort.  The server's documentation should
++     include an explanation of how to configure this
++     or where to find the recorded output.  A server
++     or gateway may supply different error streams
++     to different applications, if this is desired.
++
++  多くのサーバでは、 ``wsgi.errors`` はサーバ本体
++  のエラーログになるだろう。代わりに、これは
++  ``sys.stderr`` またはある種のログファイルでもよ
++  い。サーバのドキュメンテーションはどのようにこれ
++  を設定するか、または記録された出力をどこで見つけ
++  られるかに関する説明を含むべきである。サーバまた
++  はゲートウェイは、もし望まれているなら、異なった
++  アプリケーションに対して異なったエラーストリーム
++  を供給してもよい。
++
++
++``wsgi.multithread``
++
++  .. container:: original
++
++     This value should evaluate true if the
++     application object may be simultaneously
++     invoked by another thread in the same process,
++     and should evaluate false otherwise.
++
++  アプリケーションオブジェクトが同じプロセスの中で
++  同時に別のスレッドによって呼び出されることがある
++  なら、この値は true と評価されるべきであり、そう
++  でなければこの値は false と評価されるべきである。
++
++
++``wsgi.multiprocess``
++
++  .. container:: original
++
++     This value should evaluate true if an
++     equivalent application object may be
++     simultaneously invoked by another process,
++     and should evaluate false otherwise.
++
++  等価なアプリケーションオブジェクトが、同時に別の
++  プロセスによって呼び出されることがあるなら、この
++  値は true と評価されるべきであり、そうでなければ
++  false と評価されるべきである。
++
++
++``wsgi.run_once``
++
++  .. container:: original
++
++     This value should evaluate true if the server
++     or gateway expects (but does not guarantee!)
++     that the application will only be invoked this
++     one time during the life of its containing
++     process.  Normally, this will only be true for
++     a gateway based on CGI (or something similar).
++
++  この値は、サーバまたはゲートウェイが、プロセスの
++  寿命の間にアプリケーションが呼び出されるのはこの
++  1回だけであると期待する (しかし、保証はしない!)
++  場合に、true と評価されるべきである。通常、これ
++  は CGI (または同様の何か) に基づくゲートウェイだ
++  けで true になるだろう。
++
++
++.. container:: original
++
++   Finally, the ``environ`` dictionary may also contain server-defined
++   variables.  These variables should be named using only lower-case
++   letters, numbers, dots, and underscores, and should be prefixed with
++   a name that is unique to the defining server or gateway.  For
++   example, ``mod_python`` might define variables with names like
++   ``mod_python.some_variable``.
+ 
+ 最後に、 ``environ`` 辞書はサーバ定義変数を含んでもよい。これらの変数は、
+ アルファベット小文字、数字、ドット、およびアンダースコアだけを使用して
+@@ -1135,8 +1294,10 @@
+ 入力およびエラーストリーム
+ 
+ 
+-The input and error streams provided by the server must support
+-the following methods:
++.. container:: original
++
++   The input and error streams provided by the server must support
++   the following methods:
+ 
+ サーバによって提供された入力およびエラーストリームは、以下のメソッドを
+ サポートしなければならない:
+@@ -1144,7 +1305,7 @@
+ 
+ ===================  ==========  ========
+ Method               Stream      Notes
+-===================  ==========  ========
++-------------------  ----------  --------
+ ``read(size)``       ``input``   1
+ ``readline()``       ``input``   1, 2
+ ``readlines(hint)``  ``input``   1, 3
+@@ -1155,55 +1316,65 @@
+ ===================  ==========  ========
+ 
+ 
+-The semantics of each method are as documented in the Python Library
+-Reference, except for these notes as listed in the table above:
++.. container:: original
++
++   The semantics of each method are as documented in the Python Library
++   Reference, except for these notes as listed in the table above:
+ 
+ それぞれのメソッドの意味は、上の表にリストアップされている注記を例外と
+ して、Python Library Reference の中で以下のように文書化されている:
+ 
+ 
+-1. The server is not required to read past the client's specified
+-   ``Content-Length``, and is allowed to simulate an end-of-file
+-   condition if the application attempts to read past that point.
+-   The application **should not** attempt to read more data than is
+-   specified by the ``CONTENT_LENGTH`` variable.
+-
+-   サーバは、クライアントの指定した ``Content-Length`` を越えて読み出す
++.. container:: original
++
++   1. The server is not required to read past the client's specified
++      ``Content-Length``, and is allowed to simulate an end-of-file
++      condition if the application attempts to read past that point.
++      The application **should not** attempt to read more data than is
++      specified by the ``CONTENT_LENGTH`` variable.
++
++1. サーバは、クライアントの指定した ``Content-Length`` を越えて読み出す
+    必要はなく、アプリケーションがそのポイントを越えて読み出そうとした場
+    合に、end-of-file 状態をシミュレートすることが許される。アプリケーショ
+    ンは、 ``CONTENT_LENGTH`` 変数によって指定されるより多くのデータを読
+    み出そうとすべきでない (**should not**)。
+ 
+ 
+-2. The optional "size" argument to ``readline()`` is not supported,
+-   as it may be complex for server authors to implement, and is not
+-   often used in practice.
+-
+-   ``readline()`` への任意の「サイズ」引数はサポートされない。なぜなら、
++.. container:: original
++
++   2. The optional "size" argument to ``readline()`` is not supported,
++      as it may be complex for server authors to implement, and is not
++      often used in practice.
++
++2. ``readline()`` への任意の「サイズ」引数はサポートされない。なぜなら、
+    それはサーバ作者が実装するには複雑で、しかも実際にはしばしば使用され
+    ないためだ。
+ 
+ 
+-3. Note that the ``hint`` argument to ``readlines()`` is optional for
+-   both caller and implementer.  The application is free not to
+-   supply it, and the server or gateway is free to ignore it.
+-
+-   ``readlines()`` への ``hint`` 引数は、それを呼ぶ側と実装する側の両方
++.. container:: original
++
++   3. Note that the ``hint`` argument to ``readlines()`` is optional for
++      both caller and implementer.  The application is free not to
++      supply it, and the server or gateway is free to ignore it.
++
++3. ``readlines()`` への ``hint`` 引数は、それを呼ぶ側と実装する側の両方
+    に対して任意であることに注意。アプリケーションがそれを提供しないのは
+    自由であり、そしてサーバまたはゲートウェイは自由にそれを無視すること
+    ができる。
+ 
+ 
+-4. Since the ``errors`` stream may not be rewound, servers and gateways
+-   are free to forward write operations immediately, without buffering.
+-   In this case, the ``flush()`` method may be a no-op.  Portable
+-   applications, however, cannot assume that output is unbuffered
+-   or that ``flush()`` is a no-op.  They must call ``flush()`` if
+-   they need to ensure that output has in fact been written.  (For
+-   example, to minimize intermingling of data from multiple processes
+-   writing to the same error log.)
+-
+-   ``errors`` ストリームは巻き戻されないので、サーバやゲートウェイは書
++.. container:: original
++
++   4. Since the ``errors`` stream may not be rewound, servers and gateways
++      are free to forward write operations immediately, without buffering.
++      In this case, the ``flush()`` method may be a no-op.  Portable
++      applications, however, cannot assume that output is unbuffered
++      or that ``flush()`` is a no-op.  They must call ``flush()`` if
++      they need to ensure that output has in fact been written.  (For
++      example, to minimize intermingling of data from multiple processes
++      writing to the same error log.)
++
++4. ``errors`` ストリームは巻き戻されないので、サーバやゲートウェイは書
+    き込み操作をバッファリングなしで即座に進めることができる。この場合、
+    ``flush()`` メソッドは何もしない (no-op) かもしれない。しかし、移植
+    性のあるアプリケーションでは、出力がバッファリングされないことや、
+@@ -1213,12 +1384,14 @@
+    データの混り合いを最小にするために。)
+ 
+ 
+-The methods listed in the table above **must** be supported by all
+-servers conforming to this specification.  Applications conforming
+-to this specification **must not** use any other methods or attributes
+-of the ``input`` or ``errors`` objects.  In particular, applications
+-**must not** attempt to close these streams, even if they possess
+-``close()`` methods.
++.. container:: original
++
++   The methods listed in the table above **must** be supported by all
++   servers conforming to this specification.  Applications conforming
++   to this specification **must not** use any other methods or attributes
++   of the ``input`` or ``errors`` objects.  In particular, applications
++   **must not** attempt to close these streams, even if they possess
++   ``close()`` methods.
+ 
+ 上の表に記載されたメソッドは、この仕様に従うすべてのサーバでサポートさ
+ れなければならない (**must**)。この仕様に従うアプリケーションは、
+@@ -1231,13 +1404,15 @@
+ The ``start_response()`` Callable
+ ---------------------------------
+ 
+-The second parameter passed to the application object is a callable
+-of the form ``start_response(status, response_headers, exc_info=None)``.
+-(As with all WSGI callables, the arguments must be supplied
+-positionally, not by keyword.)  The ``start_response`` callable is
+-used to begin the HTTP response, and it must return a
+-``write(body_data)`` callable (see the `Buffering and Streaming`_
+-section, below).
++.. container:: original
++
++   The second parameter passed to the application object is a callable
++   of the form ``start_response(status, response_headers, exc_info=None)``.
++   (As with all WSGI callables, the arguments must be supplied
++   positionally, not by keyword.)  The ``start_response`` callable is
++   used to begin the HTTP response, and it must return a
++   ``write(body_data)`` callable (see the `Buffering and Streaming`_
++   section, below).
+ 
+ アプリケーションオブジェクトに渡された 2番目のパラメータは、
+ ``start_response(status, response_headers, exc_info=None)`` 形式の
+@@ -1248,13 +1423,15 @@
+ `Buffering and Streaming`_ セクションを参照)。
+ 
+ 
+-The ``status`` argument is an HTTP "status" string like ``"200 OK"``
+-or ``"404 Not Found"``.  That is, it is a string consisting of a
+-Status-Code and a Reason-Phrase, in that order and separated by a
+-single space, with no surrounding whitespace or other characters.
+-(See RFC 2616, Section 6.1.1 for more information.)  The string
+-**must not** contain control characters, and must not be terminated
+-with a carriage return, linefeed, or combination thereof.
++.. container:: original
++
++   The ``status`` argument is an HTTP "status" string like ``"200 OK"``
++   or ``"404 Not Found"``.  That is, it is a string consisting of a
++   Status-Code and a Reason-Phrase, in that order and separated by a
++   single space, with no surrounding whitespace or other characters.
++   (See RFC 2616, Section 6.1.1 for more information.)  The string
++   **must not** contain control characters, and must not be terminated
++   with a carriage return, linefeed, or combination thereof.
+ 
+ ``status`` 引数は、 ``"200 OK"`` や ``"404 Not Found"`` のような、HTTP
+ 「ステータス」文字列である。すなわち、それは Status-Code と
+@@ -1265,12 +1442,14 @@
+ 終わってはならない。
+ 
+ 
+-The ``response_headers`` argument is a list of ``(header_name,
+-header_value)`` tuples.  It must be a Python list; i.e.
+-``type(response_headers) is ListType``, and the server **may** change
+-its contents in any way it desires.  Each ``header_name`` must be a
+-valid HTTP header field-name (as defined by RFC 2616, Section 4.2),
+-without a trailing colon or other punctuation.
++.. container:: original
++
++   The ``response_headers`` argument is a list of ``(header_name,
++   header_value)`` tuples.  It must be a Python list; i.e.
++   ``type(response_headers) is ListType``, and the server **may** change
++   its contents in any way it desires.  Each ``header_name`` must be a
++   valid HTTP header field-name (as defined by RFC 2616, Section 4.2),
++   without a trailing colon or other punctuation.
+ 
+ ``response_headers`` 引数は、 ``(header_name, header_value)`` タプルの
+ リストである。それは Python リストでなければならない; すなわち、
+@@ -1280,11 +1459,13 @@
+ に) でなければならず、末尾のコロンも他の記号も含まない。
+ 
+ 
+-Each ``header_value`` **must not** include *any* control characters,
+-including carriage returns or linefeeds, either embedded or at the end.
+-(These requirements are to minimize the complexity of any parsing that
+-must be performed by servers, gateways, and intermediate response
+-processors that need to inspect or modify response headers.)
++.. container:: original
++
++   Each ``header_value`` **must not** include *any* control characters,
++   including carriage returns or linefeeds, either embedded or at the end.
++   (These requirements are to minimize the complexity of any parsing that
++   must be performed by servers, gateways, and intermediate response
++   processors that need to inspect or modify response headers.)
+ 
+ それぞれの ``header_value`` は、復帰またはラインフィードを含む *どんな*
+ 制御文字も、埋め込まれているか末尾かどうかに関わらず、含んではならない
+@@ -1293,12 +1474,14 @@
+ サで実行しなければならない構文解析の複雑さを最小にするためである。)
+ 
+ 
+-In general, the server or gateway is responsible for ensuring that
+-correct headers are sent to the client: if the application omits
+-a header required by HTTP (or other relevant specifications that are in
+-effect), the server or gateway **must** add it.  For example, the HTTP
+-``Date:`` and ``Server:`` headers would normally be supplied by the
+-server or gateway.
++.. container:: original
++
++   In general, the server or gateway is responsible for ensuring that
++   correct headers are sent to the client: if the application omits
++   a header required by HTTP (or other relevant specifications that are in
++   effect), the server or gateway **must** add it.  For example, the HTTP
++   ``Date:`` and ``Server:`` headers would normally be supplied by the
++   server or gateway.
+ 
+ 一般に、サーバまたはゲートウェイは、正しいヘッダーが確実にクライアント
+ に送られることに対する責任を負う: もしアプリケーションが HTTP (あるいは
+@@ -1308,24 +1491,28 @@
+ トウェイによって提供されるだろう。
+ 
+ 
+-(A reminder for server/gateway authors: HTTP header names are
+-case-insensitive, so be sure to take that into consideration when
+-examining application-supplied headers!)
++.. container:: original
++
++   (A reminder for server/gateway authors: HTTP header names are
++   case-insensitive, so be sure to take that into consideration when
++   examining application-supplied headers!)
+ 
+ (サーバ/ゲートウェイ作者のためのリマインダー: HTTP ヘッダ名は文字の大小
+ を区別しないので、アプリケーションで供給されたヘッダーを調べるとき、そ
+ れを必ず考慮に入れること!)
+ 
+ 
+-Applications and middleware are forbidden from using HTTP/1.1
+-"hop-by-hop" features or headers, any equivalent features in HTTP/1.0,
+-or any headers that would affect the persistence of the client's
+-connection to the web server.  These features are the
+-exclusive province of the actual web server, and a server or gateway
+-**should** consider it a fatal error for an application to attempt
+-sending them, and raise an error if they are supplied to
+-``start_response()``.  (For more specifics on "hop-by-hop" features and
+-headers, please see the `Other HTTP Features`_ section below.)
++.. container:: original
++
++   Applications and middleware are forbidden from using HTTP/1.1
++   "hop-by-hop" features or headers, any equivalent features in HTTP/1.0,
++   or any headers that would affect the persistence of the client's
++   connection to the web server.  These features are the
++   exclusive province of the actual web server, and a server or gateway
++   **should** consider it a fatal error for an application to attempt
++   sending them, and raise an error if they are supplied to
++   ``start_response()``.  (For more specifics on "hop-by-hop" features and
++   headers, please see the `Other HTTP Features`_ section below.)
+ 
+ アプリケーションとミドルウェアは、HTTP/1.1 の"hop-by-hop"機能またはヘッ
+ ダーや、HTTP/1.0 における同等の機能や、あるいはクライアントから Web サー
+@@ -1338,15 +1525,17 @@
+ を参照。)
+ 
+ 
+-The ``start_response`` callable **must not** actually transmit the
+-response headers.  Instead, it must store them for the server or
+-gateway to transmit **only** after the first iteration of the
+-application return value that yields a non-empty string, or upon
+-the application's first invocation of the ``write()`` callable.  In
+-other words, response headers must not be sent until there is actual
+-body data available, or until the application's returned iterable is
+-exhausted.  (The only possible exception to this rule is if the
+-response headers explicitly include a ``Content-Length`` of zero.)
++.. container:: original
++
++   The ``start_response`` callable **must not** actually transmit the
++   response headers.  Instead, it must store them for the server or
++   gateway to transmit **only** after the first iteration of the
++   application return value that yields a non-empty string, or upon
++   the application's first invocation of the ``write()`` callable.  In
++   other words, response headers must not be sent until there is actual
++   body data available, or until the application's returned iterable is
++   exhausted.  (The only possible exception to this rule is if the
++   response headers explicitly include a ``Content-Length`` of zero.)
+ 
+ ``start_response`` callable は、実際にレスポンスヘッダーを送信してはな
+ らない (**must not**)。代わりに、空でない文字列を yield するアプリケー
+@@ -1359,12 +1548,14 @@
+ ``Content-Length`` を含む場合である。)
+ 
+ 
+-This delaying of response header transmission is to ensure that buffered
+-and asynchronous applications can replace their originally intended
+-output with error output, up until the last possible moment.  For
+-example, the application may need to change the response status from
+-"200 OK" to "500 Internal Error", if an error occurs while the body is
+-being generated within an application buffer.
++.. container:: original
++
++   This delaying of response header transmission is to ensure that buffered
++   and asynchronous applications can replace their originally intended
++   output with error output, up until the last possible moment.  For
++   example, the application may need to change the response status from
++   "200 OK" to "500 Internal Error", if an error occurs while the body is
++   being generated within an application buffer.
+ 
+ レスポンスヘッダー送信のこの遅延は、バッファリングされる非同期なアプリ
+ ケーションが、元々意図された出力をエラー出力に取り替えることが最後の可
+@@ -1374,14 +1565,16 @@
+ 変える必要があるかもしれない。
+ 
+ 
+-The ``exc_info`` argument, if supplied, must be a Python
+-``sys.exc_info()`` tuple.  This argument should be supplied by the
+-application only if ``start_response`` is being called by an error
+-handler.  If ``exc_info`` is supplied, and no HTTP headers have been
+-output yet, ``start_response`` should replace the currently-stored
+-HTTP response headers with the newly-supplied ones, thus allowing the
+-application to "change its mind" about the output when an error has
+-occurred.
++.. container:: original
++
++   The ``exc_info`` argument, if supplied, must be a Python
++   ``sys.exc_info()`` tuple.  This argument should be supplied by the
++   application only if ``start_response`` is being called by an error
++   handler.  If ``exc_info`` is supplied, and no HTTP headers have been
++   output yet, ``start_response`` should replace the currently-stored
++   HTTP response headers with the newly-supplied ones, thus allowing the
++   application to "change its mind" about the output when an error has
++   occurred.
+ 
+ ``exc_info`` 引数は、もし提供されるなら Python の ``sys.exc_info()`` タ
+ プルでなければならない。アプリケーションは、エラーハンドラが
+@@ -1392,26 +1585,32 @@
+ たときにアプリケーションが出力に関して「気が変わる」ことを許容する。
+ 
+ 
+-However, if ``exc_info`` is provided, and the HTTP headers have already
+-been sent, ``start_response`` **must** raise an error, and **should**
+-raise the ``exc_info`` tuple.  That is::
++.. container:: original
++
++   However, if ``exc_info`` is provided, and the HTTP headers have already
++   been sent, ``start_response`` **must** raise an error, and **should**
++   raise the ``exc_info`` tuple.  That is:
+ 
+ しかし、 ``exc_info`` が提供されていて、 HTTP ヘッダが既に送られた後なら、
+ ``start_response`` はエラーを raise しなければならず (**must**)、
+-``exc_info`` タプルを raise すべきである (**should**)。以下のように::
+-
++``exc_info`` タプルを raise すべきである (**should**)。以下のように:
++
++
++.. code-block:: python
+ 
+     raise exc_info[0], exc_info[1], exc_info[2]
+ 
+ 
+-This will re-raise the exception trapped by the application, and in
+-principle should abort the application.  (It is not safe for the
+-application to attempt error output to the browser once the HTTP
+-headers have already been sent.)  The application **must not** trap
+-any exceptions raised by ``start_response``, if it called
+-``start_response`` with ``exc_info``.  Instead, it should allow
+-such exceptions to propagate back to the server or gateway.  See
+-`Error Handling`_ below, for more details.
++.. container:: original
++
++   This will re-raise the exception trapped by the application, and in
++   principle should abort the application.  (It is not safe for the
++   application to attempt error output to the browser once the HTTP
++   headers have already been sent.)  The application **must not** trap
++   any exceptions raised by ``start_response``, if it called
++   ``start_response`` with ``exc_info``.  Instead, it should allow
++   such exceptions to propagate back to the server or gateway.  See
++   `Error Handling`_ below, for more details.
+ 
+ これは、アプリケーションで捕捉された例外を再び送出する。そして原則とし
+ てアプリケーションを中止させるべきである。 (いったん HTTP ヘッダが送ら
+@@ -1423,12 +1622,14 @@
+ Handling`_ を参照。
+ 
+ 
+-The application **may** call ``start_response`` more than once, if and
+-only if the ``exc_info`` argument is provided.  More precisely, it is
+-a fatal error to call ``start_response`` without the ``exc_info``
+-argument if ``start_response`` has already been called within the
+-current invocation of the application.  (See the example CGI
+-gateway above for an illustration of the correct logic.)
++.. container:: original
++
++   The application **may** call ``start_response`` more than once, if and
++   only if the ``exc_info`` argument is provided.  More precisely, it is
++   a fatal error to call ``start_response`` without the ``exc_info``
++   argument if ``start_response`` has already been called within the
++   current invocation of the application.  (See the example CGI
++   gateway above for an illustration of the correct logic.)
+ 
+ アプリケーションは、 ``exc_info`` 引数が提供される場合にだけ、
+ ``start_response`` を複数回呼んでもよい (**may**)。より正確には、アプリ
+@@ -1437,18 +1638,22 @@
+ る。 (正しい論理の例証のために、上の CGI ゲートウェイの例を参照。)
+ 
+ 
+-Note: servers, gateways, or middleware implementing ``start_response``
+-**should** ensure that no reference is held to the ``exc_info``
+-parameter beyond the duration of the function's execution, to avoid
+-creating a circular reference through the traceback and frames
+-involved.  The simplest way to do this is something like::
++.. container:: original
++
++   Note: servers, gateways, or middleware implementing ``start_response``
++   **should** ensure that no reference is held to the ``exc_info``
++   parameter beyond the duration of the function's execution, to avoid
++   creating a circular reference through the traceback and frames
++   involved.  The simplest way to do this is something like:
+ 
+ 注意: ``start_response`` を実装するサーバ、ゲートウェイ、またはミドルウェ
+ アは、関係するトレースバックとフレームを通して循環参照を作成するのを避
+ けるために、関数の実行の持続時間を超えて ``exc_info`` パラメータへの参
+ 照を保持しないことを確実にすべきである (**should**)。これを行う最も簡単
+-な方法は以下のようになる::
+-
++な方法は以下のようになる:
++
++
++.. code-block:: python
+ 
+     def start_response(status, response_headers, exc_info=None):
+         if exc_info:
+@@ -1458,8 +1663,10 @@
+                  exc_info = None    # Avoid circular ref.
+ 
+ 
+-The example CGI gateway provides another illustration of this
+-technique.
++.. container:: original
++
++   The example CGI gateway provides another illustration of this
++   technique.
+ 
+ 例の CGI ゲートウェイはこのテクニックの別の例を提供する。
+ 
+@@ -1470,10 +1677,12 @@
+ ``Content-Length`` ヘッダーの扱い
+ 
+ 
+-If the application does not supply a ``Content-Length`` header, a
+-server or gateway may choose one of several approaches to handling
+-it.  The simplest of these is to close the client connection when
+-the response is completed.
++.. container:: original
++
++   If the application does not supply a ``Content-Length`` header, a
++   server or gateway may choose one of several approaches to handling
++   it.  The simplest of these is to close the client connection when
++   the response is completed.
+ 
+ アプリケーションが ``Content-Length`` ヘッダーを提供しないなら、サーバ
+ またはゲートウェイは、それを扱うためにいくつかのアプローチの 1つを選ん
+@@ -1481,13 +1690,15 @@
+ 閉じることである。
+ 
+ 
+-Under some circumstances, however, the server or gateway may be
+-able to either generate a ``Content-Length`` header, or at least
+-avoid the need to close the client connection.  If the application
+-does *not* call the ``write()`` callable, and returns an iterable
+-whose ``len()`` is 1, then the server can automatically determine
+-``Content-Length`` by taking the length of the first string yielded
+-by the iterable.
++.. container:: original
++
++   Under some circumstances, however, the server or gateway may be
++   able to either generate a ``Content-Length`` header, or at least
++   avoid the need to close the client connection.  If the application
++   does *not* call the ``write()`` callable, and returns an iterable
++   whose ``len()`` is 1, then the server can automatically determine
++   ``Content-Length`` by taking the length of the first string yielded
++   by the iterable.
+ 
+ しかしながら、いくつかの状況では、サーバまたはゲートウェイが
+ ``Content-Length`` ヘッダーを生成するか、または少なくともクライアント接
+@@ -1498,14 +1709,16 @@
+ とができる。
+ 
+ 
+-And, if the server and client both support HTTP/1.1 "chunked
+-encoding" [3]_, then the server **may** use chunked encoding to send
+-a chunk for each ``write()`` call or string yielded by the iterable,
+-thus generating a ``Content-Length`` header for each chunk.  This
+-allows the server to keep the client connection alive, if it wishes
+-to do so.  Note that the server **must** comply fully with RFC 2616
+-when doing this, or else fall back to one of the other strategies for
+-dealing with the absence of ``Content-Length``.
++.. container:: original
++
++   And, if the server and client both support HTTP/1.1 "chunked
++   encoding" [3]_, then the server **may** use chunked encoding to send
++   a chunk for each ``write()`` call or string yielded by the iterable,
++   thus generating a ``Content-Length`` header for each chunk.  This
++   allows the server to keep the client connection alive, if it wishes
++   to do so.  Note that the server **must** comply fully with RFC 2616
++   when doing this, or else fall back to one of the other strategies for
++   dealing with the absence of ``Content-Length``.
+ 
+ そして、サーバとクライアントがともに HTTP/1.1 "chunked encoding" [3]_ をサポー
+ トするなら、サーバは各 ``write()`` の呼び出しまたは iterable によって
+@@ -1517,11 +1730,13 @@
+ ことに対処するための他の戦略の 1 つに fall back すること。
+ 
+ 
+-(Note: applications and middleware **must not** apply any kind of
+-``Transfer-Encoding`` to their output, such as chunking or gzipping;
+-as "hop-by-hop" operations, these encodings are the province of the
+-actual web server/gateway.  See `Other HTTP Features`_ below, for
+-more details.)
++.. container:: original
++
++   (Note: applications and middleware **must not** apply any kind of
++   ``Transfer-Encoding`` to their output, such as chunking or gzipping;
++   as "hop-by-hop" operations, these encodings are the province of the
++   actual web server/gateway.  See `Other HTTP Features`_ below, for
++   more details.)
+ 
+ (注意: アプリケーションおよびミドルウェアは、出力に chunking や
+ gzipping などのどんな種類の ``Transfer-Encoding`` も適用してはならない
+@@ -1536,11 +1751,13 @@
+ バッファリングとストリーミング
+ 
+ 
+-Generally speaking, applications will achieve the best throughput
+-by buffering their (modestly-sized) output and sending it all at
+-once.  This is a common approach in existing frameworks such as
+-Zope: the output is buffered in a StringIO or similar object, then
+-transmitted all at once, along with the response headers.
++.. container:: original
++
++   Generally speaking, applications will achieve the best throughput
++   by buffering their (modestly-sized) output and sending it all at
++   once.  This is a common approach in existing frameworks such as
++   Zope: the output is buffered in a StringIO or similar object, then
++   transmitted all at once, along with the response headers.
+ 
+ 一般的に、アプリケーションは、自身の (適切なサイズの) 出力をバッファリ
+ ングして、それを一気に送ることによって、最も良い効率を実現するだろう。
+@@ -1549,11 +1766,13 @@
+ と共に一気に送信される。
+ 
+ 
+-The corresponding approach in WSGI is for the application to simply
+-return a single-element iterable (such as a list) containing the
+-response body as a single string.  This is the recommended approach
+-for the vast majority of application functions, that render
+-HTML pages whose text easily fits in memory.
++.. container:: original
++
++   The corresponding approach in WSGI is for the application to simply
++   return a single-element iterable (such as a list) containing the
++   response body as a single string.  This is the recommended approach
++   for the vast majority of application functions, that render
++   HTML pages whose text easily fits in memory.
+ 
+ WSGI における対応するアプローチは、アプリケーションが単に、単一の文字列
+ としてレスポンス本体を含む、ただ 1つの要素の iterable (リストなど) を返
+@@ -1562,12 +1781,14 @@
+ プローチである。
+ 
+ 
+-For large files, however, or for specialized uses of HTTP streaming
+-(such as multipart "server push"), an application may need to provide
+-output in smaller blocks (e.g. to avoid loading a large file into
+-memory).  It's also sometimes the case that part of a response may
+-be time-consuming to produce, but it would be useful to send ahead the
+-portion of the response that precedes it.
++.. container:: original
++
++   For large files, however, or for specialized uses of HTTP streaming
++   (such as multipart "server push"), an application may need to provide
++   output in smaller blocks (e.g. to avoid loading a large file into
++   memory).  It's also sometimes the case that part of a response may
++   be time-consuming to produce, but it would be useful to send ahead the
++   portion of the response that precedes it.
+ 
+ しかしながら、大きいファイル、または HTTP ストリーミングの特殊な用途
+ (複合「サーバプッシュ」など) のために、アプリケーションは出力をより小さ
+@@ -1577,11 +1798,13 @@
+ ことは役に立つだろう。
+ 
+ 
+-In these cases, applications will usually return an iterator (often
+-a generator-iterator) that produces the output in a block-by-block
+-fashion.  These blocks may be broken to coincide with mulitpart
+-boundaries (for "server push"), or just before time-consuming
+-tasks (such as reading another block of an on-disk file).
++.. container:: original
++
++   In these cases, applications will usually return an iterator (often
++   a generator-iterator) that produces the output in a block-by-block
++   fashion.  These blocks may be broken to coincide with mulitpart
++   boundaries (for "server push"), or just before time-consuming
++   tasks (such as reading another block of an on-disk file).
+ 
+ これらの場合では、通常、アプリケーションはブロックごとの様式で出力を生
+ 成するイテレータ (しばしばジェネレータ・イテレータ) を返すだろう。これ
+@@ -1590,12 +1813,14 @@
+ ぐ前で分割が起こるかもしれない。
+ 
+ 
+-WSGI servers, gateways, and middleware **must not** delay the
+-transmission of any block; they **must** either fully transmit
+-the block to the client, or guarantee that they will continue
+-transmission even while the application is producing its next block.
+-A server/gateway or middleware may provide this guarantee in one of
+-three ways:
++.. container:: original
++
++   WSGI servers, gateways, and middleware **must not** delay the
++   transmission of any block; they **must** either fully transmit
++   the block to the client, or guarantee that they will continue
++   transmission even while the application is producing its next block.
++   A server/gateway or middleware may provide this guarantee in one of
++   three ways:
+ 
+ WSGI サーバ、ゲートウェイ、およびミドルウェアは、どんなブロックの送信も
+ 遅延してはならない (**must not**); ブロックをクライアントに完全に伝える
+@@ -1605,33 +1830,41 @@
+ きる:
+ 
+ 
+-1. Send the entire block to the operating system (and request
+-   that any O/S buffers be flushed) before returning control
+-   to the application, OR
+-
+-   制御をアプリケーションに返す前に、ブロック全体を OS に送る (そして、
++.. container:: original
++
++   1. Send the entire block to the operating system (and request
++      that any O/S buffers be flushed) before returning control
++      to the application, OR
++
++1. 制御をアプリケーションに返す前に、ブロック全体を OS に送る (そして、
+    あらゆる OS バッファが flush されることを要求する)。
+ 
+ 
+-2. Use a different thread to ensure that the block continues
+-   to be transmitted while the application produces the next
+-   block.
+-
+-   別のスレッドを使用して、アプリケーションが次のブロックを作り出してい
++.. container:: original
++
++   2. Use a different thread to ensure that the block continues
++      to be transmitted while the application produces the next
++      block.
++
++2. 別のスレッドを使用して、アプリケーションが次のブロックを作り出してい
+    る間もブロックの送信が続けられることを保証する。
+ 
+ 
+-3. (Middleware only) send the entire block to its parent
+-   gateway/server
+-
+-   (ミドルウェアのみ) ブロック全体を、親のゲートウェイまたはサーバに送る
+-
+-
+-By providing this guarantee, WSGI allows applications to ensure
+-that transmission will not become stalled at an arbitrary point
+-in their output data.  This is critical for proper functioning
+-of e.g. multipart "server push" streaming, where data between
+-multipart boundaries should be transmitted in full to the client.
++.. container:: original
++
++   3. (Middleware only) send the entire block to its parent
++      gateway/server
++
++3. (ミドルウェアのみ) ブロック全体を、親のゲートウェイまたはサーバに送る
++
++
++.. container:: original
++
++   By providing this guarantee, WSGI allows applications to ensure
++   that transmission will not become stalled at an arbitrary point
++   in their output data.  This is critical for proper functioning
++   of e.g. multipart "server push" streaming, where data between
++   multipart boundaries should be transmitted in full to the client.
+ 
+ この保証を提供することによって、WSGI は送信が出力データの任意のポイント
+ で中断しないことをアプリケーションが保証することを可能にする。適切な機
+@@ -1646,11 +1879,13 @@
+ ブロック境界を扱うミドルウェア
+ 
+ 
+-In order to better support asynchronous applications and servers,
+-middleware components **must not** block iteration waiting for
+-multiple values from an application iterable.  If the middleware
+-needs to accumulate more data from the application before it can
+-produce any output, it **must** yield an empty string.
++.. container:: original
++
++   In order to better support asynchronous applications and servers,
++   middleware components **must not** block iteration waiting for
++   multiple values from an application iterable.  If the middleware
++   needs to accumulate more data from the application before it can
++   produce any output, it **must** yield an empty string.
+ 
+ 非同期のアプリケーションおよびサーバのより良いサポートのために、ミドル
+ ウェアコンポーネントはアプリケーション iterable から複数の値を待ってい
+@@ -1660,10 +1895,12 @@
+ (**must**)。
+ 
+ 
+-To put this requirement another way, a middleware component **must
+-yield at least one value** each time its underlying application
+-yields a value.  If the middleware cannot yield any other value,
+-it must yield an empty string.
++.. container:: original
++
++   To put this requirement another way, a middleware component **must
++   yield at least one value** each time its underlying application
++   yields a value.  If the middleware cannot yield any other value,
++   it must yield an empty string.
+ 
+ この要件を言い換えれば、ミドルウェアコンポーネントは内包するアプリケー
+ ションが値を yield する毎に **少なくとも 1つの値を yield しなければなら
+@@ -1671,23 +1908,27 @@
+ 列をyield しなければならない。
+ 
+ 
+-This requirement ensures that asynchronous applications and servers
+-can conspire to reduce the number of threads that are required
+-to run a given number of application instances simultaneously.
++.. container:: original
++
++   This requirement ensures that asynchronous applications and servers
++   can conspire to reduce the number of threads that are required
++   to run a given number of application instances simultaneously.
+ 
+ この要件は、非同期なアプリケーションとサーバが協力して、与えられた数の
+ アプリケーションインスタンスを同時に実行するのに必要なスレッドの数を減
+ らすことができることを保証する。
+ 
+ 
+-Note also that this requirement means that middleware **must**
+-return an iterable as soon as its underlying application returns
+-an iterable.  It is also forbidden for middleware to use the
+-``write()`` callable to transmit data that is yielded by an
+-underlying application.  Middleware may only use their parent
+-server's ``write()`` callable to transmit data that the
+-underlying application sent using a middleware-provided ``write()``
+-callable.