Title: Qt Ctrl-C broken on windows · Issue #20932 · matplotlib/matplotlib · GitHub
Open Graph Title: Qt Ctrl-C broken on windows · Issue #20932 · matplotlib/matplotlib
X Title: Qt Ctrl-C broken on windows · Issue #20932 · matplotlib/matplotlib
Description: @anntzer @tacaswell Hi! I have just tested the master branch on Windows and found that there is indeed a problem with the QSocketNotifier (it appeared here: #13306 (comment)). Previously, on that Windows machine, I was running my old cod...
Open Graph Description: @anntzer @tacaswell Hi! I have just tested the master branch on Windows and found that there is indeed a problem with the QSocketNotifier (it appeared here: #13306 (comment)). Previously, on that W...
X Description: @anntzer @tacaswell Hi! I have just tested the master branch on Windows and found that there is indeed a problem with the QSocketNotifier (it appeared here: #13306 (comment)). Previously, on that W...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/20932
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Qt Ctrl-C broken on windows","articleBody":"@anntzer @tacaswell \r\nHi! I have just tested the master branch on Windows and found that there is indeed a problem with the QSocketNotifier (it appeared here: https://github.com/matplotlib/matplotlib/pull/13306#issuecomment-760878434). Previously, on that Windows machine, I was running my old code with QAbstractSocket which was fine, and did not test the newest version with QSocketNotifier there (my fault, sorry). I have tested on Linux, and there is no such problem there.\r\n\r\nThe code to reproduce on Windows (in Jupyter):\r\n```python\r\n%matplotlib qt\r\nfrom matplotlib import pyplot as plt\r\nplt.plot([1,2])\r\nplt.pause(.1)\r\nplt.pause(.1)\r\nplt.pause(.1)\r\n```\r\nThe problem seems to be that if `socketpair` generates a socket with the same `fileno` value as it generated in the previous `pause()` call, the QSocketNotifier _unexpectedly_ fires and hangs here: https://github.com/matplotlib/matplotlib/blob/b600026fe86bf0c7e14fc56f568b8b1fae07313d/lib/matplotlib/backends/qt_compat.py#L232\r\nbecause _nothing was actually written_ to the `wakeup_fd`. I don't understand how that can be.\r\n\r\nWorkaround fix:\r\n```python\r\nrsock.set_blocking(False)\r\n\r\n@sn.activated.connect\r\ndef on_signal(*args):\r\n try:\r\n signal = rsock.recv(1) # clear the socket to re-arm the notifier\r\n except BlockingIOError:\r\n pass # false-trigger, nothing on rsock\r\n```\r\n\r\nWhat should we do with this? Is there a better solution?\r\n\r\n_Originally posted by @vdrhtc in https://github.com/matplotlib/matplotlib/issues/13306#issuecomment-906467433_","author":{"url":"https://github.com/tacaswell","@type":"Person","name":"tacaswell"},"datePublished":"2021-08-28T18:47:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/20932/matplotlib/issues/20932"}
| 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:103830cf-c7ec-b9da-6798-f54061879dda |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C2A:1E2237:5C9EAE:7BE743:6A534A7F |
| html-safe-nonce | af1dfc9d78e74744fb5eed1c194d31f142e95f1652abf999899e5d11da2a82c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzJBOjFFMjIzNzo1QzlFQUU6N0JFNzQzOjZBNTM0QTdGIiwidmlzaXRvcl9pZCI6IjQyNTY0OTkyNjc0NTMxMTg3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ca65c30c17607b9ea490838db1880686046b7255d38072b94abdd83bae8eb13c |
| hovercard-subject-tag | issue:981903243 |
| 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/matplotlib/matplotlib/20932/issue_layout |
| twitter:image | https://opengraph.githubassets.com/af9023c474f0123b593ac391253e7bac58a47a51965a76698db572d534f17025/matplotlib/matplotlib/issues/20932 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/af9023c474f0123b593ac391253e7bac58a47a51965a76698db572d534f17025/matplotlib/matplotlib/issues/20932 |
| og:image:alt | @anntzer @tacaswell Hi! I have just tested the master branch on Windows and found that there is indeed a problem with the QSocketNotifier (it appeared here: #13306 (comment)). Previously, on that W... |
| 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 | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width