matplotlib-0.87.2 on Windows - using subprocess.Popen()

Darren,

I tried "idle -n" and got the same result:

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
win32 Type "copyright", "credits" or "license()" for more information.

···

****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface. This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************
    
IDLE 1.1.2 ==== No Subprocess ====

import subprocess
process = subprocess.Popen(['dir'], shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in ?
    process = subprocess.Popen(['dir'], shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  File "C:\Python\lib\subprocess.py", line 533, in __init__
    (p2cread, p2cwrite,
  File "C:\Python\lib\subprocess.py", line 593, in _get_handles
    p2cread = self._make_inheritable(p2cread)
  File "C:\Python\lib\subprocess.py", line 634, in _make_inheritable
    DUPLICATE_SAME_ACCESS)
TypeError: an integer is required

PJR

-----Original Message-----
From: matplotlib-users-admin@lists.sourceforge.net
[mailto:matplotlib-users-admin@lists.sourceforge.net] On
Behalf Of Darren Dale
Sent: 20 March 2006 16:19
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] matplotlib-0.87.2 on Windows
- using subprocess.Popen()

On Monday 20 March 2006 09:03, Randewijk P-J > <pjrandew@...841...> wrote:
> Darren,
>
> I prefer using PythonWin to IDLE. Any ideas how to solve the
> subprocess.Popen() problem using PythonWin? What about using
> "win32pipe"?

I don't know how to solve it for pythonwin, maybe you could
investigate it
with a google search (thats how I learned about the problem
and the solution
for idle).

I suppose win32pipe is part of pywin32. If that is the case,
I dont think I
can support using it; we are trying to eliminate
dependencies, not add to
them. Subprocess is acceptable because it is part of the
python-2.4 standard
library and we were able to add it to the mpl tree for older
versions of
python.

Darren

> -----Original Message-----
> From: Darren Dale [mailto:dd55@…163…]
> Sent: 20 March 2006 15:52
> To: Randewijk P-J <pjrandew@...841...>
> Subject: Re: ASPN : Python Cookbook : Module to allow Asynchronous
> subprocess use on Windows and Posix platforms
>
>
> I forgot to mention, you may be able to avoid these errors
by starting
> idle with the -n flag.
>
> On Monday 20 March 2006 08:36, you wrote:
> > Aha!
> >
> > In both the IDLE & PythonWin (my default my using pylab)
shells it
> > fails... but not from the python shell...
> >
> > PJR
> >
> > > -----Original Message-----
> > > From: Darren Dale [mailto:dd55@…163…]
> > > Sent: 20 March 2006 15:25
> > > To: Randewijk P-J <pjrandew@...841...>
> > > Subject: Re: ASPN : Python Cookbook : Module to allow
Asynchronous
> > > subprocess use on Windows and Posix platforms
> > >
> > >
> > > Also, are you running this from IDLE? If so, please try
running it
> > > from a regular python shell, or better, run a script
from the dos
> > > shell.
> > >
> > > On Monday 20 March 2006 08:06, you wrote:
> > > > This is what I get:
> > > > >>> import subprocess
> > > > >>> process = subprocess.Popen(['dir'], shell=True,
> > > >
> > > > stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
> > > > Traceback (most recent call last):
> > > > File "<interactive input>", line 1, in ?
> > > > File "C:\Python\lib\subprocess.py", line 533, in __init__
> > > > (p2cread, p2cwrite,
> > > > File "C:\Python\lib\subprocess.py", line 593, in
_get_handles
> > > > p2cread = self._make_inheritable(p2cread)
> > > > File "C:\Python\lib\subprocess.py", line 634, in
>
> _make_inheritable
>
> > > > DUPLICATE_SAME_ACCESS)
> > > > TypeError: an integer is required
> > > >
> > > > PJR
> > > >
> > > > > -----Original Message-----
> > > > > From: Darren Dale [mailto:dd55@…163…]
> > > > > Sent: 20 March 2006 14:49
> > > > > To: Randewijk P-J <pjrandew@...841...>
> > > > > Subject: Re: ASPN : Python Cookbook : Module to allow
> > >
> > > Asynchronous
> > >
> > > > > subprocess use on Windows and Posix platforms
> > > > >
> > > > >
> > > > > Hi P-J,
> > > > >
> > > > > On Monday 20 March 2006 7:39 am, you wrote:
> > > > > > Dear Darren,
> > > > > >
> > > > > > Maybe this could help solve the Windows problem with
> > > > >
> > > > > Popen()... don't
> > > > >
> > > > > > know about the 2.3 issue however...
> > > > > >
> > > > > >
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/4405
> > > > > > 54
> > > > >
> > > > > I'm not convinced that there is an issue with
subprocess.Popen
> > > > > in windows. I tested the following block on windows (with
> > >
> > > python-2.4)
> > >
> > > > > and it worked fine.
> > > > >
> > > > > import subprocess
> > > > > process = subprocess.Popen(['dir'], shell=True,
> > > > > stdout=subprocess.PIPE,
> > > > > stderr=subprocess.STDOUT)
> > > > > stat = process.wait()
> > > > > print process.stdout.read()
> > > > >
> > > > > I posted this to the list last week. Did you test it?
> > >
> > > --
> > > Darren S. Dale, Ph.D.
> > > Cornell High Energy Synchrotron Source
> > > Cornell University
> > > 200L Wilson Lab
> > > Rt. 366 & Pine Tree Road
> > > Ithaca, NY 14853
> > >
> > > dd55@...163...
> > > office: (607) 255-9894
> > > fax: (607) 255-9001

--
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

dd55@...163...
office: (607) 255-9894
fax: (607) 255-9001

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking
scripting language that extends applications into web and
mobile media. Attend the live webcast and join the prime
developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&

dat=121642
_______________________________________________
Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net