This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vitaly
Recipients Denis.Bilenko, hynek, ned.deily, neologix, ronaldoussoren, schmir, vitaly
Date 2012-09-19.17:54:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1348077282.82.0.0829988915146.issue15896@psf.upfronthosting.co.za>
In-reply-to
Content
> And what kind of workaround do you propose?

[os.read(fd, buffersize)]

I am thinking about these options:

Option 1:
Fix breakages as they are discovered at higher level (above os.read) as needed in places where usage semantics are known, and address the issue via errata documentation (i.e., "On Mac OS X, don't make individual pipe read requests that would result in os.read() buffersize arg being above 127KB on non-blocking pipes."); should also check if the same issue occurs with sockets (e.g., socket.socketpair() instead of os.pipe()) to make the errata more complete.  This may be perfectly acceptable and how things have worked for a long time.

Option 2:
Implement a work-around in the lowest common denominator wrapper function, so that anything in Python that needs to call read() and could benefit from this work-around, would call that wrapper instead of read().  The read() work-around might go something like this in *pseudocode*:


if running_on_darwin and buffersize > 127KB:
    # fix up buffer size to work around a Mac OS x bug...
    if stat.S_ISFIFO(os.fstat(fd).st_mode):
        buffersize = 127KB

Then do whatever else the read function is supposed to do.
History
Date User Action Args
2012-09-19 17:54:42vitalysetrecipients: + vitaly, ronaldoussoren, schmir, ned.deily, neologix, hynek, Denis.Bilenko
2012-09-19 17:54:42vitalysetmessageid: <1348077282.82.0.0829988915146.issue15896@psf.upfronthosting.co.za>
2012-09-19 17:54:42vitalylinkissue15896 messages
2012-09-19 17:54:41vitalycreate