Title: Can not communicate with subprocess during interpreter shutdown on windows · Issue #115219 · python/cpython · GitHub
Open Graph Title: Can not communicate with subprocess during interpreter shutdown on windows · Issue #115219 · python/cpython
X Title: Can not communicate with subprocess during interpreter shutdown on windows · Issue #115219 · python/cpython
Description: Bug report Bug description: In #104826 (backported to 3.12 in #105277) to fix #104690 disallowed creating new threads during interpreter finalization. This poses a problem on windows because the Popen._communicate uses a thread (see matp...
Open Graph Description: Bug report Bug description: In #104826 (backported to 3.12 in #105277) to fix #104690 disallowed creating new threads during interpreter finalization. This poses a problem on windows because the Po...
X Description: Bug report Bug description: In #104826 (backported to 3.12 in #105277) to fix #104690 disallowed creating new threads during interpreter finalization. This poses a problem on windows because the Po...
Opengraph URL: https://github.com/python/cpython/issues/115219
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can not communicate with subprocess during interpreter shutdown on windows","articleBody":"# Bug report\n\n### Bug description:\n\nIn #104826 (backported to 3.12 in #105277) to fix #104690 disallowed creating new threads during interpreter finalization. This poses a problem on windows because the `Popen._communicate` uses a thread (see https://github.com/matplotlib/matplotlib/issues/27437#issuecomment-1840870442 for discussion).\n\nIn Matplotlib we are holding onto a latex process and triggering this via a weakref finalize, but a minimal reproducer is:\n\n```python\nfrom subprocess import Popen, PIPE\nimport atexit\n\n# anything that holds stdin and stdout should work\nproc = Popen(['powershell'], stdin=PIPE, stdout=PIPE)\n\ndef cleanup():\n print('hi bob')\n proc.kill()\n proc.communicate()\n\natexit.register(cleanup)\n```\n\n\nxref https://github.com/matplotlib/matplotlib/issues/27437\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\nWindows","author":{"url":"https://github.com/tacaswell","@type":"Person","name":"tacaswell"},"datePublished":"2024-02-09T14:59:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/115219/cpython/issues/115219"}
| 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:28a11480-d91d-f630-8c7f-07193f9f1afd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABF8:739BE:12049E5:18CB666:6969FE2D |
| html-safe-nonce | 79b8b8d7702a0df9ae0fe5f7686a32abcbb9df9cfa0bc95db5716a133f51e9e8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkY4OjczOUJFOjEyMDQ5RTU6MThDQjY2Njo2OTY5RkUyRCIsInZpc2l0b3JfaWQiOiI5MDc1NTc1NDk2NjM5MTE4ODkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2c7908eae45851ff4e37969ff35c328ed603be04fd67ebe7a86828bc8d21d090 |
| hovercard-subject-tag | issue:2127312266 |
| 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/python/cpython/115219/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ec1dc7a8ecab164761b268f65bef046ca8dcb5612cf404477bf548b74948affb/python/cpython/issues/115219 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ec1dc7a8ecab164761b268f65bef046ca8dcb5612cf404477bf548b74948affb/python/cpython/issues/115219 |
| og:image:alt | Bug report Bug description: In #104826 (backported to 3.12 in #105277) to fix #104690 disallowed creating new threads during interpreter finalization. This poses a problem on windows because the Po... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tacaswell |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width