Title: bpo-41818: Make test_openpty() avoid unexpected success due to number of rows and/or number of columns being == 0. by 8vasu · Pull Request #23526 · python/cpython · GitHub
Open Graph Title: bpo-41818: Make test_openpty() avoid unexpected success due to number of rows and/or number of columns being == 0. by 8vasu · Pull Request #23526 · python/cpython
X Title: bpo-41818: Make test_openpty() avoid unexpected success due to number of rows and/or number of columns being == 0. by 8vasu · Pull Request #23526 · python/cpython
Description: Proposed proper fix for buildbot failures introduced after #22962 merging. To check if pty.openpty() properly sets pty slave size based on the size of current stdin, PtyTest.test_openpty() was modifying the size of current stdin first. Let 'x' be the number of rows of stdin; then, we set the number of rows of stdin to some f(x) such that the function f does not have any fixed points; that is, f(x) != x for all x. In #22962, f(x) := x//5; unfortunately, in that case, f does have 0 as a fixed point [ 0//5 = 0 ]. Upon running ./python -c "import pty;pty.spawn('./python -m test -v test_pty'.split())" unexpected success was reported on Debian; this indeed was due to the # of (rows, cols) being (0,0). The Gentoo buildbot was probably also running with stdin being a tty of size (0,0). The new choice of f(x) := x+1 solves the problem, since this f has no fixed points [ x+1=x has no solution. ] TL;DR: instead of letting rows and cols of stdin be the floor of 1/5 of their original values, we now only increment their respective values by 1. Note, however, that the former is a more noticeable change when # of rows, cols are fairly large. Signed-off-by: Soumendra Ganguly soumendraganguly@gmail.com https://bugs.python.org/issue41818
Open Graph Description: Proposed proper fix for buildbot failures introduced after #22962 merging. To check if pty.openpty() properly sets pty slave size based on the size of current stdin, PtyTest.test_openpty() was modi...
X Description: Proposed proper fix for buildbot failures introduced after #22962 merging. To check if pty.openpty() properly sets pty slave size based on the size of current stdin, PtyTest.test_openpty() was modi...
Opengraph URL: https://github.com/python/cpython/pull/23526
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4a68454b-1987-2abd-a707-9b3860be99be |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 81B0:144C84:1F4229A:2BDF4FF:696A5BCF |
| html-safe-nonce | 62bb02c03d8e94d86f6d7fc2894f1f156de8e7de03401470ca04da2e1a80db03 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUIwOjE0NEM4NDoxRjQyMjlBOjJCREY0RkY6Njk2QTVCQ0YiLCJ2aXNpdG9yX2lkIjoiMjIyMDM0ODY4OTA2ODIxOTM0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3ae3b283b49e101996596592b5486e9f328405f9ce01938b58b00eb6874f1b3f |
| hovercard-subject-tag | pull_request:528320778 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/23526/files |
| twitter:image | https://avatars.githubusercontent.com/u/67527439?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/67527439?s=400&v=4 |
| og:image:alt | Proposed proper fix for buildbot failures introduced after #22962 merging. To check if pty.openpty() properly sets pty slave size based on the size of current stdin, PtyTest.test_openpty() was modi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width