This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: subprocess.py Errors with IDLE
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: astrand Nosy List: astrand, bethard, kbk
Priority: normal Keywords:

Created on 2005-02-17 20:33 by kbk, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg24343 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2005-02-17 20:33
=====================
From: David S. <davidschein <at> alumni.tufts.edu>
Subject: subprocess problem on Windows in IDLE and PythonWin
Newsgroups: gmane.comp.python.general
Date: Wed, 16 Feb 2005 02:05:24 +0000


Python 2.4 on Windows XP
In the python command-line the following works fine:

>>> from subprocess import *
>>> p = Popen('dir', stdout=PIPE)

>From within IDLE or PythonWin I get the following exception:

Traceback (most recent call last):
  File "<pyshell#13>", line 1, in -toplevel-
    p = Popen('dir', stdout=PIPE)
  File "c:\python24\lib\subprocess.py", line 545, in __init__
    (p2cread, p2cwrite,
  File "c:\python24\lib\subprocess.py", line 605, in _get_handles
    p2cread = self._make_inheritable(p2cread)
  File "c:\python24\lib\subprocess.py", line 646, in 
_make_inheritable
    DUPLICATE_SAME_ACCESS)
TypeError: an integer is required

Note it works fine on Linux also.  I tested it with 
>>> p = Popen('ls', stdout=PIPE)
... and had no trouble.

===========

I (KBK) can duplicate this on W2K using 2.4.  If I run IDLE with the -n 
switch (no subprocess) the error doesn't occur.

Unfortunately, I can't debug it because I don't have the necessary
tools on Windows.  It appears that the problem is in 
_subprocess.c:sp_DuplicateHandle(), likely that PyArg_ParseTuple()
is OK but the failure occurs in the call to DuplicateHandle().

All the args to sp_DuplicateHandle() seem to be the right type.
DUPLICATE_SAME_ACCESS is an integer, value 2

To find out what's going on, it would seem necessary to attach a
windows debugger to IDLE's subprocess (not the IDLE GUI).  Let
me know if I can help.
msg24344 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2005-09-26 14:51
Logged In: YES 
user_id=945502

I believe this is related to 1124861 (if it's not a
duplicate of it)
msg24345 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2007-01-22 19:30
Duplicate of 1124861. 
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41594
2005-02-17 20:33:16kbkcreate