Debian Bug report logs - #1063326
TypeError: first argument must be callable

version graph

Package: python3-sphinx; Maintainer for python3-sphinx is Debian Python Team <[email protected]>; Source for python3-sphinx is src:sphinx (PTS, buildd, popcon).

Reported by: Picca Frédéric-Emmanuel <[email protected]>

Date: Tue, 6 Feb 2024 08:48:01 UTC

Severity: important

Found in version sphinx/5.3.0-4

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debian Python Team <[email protected]>:
Bug#1063326; Package python3-sphinx. (Tue, 06 Feb 2024 08:48:03 GMT) (full text, mbox, link).


Acknowledgement sent to Picca Frédéric-Emmanuel <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian Python Team <[email protected]>. (Tue, 06 Feb 2024 08:48:03 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Picca Frédéric-Emmanuel <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: TypeError: first argument must be callable
Date: Tue, 06 Feb 2024 09:32:45 +0100
Package: python3-sphinx
Version: 5.3.0-4
Severity: important

Dear Maintainer,

Hello,, while preparing the new silx package, I got this error message from sphinx when calling this command line

	# build man pages
	pybuild --build -s custom -p $(PY3VER) --build-args="cd doc && env PYTHONPATH={build_dir} http_proxy='127.0.0.1:9' xvfb-run -a --server-args=\"-screen 0 1024x768x24\" {interpreter} -m sphinx -N -bman source build/man"

The error message is:

# Platform:         linux; (Linux-6.6.13-amd64-x86_64-with-glibc2.37)
# Sphinx version:   7.2.6
# Python version:   3.11.7 (CPython)
# Docutils version: 0.20.1
# Jinja2 version:   3.1.2
# Pygments version: 2.17.2

# Last messages:
#   modules/utils/index
#   modules/utils/array_like
#   modules/utils/decorators
#   modules/utils/testutils
#   modules/utils/weakref
#   modules/utils/retry
#   modules/test/index
#   changelog
#   }
#   failed

# Loaded extensions:
#   sphinx.ext.mathjax (7.2.6)
#   alabaster (0.7.12)
#   sphinx.ext.autodoc.preserve_defaults (7.2.6)
#   sphinx.ext.autodoc.type_comment (7.2.6)
#   sphinx.ext.autodoc.typehints (7.2.6)
#   sphinx.ext.autodoc (7.2.6)
#   sphinx.ext.coverage (7.2.6)
#   sphinx.ext.viewcode (7.2.6)
#   sphinx.ext.doctest (7.2.6)
#   sphinx.ext.graphviz (7.2.6)
#   sphinx.ext.inheritance_diagram (7.2.6)
#   sphinx_panels (0.6.0)
#   sphinxext-archive (0.1)
#   snapshotqt_directive (0.1)
#   nbsphinx (0.8.11)

# Traceback:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/cmd/build.py", line 298, in build_main
    app.build(args.force_all, args.filenames)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 354, in build
    self.builder.build_update()
  File "/usr/lib/python3/dist-packages/sphinx/builders/__init__.py", line 290, in build_update
    self.build(['__all__'], to_build)
  File "/usr/lib/python3/dist-packages/sphinx/builders/__init__.py", line 363, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/lib/python3/dist-packages/sphinx/util/display.py", line 92, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sphinx/builders/manpage.py", line 103, in write
    docwriter.write(largetree, destination)
  File "/usr/lib/python3/dist-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/usr/lib/python3/dist-packages/sphinx/writers/manpage.py", line 35, in translate
    visitor = self.builder.create_translator(self.document, self.builder)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sphinx/builders/__init__.py", line 119, in create_translator
    return self.app.registry.create_translator(self, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/sphinx/registry.py", line 353, in create_translator
    setattr(translator, 'visit_' + name, MethodType(visit, translator))
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: first argument must be callable



Cheers

Frederic

-- System Information:
Debian Release: 12.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-17-amd64 (SMP w/128 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-sphinx depends on:
ii  python3                     3.11.2-1+b1
ii  python3-alabaster           0.7.12-1
ii  python3-babel               2.10.3-1
ii  python3-distutils           3.11.2-3
ii  python3-docutils            0.19+dfsg-6
ii  python3-imagesize           1.4.1-1
ii  python3-importlib-metadata  4.12.0-1
ii  python3-jinja2              3.1.2-1
ii  python3-packaging           23.0-1
ii  python3-pygments            2.14.0+dfsg-1
ii  python3-requests            2.28.1+dfsg-1
ii  python3-snowballstemmer     2.2.0-2
ii  sphinx-common               5.3.0-4

Versions of packages python3-sphinx recommends:
ii  make         4.3-4.1
ii  python3-pil  9.4.0-1.1+b1

Versions of packages python3-sphinx suggests:
pn  dvipng                     <none>
ii  fonts-freefont-otf         20120503-10
ii  imagemagick-6.q16          8:6.9.11.60+dfsg-1.6
pn  latexmk                    <none>
ii  libjs-mathjax              2.7.9+dfsg-1
ii  python3-lib2to3            3.11.2-3
ii  python3-sphinx-rtd-theme   1.2.0+dfsg-1
pn  sphinx-doc                 <none>
ii  tex-gyre                   20180621-6
ii  texlive-fonts-recommended  2022.20230122-3
ii  texlive-latex-extra        2022.20230122-4
ii  texlive-latex-recommended  2022.20230122-3
ii  texlive-plain-generic      2022.20230122-4

-- no debconf information



Information forwarded to [email protected], Debian Python Team <[email protected]>:
Bug#1063326; Package python3-sphinx. (Tue, 06 Feb 2024 11:33:05 GMT) (full text, mbox, link).


Acknowledgement sent to Dmitry Shachnev <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Python Team <[email protected]>. (Tue, 06 Feb 2024 11:33:05 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Dmitry Shachnev <[email protected]>
To: Picca Frédéric-Emmanuel <[email protected]>, [email protected]
Subject: Re: Bug#1063326: TypeError: first argument must be callable
Date: Tue, 6 Feb 2024 14:30:53 +0300
[Message part 1 (text/plain, inline)]
Hi Frédéric!

On Tue, Feb 06, 2024 at 09:32:45AM +0100, Picca Frédéric-Emmanuel wrote:
> Package: python3-sphinx
> Version: 5.3.0-4
> Severity: important
> 
> Dear Maintainer,
> 
> Hello, while preparing the new silx package, I got this error message from
> sphinx when calling this command line
>
> [...]
>
>   File "/usr/lib/python3/dist-packages/sphinx/registry.py", line 353, in create_translator
>     setattr(translator, 'visit_' + name, MethodType(visit, translator))
>                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> TypeError: first argument must be callable

This is because sphinx-panels defines the handler for "fontawesome" role for
manpage builder as (None, None):

https://sources.debian.org/src/sphinx-panels/0.6.0-3/sphinx_panels/icons.py/#L144

While Sphinx expects at least the visit function (the first pair element) to
be not None.

However, sphinx-panels is dead, and upstream recommends to use sphinx-design
instead. And in sphinx-design this bug is fixed:

https://sources.debian.org/src/sphinx-design/0.5.0-2/sphinx_design/icons.py/#L42

https://github.com/executablebooks/sphinx-design/pull/88

If you want a fix in sphinx-panels, please reassign the bug. Otherwise, if you
have found another solution, please close it.

--
Dmitry Shachnev
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 15:28:58 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.