Title: Do not spawn uname(1) every time version info is needed by wdoekes · Pull Request #151 · Asana/python-asana · GitHub
Open Graph Title: Do not spawn uname(1) every time version info is needed by wdoekes · Pull Request #151 · Asana/python-asana
X Title: Do not spawn uname(1) every time version info is needed by wdoekes · Pull Request #151 · Asana/python-asana
Description: On Unixes, there is a os.uname() call which provides the same info and we don't need to fork()+execve() to get it. That uname(1) call wastes resources and trips IDSes with its unexpected fork(). Before: $ strace -feexecve python3 -c "import os; import platform; __version__ = 'x'; print({'language': 'Python', 'version': __version__, 'language_version': platform.python_version(), 'os': platform.system(), 'os_version': platform.release()})" execve("/usr/bin/python3", ["python3", "-c", "import os; import platform; __ve"...], 0x7ffc828c5c38 /* 63 vars */) = 0 strace: Process 4112873 attached [pid 4112873] execve("/usr/local/sbin/uname", ["uname", "-p"], 0x7fff0c485da8 /* 63 vars */) = -1 ENOENT (No such file or directory) [pid 4112873] execve("/usr/local/bin/uname", ["uname", "-p"], 0x7fff0c485da8 /* 63 vars */) = -1 ENOENT (No such file or directory) [pid 4112873] execve("/usr/sbin/uname", ["uname", "-p"], 0x7fff0c485da8 /* 63 vars */) = -1 ENOENT (No such file or directory) [pid 4112873] execve("/usr/bin/uname", ["uname", "-p"], 0x7fff0c485da8 /* 63 vars */) = -1 ENOENT (No such file or directory) [pid 4112873] execve("/sbin/uname", ["uname", "-p"], 0x7fff0c485da8 /* 63 vars */) = -1 ENOENT (No such file or directory) [pid 4112873] execve("/bin/uname", ["uname", "-p"], 0x7fff0c485da8 /* 63 vars */) = 0 [pid 4112873] +++ exited with 0 +++ --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4112873, si_uid=1000, si_status=0, si_utime=0, si_stime=0} --- {'language': 'Python', 'version': 'x', 'language_version': '3.8.10', 'os': 'Linux', 'os_version': '5.4.0-109-generic'} +++ exited with 0 +++ After: $ strace -feexecve python3 -c "import os; import platform; __version__ = 'x'; print({'language': 'Python', 'version': __version__, 'language_version': platform.python_version(), 'os': (hasattr(os, 'uname') and os.uname().sysname or platform.system()), 'os_version': (hasattr(os, 'uname') and os.uname().release or platform.release())})" execve("/usr/bin/python3", ["python3", "-c", "import os; import platform; __ve"...], 0x7ffdf3b12e18 /* 63 vars */) = 0 {'language': 'Python', 'version': 'x', 'language_version': '3.8.10', 'os': 'Linux', 'os_version': '5.4.0-109-generic'} +++ exited with 0 +++
Open Graph Description: On Unixes, there is a os.uname() call which provides the same info and we don't need to fork()+execve() to get it. That uname(1) call wastes resources and trips IDSes with its unexpected fork()...
X Description: On Unixes, there is a os.uname() call which provides the same info and we don't need to fork()+execve() to get it. That uname(1) call wastes resources and trips IDSes with its unexpected fo...
Opengraph URL: https://github.com/Asana/python-asana/pull/151
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/commits/:range(.:format) |
| route-controller | pull_requests |
| route-action | commits |
| fetch-nonce | v2:d950289c-0fe4-7ec9-33cb-4adcbe7958c2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B904:163D6F:C1C44:105F3C:69976F8B |
| html-safe-nonce | c3c762a6f10b07199a24cea541c3115b74811ce81140e0332da18d0125a7a63a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTA0OjE2M0Q2RjpDMUM0NDoxMDVGM0M6Njk5NzZGOEIiLCJ2aXNpdG9yX2lkIjoiMTI4ODYzMDMzOTY0OTM2Nzk0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cd11fc3b41fd8947b5bf1e15b83735a68030f711ceaebe446d8f50e3d5d88291 |
| hovercard-subject-tag | pull_request:991293240 |
| 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/Asana/python-asana/pull/151/commits/377e9086b0794ddbff709c5310ed580d565bb91a |
| twitter:image | https://avatars.githubusercontent.com/u/1225014?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1225014?s=400&v=4 |
| og:image:alt | On Unixes, there is a os.uname() call which provides the same info and we don't need to fork()+execve() to get it. That uname(1) call wastes resources and trips IDSes with its unexpected fork()... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f6df5422af98e8455c055522f48ada1a19fab299cf47471bdd590f8b7291770 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/Asana/python-asana git https://github.com/Asana/python-asana.git |
| octolytics-dimension-user_id | 1472111 |
| octolytics-dimension-user_login | Asana |
| octolytics-dimension-repository_id | 28160576 |
| octolytics-dimension-repository_nwo | Asana/python-asana |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 28160576 |
| octolytics-dimension-repository_network_root_nwo | Asana/python-asana |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cefaebe5dce897ac919acd478e66f59c8855d342 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width