command line exception under pythonwin
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned |
Bug Description
This looks like Bug #587868, but is caused by a different reason.
The problem is in win32utils.py line 551. That is, inside function get_unicode_argv() where
command_line = GetCommandLineW()
is assigned the value:
u'"C:\\
which is different from the value assigned when bzr runs WITHOUT the debugger, i.e.
"C:\Python27\
Exception message follows:
PythonWin 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
>>> bzr: ERROR: exceptions.
Traceback (most recent call last):
File "F:\canonical\
return the_callable(*args, **kwargs)
File "F:\canonical\
argv = _specified_
File "F:\canonical\
return osutils.
File "F:\canonical\
argv = _command_
File "F:\canonical\
raise AssertionError(
AssertionError: Split command line can't be shorter than argv
bzr 2.6.0dev1 on python 2.7.2 (Windows-
arguments: ['F:\\canonical
plugins:
encoding: 'cp1252', fsenc: 'mbcs', lang: 'C'
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
So, as I understand it the problem in the fact that you load bzr.py into Pythonwin debugger and then run execution of the script. Therefore, original command-line is invokation of Pythonwin, and we need actually sys.argv.
I can only suggest add some workaround to win32util.py and check for Pythonwin. In that case we should skip all our smart command-line split code and simply use sys.argv.
Maybe Pythonwin created some environment variables we can check instead of create regexp for command-line? Can you check their documentation?