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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:06586f0c-8a49-fee5-aef2-a0b43d605684 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | BCA0:31622E:9F7A68:E28E21:696A5CDF |
| html-safe-nonce | d27976aa5f6af1f303e0efd681bd0446d97e9f74b597543a4f1737315e31ba2c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0EwOjMxNjIyRTo5RjdBNjg6RTI4RTIxOjY5NkE1Q0RGIiwidmlzaXRvcl9pZCI6IjQwODM5MjgwNDA5NTU2MDAwOTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 268b97f6ab7ec46ed91372068dca04047a2aa3c0d16a716ac33219dca821ba88 |
| hovercard-subject-tag | pull_request:528320778 |
| 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/23526/checks |
| 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 |
| 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 | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width