You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
file.read() followed by file.write() result in incorrect behavior #67750
bpo-12215: TextIOWrapper: issues with interlaced read-write
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2015-03-02.15:45:52.019>created_at=<Date2015-03-02.14:37:41.806>labels= ['expert-IO']
title='file.read() followed by file.write() result in incorrect behavior'updated_at=<Date2015-03-02.15:45:52.018>user='https://github.com/maximesteisel'
Activity
maximesteisel commentedon Mar 2, 2015
Observed Behavior:
Expected Behavior
According to POSIX, the last f.read() should return "Hello people", like in Python 2:
Workaround:
f.seek(f.tell()) immediately after f.read(5) restore the correct behavior.
vstinner commentedon Mar 2, 2015
This issue is probably a duplicate of the issue bpo-12215 (see also bpo-12513 for the codecs moduile).