Skip to content
Draft
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
3 changes: 3 additions & 0 deletions pydevd_file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ def _apply_func_and_normalize_case(filename, func, isabs, normalize_case, os_pat
ind += 4
zip_path = r[:ind]
inner_path = r[ind:]
if inner_path and not inner_path.startswith(("!", "/", "\\")):
# Keep paths such as ".zipx/main.py" as regular filesystem paths.
inner_path = ""
if inner_path.startswith("!"):
# Note (fabioz): although I can replicate this by creating a file ending as
# .zip! or .egg!, I don't really know what's the real-world case for this
Expand Down
12 changes: 12 additions & 0 deletions tests_python/test_pydevd_file_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os

import pydevd_file_utils


def test_normalize_case_does_not_split_dot_zipx_directory(tmpdir):
zipx_dir = tmpdir.mkdir(".zipx")
filename = str(zipx_dir.join("main.py"))
zipx_dir.join("main.py").write("print('ok')\n")

expected = os.path.abspath(filename)
assert pydevd_file_utils._apply_func_and_normalize_case(filename, os.path.abspath, True, False) == expected