subprocess problem on Windows in IDLE and PythonWin

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David S.

    #1

    subprocess problem on Windows in IDLE and PythonWin

    Python 2.4 on Windows XP
    In the python command-line the following works fine:
    [color=blue][color=green][color=darkred]
    >>> from subprocess import *
    >>> p = Popen('dir', stdout=PIPE)[/color][/color][/color]
    [color=blue]
    >From within IDLE or PythonWin I get the following exception:[/color]

    Traceback (most recent call last):
    File "<pyshell#1 3>", line 1, in -toplevel-
    p = Popen('dir', stdout=PIPE)
    File "c:\python24\li b\subprocess.py ", line 545, in __init__
    (p2cread, p2cwrite,
    File "c:\python24\li b\subprocess.py ", line 605, in _get_handles
    p2cread = self._make_inhe ritable(p2cread )
    File "c:\python24\li b\subprocess.py ", line 646, in _make_inheritab le
    DUPLICATE_SAME_ ACCESS)
    TypeError: an integer is required

    Note it works fine on Linux also. I tested it with[color=blue][color=green][color=darkred]
    >>> p = Popen('ls', stdout=PIPE)[/color][/color][/color]
    .... and had no trouble.

Working...