Skip to content

Commit 207bea5

Browse files
committed
Review feedback
1 parent 38f4c5c commit 207bea5

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/manage/aliasutils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def _parse_entrypoint_line(line):
239239
name, sep, rest = line.partition("=")
240240
name = name.strip()
241241
if name and name[0].isalnum() and sep and rest:
242+
# "names" that have a parent directory/slash are invalid
242243
if PurePath(name).parent:
243244
return None, None, None
244245
mod, sep, rest = rest.partition(":")

tests/test_alias.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def test_write_script_alias(alias_checker):
121121
"..\\evil_path",
122122
"dir\\..\\evil_path",
123123
"normal\\subdir",
124+
"C:\\absolute\\evil_path",
124125
])
125126
def test_write_invalid_alias_name(alias_checker, name):
126127
with pytest.raises(ValueError):

0 commit comments

Comments
 (0)