CrossNox / m2r2

Markdown to reStructuredText converter
https://crossnox.github.io/m2r2
MIT License
107 stars 26 forks source link

m2r2 prohibits usage of multiple Sphinx builder jobs #39

Open marscher opened 2 years ago

marscher commented 2 years ago

When I use multiple jobs in conjunctions with m2r2 I receive the following exception during pickling the environment:


pickling environment... failed

Traceback (most recent call last):
  File "/home/marscher/miniconda3/envs/rtd39/lib/python3.9/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/marscher/miniconda3/envs/rtd39/lib/python3.9/site-packages/sphinx/application.py", line 343, in build
    self.builder.build_update()
  File "/home/marscher/miniconda3/envs/rtd39/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 293, in build_update
    self.build(to_build,
  File "/home/marscher/miniconda3/envs/rtd39/lib/python3.9/site-packages/sphinx/builders/__init__.py", line 324, in build
    pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL)
AttributeError: Can't pickle local object 'Domain.role.<locals>.role_adapter'

Without m2r2 it works as expected (multiple jobs), but of course the markdown conversion breaks down. E.g. I simply comment out the m2r2 extension.

I will try to reproduce this with a minimum working example once I have the time to do it. I would have to break down a rather complex setup. In the meantime I provide the complex failing example https://github.com/BAMWelDX/weldx/tree/master/doc