-
-
Notifications
You must be signed in to change notification settings - Fork 32k
io.TextIOWrapper.read does not flush the underlying write buffer when given a size argument #115059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Feb 8, 2024
It is because the C implementation of |
serhiy-storchaka
added a commit
that referenced
this issue
Feb 9, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Feb 9, 2024
…om.read1() (pythonGH-115163) (cherry picked from commit 846fd72) Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Feb 9, 2024
…om.read1() (pythonGH-115163) (cherry picked from commit 846fd72) Co-authored-by: Serhiy Storchaka <[email protected]>
Thank you for your report @blhsing. The issue is now fixed. |
serhiy-storchaka
added a commit
that referenced
this issue
Feb 9, 2024
…dom.read1() (GH-115163) (GH-115205) (cherry picked from commit 846fd72) Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka
added a commit
that referenced
this issue
Feb 9, 2024
…dom.read1() (GH-115163) (GH-115206) (cherry picked from commit 846fd72) Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Feb 10, 2024
serhiy-storchaka
added a commit
that referenced
this issue
Feb 10, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Feb 10, 2024
(cherry picked from commit 597fad0) Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Feb 10, 2024
(cherry picked from commit 597fad0) Co-authored-by: Serhiy Storchaka <[email protected]>
This was referenced Feb 10, 2024
serhiy-storchaka
added a commit
that referenced
this issue
Feb 10, 2024
…5245) (cherry picked from commit 597fad0) Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka
added a commit
that referenced
this issue
Feb 10, 2024
…5244) (cherry picked from commit 597fad0) Co-authored-by: Serhiy Storchaka <[email protected]>
fsc-eriker
pushed a commit
to fsc-eriker/cpython
that referenced
this issue
Feb 14, 2024
fsc-eriker
pushed a commit
to fsc-eriker/cpython
that referenced
this issue
Feb 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
As reported by the StackOverflow question:
https://stackoverflow.com/questions/76142400/python-file-write-stuck-in-append-mode-when-read-has-byte-count-as-parameter
In the code below, when
f.read
is not given an argument, the pending content in the write buffer gets flushed so the output is***s is a line
as expected.But when
f.read
is given a size argument, it is apparent that the underlying write buffer is not flushed immediately, causing the pending content to be written at the end of the file, rendering an output ofthis is a line***
instead:This issue occurs only with the C implementation of
io.TextIOWrapper
since the code above would work as expected if it is prepended with:CPython versions tested on:
3.8, 3.11
Operating systems tested on:
Linux, Windows
Linked PRs
The text was updated successfully, but these errors were encountered: