From cb55b45d47ba29dce71798bb9d236e1c1a47bb59 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 19 Sep 2020 22:13:45 +0200 Subject: [PATCH] Catch an OSError on Windows --- jedi/inference/compiled/mixed.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jedi/inference/compiled/mixed.py b/jedi/inference/compiled/mixed.py index ef82a574..43e0ed6c 100644 --- a/jedi/inference/compiled/mixed.py +++ b/jedi/inference/compiled/mixed.py @@ -191,8 +191,15 @@ def _find_syntax_node_name(inference_state, python_object): # The type might not be known (e.g. class_with_dict.__weakref__) return None path = None if path is None else Path(path) - if path is None or not path.exists(): - # The path might not exist or be e.g. . + try: + if path is None or not path.exists(): + # The path might not exist or be e.g. . + return None + except OSError: + # Might raise an OSError on Windows: + # + # [WinError 123] The filename, directory name, or volume label + # syntax is incorrect: '' return None file_io = FileIO(path)