#1135502 mongo-c-driver: FTBFS: exception: 'DirectoryHTMLBuilder' object has no attribute 'script_files'

Package:
src:mongo-c-driver
Source:
src:mongo-c-driver
Submitter:
Santiago Vila
Date:
2026-06-03 18:37:01 UTC
Severity:
normal
Tags:
#1135502#5
Date:
2026-05-01 23:29:22 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202605/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:mongo-c-driver, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
 debian/rules clean
dh clean
   debian/rules override_dh_auto_clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
rm -f VERSION_CURRENT
dh_auto_clean
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_clean
 debian/rules binary
dh binary
   dh_update_autotools_config
   dh_autoreconf
   debian/rules override_dh_auto_configure
make[1]: Entering directory '/<<PKGBUILDDIR>>'
[ "ON" = "ON" ] || echo "arch-only build; not building documentation"
echo 2.3.0 > VERSION_CURRENT
dh_auto_configure -- \
-DENABLE_MONGOC=ON \
-DENABLE_MAN_PAGES=ON \
-DENABLE_HTML_DOCS=ON \
-DENABLE_MAINTAINER_FLAGS=ON \
-DENABLE_TESTS=OFF \
-DENABLE_ZLIB=SYSTEM \
-DUSE_BUNDLED_UTF8PROC=OFF
	cd obj-x86_64-linux-gnu && DEB_PYTHON_INSTALL_LAYOUT=deb PKG_CONFIG=/usr/bin/pkg-config cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DENABLE_MONGOC=ON -DENABLE_MAN_PAGES=ON -DENABLE_HTML_DOCS=ON -DENABLE_MAINTAINER_FLAGS=ON -DENABLE_TESTS=OFF -DENABLE_ZLIB=SYSTEM -DUSE_BUNDLED_UTF8PROC=OFF ..
-- The C compiler identification is GNU 15.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for a CXX compiler
-- Looking for a CXX compiler - /usr/bin/c++
-- The CXX compiler identification is GNU 15.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_LLD_LINKER_SUPPORT
-- Performing Test HAVE_LLD_LINKER_SUPPORT - Failed
-- Found Python3: /usr/bin/python3 (found version "3.13.12") found components: Interpreter
-- Using bundled libbson
-- Looking for snprintf
-- Looking for snprintf - found
-- Performing Test BSON_HAVE_TIMESPEC
-- Performing Test BSON_HAVE_TIMESPEC - Success
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for rand_r
-- Looking for rand_r - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for strlcpy
-- Looking for strlcpy - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for aligned_alloc
-- Looking for aligned_alloc - not found
-- Found Sphinx: /usr/bin/sphinx-build
-- Looking for sched_getcpu
-- Looking for sched_getcpu - not found
-- libmongoc version (from VERSION_CURRENT file): 2.3.0
-- Searching for zlib CMake packages
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3.2")
--    zlib found version "1.3.2"
--    zlib include path "/usr/include"
--    zlib libraries "/usr/lib/x86_64-linux-gnu/libz.so"
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Searching for compression library zstd
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.5.1")
-- Checking for module 'libzstd'
--   Found libzstd, version 1.5.7
--   Found zstd version 1.5.7 in /usr/include
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "3.6.2")
-- libmongoc TLS : OpenSSL
-- Looking for ASN1_STRING_get0_data
-- Looking for ASN1_STRING_get0_data - found
-- Found SASL2: 2.1.28 (found suitable version "2.1.28", minimum required is "2.0")
-- Using SASL backend : Cyrus
-- Looking for sasl_client_done
-- Looking for sasl_client_done - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of socklen_t
-- Check size of socklen_t - done
-- Looking for res_nsearch
-- Looking for res_nsearch - found
-- Looking for res_search
-- Looking for res_search - found
-- Looking for res_ndestroy
-- Looking for res_ndestroy - not found
-- Looking for res_nclose
-- Looking for res_nclose - found
-- Detected parameters: accept (int, struct sockaddr *, socklen_t *)
-- Searching for compression library header snappy-c.h
--   Found in /usr/include
-- Searching for libsnappy
--   Found /usr/lib/x86_64-linux-gnu/libsnappy.so
-- Searching for libmongocrypt
--   libmongocrypt found at /usr/lib/x86_64-linux-gnu/libmongocrypt.so
--   libmongocrypt include path /usr/include
--   libmongocrypt version 1.17.3
-- Performing Test MONGOC_HAVE_SS_FAMILY
-- Performing Test MONGOC_HAVE_SS_FAMILY - Success
-- Compiling against Cyrus SASL
-- Searching for utf8proc on system
-- Checking for module 'libutf8proc'
--   Found libutf8proc, version 3.2.3
-- Adding -fPIC to compilation of mongoc_static components
-- Building with MONGODB-AWS auth support
CMake Deprecation Warning at build/cmake/GenerateUninstaller.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0147 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:485 (include)

#1135502#12
Date:
2026-05-21 09:39:50 UTC
From:
To:
Hello,

I have uploaded 2.3.0-1.1 to delayed/10 to address this issue. I simply
added the upstream fix for this issue:

https://github.com/mongodb/mongo-c-driver/commit/e5038f25d9088a9efe5befaf44e9316c0e5a927c


diff -Naur old/mongo-c-driver-2.3.0/debian/changelog
mongo-c-driver-2.3.0/debian/changelog
--- old/mongo-c-driver-2.3.0/debian/changelog   2026-04-22 
22:22:27.000000000 +0200
+++ mongo-c-driver-2.3.0/debian/changelog       2026-05-21
11:02:19.875533238 +0200
@@ -1,3 +1,11 @@
+mongo-c-driver (2.3.0-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add upstream patch 0002_Remove_HTML_redirect_tricks to fix a FTBFS.
+    Closes: #1135502
+
+ -- Patrick Matthäi <pmatthaei@debian.org>  Thu, 21 May 2026 10:58:04 +0200
+
  mongo-c-driver (2.3.0-1) unstable; urgency=medium

    * New upstream release
diff -Naur old/mongo-c-driver-2.3.0/debian/files
mongo-c-driver-2.3.0/debian/files
--- old/mongo-c-driver-2.3.0/debian/files       1970-01-01 
01:00:00.000000000 +0100
+++ mongo-c-driver-2.3.0/debian/files   2026-05-21 11:02:36.607496297 +0200
@@ -0,0 +1 @@
+mongo-c-driver_2.3.0-1.1_source.buildinfo libs optional
diff -Naur
old/mongo-c-driver-2.3.0/debian/patches/0002_Remove_HTML_redirect_tricks.diff
mongo-c-driver-2.3.0/debian/patches/0002_Remove_HTML_redirect_tricks.diff
--- 
old/mongo-c-driver-2.3.0/debian/patches/0002_Remove_HTML_redirect_tricks.diff
      1970-01-01 01:00:00.000000000 +0100
+++
mongo-c-driver-2.3.0/debian/patches/0002_Remove_HTML_redirect_tricks.diff
  2026-05-21 10:56:19.936325889 +0200
@@ -0,0 +1,138 @@
+From e5038f25d9088a9efe5befaf44e9316c0e5a927c Mon Sep 17 00:00:00 2001
+From: Colby Pike <vectorofbool@gmail.com>
+Date: Thu, 7 May 2026 12:35:07 -0600
+Subject: [PATCH] [CDRIVER-6031] Remove HTML redirect tricks from docs build
+ (#2286)
+
+This fixes our HTML documentation builds with Sphinx 9.0+. After some
inspection, it was found that the HTML-based redirects where never
published to our official documentation, as the dirhtml builder wasn't
being used there. As such, the redirects were never relied on by any
users, so they can be removed without issue.
+---
+ build/cmake/SphinxBuild.cmake | 31 ++++++------------------------
+ build/sphinx/mongoc_common.py | 36 -----------------------------------
+ build/sphinx/redirect.t.html  | 12 ------------
+ 3 files changed, 6 insertions(+), 73 deletions(-)
+ delete mode 100644 build/sphinx/redirect.t.html
+
+diff --git a/build/cmake/SphinxBuild.cmake b/build/cmake/SphinxBuild.cmake
+index a25434fd2dd..d35c057410d 100644
+--- a/build/cmake/SphinxBuild.cmake
++++ b/build/cmake/SphinxBuild.cmake
+@@ -25,30 +25,11 @@ function (sphinx_build_html target_name doc_dir)
+
+    file (GLOB_RECURSE doc_rsts RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
CONFIGURE_DEPENDS *.rst)
+
+-   # Select a builder: The Sphinx `dirhtml` builder will result in
"prettier" URLs,
+-   # as each page is an `index.html` within a directory. This relies
on "autoindex"-style
+-   # static file URL resolution in the HTTP server, which is extremely
common. For
+-   # EVG, however, we host build results on a server that does not
support this,
+-   # so instead use the traditional HTML builder so that the built
documentation
+-   # artifact can be easily viewed in a web browser
+-   set(is_evg_docs_build "$ENV{EVG_DOCS_BUILD}")
+-   if(NOT is_evg_docs_build)
+-      set (builder dirhtml)
+-      # We have an extension in place that generates stub page
redirects for
+-      # old HTML file URLs that now point to the auto-index URL for the
+-      # corresponding page. As such, every .rst builds two
corresponding .html
+-      # files:
+-      list (TRANSFORM doc_rsts
+-            REPLACE "^(.+)\\.rst$" "html/\\1.html;html/\\1/index.html"
+-            OUTPUT_VARIABLE doc_htmls)
+-   else()
+-      set (builder html)
+-      # We use the regular html builder in this case, which generates
exactly
+-      # one HTML page for each input rST file
+-      list (TRANSFORM doc_rsts
+-            REPLACE "^(.+)\\.rst$" "html/\\1.html"
+-            OUTPUT_VARIABLE doc_htmls)
+-   endif()
++   # We use the regular html builder in this case, which generates exactly
++   # one HTML page for each input rST file
++   list (TRANSFORM doc_rsts
++         REPLACE "^(.+)\\.rst$" "html/\\1.html"
++         OUTPUT_VARIABLE doc_htmls)
+
+    # Set PYTHONDONTWRITEBYTECODE to prevent .pyc clutter in the source
directory
+    add_custom_command (OUTPUT ${doc_htmls}
+@@ -57,7 +38,7 @@ function (sphinx_build_html target_name doc_dir)
+       ${CMAKE_COMMAND} -E env
+          "PYTHONDONTWRITEBYTECODE=1"
+       ${SPHINX_EXECUTABLE}
+-         -qnW -b "${builder}"
++         -qnW -b html
+          -j "${NPROCS}"
+          -c "${CMAKE_CURRENT_SOURCE_DIR}"
+          -d "${doctrees_dir}"
+diff --git a/build/sphinx/mongoc_common.py b/build/sphinx/mongoc_common.py
+index 4247d649083..d7fcabe916b 100644
+--- a/build/sphinx/mongoc_common.py
++++ b/build/sphinx/mongoc_common.py
+@@ -6,13 +6,7 @@
+ from docutils import nodes
+ from docutils.nodes import Node, document
+ from sphinx.application import Sphinx
+-from sphinx.application import logger as sphinx_log
+
+-try:
+-    from sphinx.builders.dirhtml import DirectoryHTMLBuilder
+-except ImportError:
+-    # Try importing from older Sphinx version path.
+-    from sphinx.builders.html import DirectoryHTMLBuilder
+ from docutils.parsers.rst import Directive
+
+ # Do not require newer sphinx. EPEL packages build man pages with
Sphinx 1.7.6. Refer: CDRIVER-4767
+@@ -136,38 +130,8 @@ def run(self) -> Sequence[Node]:
+         return [header, blist]
+
+
+-def generate_html_redirs(app: Sphinx, page: str, templatename: str,
context: Dict[str, Any], doctree: Any) -> None:
+-    builder = app.builder
+-    if not isinstance(builder, DirectoryHTMLBuilder) or
'writing-redirect' in context:
+-        return
+-    if page == 'index' or page.endswith('.index'):
+-        return
+-    path = app.project.doc2path(page, True)
+-    out_index_html = Path(builder.get_outfilename(page))
+-    slug = out_index_html.parent.name
+-    redirect_file = out_index_html.parent.parent / f'{slug}.html'
+-    # HACK: handle_page() is not properly reentrant. Save and restore
state for
+-    # this page while we generate our redirects page:
+-    prev_scripts = builder.script_files[:]
+-    prev_css = builder.css_files[:]
+-    builder.handle_page(
+-        f'redirect-for-{page}',
+-        {'target': page, 'writing-redirect': 1},
+-        str(Path(__file__).parent.resolve() / 'redirect.t.html'),
+-        # Note: In Sphinx 8.2, this argument changed from `str` to
`Path`, but
+-        # continues to work with `str`. A future version might need
this changed
+-        # to pass a `Path`, but we can keep `str` for now.
+-        outfilename=str(redirect_file),  # type: ignore
+-    )
+-    # Restore prior state:
+-    builder.script_files[:] = prev_scripts
+-    builder.css_files[:] = prev_css
+-    sphinx_log.debug('Wrote redirect: %r -> %r', path, page)
+-
+-
+ def mongoc_common_setup(app: Sphinx):
+     _collect_man(app)
+-    app.connect('html-page-context', generate_html_redirs)
+     app.connect('html-page-context', add_ga_javascript)
+     # Run sphinx-build -D analytics=1 to enable Google Analytics.
+     app.add_config_value('analytics', False, 'html')
+diff --git a/build/sphinx/redirect.t.html b/build/sphinx/redirect.t.html
+deleted file mode 100644
+index bbc16085932..00000000000
+--- a/build/sphinx/redirect.t.html
++++ /dev/null
+@@ -1,12 +0,0 @@
+-{%- extends "!page.html" %}
+-
+-{% block extrahead -%}
+-<meta http-equiv="refresh" content="3; url={{ pathto(target, 1) | e }}">
+-{%- endblock %}
+-
+-{% block content %}
+-<p>
+-    This page has been migrated to <pre>{{ pathto(target) | e
}}</pre>. You should be
+-    redirected to this location automatically in a few seconds.
+-</p>
+-{% endblock %}
diff -Naur old/mongo-c-driver-2.3.0/debian/patches/series
mongo-c-driver-2.3.0/debian/patches/series
--- old/mongo-c-driver-2.3.0/debian/patches/series      2026-04-22 
22:22:27.000000000 +0200
+++ mongo-c-driver-2.3.0/debian/patches/series  2026-05-21
10:57:41.808145936 +0200
@@ -1 +1,2 @@
  0001_local_mathjax.diff
+0002_Remove_HTML_redirect_tricks.diff

#1135502#15
Date:
2026-05-21 09:39:50 UTC
From:
To:
Hello,

I have uploaded 2.3.0-1.1 to delayed/10 to address this issue. I simply
added the upstream fix for this issue:

https://github.com/mongodb/mongo-c-driver/commit/e5038f25d9088a9efe5befaf44e9316c0e5a927c


diff -Naur old/mongo-c-driver-2.3.0/debian/changelog
mongo-c-driver-2.3.0/debian/changelog
--- old/mongo-c-driver-2.3.0/debian/changelog   2026-04-22 
22:22:27.000000000 +0200
+++ mongo-c-driver-2.3.0/debian/changelog       2026-05-21
11:02:19.875533238 +0200
@@ -1,3 +1,11 @@
+mongo-c-driver (2.3.0-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add upstream patch 0002_Remove_HTML_redirect_tricks to fix a FTBFS.
+    Closes: #1135502
+
+ -- Patrick Matthäi <pmatthaei@debian.org>  Thu, 21 May 2026 10:58:04 +0200
+
  mongo-c-driver (2.3.0-1) unstable; urgency=medium

    * New upstream release
diff -Naur old/mongo-c-driver-2.3.0/debian/files
mongo-c-driver-2.3.0/debian/files
--- old/mongo-c-driver-2.3.0/debian/files       1970-01-01 
01:00:00.000000000 +0100
+++ mongo-c-driver-2.3.0/debian/files   2026-05-21 11:02:36.607496297 +0200
@@ -0,0 +1 @@
+mongo-c-driver_2.3.0-1.1_source.buildinfo libs optional
diff -Naur
old/mongo-c-driver-2.3.0/debian/patches/0002_Remove_HTML_redirect_tricks.diff
mongo-c-driver-2.3.0/debian/patches/0002_Remove_HTML_redirect_tricks.diff
--- 
old/mongo-c-driver-2.3.0/debian/patches/0002_Remove_HTML_redirect_tricks.diff
      1970-01-01 01:00:00.000000000 +0100
+++
mongo-c-driver-2.3.0/debian/patches/0002_Remove_HTML_redirect_tricks.diff
  2026-05-21 10:56:19.936325889 +0200
@@ -0,0 +1,138 @@
+From e5038f25d9088a9efe5befaf44e9316c0e5a927c Mon Sep 17 00:00:00 2001
+From: Colby Pike <vectorofbool@gmail.com>
+Date: Thu, 7 May 2026 12:35:07 -0600
+Subject: [PATCH] [CDRIVER-6031] Remove HTML redirect tricks from docs build
+ (#2286)
+
+This fixes our HTML documentation builds with Sphinx 9.0+. After some
inspection, it was found that the HTML-based redirects where never
published to our official documentation, as the dirhtml builder wasn't
being used there. As such, the redirects were never relied on by any
users, so they can be removed without issue.
+---
+ build/cmake/SphinxBuild.cmake | 31 ++++++------------------------
+ build/sphinx/mongoc_common.py | 36 -----------------------------------
+ build/sphinx/redirect.t.html  | 12 ------------
+ 3 files changed, 6 insertions(+), 73 deletions(-)
+ delete mode 100644 build/sphinx/redirect.t.html
+
+diff --git a/build/cmake/SphinxBuild.cmake b/build/cmake/SphinxBuild.cmake
+index a25434fd2dd..d35c057410d 100644
+--- a/build/cmake/SphinxBuild.cmake
++++ b/build/cmake/SphinxBuild.cmake
+@@ -25,30 +25,11 @@ function (sphinx_build_html target_name doc_dir)
+
+    file (GLOB_RECURSE doc_rsts RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
CONFIGURE_DEPENDS *.rst)
+
+-   # Select a builder: The Sphinx `dirhtml` builder will result in
"prettier" URLs,
+-   # as each page is an `index.html` within a directory. This relies
on "autoindex"-style
+-   # static file URL resolution in the HTTP server, which is extremely
common. For
+-   # EVG, however, we host build results on a server that does not
support this,
+-   # so instead use the traditional HTML builder so that the built
documentation
+-   # artifact can be easily viewed in a web browser
+-   set(is_evg_docs_build "$ENV{EVG_DOCS_BUILD}")
+-   if(NOT is_evg_docs_build)
+-      set (builder dirhtml)
+-      # We have an extension in place that generates stub page
redirects for
+-      # old HTML file URLs that now point to the auto-index URL for the
+-      # corresponding page. As such, every .rst builds two
corresponding .html
+-      # files:
+-      list (TRANSFORM doc_rsts
+-            REPLACE "^(.+)\\.rst$" "html/\\1.html;html/\\1/index.html"
+-            OUTPUT_VARIABLE doc_htmls)
+-   else()
+-      set (builder html)
+-      # We use the regular html builder in this case, which generates
exactly
+-      # one HTML page for each input rST file
+-      list (TRANSFORM doc_rsts
+-            REPLACE "^(.+)\\.rst$" "html/\\1.html"
+-            OUTPUT_VARIABLE doc_htmls)
+-   endif()
++   # We use the regular html builder in this case, which generates exactly
++   # one HTML page for each input rST file
++   list (TRANSFORM doc_rsts
++         REPLACE "^(.+)\\.rst$" "html/\\1.html"
++         OUTPUT_VARIABLE doc_htmls)
+
+    # Set PYTHONDONTWRITEBYTECODE to prevent .pyc clutter in the source
directory
+    add_custom_command (OUTPUT ${doc_htmls}
+@@ -57,7 +38,7 @@ function (sphinx_build_html target_name doc_dir)
+       ${CMAKE_COMMAND} -E env
+          "PYTHONDONTWRITEBYTECODE=1"
+       ${SPHINX_EXECUTABLE}
+-         -qnW -b "${builder}"
++         -qnW -b html
+          -j "${NPROCS}"
+          -c "${CMAKE_CURRENT_SOURCE_DIR}"
+          -d "${doctrees_dir}"
+diff --git a/build/sphinx/mongoc_common.py b/build/sphinx/mongoc_common.py
+index 4247d649083..d7fcabe916b 100644
+--- a/build/sphinx/mongoc_common.py
++++ b/build/sphinx/mongoc_common.py
+@@ -6,13 +6,7 @@
+ from docutils import nodes
+ from docutils.nodes import Node, document
+ from sphinx.application import Sphinx
+-from sphinx.application import logger as sphinx_log
+
+-try:
+-    from sphinx.builders.dirhtml import DirectoryHTMLBuilder
+-except ImportError:
+-    # Try importing from older Sphinx version path.
+-    from sphinx.builders.html import DirectoryHTMLBuilder
+ from docutils.parsers.rst import Directive
+
+ # Do not require newer sphinx. EPEL packages build man pages with
Sphinx 1.7.6. Refer: CDRIVER-4767
+@@ -136,38 +130,8 @@ def run(self) -> Sequence[Node]:
+         return [header, blist]
+
+
+-def generate_html_redirs(app: Sphinx, page: str, templatename: str,
context: Dict[str, Any], doctree: Any) -> None:
+-    builder = app.builder
+-    if not isinstance(builder, DirectoryHTMLBuilder) or
'writing-redirect' in context:
+-        return
+-    if page == 'index' or page.endswith('.index'):
+-        return
+-    path = app.project.doc2path(page, True)
+-    out_index_html = Path(builder.get_outfilename(page))
+-    slug = out_index_html.parent.name
+-    redirect_file = out_index_html.parent.parent / f'{slug}.html'
+-    # HACK: handle_page() is not properly reentrant. Save and restore
state for
+-    # this page while we generate our redirects page:
+-    prev_scripts = builder.script_files[:]
+-    prev_css = builder.css_files[:]
+-    builder.handle_page(
+-        f'redirect-for-{page}',
+-        {'target': page, 'writing-redirect': 1},
+-        str(Path(__file__).parent.resolve() / 'redirect.t.html'),
+-        # Note: In Sphinx 8.2, this argument changed from `str` to
`Path`, but
+-        # continues to work with `str`. A future version might need
this changed
+-        # to pass a `Path`, but we can keep `str` for now.
+-        outfilename=str(redirect_file),  # type: ignore
+-    )
+-    # Restore prior state:
+-    builder.script_files[:] = prev_scripts
+-    builder.css_files[:] = prev_css
+-    sphinx_log.debug('Wrote redirect: %r -> %r', path, page)
+-
+-
+ def mongoc_common_setup(app: Sphinx):
+     _collect_man(app)
+-    app.connect('html-page-context', generate_html_redirs)
+     app.connect('html-page-context', add_ga_javascript)
+     # Run sphinx-build -D analytics=1 to enable Google Analytics.
+     app.add_config_value('analytics', False, 'html')
+diff --git a/build/sphinx/redirect.t.html b/build/sphinx/redirect.t.html
+deleted file mode 100644
+index bbc16085932..00000000000
+--- a/build/sphinx/redirect.t.html
++++ /dev/null
+@@ -1,12 +0,0 @@
+-{%- extends "!page.html" %}
+-
+-{% block extrahead -%}
+-<meta http-equiv="refresh" content="3; url={{ pathto(target, 1) | e }}">
+-{%- endblock %}
+-
+-{% block content %}
+-<p>
+-    This page has been migrated to <pre>{{ pathto(target) | e
}}</pre>. You should be
+-    redirected to this location automatically in a few seconds.
+-</p>
+-{% endblock %}
diff -Naur old/mongo-c-driver-2.3.0/debian/patches/series
mongo-c-driver-2.3.0/debian/patches/series
--- old/mongo-c-driver-2.3.0/debian/patches/series      2026-04-22 
22:22:27.000000000 +0200
+++ mongo-c-driver-2.3.0/debian/patches/series  2026-05-21
10:57:41.808145936 +0200
@@ -1 +1,2 @@
  0001_local_mathjax.diff
+0002_Remove_HTML_redirect_tricks.diff

#1135502#22
Date:
2026-05-21 12:49:22 UTC
From:
To:
Hello Patrick,

I appreciate your contribution, but I have rejected the upload
nonetheless. Please note that I had already tagged the bug as
'fixed-upstream' (which you no doubt noticed, as you cherry-picked the
upstream fix). However, a quick ping via email would have been helpful,
as I would have been able to save you the effort of the NMU. A new
upstream release is pending within the next 2 weeks and will contain
this exact fix.

Regards,

#1135502#27
Date:
2026-05-21 14:34:34 UTC
From:
To:
Hi Roberto,

no problem, for that we have got the delayed queue. Just uploaded it
because I were in flow and fastnetmon has this status:

fastnetmon: buggy deps mongo-c-driver, flagged for removal in 29.


Am 21.05.2026 um 14:49 schrieb Roberto C. Sánchez:

#1135502#32
Date:
2026-05-21 16:58:29 UTC
From:
To:
Ack. I'm glad you didn't put much effort into it. The new upstream
version should land soon.

Regards,

#1135502#37
Date:
2026-06-03 18:34:33 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
mongo-c-driver, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1135502@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Roberto C. Sanchez <roberto@connexer.com> (supplier of updated mongo-c-driver package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 03 Jun 2026 13:42:28 -0400
Source: mongo-c-driver
Architecture: source
Version: 2.3.1-1
Distribution: unstable
Urgency: medium
Maintainer: Mongo C Driver Team <mongo-c-driver-debian@googlegroups.com>
Changed-By: Roberto C. Sanchez <roberto@connexer.com>
Closes: 1135502 1138319
Changes:
 mongo-c-driver (2.3.1-1) unstable; urgency=medium
 .
   * New upstream release (Closes: #1135502, #1138319)
Checksums-Sha1:
 2d754ab98a89623f9ce4363ff0234e5816f546b8 2697 mongo-c-driver_2.3.1-1.dsc
 4d03a3a052c244c5b591fe2c805e2d8e7b0619b5 7413397 mongo-c-driver_2.3.1.orig.tar.gz
 0099edbd2746060116f0de868440adb4894a0ca0 10084 mongo-c-driver_2.3.1-1.debian.tar.xz
 f173d4abfedfc083ee2e7092c342a29211ff6587 10154 mongo-c-driver_2.3.1-1_amd64.buildinfo
Checksums-Sha256:
 df3623be12f98cdbb2e67be7c73576628404e214066d2f06709c0cec80ee6aa6 2697 mongo-c-driver_2.3.1-1.dsc
 a82c2a361dfa4937a1a12522a0675c99b72f8f81bd76429c816681c50c7bc881 7413397 mongo-c-driver_2.3.1.orig.tar.gz
 02b35b0c2126fb3b8840b4aa068474f91fe08c681cd710c7072d9618bf6883e0 10084 mongo-c-driver_2.3.1-1.debian.tar.xz
 c9cd4006f26a0deece0cdcc4ce7fd7285724ae28b5466226f623f2d0d6b41376 10154 mongo-c-driver_2.3.1-1_amd64.buildinfo
Files:
 fb48d5949d502406532a04f439706763 2697 libs optional mongo-c-driver_2.3.1-1.dsc
 997f571dc291f822e6d4b4af17b2f1d2 7413397 libs optional mongo-c-driver_2.3.1.orig.tar.gz
 7953df10ac6f5e68cc093b41cd10aa9f 10084 libs optional mongo-c-driver_2.3.1-1.debian.tar.xz
 6aa5e2c73e3b5454af34d294519cda56 10154 libs optional mongo-c-driver_2.3.1-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEIYZ1DR4ae5UL01q7ldFmTdL1kUIFAmogcJwACgkQldFmTdL1
kUIh6RAAo/caAsIqGTvnwbJaCoJSzjY+70Rw4jhRZyZTIH9C/Qqdhk8KaUPYKsiQ
JJscKGMq7arK//aeYWe74iuChOT8f/5Q0hUf9DLmil1s09/3SPR524/Op8WYi5pS
Vtr49FmB2PlQjlcMOXBRPcHuq9T3kcEE7Xjw9n//RRKWUcDMyanSbC3ILgGtuHwG
a9KVnvt7lPaHrbxDrutYzkNKHJDzFmxKir6lzHFhgVAGwTXlrUOjjWQbRKNVc4ch
7kSm/SgoJL36nY41kjZtYP7EA3JkqNAuP9k43Q76+458pCsshTcLHecOFNlLtK0R
2layqgXq7RKzrZTYRH7nfWmuE272dkqnk+AIFI3D4aDtfLjAJJgk2KsRXBNZsFrP
q4YYucVYNFfoCLA7eyn1EXXecKKejI42t9w6megW7BNeekLCudGd36vXPivvycb4
Z44VusaldgOsw4N1d+ylDkHkjJweA40bClauqRsbwMyL1hPJYOFPaOxoBgP1Emar
6H4gDDiUTwIgR0MMx4+pJm8cudOnVdu7Z7ouyVGxBi9KA3O3t1UNF4xwADHDZjDd
vRctygRtgbdozztLKGSIrrwnsTUAG7p4sTLj4GPHKLQW5GNTfHk0TRF0AvoaoPcG
9MGBCDwrSG4vZ+SDx2u8nc0U7HOZdrOORhwEm52MyoYGGl6bRuU=
=BvIW
-----END PGP SIGNATURE-----