X-Received: by 10.224.185.201 with SMTP id cp9mr538qab.6.1361382846977; Wed, 20 Feb 2013 09:54:06 -0800 (PST) X-Received: by 10.49.58.167 with SMTP id s7mr1455193qeq.5.1361382846955; Wed, 20 Feb 2013 09:54:06 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!dd2no958565qab.0!news-out.google.com!t2ni2qaj.0!nntp.google.com!dd2no958561qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Wed, 20 Feb 2013 09:54:06 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=86.9.199.73; posting-account=EvoLHwoAAAAe6MGgc84vdAuhA1J1BvTN NNTP-Posting-Host: 86.9.199.73 References: <76620a9e-45fe-499d-b1bf-06b1d2a91c25@googlegroups.com> <16e85bd1-6e5d-4d70-95bf-cc6b986a9f7c@googlegroups.com> <8f26ac4d-4732-46ac-bf4e-877696b22241@googlegroups.com> <85cd2254-0800-4448-9117-9175bbfd10f6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: improving performance of writing into a pipe From: mikprog@gmail.com Cc: python-list@python.org Injection-Date: Wed, 20 Feb 2013 17:54:06 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.python:39368 On Tuesday, February 19, 2013 5:47:16 PM UTC, Michael Torrie wrote: > On 02/19/2013 02:24 AM, mikprog@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. Michael believe me: I am not resistant or try to hide anything! As written before, I don't know what exception to search for, so I wrote the (wrong) code: except: print "error" Let's why I don't have a clue about it. But someone already explained me that I should not do this. > > 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. Yes it is and has rwx permissions. Unfortunately I don't have access to the code in the pipe. > > 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 > $ 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? I think I do now, thanks. mik