Message383791
"Enhancements" (non-bugfix feature changes) can only be applied to future versions. However, you are asking for the reversion of an intentional feature change made in a 'bugfix' release# for (I believe) 3.1. Before the change, as I remember, truncating to 0 *did* move the file pointer back to 0. As I remember, Guide von Rossum requested the change and Antoine Pitrou made it.
https://docs.python.org/3/library/io.html#io.IOBase.seek
new says "The current stream position isn’t changed."
If you also want to change the stream position, do it with seek(), perhaps before the truncate.
# This change in a bugfix release, a violation the rule stated above, broke the code of multiple people. (We thereafter strengthened the policy.) To fix my code, I had to add a seek(0). I put it before truncate(0), so I know that this works. |
|
Date |
User |
Action |
Args |
2020-12-26 02:19:55 | terry.reedy | set | recipients:
+ terry.reedy, steven.daprano, ke265379ke |
2020-12-26 02:19:55 | terry.reedy | set | messageid: <1608949195.36.0.0121566431562.issue42733@roundup.psfhosted.org> |
2020-12-26 02:19:55 | terry.reedy | link | issue42733 messages |
2020-12-26 02:19:55 | terry.reedy | create | |
|