[issue16863] Argparse tutorial outdated
New submission from Charlie Dimino: http://docs.python.org/2/howto/argparse.html Error message in the first example is outdated, may indicate further out of date information on page. Example: The tutorial says: prog.py: error: the following arguments are required: echo When the actual error received is: prog.py: error: too few arguments ---------- assignee: docs@python components: Documentation messages: 179041 nosy: Charlie.Dimino, docs@python priority: normal severity: normal status: open title: Argparse tutorial outdated versions: Python 2.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
R. David Murray added the comment: Actually it looks like it is future-dated. The documented error message is the one you get from 3.3. I guess someone backported a doc change for a feature change. ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
R. David Murray added the comment: Ah, the whole tutorial is newish. So this is a bug just in the 2.7 version of the tutorial (it doesn't match the 2.7 code), and yes, there may be other issues as well. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
R. David Murray added the comment: See issue 14034. Ezio apparently left the error messages unchanged on purpose...I'm not sure why. ---------- assignee: docs@python -> nosy: +ezio.melotti, tshepang _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Ezio Melotti added the comment: When I backported the patch I probably didn't want to try all the examples to see what the py2 error was. In addition the py3 error is more clear even if it doesn't match what you actually get. I think this can be closed as won't fix, unless someone wants to propose a patch. ---------- type: -> enhancement _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Charlie Dimino added the comment: If it's okay, don't close this just yet. I'm new to this system but I'll submit a patch with any fixes to the tutorial I find. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Changes by Tshepang Lekhonkhobe <tshepang@gmail.com>: ---------- title: Argparse tutorial outdated -> Python 2 error in Argparse tutorial _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Terry J. Reedy added the comment: A quick patch would be 'This tutorial was written for argparse in Python 3. A few details are different in 2.x.' But feel free to do better. ---------- nosy: +terry.reedy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Tshepang Lekhonkhobe added the comment:
A quick patch would be 'This tutorial was written for argparse in Python 3. A few details are different in 2.x.' But feel free to do better.
That really sounds great, especially since it avoids resorting to things as ugly as "...and this is Python 2 output". ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Changes by Phil Connell <pconnell@gmail.com>: ---------- nosy: +pconnell _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- keywords: +easy nosy: +berker.peksag stage: -> needs patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Terry J. Reedy added the comment: Since the author of the tutorial agrees with my idea, and no one has come forward with anything else, I will make the change. ---------- assignee: -> terry.reedy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Roundup Robot added the comment: New changeset e7428d7f641f by Terry Jan Reedy in branch '2.7': Issue #16863: Explain difference between text and 2.7 behavior. https://hg.python.org/cpython/rev/e7428d7f641f ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
Terry J. Reedy added the comment: Once this discrepancy is explained (3.x) prog.py: error: the following arguments are required: echo (2.7) prog.py: error: too few arguments I agree with leaving the 3.x version in the tutorial. A normal output discrepany might be a different matter. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16863> _______________________________________
participants (8)
-
Berker Peksag
-
Charlie Dimino
-
Ezio Melotti
-
Phil Connell
-
R. David Murray
-
Roundup Robot
-
Terry J. Reedy
-
Tshepang Lekhonkhobe