delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/08/06:49:12

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Bug Report: python os.popen seems to have recently been broken
Date: Mon, 8 Aug 2005 11:49:02 +0100
MIME-Version: 1.0
In-Reply-To: <Pine.LNX.4.61.0508081105290.21628@localhost.localdomain>
Message-ID: <SERRANOtWpjIMUy0Yn3000000fb@SERRANO.CAM.ARTIMI.COM>

----Original Message----
>From: Nick Burch
>Sent: 08 August 2005 11:16

> I think the os.popen function in python has recently been broken.
> 
> You can see this with the following python code:
>  	import os
>  	fout = os.popen("echo hello")
>  	print fout.read()
> 
> On a machine I haven't updated for a little while, I get the expected
> result of "hello". This machine is running:
>  	Python 2.4 (#1, Dec  4 2004, 20:10:33)
>  	[GCC 3.3.3 (cygwin special)] on cygwin
> 
> On another machine that I updated last week, I get a blank string
> returned, instead of "hello" as expected. It runs:
>  	Python 2.4.1 (#1, May 27 2005, 18:02:40)
>  	[GCC 3.3.3 (cygwin special)] on cygwin
>
> I'm not sure if this is related, but if I call "fout.close()" on the 1st
> machine, then nothing is returned (as expected). However, if I execute it
> on the 2nd (updated) machine, then I get an integer returned, 32512.

  WJFFM:

-------------------------------<snip!>-------------------------------
dk AT mace /artimi/firmware> python
Python 2.4.1 (#1, May 27 2005, 18:02:40)
[GCC 3.3.3 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> fout = os.popen("echo hello")
>>> print fout.read ()
hello
>>> print fout.close ()
None
-------------------------------<snip!>-------------------------------

  I reckon you probably got bitten by the recent sh/ash/bash transition
problems.  You could post your cygcheck output as described at
http://cygwin.com/problems.html if you want us to take a looksee, or you
could just try re-runiong setup.exe and making sure you're up-to-date with
the latest shell packages.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019