[issue11906] Test_argparse failure but only in interactive mode

Andreas Stührk report at bugs.python.org
Sat Apr 23 01:51:15 CEST 2011


Andreas Stührk <andy-python at hammerhartes.de> added the comment:

That happens because argparse uses `os.basename(sys.argv[0])` (per default) as program name, but `sys.argv[0]` is usually a string of length 0 at interactive sessions. The tests use ``"usage: {} ...".format(program_name)`` (note that there will be two spaces for an empty `program_name`) for the expected output, while argparse only outputs one space in that case.

----------
nosy: +Trundle

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11906>
_______________________________________


More information about the Python-bugs-list mailing list