[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-19 Thread Fijal
Fijal added the comment: That sounds like a good idea I think. PyPy bug tracker ___ pypy-issue mailing list pypy-issue@python.org http

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-19 Thread Armin Rigo
Armin Rigo added the comment: Well, yes, streamio is used at a few places, but that's because we don't support files in the first place. If we make RPython some subset of the file interface, it would just work fine without streamio, I believe. PyPy bug

Re: [pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-18 Thread Maciej Fijalkowski
On Mon, Feb 18, 2013 at 7:08 PM, Amaury Forgeot d Arc wrote: > > Amaury Forgeot d Arc added the comment: > > Last time I looked, streamio is still used in some places; maybe the marshal > module. well, I think we can't kill streamio, but can we kill all the logic and just make it use FILE under

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-18 Thread Amaury Forgeot d Arc
Amaury Forgeot d Arc added the comment: Last time I looked, streamio is still used in some places; maybe the marshal module. PyPy bug tracker ___

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-18 Thread Armin Rigo
Armin Rigo added the comment: The answer to my Python 3 question is that py3k's _io module (just like the one on pypy for Python 2) don't use streamio.py at all. This means that the latter has no more reason to be kept alive. Kill kill kill! PyPy bug t

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-18 Thread Armin Rigo
Armin Rigo added the comment: Fwiw Python 3 also reimplements (its own version of) streamio.py. This doesn't mean there would be no point in saying "too bad" now and give up at least for "PyPy 2". It's something I would find perfectly acceptable too; and breaking the OO translations of PyPy un

Re: [pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-14 Thread Maciej Fijalkowski
On Thu, Feb 14, 2013 at 4:47 PM, Amaury Forgeot d'Arc wrote: > 2013/2/14 bdk >> >> >> bdk added the comment: >> >> Sure, but given that the CPython docs explicitly state a file object is a >> wrapper on top of FILE*/to expect FILE* behavior in corner cases, and the >> PyPy >> ones "Differences t

Re: [pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-14 Thread Amaury Forgeot d'Arc
2013/2/14 bdk > > bdk added the comment: > > Sure, but given that the CPython docs explicitly state a file object is a > wrapper on top of FILE*/to expect FILE* behavior in corner cases, and the > PyPy > ones "Differences that are not listed here should be considered bugs of > PyPy.", > I think

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-14 Thread bdk
bdk added the comment: Sure, but given that the CPython docs explicitly state a file object is a wrapper on top of FILE*/to expect FILE* behavior in corner cases, and the PyPy ones "Differences that are not listed here should be considered bugs of PyPy.", I think this is worth mentioning in P

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-14 Thread Fijal
Fijal added the comment: The python docs don't state it prominently, but C docs very clearly state you should *never* use a combination of fread and read on the same fd. Most notably the behavior will differ between platforms, since the caching strategy depends on the libc.

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-13 Thread bdk
bdk added the comment: Also, maybe https://bugs.pypy.org/issue1283 is an issue stemming from the same underlying difference, an issue that doesn't even require one to 'abuse' it by using the python file object and the fd? There are probably other differences that might arise too, like the one

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-13 Thread bdk
bdk added the comment: Surely one can use it as a file stream and then afterwards as a fd? And then have some expectations about the interactions? Cpython docs explicitly state "File objects are implemented using C’s stdio package" and other things like "This function is simply a wrapper for

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-13 Thread Fijal
Fijal added the comment: I think this is generally acceptable. It's well documented not to use both methods of reading from files at the same time. -- nosy: +fijal status: unread -> chatting PyPy bug tracker _

[pypy-issue] [issue1397] file stream behavior differences from cpython

2013-02-13 Thread bdk
New submission from bdk : The attached script produces different outputs on python and pypy. -- files: test_file.py messages: 5328 nosy: bdk, pypy-issue priority: bug status: unread title: file stream behavior differences from cpython PyPy bug tr