From 5acbc64a9e9d8f9bfe628246bf7eb5a0b9d22d16 Mon Sep 17 00:00:00 2001 From: Bernhard Wagner Date: Wed, 29 Mar 2023 16:30:52 +0200 Subject: [PATCH 1/8] FIXES: documentation of read, Parameter amt https://discuss.python.org/t/wrong-parameter-name-in-http-client-read-documentation-amt-vs-n/25284/3?u=bwagner --- Lib/http/client.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Lib/http/client.py b/Lib/http/client.py index 15c5cf634cf508..7e3b005c06a285 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -448,6 +448,22 @@ def isclosed(self): return self.fp is None def read(self, amt=None): + '''Read and return up to amt bytes. + + If the argument is omitted, None, or negative, reads and + returns all data until EOF. + + If the argument is positive, and the underlying raw stream is + not 'interactive', multiple raw reads may be issued to satisfy + the byte count (unless EOF is reached first). But for + interactive raw streams (as well as sockets and pipes), at most + one raw read will be issued, and a short result does not imply + that EOF is imminent. + + Returns an empty bytes object on EOF. + + Returns None if the underlying raw stream was open in non-blocking + mode and no data is available at the moment.''' if self.fp is None: return b"" From 4a0c2f34e7075d1b7bb6c6d39fdeb7cc676522b0 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 14:51:40 +0000 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst diff --git a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst new file mode 100644 index 00000000000000..5d32416ec1e0a8 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst @@ -0,0 +1 @@ +documentation of http.client.HTTPResponse.read, Parameter amt fixed. From 43948c8c6d3a967a12f0f3b0ff13d6500aba133f Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 29 Mar 2023 13:02:10 -0400 Subject: [PATCH 3/8] Update Lib/http/client.py --- Lib/http/client.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Lib/http/client.py b/Lib/http/client.py index 7e3b005c06a285..dc3122d8eed414 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -448,22 +448,7 @@ def isclosed(self): return self.fp is None def read(self, amt=None): - '''Read and return up to amt bytes. - - If the argument is omitted, None, or negative, reads and - returns all data until EOF. - - If the argument is positive, and the underlying raw stream is - not 'interactive', multiple raw reads may be issued to satisfy - the byte count (unless EOF is reached first). But for - interactive raw streams (as well as sockets and pipes), at most - one raw read will be issued, and a short result does not imply - that EOF is imminent. - - Returns an empty bytes object on EOF. - - Returns None if the underlying raw stream was open in non-blocking - mode and no data is available at the moment.''' + """ Read and return the response body, or up to the next amt bytes.""" if self.fp is None: return b"" From 264e89fe5168a73ecc2bd6023ffd14b4c5eb6931 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 29 Mar 2023 13:04:49 -0400 Subject: [PATCH 4/8] Update Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst --- .../2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst index 5d32416ec1e0a8..094bfb1f4f72f8 100644 --- a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst +++ b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst @@ -1 +1 @@ -documentation of http.client.HTTPResponse.read, Parameter amt fixed. +Add http.client.HTTPResponse.read docstring and fix help output. From 34b17ef728cd64e53def3753c3257645f53e6344 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 29 Mar 2023 13:07:30 -0400 Subject: [PATCH 5/8] Update Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst --- .../2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst index 094bfb1f4f72f8..c034cb533711c6 100644 --- a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst +++ b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst @@ -1 +1 @@ -Add http.client.HTTPResponse.read docstring and fix help output. +Add http.client.HTTPResponse.read docstring and fix pydoc output. From e458c0a1bee53ca6e01e171eaf2a7b6d0bf570a6 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 29 Mar 2023 13:21:24 -0400 Subject: [PATCH 6/8] Update Lib/http/client.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric --- Lib/http/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/http/client.py b/Lib/http/client.py index dc3122d8eed414..bd55e7d239af0c 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -448,7 +448,7 @@ def isclosed(self): return self.fp is None def read(self, amt=None): - """ Read and return the response body, or up to the next amt bytes.""" + """Read and return the response body, or up to the next amt bytes.""" if self.fp is None: return b"" From 496de75f15b1fc656c972199b589d8a3823028ec Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 29 Mar 2023 13:22:05 -0400 Subject: [PATCH 7/8] Update Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric --- .../2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst index c034cb533711c6..4458a4a5a814ae 100644 --- a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst +++ b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst @@ -1 +1 @@ -Add http.client.HTTPResponse.read docstring and fix pydoc output. +Add docstring to :meth:`http.client.HTTPResponse.read` to fix :cmd:`pydoc` output. From 8bd94e3df2bd4aeb001dbbe4c19478b43d48db94 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 29 Mar 2023 14:01:40 -0400 Subject: [PATCH 8/8] Update Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst --- .../2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst index 4458a4a5a814ae..babc8150966117 100644 --- a/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst +++ b/Misc/NEWS.d/next/Documentation/2023-03-29-14-51-39.gh-issue-103112.XgGSEO.rst @@ -1 +1 @@ -Add docstring to :meth:`http.client.HTTPResponse.read` to fix :cmd:`pydoc` output. +Add docstring to :meth:`http.client.HTTPResponse.read` to fix ``pydoc`` output.