summaryrefslogtreecommitdiff
path: root/Doc/library/cgi.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/cgi.rst')
-rw-r--r--Doc/library/cgi.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
index 74abed5c55..7e496ca361 100644
--- a/Doc/library/cgi.rst
+++ b/Doc/library/cgi.rst
@@ -157,6 +157,9 @@ return bytes)::
if not line: break
linecount = linecount + 1
+:class:`FieldStorage` objects also support being used in a :keyword:`with`
+statement, which will automatically close them when done.
+
If an error is encountered when obtaining the contents of an uploaded file
(for example, when the user interrupts the form submission by clicking on
a Back or Cancel button) the :attr:`~FieldStorage.done` attribute of the
@@ -182,6 +185,10 @@ A form submitted via POST that also has a query string will contain both
The :attr:`~FieldStorage.file` attribute is automatically closed upon the
garbage collection of the creating :class:`FieldStorage` instance.
+.. versionchanged:: 3.5
+ Added support for the context management protocol to the
+ :class:`FieldStorage` class.
+
Higher Level Interface
----------------------