Title: Git.execute output_stream is not documented to suppress kill_after_timeout, but does · Issue #1762 · gitpython-developers/GitPython · GitHub
Open Graph Title: Git.execute output_stream is not documented to suppress kill_after_timeout, but does · Issue #1762 · gitpython-developers/GitPython
X Title: Git.execute output_stream is not documented to suppress kill_after_timeout, but does · Issue #1762 · gitpython-developers/GitPython
Description: When calling Git.execute, including indirectly through the dynamic methods of a Git object, passing a non-None value of output_stream suppresses the effect of kill_after_timeout. The threading.Timer object is created with the local kill_...
Open Graph Description: When calling Git.execute, including indirectly through the dynamic methods of a Git object, passing a non-None value of output_stream suppresses the effect of kill_after_timeout. The threading.Time...
X Description: When calling Git.execute, including indirectly through the dynamic methods of a Git object, passing a non-None value of output_stream suppresses the effect of kill_after_timeout. The threading.Time...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1762
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Git.execute output_stream is not documented to suppress kill_after_timeout, but does","articleBody":"When calling `Git.execute`, including indirectly through the dynamic methods of a `Git` object, passing a non-`None` value of `output_stream` suppresses the effect of `kill_after_timeout`. [The `threading.Timer` object is created](https://github.com/gitpython-developers/GitPython/blob/a58a6be043f62e6552ef1638ec497f3b805c5480/git/cmd.py#L1040-L1042) with the local `kill_process` function as its callback, but `start` is never called on it.\r\n\r\nhttps://github.com/gitpython-developers/GitPython/blob/a58a6be043f62e6552ef1638ec497f3b805c5480/git/cmd.py#L1050-L1079\r\n\r\nThis situation appears not entirely intentional, because:\r\n\r\n- The \"watchdog\" `Timer` is created, even though it is never used.\r\n- The docstring, even as it documents [that `as_process` suppresses `kill_after_timeout`](https://github.com/gitpython-developers/GitPython/blob/a58a6be043f62e6552ef1638ec497f3b805c5480/git/cmd.py#L880) (and that [`as_process` suppresses `output_stream`](https://github.com/gitpython-developers/GitPython/blob/a58a6be043f62e6552ef1638ec497f3b805c5480/git/cmd.py#L867)), does not mention any effect of `output_stream` on `kill_after_timeout`.\r\n\r\nSo either `kill_after_timeout` should be honored even when `output_stream` is used, *or* the docstring should be updated to mention that it does not (and the code possibly modified to not create the `Timer` object in the case that it is unused).\r\n\r\nI am not sure which change should be made, so I'm opening this rather than a PR to propose one of them.\r\n\r\nThis is effectively separate from #1756. (One quality this shares with #1756 is that it is relevant only to the behavior of `Git.execute` and functions that use it. Functions that use `handle_process_output` are unaffected; its `kill_after_timeout` is implemented differently with nonequivalent behavior and separate code. `handle_process_output` also does not take an `output_stream` argument.)","author":{"url":"https://github.com/EliahKagan","@type":"Person","name":"EliahKagan"},"datePublished":"2023-12-10T08:30:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/1762/GitPython/issues/1762"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0a6aaf2c-c528-8445-5296-f8c1d23c2f55 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B4FC:300E6:883C1:B2A3A:69686AA7 |
| html-safe-nonce | 5189a492852ee25a409ed9628e015847faf378cb1c9cf9e6fa0fddfdaca56f78 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNEZDOjMwMEU2Ojg4M0MxOkIyQTNBOjY5Njg2QUE3IiwidmlzaXRvcl9pZCI6IjUyNDU0MDYyNDU2OTczODMwNzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3e59c0987f2d8121291d7f6b338a9d36a7de27b4010030f510385c57ecae8e56 |
| hovercard-subject-tag | issue:2034271757 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/gitpython-developers/GitPython/1762/issue_layout |
| twitter:image | https://opengraph.githubassets.com/afe39edde7eb31bf470ac19bdb4a78abb6b7e0393cc9e7591b1f873ce3d1e572/gitpython-developers/GitPython/issues/1762 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/afe39edde7eb31bf470ac19bdb4a78abb6b7e0393cc9e7591b1f873ce3d1e572/gitpython-developers/GitPython/issues/1762 |
| og:image:alt | When calling Git.execute, including indirectly through the dynamic methods of a Git object, passing a non-None value of output_stream suppresses the effect of kill_after_timeout. The threading.Time... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EliahKagan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 50f46dc2d6192249fd8ebf20e76c800f4f2596d4a5f3ab63dd63a754df154f54 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| 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 | fef287f17234b4529a4b112a3d47fe8551e32ddd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width