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 serhiy.storchaka
Recipients Zero, benjamin.peterson, docs@python, eryksun, fornax, pitrou, serhiy.storchaka, steve.dower, stutzbach, vstinner
Date 2016-01-19.18:04:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1453226666.56.0.308728032052.issue26158@psf.upfronthosting.co.za>
In-reply-to
Content
This is not always possible. Consider following example:

>>> open('temp.txt', 'wb').write(b'+BDAEMQQyBDMENA-')
16
>>> f = open('temp.txt', 'r+', encoding='utf-7')
>>> f.read(2)
'аб'

What should be the result of truncating?

I think it would be better to not implement truncate() for text files at all.
History
Date User Action Args
2016-01-19 18:04:26serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, vstinner, benjamin.peterson, stutzbach, Zero, docs@python, eryksun, steve.dower, fornax
2016-01-19 18:04:26serhiy.storchakasetmessageid: <1453226666.56.0.308728032052.issue26158@psf.upfronthosting.co.za>
2016-01-19 18:04:26serhiy.storchakalinkissue26158 messages
2016-01-19 18:04:26serhiy.storchakacreate