[New-bugs-announce] [issue28210] argparse with subcommands difference in python 2.7 / 3.5

stephan report at bugs.python.org
Tue Sep 20 04:43:54 EDT 2016


New submission from stephan:

In python 2.7.12 I get an error if I do not pass
arguments, while in python 3.5.2 I do not get
the error (it fails silently).
Stumbled on this during my migration of my python 2.7 code to python 3.5 for django.

Here is the console output:

D:\util\python\test>py -3 test_argparse.py
3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]
Use subparsers: True
Namespace(command=None)

D:\util\python\test>py -2 test_argparse.py
2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)]
Use subparsers: True
usage: test_argparse.py [-h] command ...
test_argparse.py: error: too few arguments

D:\util\python\test>

----------
files: test_argparse.py
messages: 277017
nosy: stephan
priority: normal
severity: normal
status: open
title: argparse with subcommands difference in python 2.7 / 3.5
type: behavior
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file44751/test_argparse.py

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


More information about the New-bugs-announce mailing list