diff --git a/src/debugpy/_vendored/pydevd/pydevd_file_utils.py b/src/debugpy/_vendored/pydevd/pydevd_file_utils.py index fe6d5fd46..caff70f17 100644 --- a/src/debugpy/_vendored/pydevd/pydevd_file_utils.py +++ b/src/debugpy/_vendored/pydevd/pydevd_file_utils.py @@ -218,6 +218,8 @@ def _get_path_with_real_case(filename): parts = parts.lower().split(os.path.sep) try: + if parts == ['']: + return drive return _resolve_listing(drive, iter(parts)) except FileNotFoundError: _listdir_cache.clear() diff --git a/src/debugpy/_vendored/pydevd/tests_python/test_convert_utilities.py b/src/debugpy/_vendored/pydevd/tests_python/test_convert_utilities.py index 28ffc7622..63f14e11b 100644 --- a/src/debugpy/_vendored/pydevd/tests_python/test_convert_utilities.py +++ b/src/debugpy/_vendored/pydevd/tests_python/test_convert_utilities.py @@ -5,6 +5,7 @@ import io from _pydev_bundle.pydev_log import log_context import pytest +import sys def test_convert_utilities(tmpdir): @@ -99,6 +100,12 @@ def test_source_reference(tmpdir): assert pydevd_file_utils.get_server_filename_from_source_reference(source_reference) == '/another/my' +@pytest.mark.skipif(sys.platform != 'win32', reason='Windows-only test.') +def test_translate_only_drive(): + import pydevd_file_utils + assert pydevd_file_utils.get_path_with_real_case('c:\\') == 'C:\\' + + def test_to_server_and_to_client(tmpdir): try: