Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the case where only a drive is given for the translation. Fixes #770 #804

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/debugpy/_vendored/pydevd/pydevd_file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io
from _pydev_bundle.pydev_log import log_context
import pytest
import sys


def test_convert_utilities(tmpdir):
Expand Down Expand Up @@ -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:

Expand Down