Re: [Python-Dev] TextIO seek and tell cookies

2016-09-26 Thread Ben Leslie
sure that they would be interpreted correctly in any receiving instance. Cheers, Ben On 26 September 2016 at 02:30, Ben Leslie wrote: > I think the case of JSON or SQL database is even more important though. > > tell/seek can return 129-bit integers (maybe even more? my maths might >

Re: [Python-Dev] TextIO seek and tell cookies

2016-09-26 Thread Ben Leslie
idiot proof. > > On Sun, Sep 25, 2016 at 9:05 PM, Nick Coghlan wrote: >> On 26 September 2016 at 10:21, MRAB wrote: >>> On 2016-09-26 00:21, Ben Leslie wrote: >>>> Are there any downsides to this? I've made some progress developing a >>>> patch t

Re: [Python-Dev] TextIO seek and tell cookies

2016-09-26 Thread Ben Leslie
On 25 September 2016 at 17:21, MRAB wrote: > On 2016-09-26 00:21, Ben Leslie wrote: >> >> Hi all, >> >> I recently shot myself in the foot by assuming that TextIO.tell >> returned integers rather than opaque cookies. Specifically I was >> adding an offset t

[Python-Dev] TextIO seek and tell cookies

2016-09-25 Thread Ben Leslie
Hi all, I recently shot myself in the foot by assuming that TextIO.tell returned integers rather than opaque cookies. Specifically I was adding an offset to the value returned by TextIO.tell. In retrospect this doesn't make sense/ Now, I don't want to drive change simply because I failed to read

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-09 Thread Ben Leslie
On 9 June 2016 at 13:29, Steven D'Aprano wrote: > On Thu, Jun 09, 2016 at 12:54:31PM -0400, Ben Leslie wrote: > >> I think an exception is much easier for a user to deal with from a >> practical point of view. Trying to work out why a process has hung is >> obviously

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-09 Thread Ben Leslie
On 9 June 2016 at 12:39, Donald Stufft wrote: > >> On Jun 9, 2016, at 12:30 PM, Steven D'Aprano wrote: >> >>> >>> os.urandom >>> -- >> [...] >>> With that in mind, I think that we should, to the best of our ability given >>> the >>> platform we're on, ensure that os.urandom does not retu

Re: [Python-Dev] Obtaining stack-frames from co-routine objects

2015-06-14 Thread Ben Leslie
at, Jun 13, 2015 at 6:16 PM, Nick Coghlan wrote: >> >> >> On 14 Jun 2015 10:01, "Ben Leslie" wrote: >> > >> > If this seems like a good approach I'll try and work it in to a >> > suitable patch for contribution. >> >> I think it

Re: [Python-Dev] Obtaining stack-frames from co-routine objects

2015-06-13 Thread Ben Leslie
On 14 June 2015 at 09:20, Greg Ewing wrote: > Nick Coghlan wrote: >> >> I wonder if in 3.6 it might be possible to *add* some bookkeeping to >> "await" and "yield from" expressions that provides external visibility >> into the underlying iterable or coroutine that the generator-iterator >> or coro

Re: [Python-Dev] Obtaining stack-frames from co-routine objects

2015-06-13 Thread Ben Leslie
On 13 June 2015 at 19:03, Guido van Rossum wrote: > On Sat, Jun 13, 2015 at 12:22 AM, Nick Coghlan wrote: >> >> On 13 June 2015 at 04:13, Guido van Rossum wrote: >> > IOW I don't think that the problem here is that you haven't sufficiently >> > motivated your use case -- you are asking for infor

Re: [Python-Dev] Obtaining stack-frames from co-routine objects

2015-06-13 Thread Ben Leslie
On 13 June 2015 at 17:22, Nick Coghlan wrote: > On 13 June 2015 at 04:13, Guido van Rossum wrote: >> IOW I don't think that the problem here is that you haven't sufficiently >> motivated your use case -- you are asking for information that just isn't >> available. (Which is actually where you sta

Re: [Python-Dev] Obtaining stack-frames from co-routine objects

2015-06-12 Thread Ben Leslie
On 2 June 2015 at 14:39, Yury Selivanov wrote: > Hi Ben, > > On 2015-05-31 8:35 AM, Ben Leslie wrote: >> >> Hi Yury, >> >> I'm just starting my exploration into using async/await; all my >> 'real-world' scenarios are currently hypothetical. &

Re: [Python-Dev] Obtaining stack-frames from co-routine objects

2015-05-31 Thread Ben Leslie
e: > Hi Ben, > > Is there any real-world scenario where you would need this? > > It looks like this can help with debugging, somehow, but the easiest > solution is to put a "if debug: log(...)" before "yield" in your > "switch()" function. Yo

[Python-Dev] Obtaining stack-frames from co-routine objects

2015-05-28 Thread Ben Leslie
Hi all, Apologies in advance; I'm not a regular, and this may have been handled already (but I couldn't find it when searching). I've been using the new async/await functionality (congrats again to Yury on getting that through!), and I'd like to get a stack trace between the place at which blocki

Re: [Python-Dev] Introducing Electronic Contributor Agreements

2013-03-04 Thread Ben Leslie
On Tue, Mar 5, 2013 at 3:30 AM, Brian Curtin wrote: > The full announcement is at > http://blog.python.org/2013/03/introducing-electronic-contributor.html, > but a summary follows. > > We've now moved to an electronic Contributor License Agreement form at > http://www.python.org/psf/contrib/contr

[Python-Dev] Should libpython.a go in eprefix?

2013-01-15 Thread Ben Leslie
Hi all, This issue: http://bugs.python.org/issue9807 from a couple of years ago seems to have changed the LIBPL build variable from pointing to a directory inside EPREFIX, to a directory in PREFIX. This doesn't seem ideal as LIBPL is populated with platform specific files such as libpython.a. I'

Re: [Python-Dev] fork or exec?

2013-01-10 Thread Ben Leslie
On Fri, Jan 11, 2013 at 5:30 PM, Charles-François Natali < cf.nat...@gmail.com> wrote: > > That could always be overcome by passing close_fds=False explicitly to > > subprocess from my code, though, right? I'm not doing that now, but then > I'm not > > using the esoteric options in python-gnupg co

[Python-Dev] http.client Nagle/delayed-ack optimization

2012-12-14 Thread Ben Leslie
The http.client HTTPConnection._send_output method has an optimization for avoiding bad interactions between delayed-ack and the Nagle algorithm: http://hg.python.org/cpython/file/f32f67d26035/Lib/http/client.py#l884 Unfortunately this interacts rather poorly if the case where the message_body is

[Python-Dev] Thread/garbage collection race in Popen

2012-10-04 Thread Ben Leslie
Hi all, I have a Python program where I have many threads each calling Popen, and I was hitting some trouble. I've been seeing this on 3.2.3, however I believe the same issue is still potentially a problem on head. The error manifests itself when a call to os.close(errpipe_read) fails with EBADF