From 529d66a2ac8a86efaf4cc9e04f00b38029127ba5 Mon Sep 17 00:00:00 2001 From: monasco <145488867+monasco@users.noreply.github.com> Date: Tue, 8 Sep 2026 00:13:01 +0200 Subject: [PATCH] Document that max_redirects=0 means no limit (#13659) --- CHANGES/13658.doc.rst | 1 + CONTRIBUTORS.txt | 1 + docs/client_reference.rst | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 CHANGES/13658.doc.rst diff --git a/CHANGES/13658.doc.rst b/CHANGES/13658.doc.rst new file mode 100644 index 00000000000..bea16a444a5 --- /dev/null +++ b/CHANGES/13658.doc.rst @@ -0,0 +1 @@ +Documented that ``max_redirects=0`` means no limit and that ``allow_redirects=False`` disables redirects -- by :user:`monasco`. diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index aa051c80ca1..fec05a6644a 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -295,6 +295,7 @@ Mikhail Nacharov Mingjie Zhao Misha Behersky Mitchell Ferree +monasco Morgan Delahaye-Prat Moss Collum Mun Gwan-gyeong diff --git a/docs/client_reference.rst b/docs/client_reference.rst index 76d3a3334d3..8b5ec33e0ac 100644 --- a/docs/client_reference.rst +++ b/docs/client_reference.rst @@ -478,6 +478,8 @@ The client session supports the context manager protocol for self closing. :param int max_redirects: Maximum number of redirects to follow. :exc:`TooManyRedirects` is raised if the number is exceeded. + ``0`` means no limit, redirects are followed until the request + times out. Use ``allow_redirects=False`` to not follow redirects at all. Ignored when ``allow_redirects=False``. ``10`` by default. @@ -970,6 +972,8 @@ certification chaining. :param int max_redirects: Maximum number of redirects to follow. :exc:`TooManyRedirects` is raised if the number is exceeded. + ``0`` means no limit, redirects are followed until the request + times out. Use ``allow_redirects=False`` to not follow redirects at all. Ignored when ``allow_redirects=False``. ``10`` by default.