[issue27619] getopt should strip whitespace from long arguments

2017-03-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: patch review -> resolved status: pending -> closed ___ Python tracker ___

[issue27619] getopt should strip whitespace from long arguments

2016-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this should just be closed. -- status: open -> pending ___ Python tracker ___

[issue27619] getopt should strip whitespace from long arguments

2016-07-26 Thread R. David Murray
R. David Murray added the comment: I realized some time after I posted that my comment about it emulating C getopt needed a gloss. What I meant was that C getopt is the model, so there should be a sufficient argument that adding a feature is worthwhile. You are making that argument, but

[issue27619] getopt should strip whitespace from long arguments

2016-07-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: C getopt doesn't strip trailing spaces. What you mistook for stripping trailing spaces is actually a feature of GNU getopt that allows you to use shortened variant of long option. $ ./getopdemo "-- sp" 1 --eg 2 "-- ch" 3 option spam with arg 1 option

[issue27619] getopt should strip whitespace from long arguments

2016-07-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Jul 26, 2016 at 03:27:29PM +, R. David Murray wrote: [...] > getopt is explicitly emulating the C getopt There are lots of differences between the C getopt and the Python version, and the Python version is described as offering an API "designed

[issue27619] getopt should strip whitespace from long arguments

2016-07-26 Thread R. David Murray
R. David Murray added the comment: I agree with Serhiy. Python is a programming language, not a shell. It seems to me that it should not be second guessing a constant specified by the programmer. If the programmer puts spaces in the specification string, Python should respect that. I have

[issue27619] getopt should strip whitespace from long arguments

2016-07-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Who would want options --f o o, --f�oo, or --fоо? -- ___ Python tracker ___

[issue27619] getopt should strip whitespace from long arguments

2016-07-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: Serhiy Storchaka added the comment: > It makes Python getopt behave less like the C getopt. Exactly! If C getopt allows whitespace in long options, it's a GOOD thing to avoid such a poor design. Who would want a option --foo (note the trailing space)?

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Jul 26, 2016 at 04:50:33AM +, Serhiy Storchaka wrote: > My answer: if you don't want a space in your long_option, don't put a > space in there. There is no a bug in Python, That's why I listed it as an enhancement, not a bug. > and the patch

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It makes Python getopt behave less like the C getopt. -- ___ Python tracker ___

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > On my Centos system, getopt ignores leading and trailing whitespace on long > options. This is not related to how getopt_long in C works with leading and trailing whitespace on long options, but is related to how command-line utility getopt parses a list

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks for the quick review, I've fixed the issues you mentioned. -- Added file: http://bugs.python.org/file43886/getopt.patch ___ Python tracker

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Berker Peksag
Berker Peksag added the comment: I left some review comments on Rietveld. I think we can treat this as a bug and fix it in 3.5 too. -- nosy: +berker.peksag stage: -> patch review ___ Python tracker

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano
New submission from Steven D'Aprano: As reported here: https://mail.python.org/pipermail/python-list/2016-July/711333.html there's a possible annoyance with getopt when you accidentally leave whitespace on a long option. On my Centos system, getopt ignores leading and trailing whitespace on