Title: gh-94808: add test coversage for PyFile_FromFd by fatelei · Pull Request #138866 · python/cpython · GitHub
Open Graph Title: gh-94808: add test coversage for PyFile_FromFd by fatelei · Pull Request #138866 · python/cpython
X Title: gh-94808: add test coversage for PyFile_FromFd by fatelei · Pull Request #138866 · python/cpython
Description: gh-94808: add test coversage for PyFile_FromFd What I fixed • Corrected PyFile_FromFd in Objects/fileobject.c to accept optional NULL strings for encoding, errors, and newline by switching the call format to use optional string specifiers: • was "isisssO" • now "isizzzO" This fixes the bug where passing NULL crashed or misrouted arguments. Unit tests added • Extended Lib/test/test_capi/test_file.py: • Added coverage for default buffering with buffering=-1: ◦ "rb" returns a _io.BufferedReader ◦ "r" returns a _io.TextIOWrapper • Added a closefd=True behavior test (test_pyfile_fromfd_closefd) that ensures the underlying fd is closed when the returned object is closed (verifies EBADF on a second os.close).
Open Graph Description: gh-94808: add test coversage for PyFile_FromFd What I fixed • Corrected PyFile_FromFd in Objects/fileobject.c to accept optional NULL strings for encoding, errors, and newline by switching the cal...
X Description: gh-94808: add test coversage for PyFile_FromFd What I fixed • Corrected PyFile_FromFd in Objects/fileobject.c to accept optional NULL strings for encoding, errors, and newline by switching the cal...
Opengraph URL: https://github.com/python/cpython/pull/138866
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:34abf0da-5327-bbfe-977f-aef8d511e53e |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 922C:1F4CB1:168D0F6:1E1F907:6969BBED |
| html-safe-nonce | 4ac6c751bb737b63d3a93ea05ce9730fa1b3bdcfc65b8de14ab5c9afa71a6b52 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjJDOjFGNENCMToxNjhEMEY2OjFFMUY5MDc6Njk2OUJCRUQiLCJ2aXNpdG9yX2lkIjoiOTUwNDc2MDk2ODY5NjEyNTI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b04ad3826437d39a316e405324e7d06bc3fb9bcc977051cd33d844313bf409d3 |
| hovercard-subject-tag | pull_request:2825035327 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/138866/checks |
| twitter:image | https://avatars.githubusercontent.com/u/961094?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/961094?s=400&v=4 |
| og:image:alt | gh-94808: add test coversage for PyFile_FromFd What I fixed • Corrected PyFile_FromFd in Objects/fileobject.c to accept optional NULL strings for encoding, errors, and newline by switching the cal... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-cache |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width