From a1978d69643acfa7f6d9a57ecaf17351f4fc2955 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 2 Jan 2022 22:06:48 +0200 Subject: [PATCH 1/3] bpo-23952: Document cgi module's maxlen variable --- Lib/cgi.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/cgi.py b/Lib/cgi.py index 6cb8cf28bd6645..1f510d9b680dcd 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -13,6 +13,11 @@ This module defines a number of utilities for use by CGI scripts written in Python. + +The maxlen variable can be set to an integer indicating the maximum size of a +POST request. POST requests larger than this size will result in a ValueError +being raised during parsing. The default value of this variable is 0, meaning +the request size is unlimited. """ # History From c224527c200b012063cace11aefcf35ca23d7cb8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 2 Jan 2022 22:38:26 +0200 Subject: [PATCH 2/3] bpo-23952: Document cgi module's maxlen variable --- Doc/library/cgi.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst index c151f04dfb8d01..f8263654c1b8a0 100644 --- a/Doc/library/cgi.rst +++ b/Doc/library/cgi.rst @@ -21,6 +21,11 @@ Support module for Common Gateway Interface (CGI) scripts. This module defines a number of utilities for use by CGI scripts written in Python. +The ``maxlen`` variable can be set to an integer indicating the maximum size +of a POST request. POST requests larger than this size will result in a +:exc:`ValueError` being raised during parsing. The default value of this +variable is ``0``, meaning the request size is unlimited. + Introduction ------------ From 90442ca1d640fe127c4d1f96678fd6a7022ee8a9 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 2 Jan 2022 23:14:48 +0200 Subject: [PATCH 3/3] bpo-23952: maxlen is a global variable --- Doc/library/cgi.rst | 4 ++-- Lib/cgi.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst index f8263654c1b8a0..a2957ba5a68ad0 100644 --- a/Doc/library/cgi.rst +++ b/Doc/library/cgi.rst @@ -21,8 +21,8 @@ Support module for Common Gateway Interface (CGI) scripts. This module defines a number of utilities for use by CGI scripts written in Python. -The ``maxlen`` variable can be set to an integer indicating the maximum size -of a POST request. POST requests larger than this size will result in a +The global variable ``maxlen`` can be set to an integer indicating the maximum +size of a POST request. POST requests larger than this size will result in a :exc:`ValueError` being raised during parsing. The default value of this variable is ``0``, meaning the request size is unlimited. diff --git a/Lib/cgi.py b/Lib/cgi.py index 1f510d9b680dcd..22897a14a9c122 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -14,10 +14,10 @@ This module defines a number of utilities for use by CGI scripts written in Python. -The maxlen variable can be set to an integer indicating the maximum size of a -POST request. POST requests larger than this size will result in a ValueError -being raised during parsing. The default value of this variable is 0, meaning -the request size is unlimited. +The global variable maxlen can be set to an integer indicating the maximum size +of a POST request. POST requests larger than this size will result in a +ValueError being raised during parsing. The default value of this variable is 0, +meaning the request size is unlimited. """ # History