Title: bpo-33550: Warn not to set SIGPIPE to SIG_DFL by splbio · Pull Request #6773 · python/cpython · GitHub
Open Graph Title: bpo-33550: Warn not to set SIGPIPE to SIG_DFL by splbio · Pull Request #6773 · python/cpython
X Title: bpo-33550: Warn not to set SIGPIPE to SIG_DFL by splbio · Pull Request #6773 · python/cpython
Description: https://bugs.python.org/issue33550 An anti-pattern often seen in python programs is reset SIGPIPE handling to SIG_DFL (process should terminate) for cli tools in order to avoid "messy" output on stderr when the cli tool is piped into a program such as head(1). The problem with doing this is that if your program happens to talk to anything via sockets or pipes (even via a library) setting SIGPIPE handling to SIG_DFL means that if the remote side closes the connection, or the network drops, your program will instantly terminate instead of following any retry logic. This results in difficult to debug "why is my tool exiting for no reason?" bugs for cli tools. Since over the years I've seen this anti-pattern often enough, and often enough it's caused problems in the various environments I've worked in, it deserves some form of documentation somewhere. https://bugs.python.org/issue33550
Open Graph Description: https://bugs.python.org/issue33550 An anti-pattern often seen in python programs is reset SIGPIPE handling to SIG_DFL (process should terminate) for cli tools in order to avoid "messy" ou...
X Description: https://bugs.python.org/issue33550 An anti-pattern often seen in python programs is reset SIGPIPE handling to SIG_DFL (process should terminate) for cli tools in order to avoid "messy&...
Opengraph URL: https://github.com/python/cpython/pull/6773
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:243b6bdc-513f-8628-116c-fa9a43b96ab6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D1C0:371600:97C4ED:D29AEF:696A790D |
| html-safe-nonce | e533e19c77ec84690d042fb51228c78006169f9e7b373243a3ef53cdce83b164 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUMwOjM3MTYwMDo5N0M0RUQ6RDI5QUVGOjY5NkE3OTBEIiwidmlzaXRvcl9pZCI6IjUzODU4MTA2NDIxNTkxNzE4NTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1d59be4363fb3531e8ad52ac597cf930bdd13e01567506b1c6264293ceec7466 |
| hovercard-subject-tag | pull_request:187638036 |
| 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/6773/files |
| twitter:image | https://avatars.githubusercontent.com/u/629072?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/629072?s=400&v=4 |
| og:image:alt | https://bugs.python.org/issue33550 An anti-pattern often seen in python programs is reset SIGPIPE handling to SIG_DFL (process should terminate) for cli tools in order to avoid "messy" ou... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5b774e44f85c14a75886edd04ddda4e5a25ddebbb241bcbb590b08a3048730e8 |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cc5f4eee261b3601c1e98e217ceaf28508b9567e |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width