From 652813da4bf405e25c4859315f6015acd287bf54 Mon Sep 17 00:00:00 2001 From: Devon Stewart Date: Wed, 17 Apr 2024 12:15:27 -0700 Subject: [PATCH] Prevent a crash if stdin is not defined (#3609) --- mkdocs/config/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs/config/base.py b/mkdocs/config/base.py index 40f5aacf9b..d21b42ab58 100644 --- a/mkdocs/config/base.py +++ b/mkdocs/config/base.py @@ -362,7 +362,7 @@ def load_config( from mkdocs.config.defaults import MkDocsConfig if config_file_path is None: - if fd is not sys.stdin.buffer: + if sys.stdin and fd is not sys.stdin.buffer: config_file_path = getattr(fd, 'name', None) cfg = MkDocsConfig(config_file_path=config_file_path) # load the config file