Message11902

Author jeff.allen
Recipients amit, fwierzbicki, jeff.allen, psykiatris, santa4nt, zyasoft
Date 2018-04-13.19:54:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523649261.15.0.682650639539.issue2363@psf.upfronthosting.co.za>
In-reply-to
Content
Now we have a failing test (based on certain expectations) but:
1. Does CPython also fail this test?
2. Can you develop a change to Jython that makes it pass?

If the answer to #1 is yes, we ought to think seriously whether it matters that Jython fails. Are our expectations correct/meaningful?

The question in my mind is whether we should really expect a buffered text file with encoding, soft-spacing and universal line-end processsing to seek accurately. The streams from the io module support seek, but not arithmetically in the obvious way: the argument must be a sort of opaque "cookie" or "marker" returned by tell(). The built-in file is not from the io module, and is likely less sophisticated.


Patrick:

This will be what Jim is getting at in his comment #msg10655. If you simply prove that the behaviour is undefined in these cases, that's useful work we've been neglecting and you will have closed another issue.

Assuming there is something to fix here, a useful patch would consist of:
1. an addition to the test suite that fails in the present version.
2. a change to Jython that makes the test pass.
3. no accidental inclusions of other files.

We won't want your src/test_fileseek.py as it stands in the codebase, but you're probably now in a position to add the failing test(s) to (most likely) Lib/test/test_file_jy.py, based on it. If you look in there, and other tests modules nearby, you'll see how unit tests work. If you haven't used unittest before it is a useful module to learn about.

There are tests for file.seek in Lib/test/test_file.py: why don't those fail?

Could you attach just the latest version of test_fileseek.py as an entire file (not patches)? We can do without the old versions: if you can't remove them I can.
History
Date User Action Args
2018-04-13 19:54:21jeff.allensetmessageid: <1523649261.15.0.682650639539.issue2363@psf.upfronthosting.co.za>
2018-04-13 19:54:21jeff.allensetrecipients: + jeff.allen, fwierzbicki, zyasoft, santa4nt, amit, psykiatris
2018-04-13 19:54:21jeff.allenlinkissue2363 messages
2018-04-13 19:54:20jeff.allencreate