From 0adfb2a06a0ffc4c669c6d8d3aa729fd0ba1f8ce Mon Sep 17 00:00:00 2001 From: Burt Holzman Date: Wed, 13 Mar 2024 11:09:10 -0500 Subject: [PATCH] Ignore zero-length page_config.json, restore previous behavior of crashing for invalid JSON (#1405) --- jupyter_server/config_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jupyter_server/config_manager.py b/jupyter_server/config_manager.py index 30d52b5bd8..cf9d02afed 100644 --- a/jupyter_server/config_manager.py +++ b/jupyter_server/config_manager.py @@ -101,7 +101,7 @@ def get(self, section_name: str, include_root: bool = True) -> dict[str, t.Any]: ) data: dict[str, t.Any] = {} for path in paths: - if os.path.isfile(path): + if os.path.isfile(path) and os.path.getsize(path): with open(path, encoding="utf-8") as f: try: recursive_update(data, json.load(f))