Skip to content

Commit eec7fb4

Browse files
authored
fix: Create default SSL context in main thread before downloading inventories
Issue-796: https://github.com/mkdocstrings/mkdocstrings/issue/796 PR-797: #797
1 parent 5726771 commit eec7fb4

File tree

1 file changed

+6
-0
lines changed
  • src/mkdocstrings/_internal/handlers

1 file changed

+6
-0
lines changed

src/mkdocstrings/_internal/handlers/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import datetime
88
import importlib
99
import inspect
10+
import ssl
1011
import sys
1112
from concurrent import futures
1213
from io import BytesIO
@@ -753,6 +754,11 @@ def _download_inventories(self) -> None:
753754
to_download.extend((handler, url, conf) for url, conf in inv_configs)
754755

755756
if to_download:
757+
# YORE: EOL 3.12: Remove block.
758+
# NOTE: Create context in main thread to fix issue
759+
# https://github.com/mkdocstrings/mkdocstrings/issues/796.
760+
_ = ssl.create_default_context()
761+
756762
thread_pool = futures.ThreadPoolExecutor(4)
757763
for handler, url, conf in to_download:
758764
_logger.debug("Downloading inventory from %s", url)

0 commit comments

Comments
 (0)