GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — gh-160427: Return None from TextIOWrapper.buffer when detached by cmaloney · Pull Request #160802 · python/cpython Conversation
|
|
cc: @kumaraditya303 , @vstinner : This attribute changed from returning |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @cmaloney for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @cmaloney, I could not cleanly backport this to Please backport manually with cherry_picker, see the devguide for more information. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-161449 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-161450 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…GH-160802) (#161449) gh-154523 turned the buffer member descriptor into a getter that raises ValueError when the buffer is NULL, and the backport shipped in 3.14.9 and 3.15.1. That made hasattr(stream, "buffer") raise after detach(). Restore the old member descriptor result (None) while keeping the critical section. (cherry picked from commit 3422197) Co-authored-by: Cody Maloney <[email protected]>
…GH-160802) (#161450) gh-154523 turned the buffer member descriptor into a getter that raises ValueError when the buffer is NULL, and the backport shipped in 3.14.9 and 3.15.1. That made hasattr(stream, "buffer") raise after detach(). Restore the old member descriptor result (None) while keeping the critical section. (cherry picked from commit 3422197)
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Post-merge review.
Ooops, it's not good to change io module behavior in bugfix releases. Well, it happens, it should now be fixed as any other bug/regression. At least, we do now have a test checking for the expected behavior.
LGTM. _io_TextIOWrapper_buffer_get_impl() code is safe on Free Threading since it uses a critical section.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
hasattr(stream, "buffer") fails with ValueError if buffer is detached
There was an error while loading. Please reload this page.