Race condition deadlock in communicate when threading?

2011-09-26 Thread Atherun
In python 2.6.4 I have a fairly complex system running (copying and pasting it would be quite difficult). At its core there are builders that inherit from threading.Thread. I have some builders that run external tasks via popen and read output using communicate. I have the ability to run any num

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: >

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 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?

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-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 documentatio

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

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 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 app

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