Python Interpreter generated by buildout does not support -V option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Buildout |
New
|
Undecided
|
Unassigned |
Bug Description
For the python interpreter generated by buildout, that is, when you specify in buildout.cfg :
...
[eggs]
recipe = zc.recipe.egg
eggs =
extra-paths =
interpreter = python
it does not recognize the -V option:
$ <myproject>
Traceback (most recent call last):
File "bin/python", line 87, in <module>
_options, _args = __import_
File "/usr/lib/
opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
File "/usr/lib/
if short_has_arg(opt, shortopts):
File "/usr/lib/
raise GetoptError('option -%s not recognized' % opt, opt)
getopt.
A normal behaviour should be :
# /usr/bin/python -V
Python 2.7.5
This is normal because buildout generated an interpreter that does not include detection of -V option, one can see within the interpreter script:
_interactive = True
if len(sys.argv) > 1:
_options, _args = __import_
for (_opt, _val) in _options:
if _opt == '-i':
elif _opt == '-c':
elif _opt == '-m':
The suggested fix is (buildout/
_interactive = True
if len(sys.argv) > 1:
_options, _args = __import_
for (_opt, _val) in _options:
if _opt == '-i':
elif _opt == '-c':
elif _opt == '-V':
elif _opt == '-m':
Note : the '-V' option is mandatory to get PyCharm IDE fully working as it must detect python version to make a correct syntax coloring.