[Pkg-salt-team] Bug#955057: Bug#955057: salt: FTBFS with Sphinx 2.4: AttributeError: __enter__

Dmitry Shachnev mitya57 at debian.org
Tue Mar 31 14:13:22 BST 2020


On Mon, Mar 30, 2020 at 01:38:24PM +0200, Benjamin Drung wrote:
> Thanks for that help. After adding -T, I got the full stack trace:
>
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/sphinx/cmd/build.py", line 272, in build_main
>     app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
>   File "/usr/lib/python3/dist-packages/sphinx/application.py", line 272, in __init__
>     self._init_builder()
>   File "/usr/lib/python3/dist-packages/sphinx/application.py", line 328, in _init_builder
>     self.events.emit('builder-inited')
>   File "/usr/lib/python3/dist-packages/sphinx/events.py", line 99, in emit
>     results.append(callback(self.app, *args))
>   File "/usr/lib/python3/dist-packages/sphinx/ext/intersphinx.py", line 233, in load_mappings
>     with concurrent.futures.ThreadPoolExecutor() as pool:
> AttributeError: __enter__
>
> It looks like a bug in sphinx, because the full stack trace consists
> entirely of code from sphinx itself. I get the same error message when
> disabling all extensions from salt (shipped in docs/_ext/).

No, actually it is a bug in salt :)

salt's conf.py has the following code:

  MOCK_MODULES = [
      # Python stdlib
      'user',

      # salt core
      'concurrent',
      ...
  ]

  ...

  for mod_name in MOCK_MODULES:
      sys.modules[mod_name] = Mock(mapping=MOCK_MODULES_MAPPING.get(mod_name))

So it changes the concurrent module from standard library to a mock,
and because of that concurrent.futures.ThreadPoolExecutor does not have
__enter__.

Removing two occurrences of 'concurrent' from MOCK_MODULES seems to help.

--
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-salt-team/attachments/20200331/a98addff/attachment.sig>


More information about the pkg-salt-team mailing list