Message258614
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. |
|
Date |
User |
Action |
Args |
2016-01-19 18:04:26 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, vstinner, benjamin.peterson, stutzbach, Zero, docs@python, eryksun, steve.dower, fornax |
2016-01-19 18:04:26 | serhiy.storchaka | set | messageid: <1453226666.56.0.308728032052.issue26158@psf.upfronthosting.co.za> |
2016-01-19 18:04:26 | serhiy.storchaka | link | issue26158 messages |
2016-01-19 18:04:26 | serhiy.storchaka | create | |
|