Hi, I solved my problem. It is a known fork() bug in Python 2.7.2. I also replaced the subprocess code with low-level os-module code.
Thanks anyways Christian > this is my first port here on the list. I have tried to find information for > my problem on the web, but had no success. > > I am developing a wsgi application that shall be runn with mod_wsgi. There is > some piece of code that allows to execute a command. This command in turn > shall return output which the application needs. > > Here is a code fragment: > > for special_opt in iter(special_opts): > if self.has_option(section, special_opt): > cmd = shlex.split(self.get(section, special_opt)) > > # ... some more code ... > > p = subprocess.Popen(cmd, > stdout=subprocess.PIPE, > stderr=subprocess.PIPE, > shell=True) > > result = p.communicate() > > if p.returncode != 0: > raise Exception(p.returncode, result[1]) > else: > domain = result[0] > > if domain == "": > continue > > The main problem I do have is that stdout seems not to work and I can not > figure out why. If cmd is a simple list like: > > ['/bin/echo', 'hello'] > > the returncode is "-6" and the result[0] = '' > > There is no special mod_wsgi configuration. No restrictions on using stdout. > All I get is the raised exception seen above in error.log > > Does Apache or mod_wsgi forbid something? Is this configurable somewhere. I > would be really thankful for any help you can give. > > Best wishes > Christian -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
