[issue12215] TextIOWrapper: issues with interlaced read-write

2018-11-23 Thread Martin Panter
Martin Panter added the comment: For the record, the more recent bug I mentioned was a complaint from 2015 (one and a half years before Victor’s comment). Even if it is not worth supporting writing after reading, the problem could be documented. -- resolution: out of date -> wont fix

[issue12215] TextIOWrapper: issues with interlaced read-write

2017-06-27 Thread STINNER Victor
STINNER Victor added the comment: Given that nobody complains the last 9 years (since Python 3.0 was released), I'm not sure that it's worth it to fix this corner case. If you consider that I'm wrong, please reopen the issue ;-) -- resolution: -> out of date stage: -> resolved status

[issue12215] TextIOWrapper: issues with interlaced read-write

2016-01-20 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue12215] TextIOWrapper: issues with interlaced read-write

2016-01-19 Thread Martin Panter
Martin Panter added the comment: Consider codecs that maintain an internal buffer (UTF-7) or other state (ISO-2022). When you call TextIOWrapper.read() and then tell(), the I think the returned number is supposed to hold the _decoder_ state, so you can seek back and read again. But I don’t thi

[issue12215] TextIOWrapper: issues with interlaced read-write

2014-06-24 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3 ___ Python tracker ___ ___ Python-bugs-list m

[issue12215] TextIOWrapper: issues with interlaced read-write

2014-06-24 Thread Mark Lawrence
Mark Lawrence added the comment: Does anybody want to follow up on this? #12213 was closed as fixed, #12513 is still open. -- nosy: +BreamoreBoy ___ Python tracker ___

[issue12215] TextIOWrapper: issues with interlaced read-write

2011-07-01 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue12215] TextIOWrapper: issues with interlaced read-write

2011-06-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: Perhaps the stdio requirement was based on an underlying OS (*nix?) requirement, which io has to fulfill even if it does not use stdio. Stdio was, I presume, optimized for speed. In the relatively rare case of mixed read/write, it *should* put the burden on

[issue12215] TextIOWrapper: issues with interlaced read-write

2011-06-03 Thread STINNER Victor
STINNER Victor added the comment: > If I understand, the essence of the patch is to do > the file positioning automatically internally when needed. My patch is just a proposition to fix the issue. I wrote "I suppose that we can do better": self.seek(self.tell()) is more a workaround than a rea

[issue12215] TextIOWrapper: issues with interlaced read-write

2011-06-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: For c stdio files, intermixed reads and writes require a file positioning operation. This is a nuisance and source of program bugs. I do not see any such limitation documented for our io module. So for both reasons, it will be nice to not have the limitation

[issue12215] TextIOWrapper: issues with interlaced read-write

2011-05-30 Thread STINNER Victor
Changes by STINNER Victor : -- versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue12215] TextIOWrapper: issues with interlaced read-write

2011-05-30 Thread STINNER Victor
Changes by STINNER Victor : -- versions: +Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue12215] TextIOWrapper: issues with interlaced read-write

2011-05-30 Thread STINNER Victor
STINNER Victor added the comment: textiowrapper_interlaced_read_write.patch: TextIOWrapper.write() calls self.seek(self.tell()) if it has a decoder or if snapshot is not None. I suppose that we can do better, but at least it does fix this issue. "read(); write(); write()" only calls self.seek

[issue12215] TextIOWrapper: issues with interlaced read-write

2011-05-30 Thread STINNER Victor
New submission from STINNER Victor : The following code fails on an assertion error (Python exception for _pyio, C assertion for io): -- with io.BytesIO(b'abcd') as raw: with _pyio.TextIOWrapper(raw, encoding='ascii') as f: f.read(1) f.write('2') f.te