Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError when mkdocs serve rebuilds #47

Open
nbanyan opened this issue Nov 13, 2024 · 0 comments
Open

RuntimeError when mkdocs serve rebuilds #47

nbanyan opened this issue Nov 13, 2024 · 0 comments

Comments

@nbanyan
Copy link

nbanyan commented Nov 13, 2024

Triggering a rebuild gives RuntimeError: There is no current event loop in thread 'MainThread'

It's thrown when formats.pdf.Browser.__init__() attempts to call asyncio.Lock() again.

One solution would be to catch the exception:

try:
  self.lock = asyncio.Lock()
except RuntimeError as e:
  if 'no current event loop' in str(e):
    asyncio.set_event_loop(asyncio.new_event_loop())
    self.lock = asyncio.Lock()
  else:
    raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant