Skip to content

Commit

Permalink
Handle OSError when listing to get path with real case. Fixes microso…
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Dec 15, 2022
1 parent ed59c6d commit 79da971
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/debugpy/_vendored/pydevd/pydevd_file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ def _resolve_listing_parts(resolved, parts_in_lowercase, filename):
pydev_log.exception()
# Don't fail, just return the original file passed.
return filename
except OSError:
# Something as: PermissionError (listdir may fail).
# See: https://github.com/microsoft/debugpy/issues/1154
# Don't fail nor log unless the trace level is at least info. Just return the original file passed.
if DebugInfoHolder.DEBUG_TRACE_LEVEL >= 1:
pydev_log.info(
'pydev debugger: OSError: Unable to get real case for file. Details:\n'
'filename: %s\ndrive: %s\nparts: %s\n',
filename, resolved, parts_in_lowercase
)
pydev_log.exception()
return filename


if sys.platform == 'win32':
Expand Down

0 comments on commit 79da971

Please sign in to comment.