Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.4k
gh-138775: fix handlepython -m base64 stdin correct with EOF signal#138776
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
python -m base64 stdin correct with EOF single.python -m base64 stdin correct with EOF signal.python -m base64 stdin correct with EOF signal.python -m base64 stdin correct with EOF signalaisk commentedSep 11, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I’m concerned that the current implementation reads the input in chunks, this allows the function to process the input as a stream via a pipe and avoids using too much memory with large inputs: Lines 531 to 537 in4978bfc
With this change, however, all input is read into memory, which breaks the chunked behavior. |
yihong0618 commentedSep 11, 2025
Thanks for the comments I will checked if and in stdin old behavior is wrong, so I think is fine. |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
yihong0618 commentedSep 11, 2025
keep the old behavior and use |
Misc/NEWS.d/next/Library/2025-09-11-15-03-37.gh-issue-138775.w7rnSx.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
yihong0618 commentedSep 11, 2025
Thank you very much for the review again, I will try to learn how to express the change more clearly. |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz commentedSep 11, 2025
Don't worry. Considering English isn't your first language, you can just leave formulation matters to others. |
Misc/NEWS.d/next/Library/2025-09-11-15-03-37.gh-issue-138775.w7rnSx.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
gpshead commentedNov 11, 2025
I went with this PR after playing around with the BufferedReader connected to a terminal - it really is difficult to tell when you have an EOF in that scenario vs what the |
f5c2a41 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@yihong0618 for the PR, and@gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
… signal (pythonGH-138776)* fix: handle stdin correct with EOF single.* fix: flollow the comments when pipe stdin use buffer* Apply suggestions from code review* fix: apply review comments in Lib/base64.py* fix: address comments* Reword comment and NEWS entry.---------(cherry picked from commit f5c2a41f9a6b3be95c5be9dbae0a4a3342d356dc)Co-authored-by: yihong <zouzou0208@gmail.com>Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>
GH-141432 is a backport of this pull request to the3.14 branch. |
… signal (pythonGH-138776)* fix: handle stdin correct with EOF single.* fix: flollow the comments when pipe stdin use buffer* Apply suggestions from code review* fix: apply review comments in Lib/base64.py* fix: address comments* Reword comment and NEWS entry.---------(cherry picked from commit f5c2a41f9a6b3be95c5be9dbae0a4a3342d356dc)Co-authored-by: yihong <zouzou0208@gmail.com>Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>
GH-141433 is a backport of this pull request to the3.13 branch. |
…F signal (GH-138776) (#141433)gh-138775: fix handle `python -m base64` stdin correct with EOF signal (GH-138776)* fix: handle stdin correct with EOF single.* fix: flollow the comments when pipe stdin use buffer* Apply suggestions from code review* fix: apply review comments in Lib/base64.py* fix: address comments* Reword comment and NEWS entry.---------(cherry picked from commitf5c2a41)Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: yihong <zouzou0208@gmail.com>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>
…F signal (GH-138776) (#141432)gh-138775: fix handle `python -m base64` stdin correct with EOF signal (GH-138776)* fix: handle stdin correct with EOF single.* fix: flollow the comments when pipe stdin use buffer* Apply suggestions from code review* fix: apply review comments in Lib/base64.py* fix: address comments* Reword comment and NEWS entry.---------(cherry picked from commitf5c2a41)Signed-off-by: yihong0618 <zouzou0208@gmail.com>Co-authored-by: yihong <zouzou0208@gmail.com>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>
Uh oh!
There was an error while loading.Please reload this page.
This make
python -m base64the same behavior asastorjson