Le 9 déc. 2011 10:27, "Ansgar Burchardt" <ansgar@debian.org> a écrit :
>
> Sébastien Bertrand <thedamocles@gmail.com> writes:
> >> - It probably does not handle whitespace in command names or
> >> directories.
> >
> > It handles complex command without problem.
>
> How? anonx does
>
> app = ' '.join(sys.argv[1:]) # Pick all arguments,
>
> but calling
>
> foo "bar x"
>
> is not the same as calling
>
> foo bar x.
From the point of view of anoX, these two commands are the same.
>
> Similar for directories: if the current work directory is something like
> "/foo/bar foo", then
>
> f.write("cd " + directory + "\n")
>
> will not work. (Everything except \0 can appear in a path.)
>
> >> - From the documentation on Popen.wait[1]:
> >> "Warning: This will deadlock when using stdout=PIPE and/or
> >> stderr=PIPE and the child process generates enough output to a pipe
> >> such that it blocks waiting for the OS pipe buffer to accept more
> >> data."
> >
> > Ok, I'm not sure to understand how to write the code, but I'll check that point.
>
> You could just not redirect stdout (same as stderr).
Thanks, that's managed in the 2.1 with Popon.communicate().
Regards,
Sébastien.