[issue29681] getopt fails to handle option with missing value in middle of list

2017-02-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Martin. This is not a bug. -- nosy: +serhiy.storchaka stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29681] getopt fails to handle option with missing value in middle of list

2017-02-28 Thread Martin Panter
Martin Panter added the comment: It's not clear what you expected the behaviour to be. A function cannot both raise an exception and return a value. In any case, you are correct in saying "the next option, '-d', is taken as the argument." I do not think this is a bug. See

[issue29681] getopt fails to handle option with missing value in middle of list

2017-02-28 Thread Marshall Giguere
New submission from Marshall Giguere: Python 3.4.3 (default, Nov 17 2016, 01:08:31) [GCC 4.8.4] on linux >>> from getopt import getopt >>> argv = [ '-a', '-b', '-c', '-d', 'foo'] >>> opts, args = getopt( argv, 'abc:d:') >>> opts [('-a', ''), ('-b', ''), ('-c', '-d')] >>> args ['foo'] Expected b