Skip to content

Commit 0879ae0

Browse files
twilight39m3nu
authored andcommitted
Skip reading file size if path name is too long
Signed-off-by: Choo Kein Yie <[email protected]>
1 parent 0a316e7 commit 0879ae0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vorta/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ def get_directory_size(dir_path, exclude_patterns):
121121
if not is_excluded:
122122
data_size_filtered += stat.st_size
123123
seen_filtered.add(stat.st_ino)
124-
except (FileNotFoundError, PermissionError):
124+
except (FileNotFoundError, PermissionError, OSError):
125+
# OSError is thrown when the file path name exceeds the maximum length allowed by the operating system
125126
continue
126127

127128
files_count_filtered = len(seen_filtered)

0 commit comments

Comments
 (0)