On 02/19/2013 02:24 AM, mikp...@gmail.com wrote:
> Or rather: what would you try to catch in this particular case?

As Peter said, nothing for now.  But you seem very resistant to telling
us what exception was raised.

Though looking at your code more closely I can see that likely the error
is related to the fact that /tmp/mypipe is not an executable program.
popen (which is deprecated and replaced by the subprocess module) is for
running programs and communicating with them over pipes created by the
popen function.  So your code is not likely to ever work as it is
presently given.

Here's the bash equivalent of your code:

$ mkfifo /tmp/path
$ cat </tmp/path &
$ echo hello, world | /tmp/path

Bash will say, "bash: /tmp/path: Permission denied"

The correct bash line is:
$ echo hello, world > /tmp/path

popen() (and subprocess) is the equivalent of the first bash command.
open() is the equivalent of the second line.

Do you understand the difference?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to