-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
bpo-24658: os.read() reuses _PY_READ_MAX #10657
Conversation
os_read_impl() now also truncates the size of _PY_READ_MAX (INT_MAX) on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes.
Maybe this change should be backported to Python 3.6 and 3.7. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS). (cherry picked from commit 9a0d7a7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
GH-10658 is a backport of this pull request to the 3.7 branch. |
GH-10659 is a backport of this pull request to the 3.6 branch. |
os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS). (cherry picked from commit 9a0d7a7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS). (cherry picked from commit 9a0d7a7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS). (cherry picked from commit 9a0d7a7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
It is a naive question, Can anyone say how can I apply this fix to my script? |
os_read_impl() now also truncates the size of _PY_READ_MAX (INT_MAX)
on macOS, to avoid to allocate a larger buffer even if _Py_read() is
limited to _PY_READ_MAX bytes.
https://bugs.python.org/issue24658