Closed Bug 1810702 Opened 1 year ago Closed 1 year ago

"TypeError: first argument must be callable" when running "mach doc --format text"

Categories

(Developer Infrastructure :: Source Documentation, defect)

defect

Tracking

(firefox112 fixed)

RESOLVED FIXED
Tracking Status
firefox112 --- fixed

People

(Reporter: marco, Assigned: ogiorgis)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

Traceback (most recent call last):
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/application.py", line 344, in build
    self.builder.build_update()
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 294, in build_update
    self.build(to_build,
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 358, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 529, in write
    self._write_parallel(sorted(docnames),
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 556, in _write_parallel
    self.write_doc(firstname, doctree)
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/builders/text.py", line 70, in write_doc
    self.writer.write(doctree, destination)
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/docutils/writers/__init__.py", line 78, in write
    self.translate()
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/writers/text.py", line 377, in translate
    visitor = self.builder.create_translator(self.document, self.builder)
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 128, in create_translator
    return self.app.registry.create_translator(self, *args)
  File "/home/marco/FD/mozilla-unified/obj-x86_64-pc-linux-gnu/_virtualenvs/docs/lib/python3.10/site-packages/sphinx/registry.py", line 346, in create_translator
    setattr(translator, 'visit_' + name, MethodType(visit, translator))
TypeError: first argument must be callable

The severity field is not set for this bug.
:Sylvestre, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(sledru)
Flags: needinfo?(sledru)

We should either:

  • support the txt export
  • trigger an error

Marco told me he needs it ML learning

Severity: -- → S3

There are 2 extensions that are problematic:

Yeah, for sphinx design, I opened: https://bugzilla.mozilla.org/show_bug.cgi?id=1808026

but we have a dependency issue in python between our vendored libs and pip ...
sphinx design requires a more recent version of sphinx which conflicts with importlib metadata or something :)

I suspect it's not that simple.
I will already see the problem with mozbuild.sphinx then I will take a look at sphinx-design

The problem for mozbuild.sphinx is the nested table in the file security/nss/doc/rst/legacy/jss/jss_provider_notes/index.rst .
If we drop (or fix :) ) this table, mozbuild.sphinx does not raise the error.

This table is anyway not rendered correctly in html
https://firefox-source-docs.mozilla.org/security/nss/legacy/jss/jss_provider_notes/index.html#what-s-not-supported

These tables are not taken into account by sphinx, appear badly in
html and trigger a problem when you want to build the doc in text
mode.

Assignee: nobody → ogiorgis
Attachment #9315774 - Attachment description: WIP: Bug 1810702 - remove nested table in rst doc → Bug 1810702 - remove nested table in rst doc r=#firefox-source-docs-reviewers
Status: NEW → ASSIGNED

Depends on D168516

Moreover it fixes the behavior of the right menu.

Depends on D170178

Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/317d08812946
fix title lenght in doc r=firefox-source-docs-reviewers,sylvestre DONTBUILD
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e5ceb5526b06
remove circular reference warnings r=firefox-source-docs-reviewers,sylvestre DONTBUILD

This is still failing for me.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Yes, I fixed the first problem here: https://phabricator.services.mozilla.com/D168766 (But the fix is only here https://hg.mozilla.org/projects/nss/ repository for the moment).
And the second point depends on https://bugzilla.mozilla.org/show_bug.cgi?id=1808026 which is not resolved yet.

Depends on: 1808026

Comment on attachment 9322667 [details]
Bug 1810702 - Fix incorrect pygment style r=#firefox-source-docs-reviewers,sylvestre

Revision D172398 was moved to bug 1821997. Setting attachment 9322667 [details] to obsolete.

Attachment #9322667 - Attachment is obsolete: true
No longer depends on: 1808026
Depends on: 1824659
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: