Skip to content

Build error when using docutils #94

@David-Le-Nir

Description

@David-Le-Nir

I'm currently migrating to Sphinx 8.2.3 and sphinx-Needs 4.2.0.

With sphinx-test-reports in 1.1.0, when built with "sphinx-build" no issue but when built with "docutils" I got he following error:

/usr/local/lib/python3.11/dist-packages/sphinxcontrib/test_reports/environment.py:58: RemovedInSphinx90Warning: 'sphinx.builders.html.StandaloneHTMLBuilder.css_files' is deprecated. Check CHANGES for Sphinx API modifications.
  hasattr(app.builder, "css_files") and static_data_file in app.builder.css_files  # noqa: W503
/usr/local/lib/python3.11/dist-packages/sphinxcontrib/test_reports/environment.py:58: RemovedInSphinx90Warning: The str interface for _CascadingStyleSheet objects is deprecated. Use css.filename instead.
  hasattr(app.builder, "css_files") and static_data_file in app.builder.css_files  # noqa: W503
Copying static files for sphinx-test-results custom style support...[100%] --- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.11/logging/__init__.py", line 1110, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/logging/__init__.py", line 953, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/sphinx/util/logging.py", line 574, in format
    return colourise(colour_name, message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/sphinx/_cli/util/colour.py", line 58, in colourise
    if colour_name.startswith('_') or colour_name in {
       ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute 'startswith'
Call stack:
  File "/usr/local/bin/sphinx-build", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.11/dist-packages/sphinx/cmd/build.py", line 493, in main
    return build_main(argv)
  File "/usr/local/lib/python3.11/dist-packages/sphinx/cmd/build.py", line 432, in build_main
    app.build(args.force_all, args.filenames)
  File "/usr/local/lib/python3.11/dist-packages/sphinx/application.py", line 422, in build
    self.builder.build_all()
  File "/usr/local/lib/python3.11/dist-packages/sphinx/builders/__init__.py", line 319, in build_all
    self.build(None, summary=__('all source files'), method='all')
  File "/usr/local/lib/python3.11/dist-packages/sphinx/builders/__init__.py", line 403, in build
    updated_docnames = set(self.read())
  File "/usr/local/lib/python3.11/dist-packages/sphinx/builders/__init__.py", line 564, in read
    for retval in self.events.emit('env-updated', self.env):
  File "/usr/local/lib/python3.11/dist-packages/sphinx/events.py", line 404, in emit
    results.append(listener.handler(self.app, *args))
  File "/usr/local/lib/python3.11/dist-packages/sphinxcontrib/test_reports/environment.py", line 78, in install_styles_static_files
    for source_file_path in status_iterator(
  File "/usr/local/lib/python3.11/dist-packages/sphinx/util/display.py", line 53, in status_iterator
    logger.info(stringify_func(item), nonl=True, color=color)
  File "/usr/lib/python3.11/logging/__init__.py", line 1849, in info
    self.log(INFO, msg, *args, **kwargs)
  File "/usr/local/lib/python3.11/dist-packages/sphinx/util/logging.py", line 138, in log
    super().log(level, msg, *args, **kwargs)
  File "/usr/lib/python3.11/logging/__init__.py", line 1887, in log
    self.logger.log(level, msg, *args, **kwargs)
  File "/usr/lib/python3.11/logging/__init__.py", line 1559, in log
    self._log(level, msg, args, **kwargs)
  File "/usr/lib/python3.11/logging/__init__.py", line 1634, in _log
    self.handle(record)
  File "/usr/lib/python3.11/logging/__init__.py", line 1644, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.11/logging/__init__.py", line 1706, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python3.11/logging/__init__.py", line 978, in handle
    self.emit(record)
  File "/usr/local/lib/python3.11/dist-packages/sphinx/util/logging.py", line 219, in emit
    super().emit(record)
Message: 'common.css'
Arguments: ()
/usr/local/lib/python3.11/dist-packages/sphinxcontrib/test_reports/environment.py:35: RemovedInSphinx90Warning: 'sphinx.builders.html.StandaloneHTMLBuilder.css_files' is deprecated. Check CHANGES for Sphinx API modifications.
  if hasattr(app.builder, "css_files") and static_data_file not in app.builder.css_files:  # noqa: W503
/usr/local/lib/python3.11/dist-packages/sphinxcontrib/test_reports/environment.py:35: RemovedInSphinx90Warning: The str interface for _CascadingStyleSheet objects is deprecated. Use css.filename instead.
  if hasattr(app.builder, "css_files") and static_data_file not in app.builder.css_files:  # noqa: W503```

I do not know what is the difference in behavior.

Do you have an idea of how I could workaround that ?

Or maybe I can work on a PR but I need some advice of what to do ...

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions