Fix #69: "Couldn't spawn debuggee" with non-ASCII filename on Python 2.7

Prevent implicit filename conversion from bytes to unicode with incorrect encoding.
This commit is contained in:
Pavel Minaev 2020-03-12 19:05:58 -07:00 committed by Pavel Minaev
parent ec50794286
commit ac98e8a623

View file

@ -190,7 +190,9 @@ def parse_argv():
except StopIteration:
raise ValueError("missing target: " + TARGET)
switch = arg if arg.startswith("-") else ""
switch = compat.filename(arg)
if not switch.startswith("-"):
switch = ""
for pattern, placeholder, action in switches:
if re.match("^(" + pattern + ")$", switch):
break