MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / _resolve_listing_parts

Function _resolve_listing_parts

pydevd_file_utils.py:170–206  ·  view source on GitHub ↗
(resolved, parts_in_lowercase, filename)

Source from the content-addressed store, hash-verified

168
169
170def _resolve_listing_parts(resolved, parts_in_lowercase, filename):
171 try:
172 if parts_in_lowercase == [""]:
173 return resolved
174 return _resolve_listing(resolved, iter(parts_in_lowercase))
175 except FileNotFoundError:
176 _listdir_cache.clear()
177 # Retry once after clearing the cache we have.
178 try:
179 return _resolve_listing(resolved, iter(parts_in_lowercase))
180 except FileNotFoundError:
181 if os_path_exists(filename):
182 # This is really strange, ask the user to report as error.
183 pydev_log.critical(
184 "pydev debugger: critical: unable to get real case for file. Details:\n"
185 "filename: %s\ndrive: %s\nparts: %s\n"
186 "(please create a ticket in the tracker to address this).",
187 filename,
188 resolved,
189 parts_in_lowercase,
190 )
191 pydev_log.exception()
192 # Don't fail, just return the original file passed.
193 return filename
194 except OSError:
195 # Something as: PermissionError (listdir may fail).
196 # See: https://github.com/microsoft/debugpy/issues/1154
197 # Don't fail nor log unless the trace level is at least info. Just return the original file passed.
198 if DebugInfoHolder.DEBUG_TRACE_LEVEL >= 1:
199 pydev_log.info(
200 "pydev debugger: OSError: Unable to get real case for file. Details:\n" "filename: %s\ndrive: %s\nparts: %s\n",
201 filename,
202 resolved,
203 parts_in_lowercase,
204 )
205 pydev_log.exception()
206 return filename
207
208
209if sys.platform == "win32":

Callers 2

_get_path_with_real_caseFunction · 0.85
get_path_with_real_caseFunction · 0.85

Calls 4

_resolve_listingFunction · 0.85
exceptionMethod · 0.80
infoMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected