[wingide-users] zc.buildout & Getopt Error

Wingware Support support at wingware.com
Wed Nov 18 10:03:31 MST 2009


James Mackenzie wrote:
> I've created a bootstrapped python executable using zc.buildout 
> following http://jacobian.org/writing/django-apps-with-buildout/ tutorial.
> Whenever i set this particular executable as an option for project 
> properties and restart wing ide, an exception with a traceback provided 
> bellow occurs:
> 
>  Traceback (most recent call last):
>   File "/home/user/programming//bin/python", line 19, in <module>
>     _options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:')
>   File "/usr/lib/python2.6/getopt.py", line 91, in getopt
>     opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
>   File "/usr/lib/python2.6/getopt.py", line 191, in do_shorts
>     if short_has_arg(opt, shortopts):
>   File "/usr/lib/python2.6/getopt.py", line 207, in short_has_arg
>     raise GetoptError('option -%s not recognized' % opt, opt)
> getopt.GetoptError: option -u not recognized
> 
> it turns out, that wingide tries to run the python executable with the 
> '-u'  and, for some unknown(for me) reason, the zc.buildout's generated 
> custom
> python executable doesn't accept this '-u' parameter.
> 
> Is there a way to run python executable in the wingide's Python shell 
> tab without the "-u" option?

This seems like a mistake in buildout.  I would expect it to accept args
other than -i, -c, and -m.  May be worth reporting as a bug to the
developers.

Unfortunately the only way to work around this now would be to find and alter
the getopt call to include 'u' in the arg spec.  I'm not quite clear on how
buildout works (in other words, where the first stack frame <module> is)
but searching for getopt turns up some matches.  You may need to alter
easy_install.py, which seems to have a string w/ this code in it, and
then regenerate some things.

Actually, another way to do it might be to create a shell script that
removes the -u parameter and invokes the buildout python and then set
that shell script as your Python Executable in Wing.  That might be
easier as a work-around.

I'm looking into creating a way to do this in Wing.  Please let me know
if neither of the above work for you.

Thanks,

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com



More information about the wingide-users mailing list