This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: very odd behavior of Cygwin python from CMD


David Abrahams <dave@boost-consulting.com> writes:

> With c:\cygwin\bin in my PATH, if I open a CMD shell and invoke
>
>   python
>
> I get some garbage characters on my console, and then it freezes.   If
> I instead do
>
>   set USER=dave && python
>
> there are no garbage characters and no freeze, but also no python
> process.
>
> Can anyone explain this?

Okay, I have my explanation (sorta): python is a symlink, and if I
execute "python2.4" from CMD I don't have any problems.  

Now, I am writing a program that must use CMD to probe for python in
the PATH and check its version.  If I do the naive thing and just try
to invoke "python," and there's a Cygwin installation, my program will
crash or freeze.  So the question is, what do I do instead?

I can't think of anything that isn't prone to the same issues... okay,
I suppose I could look for the .exe or .bat extension, and if it isn't
found, assume I have a symlink.  Is that the best I can do?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]