Skip to content

Commit a1582d2

Browse files
committed
FIX: do not try to display files which do not exist (fixes #317)
1 parent 5610af1 commit a1582d2

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

doc/source/changes/version_0_35_1.rst.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ Fixes
6666
relative difference" label were always wrong and the comparison failed
6767
completely when the first array was an object array containing any 0 value.
6868

69+
* do not try to display Path objects which point to a file or directory which
70+
does not exist (closes :editor_issue:`317`).
71+
6972
* fixed the mechanism writing warning/error messages happening during the
7073
editor initialization. The errors are now correctly written in the user
7174
TEMP directory / larray-editor-stderr.log

larray_editor/arrayadapter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,8 @@ def cell_activated(self, row_idx, column_idx):
10951095
@adapter_for('pathlib.Path')
10961096
def get_path_suffix_adapter(fpath):
10971097
logger.debug(f"get_path_suffix_adapter('{fpath}')")
1098+
if not fpath.exists():
1099+
return f"Path '{fpath}' does not exist"
10981100
suffix = fpath.suffix.lower()
10991101
if suffix in PATH_SUFFIX_ADAPTERS:
11001102
path_adapter_cls, required_module = PATH_SUFFIX_ADAPTERS[suffix]

0 commit comments

Comments
 (0)