Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52555

Re: Pair of filenos read/write each other?

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <tdhfwh@nottheoilrig.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'advice.': 0.09; 'app,': 0.09; 'wrapper': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'suggest': 0.14; 'descriptor': 0.16; 'do,': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'library': 0.18; 'wed,': 0.18; 'bit': 0.19; 'app': 0.19; 'trying': 0.19; 'normally': 0.19; 'written': 0.21; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'passes': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'received:24': 0.27; '+0100,': 0.31; 'app.': 0.31; 'context,': 0.31; 'subject:other': 0.31; 'anyone': 0.31; 'file': 0.32; 'run': 0.32; 'test': 0.35; 'there': 0.35; '14,': 0.36; 'vice': 0.36; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'depends': 0.38; 'anything': 0.39; 'read': 0.60; 'numbers': 0.61; "you're": 0.61; 'content-disposition:inline': 0.62; 'such': 0.63; 'more': 0.64; 'mock': 0.84; 'subject:read': 0.84; 'subject:Pair': 0.91; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=simple/simple; d=nottheoilrig.com; s=mail; t=1376582170; bh=HzP0AU3Qwz8JfTx+DNjp/h9krdTz9JwLq9YOMCz5sLM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=eD7PAGSXpBd1yED2MSumCoaOwGCMTmo9mw1bc4pV9Dz8xcyyt3JSb9bbUwxRJ2iK1 0ornuRaJLcEIlKmY8iiG3xHYt7t0MwnWp0jDdtma4MY1J0Iq2L2t5fUpKD4r2+3+W0 gn5Ca0Bsg+59swk8bRDf5DHyAM+tglZ6Fl+3bhsM=
Date Thu, 15 Aug 2013 08:56:10 -0700
From Jack Bates <tdhfwh@nottheoilrig.com>
To Rhodri James <rhodri@wildebst.demon.co.uk>
Subject Re: Pair of filenos read/write each other?
References <mailman.552.1376435986.1251.python-list@python.org> <op.w1r5rqzha8ncjz@gnudebeest>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <op.w1r5rqzha8ncjz@gnudebeest>
User-Agent Mutt/1.5.20 (2009-06-14)
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.600.1376582179.1251.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1376582179 news.xs4all.nl 15926 [2001:888:2000:d::a6]:39177
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52555

Show key headers only | View raw


On Wed, Aug 14, 2013 at 01:17:40AM +0100, Rhodri James wrote:
> On Wed, 14 Aug 2013 00:10:41 +0100, Jack Bates <tdhfwh@nottheoilrig.com>  
> wrote:
> 
> > Can anyone suggest a way to get a pair of file descriptor numbers such  
> > that data written to one can be read from the other and vice versa?
> >
> > Is there anything like os.pipe() where you can read/write both ends?
> 
> Sockets?  It depends a bit on what you're trying to do, exactly.  If you  
> give us a bit more context, we might be able to give you better advice.

Thanks, I am writing a fixture to test an app. The app normally uses the Python
wrapper for the GnuTLS library to handshake with a service that I want to
mock up in my fixture. The app passes a file descriptor number to
gnutls_transport_set_ptr()

When I test the app, the app and fixture run in the same process. I want a file
descriptor number I can foist on the app, and in the fixture access what is
read/written to it by the GnuTLS wrapper.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Pair of filenos read/write each other? Jack Bates <tdhfwh@nottheoilrig.com> - 2013-08-13 16:10 -0700
  Re: Pair of filenos read/write each other? "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-08-14 01:17 +0100
    Re: Pair of filenos read/write each other? Chris Angelico <rosuav@gmail.com> - 2013-08-14 01:55 +0100
    Re: Pair of filenos read/write each other? Jack Bates <tdhfwh@nottheoilrig.com> - 2013-08-15 08:56 -0700
    Re: Pair of filenos read/write each other? Jack Bates <tdhfwh@nottheoilrig.com> - 2013-08-15 08:59 -0700
  Re: Pair of filenos read/write each other? Roy Smith <roy@panix.com> - 2013-08-13 21:37 -0400
  Re: Pair of filenos read/write each other? Nobody <nobody@nowhere.com> - 2013-08-14 08:21 +0100
    Re: Pair of filenos read/write each other? Antoine Pitrou <solipsis@pitrou.net> - 2013-08-14 08:34 +0000
    Re: Pair of filenos read/write each other? Jack Bates <tdhfwh@nottheoilrig.com> - 2013-08-15 09:19 -0700
    Re: Pair of filenos read/write each other? Antoine Pitrou <solipsis@pitrou.net> - 2013-08-15 18:24 +0000

csiph-web