X-Spam-Check-By: sourceware.org
Date: Fri, 04 May 2007 13:54:28 -0400
From: Jason Tishler <jason@tishler.net>
Subject: Re: popen problems
In-reply-to: <82f04dc40705040736w3fbdb9a8r6fd9b0a9a8f9ee42@mail.gmail.com>
To: cygwin@cygwin.com
Mail-followup-to: cygwin@cygwin.com
Message-id: <20070504175428.GA2556@tishler.net>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-disposition: inline
References: <82f04dc40705040736w3fbdb9a8r6fd9b0a9a8f9ee42@mail.gmail.com>
User-Agent: Mutt/1.4.2.1i
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Dan,

On Fri, May 04, 2007 at 09:36:23AM -0500, Dan Armbrust wrote:
> [snip]
> >>>import os.path
> >>>os.popen('ls').readline()
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
> OSError: [Errno 13] Permission denied
> 
> What on earth happened?

The above indicates that /bin/sh.exe is not executable.  I can reproduce
the problem with the following:

    $ python -c 'import os; os.popen("ls").readline()' # works
    $ chmod -x /bin/sh.exe
    $ python -c 'import os; os.popen("ls").readline()' # doesn't work
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    OSError: [Errno 13] Permission denied
    $ chmod +x /bin/sh.exe
    $ python -c 'import os; os.popen("ls").readline()' # works again
    $

> Any idea how I can fix this?

Make your Cygwin executables and DLLs executable.  You may have to use
Windows tools, if chmod is not executable...

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--
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/

