Code hint: look at the bzrlib/win32utils.py, end of the file has the function get_unicode_argv. In that function you need to improve the following code block:
if getattr(sys, 'frozen', None) is None:
# Invoked via 'python.exe' which takes the form:
# python.exe [PYTHON_OPTIONS] C:\Path\bzr [BZR_OPTIONS]
# we need to get only BZR_OPTIONS part,
# We already removed 'python.exe' so we remove everything up to and
# including the first non-option ('-') argument.
for idx in xrange(len(argv)):
if argv[idx][:1] != '-': break
argv = argv[idx+1:]
Currently it handles `python -c "foo" ...` use case only.
If you comparing sys.argv (sys.argv[1:]) and output of that function you can see extra arguments (from -m pdb) which should be removed as well.
Code hint: look at the bzrlib/ win32utils. py, end of the file has the function get_unicode_argv. In that function you need to improve the following code block:
if getattr(sys, 'frozen', None) is None:
break
# Invoked via 'python.exe' which takes the form:
# python.exe [PYTHON_OPTIONS] C:\Path\bzr [BZR_OPTIONS]
# we need to get only BZR_OPTIONS part,
# We already removed 'python.exe' so we remove everything up to and
# including the first non-option ('-') argument.
for idx in xrange(len(argv)):
if argv[idx][:1] != '-':
argv = argv[idx+1:]
Currently it handles `python -c "foo" ...` use case only.
If you comparing sys.argv (sys.argv[1:]) and output of that function you can see extra arguments (from -m pdb) which should be removed as well.