File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1313import os
1414import platform
1515import re
16+ import stat
1617import sys
1718from abc import ABCMeta , abstractmethod
1819from pathlib import Path
@@ -274,14 +275,19 @@ def _walk_relative_paths(
274275 reporter .invalid_name (str (local_path ), str (e ))
275276 continue
276277
278+ # Deliberately don't use Path.is_dir here: for directories
279+ # without search permission, Python 3.13 raises PermissionError
280+ # while Python 3.14 returns False.
277281 try :
278- is_dir = local_path .is_dir ( )
282+ is_dir = stat . S_ISDIR ( local_path .stat (). st_mode )
279283 except PermissionError : # `chmod -x dir` can trigger this
280284 if reporter is not None and not policies_manager .should_exclude_local_directory (
281285 str (relative_file_path )
282286 ):
283287 reporter .local_permission_error (str (local_path ))
284288 continue
289+ except (OSError , ValueError ):
290+ is_dir = False
285291
286292 if is_dir :
287293 if policies_manager .should_exclude_local_directory (str (relative_file_path )):
Original file line number Diff line number Diff line change 1+ Use ` stat.S_ISDIR ` check for local folder children scanning instead of ` Path.is_dir ` to account for an api change in Python 3.14.
You can’t perform that action at this time.
0 commit comments