[Pythonmac-SIG] Macho python: os.popen3 hangs

Francesco Pierfederici fpierfed@eso.org
Fri, 12 Jul 2002 11:13:54 +0200


Hi everybody,

I'm using macho-python on a MacOSX 10.1.5 box (I installed the wxPython
version of Python).

I noticed that using os.popen3 to read the stderr of a system command, makes
the python interpreter hang.

Did anybody experience anything like this?

Thanks
Fra


astarte> python -v
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/site.pyc
matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/site.py
import site # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/site.pyc
# /Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/os.pyc
matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/os.py
import os # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/os.pyc
import posix # builtin
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/posixpat
h.pyc matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/posixpat
h.py
import posixpath # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/posixpat
h.pyc
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/stat.pyc
matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/stat.py
import stat # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/stat.pyc
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/UserDict
.pyc matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/UserDict
.py
import UserDict # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/UserDict
.pyc
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/copy_reg
.pyc matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/copy_reg
.py
import copy_reg # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/copy_reg
.pyc
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/types.py
c matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/types.py
import types # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/types.py
c
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/__future
__.pyc matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/__future
__.py
import __future__ # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/__future
__.pyc
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/sitecust
omize.pyc matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/sitecust
omize.py
import sitecustomize # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/sitecust
omize.pyc
Python 2.2.1 (#14, Apr 17 2002, 11:23:23)
[GCC 2.95.2 19991024 (release)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import readline # dynamically loaded from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/lib-dynl
oad/readline.so
>>> import os
>>> (d, o, e) = os.popen3('diff /Users/fpierfed/.subscriptions/AAS/AAS
/Users/fpierfed/.subscriptions/AAS/AAS.temp')
# 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/popen2.p
yc matches 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/popen2.p
y
import popen2 # precompiled from
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.2/popen2.p
yc
>>> e.readlines()

And then a ^C results in the usual
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
KeyboardInterrupt
>>>