[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed. Thanks, Anton. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7f8843ec34ee by Alexander Belopolsky in branch 'default': Issue #21966: Respect -q command-line option when code module is ran. http://hg.python.org/cpython/rev/7f8843ec34ee -- nosy: +python-dev ___ Pytho

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Anton Barkovsky
Anton Barkovsky added the comment: Yeah, my love for keyword arguments is a bit too big sometimes. -- Added file: http://bugs.python.org/file35934/code_flags_argparse_v2.patch ___ Python tracker ___

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: A nitpick: banner=banner in + interact(banner=banner) is redundant. + interact(banner) would work and is just as clear. -- ___ Python tracker ___

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Anton Barkovsky
Anton Barkovsky added the comment: That's not a very likely scenario and I think the distinction between arguments that are passed to the script and interpreter flags is fairly obvious. -- ___ Python tracker _

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I think we should check for -q both before -m and after, because why not? If we check for sys.flags.quiet, wouldn't it be surprising to have $ python3 -mcode -q >>> import sys; sys.flags.quiet 0 -- ___ Pytho

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Anton Barkovsky
Anton Barkovsky added the comment: Here's a patch that checks both sys.flags and sys.argv and uses argparse. -- Added file: http://bugs.python.org/file35933/code_flags_argparse.patch ___ Python tracker

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: In order to implement reasonable rejection behavior, we probably need to add some support for -h. $ python3 -z Unknown option: -z usage: python3 [option] ... [-c cmd | -m mod | file | -] [arg] ... Try `python -h' for more information. I don't think we sh

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Anton Barkovsky
Anton Barkovsky added the comment: > 1. How should python3 -q -mcode behave? I've only now found out about sys.flags. I think we should check for -q both before -m and after, because why not? > 2. If we add this patch, should we also attempt to emulate other command line > options (-V, -h, et

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread R. David Murray
R. David Murray added the comment: Whether or not other options are emulated, unimplemented ones should probably be rejected. -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: That was quick! (Well - I knew it would not be hard.) I have two questions: 1. How should python3 -q -mcode behave? 2. If we add this patch, should we also attempt to emulate other command line options (-V, -h, etc.)? -- assignee: -> belopolsky

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Anton Barkovsky
Anton Barkovsky added the comment: Here's a patch. -- keywords: +patch nosy: +anton.barkovsky Added file: http://bugs.python.org/file35932/code.patch ___ Python tracker ___ _

[issue21966] InteractiveConsole does not support -q option

2014-07-12 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: When invoked with -q option, python3 prints no banner: $ python3 -q >>> However, code.InteractiveConsole does not implement this feature: $ python3 -mcode -q Python 3.4.1 (default, May 19 2014, 13:10:29) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.