On Wed, Nov 30, 2016 at 4:54 PM, duncan smith <duncan@invalid.invalid> wrote:
>
> Thanks. So something like the following might do the job?
>
> def _execute(command):
>     p = subprocess.Popen(command, shell=False,
>                          stdout=subprocess.PIPE,
>                          stderr=subprocess.STDOUT,
>                          close_fds=True)
>     out_data, err_data = p.communicate()
>     if err_data:
>         print err_data

I did not notice it when I sent my first e-mail (but noted it in my
second one) that the docstring in to_image is presuming that
shell=True. That said, as it seems everybody is at a loss to explain
your issue, perhaps there is some oddity, and if everything appears to
work with shell=False, it may be worth changing to see if it does fix
the problem. With other information since provided, it is unlikely,
however.

Not specifying the stdin may help, however it will only reduce the
file handle count by 1 per call (from 2), so there is probably a root
problem that it will not help.

I would expect the communicate change to fix the problem, except for
your follow-up indicating that you had tried that before without
success.

Removing the manual stdout.read may fix it, if the problem is due to
hanging processes, but again, your follow-up indicates thats not the
problem - you should have zombie processes if that were the case.

A few new questions that you have not answered (nor have they been
asked in this thread): How much memory does your system have? Are you
running a 32-bit or 64-bit Python? Is your Python process being run
with any additional limitations via system commands (I don't know the
command, but I know it exists; similarly, if launched from a third
app, it could be placing limits)?

Chris
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to