Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 7:03 pm, Matt Joiner wrote: > how do you get the call stacks like this? > > > > > > > > On Sat, Sep 24, 2011 at 3:59 AM, Atherun wrote: > > On Sep 23, 10:47 am, Nobody wrote: > >> On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote: > >> >> kernel32.dll!WaitForSingleObject+0x12 > >> >> p

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Matt Joiner
how do you get the call stacks like this? On Sat, Sep 24, 2011 at 3:59 AM, Atherun wrote: > On Sep 23, 10:47 am, Nobody wrote: >> On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote: >> >> kernel32.dll!WaitForSingleObject+0x12 >> >> python26.dll!_Py_svnversion+0xcf8 >> >> > I haven't a clue how thi

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 10:47 am, Nobody wrote: > On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote: > >> kernel32.dll!WaitForSingleObject+0x12 > >> python26.dll!_Py_svnversion+0xcf8 > > > I haven't a clue how this happens. _Py_svnversion just returns a string: > > In retrospect, I think that's a red herring. 0

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Nobody
On Fri, 23 Sep 2011 06:59:12 +0100, Nobody wrote: >> kernel32.dll!WaitForSingleObject+0x12 >> python26.dll!_Py_svnversion+0xcf8 > > I haven't a clue how this happens. _Py_svnversion just returns a string: In retrospect, I think that's a red herring. 0xcf8 seems like too large an offset for such

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 7:58 am, Atherun wrote: > On Sep 23, 12:08 am, Chris Angelico wrote: > > > On Fri, Sep 23, 2011 at 3:59 PM, Nobody wrote: > > > It doesn't even > > > You intrigue me, sir. Does it odd? > > > What is the remainder of this aborted sentence? > > > ChrisA > > That is odd, I also find it o

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Atherun
On Sep 23, 12:08 am, Chris Angelico wrote: > On Fri, Sep 23, 2011 at 3:59 PM, Nobody wrote: > > It doesn't even > > You intrigue me, sir. Does it odd? > > What is the remainder of this aborted sentence? > > ChrisA That is odd, I also find it odd that it deadlocks the entire python system, even t

Re: Python deadlock using subprocess.popen and communicate

2011-09-23 Thread Chris Angelico
On Fri, Sep 23, 2011 at 3:59 PM, Nobody wrote: > It doesn't even > You intrigue me, sir. Does it odd? What is the remainder of this aborted sentence? ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Python deadlock using subprocess.popen and communicate

2011-09-22 Thread Nobody
On Thu, 22 Sep 2011 11:19:28 -0700, Atherun wrote: >> I suggest obtaining a copy of Process Explorer, and using it to >> investigate the state of both processes (but especially the child) at the >> point that the "deadlock" seems to occur. > > In the one case I can easily reproduce, its in a p4.e

Re: Python deadlock using subprocess.popen and communicate

2011-09-22 Thread Atherun
On Sep 22, 10:44 am, Nobody wrote: > On Thu, 22 Sep 2011 08:55:40 -0700, Atherun wrote: > >> Just handle process.stdout/stderr by yourself - read it out until EOF > >> and then wait() for the process. > > > Thats what confuses me though, the documentation says > > process.stdout.read()/stderr.read

Re: Python deadlock using subprocess.popen and communicate

2011-09-22 Thread Nobody
On Thu, 22 Sep 2011 08:55:40 -0700, Atherun wrote: >> Just handle process.stdout/stderr by yourself - read it out until EOF >> and then wait() for the process. > > Thats what confuses me though, the documentation says > process.stdout.read()/stderr.read() can deadlock and apparently so can > comm

Re: Python deadlock using subprocess.popen and communicate

2011-09-22 Thread Atherun
On Sep 22, 12:24 am, Thomas Rachel wrote: > Am 22.09.2011 05:42 schrieb Atherun: > > > I'm pretty sure thats the problem, this is a generic catch all > > function for running subprocesses.  It can be anything to a simple > > command to a complex command with a ton of output.  I'm looking for a > >

Re: Python deadlock using subprocess.popen and communicate

2011-09-22 Thread Thomas Rachel
Am 22.09.2011 05:42 schrieb Atherun: I'm pretty sure thats the problem, this is a generic catch all function for running subprocesses. It can be anything to a simple command to a complex command with a ton of output. I'm looking for a better solution to handle the case of running subprocesses

Re: Python deadlock using subprocess.popen and communicate

2011-09-21 Thread Atherun
On Sep 21, 8:58 pm, Roy Smith wrote: > In article , >  Chris Rebert wrote: > > > Popen.poll(): > >     Check if child process has terminated. Set **and return** > > returncode attribute. > > [Direct quote from the docs; emphasis added] > > Doh.  I read right past that and didn't see it.  Thanks f

Re: Python deadlock using subprocess.popen and communicate

2011-09-21 Thread Roy Smith
In article , Chris Rebert wrote: > Popen.poll(): > Check if child process has terminated. Set **and return** > returncode attribute. > [Direct quote from the docs; emphasis added] Doh. I read right past that and didn't see it. Thanks for the correction. -- http://mail.python.org/mailman

Re: Python deadlock using subprocess.popen and communicate

2011-09-21 Thread Chris Rebert
On Wed, Sep 21, 2011 at 8:32 PM, Roy Smith wrote: > My reading of the docs > (http://docs.python.org/release/2.6.7/library/subprocess.html#popen-objec > ts) says that Popen.poll() doesn't return a value, it sets the object's > return code attribute, which you can then interrogate. Popen.poll():

Re: Python deadlock using subprocess.popen and communicate

2011-09-21 Thread Atherun
On Sep 21, 8:33 pm, Chris Rebert wrote: > On Wed, Sep 21, 2011 at 8:09 PM, Atherun wrote: > > This is on windows with python 2.6. > > I can't seem to remove a possibility of a  deadlock in one of my > > scripts at the moment.  Its not a constant deadlock but it appears > > from time to time.  The

Re: Python deadlock using subprocess.popen and communicate

2011-09-21 Thread Roy Smith
In article <098f3d78-85f5-44e7-ba72-f2270a24d...@o9g2000vbo.googlegroups.com>, Atherun wrote: > This is on windows with python 2.6. > I can't seem to remove a possibility of a deadlock in one of my > scripts at the moment. Its not a constant deadlock but it appears > from time to time. The c

Re: Python deadlock using subprocess.popen and communicate

2011-09-21 Thread Chris Rebert
On Wed, Sep 21, 2011 at 8:09 PM, Atherun wrote: > This is on windows with python 2.6. > I can't seem to remove a possibility of a  deadlock in one of my > scripts at the moment.  Its not a constant deadlock but it appears > from time to time.  The code is below: > > try: > >        process = > sub

Python deadlock using subprocess.popen and communicate

2011-09-21 Thread Atherun
This is on windows with python 2.6. I can't seem to remove a possibility of a deadlock in one of my scripts at the moment. Its not a constant deadlock but it appears from time to time. The code is below: try: process = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOU