Title: Cannot terminate Python process with SIGINT · Issue #549 · rawpython/remi · GitHub
Open Graph Title: Cannot terminate Python process with SIGINT · Issue #549 · rawpython/remi
X Title: Cannot terminate Python process with SIGINT · Issue #549 · rawpython/remi
Description: This: def serve_forever(self): # we could join on the threads, but join blocks all interrupts (including # ctrl+c, so just spin here # noinspection PyBroadException try: def sig_manager(sig, callstack): self.stop() self._log.info('*** si...
Open Graph Description: This: def serve_forever(self): # we could join on the threads, but join blocks all interrupts (including # ctrl+c, so just spin here # noinspection PyBroadException try: def sig_manager(sig, callst...
X Description: This: def serve_forever(self): # we could join on the threads, but join blocks all interrupts (including # ctrl+c, so just spin here # noinspection PyBroadException try: def sig_manager(sig, callst...
Opengraph URL: https://github.com/rawpython/remi/issues/549
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot terminate Python process with SIGINT","articleBody":"This:\n```\n def serve_forever(self):\n # we could join on the threads, but join blocks all interrupts (including\n # ctrl+c, so just spin here\n # noinspection PyBroadException\n try:\n def sig_manager(sig, callstack):\n self.stop()\n self._log.info('*** signal %d received.' % sig)\n return signal.SIG_IGN\n prev_handler = signal.signal(signal.SIGINT, sig_manager)\n except Exception:\n # signal.pause() is missing for Windows; wait 1ms and loop instead\n pass\n except KeyboardInterrupt:\n pass\n```\nin `remi/server.py` is just... WTF? How am I supposed to end the app gracefully with interrupt signal if Remi is just another user interface (it has physical buttons)?\n\nThe remi package (`__init__.py`) even imports a special function for starting the server:\n```\nfrom .server import App, Server, start\n```\nBut apparently there is absolutely no interface for stopping it. Why?\n\nI've found this old bug report where a functional solution was proposed but the report was closed for no reason: https://github.com/rawpython/remi/issues/274#issuecomment-457251735\n\nSo, if one has an instance of such a `MyApp`, they can do this:\n```\n my_app = MyApp()\n def interrupt_handler():\n my_app_instance.server.server_starter_instance._alive = False\n my_app_instance.server.server_starter_instance._sserver.shutdown()\n return signal.SIG_DFL\n remi.start(my_app, ...)\n signal.signal(signal.SIGINT, interrupt_handler)\n```\nor they have to implement such a handler into their `MyApp`.","author":{"url":"https://github.com/kyselejsyrecek","@type":"Person","name":"kyselejsyrecek"},"datePublished":"2025-06-04T15:26:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/549/remi/issues/549"}
| 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:cfa1d9b5-5dc0-05a8-da94-c70d0a8c6f9c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 877A:1F1F98:918BFC3:C0B0AA6:696DFCBF |
| html-safe-nonce | 981c349dea18daf15e450124c86d3456a217a475fc790b5bc6217edc75508319 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzdBOjFGMUY5ODo5MThCRkMzOkMwQjBBQTY6Njk2REZDQkYiLCJ2aXNpdG9yX2lkIjoiMzczOTIyNjIwNjQzNTY3MTIzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4c5b824d28e6b35147c8a2c3b0d8d68aa59be9b5392388bcf0f869ccd6642a65 |
| hovercard-subject-tag | issue:3118238363 |
| 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/rawpython/remi/549/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fba288ac8378f621ea839e7cbf3e16261091eb932bcc40fc77b2184ccd9b5ff3/rawpython/remi/issues/549 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fba288ac8378f621ea839e7cbf3e16261091eb932bcc40fc77b2184ccd9b5ff3/rawpython/remi/issues/549 |
| og:image:alt | This: def serve_forever(self): # we could join on the threads, but join blocks all interrupts (including # ctrl+c, so just spin here # noinspection PyBroadException try: def sig_manager(sig, callst... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kyselejsyrecek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064 |
| turbo-cache-control | no-preview |
| go-import | github.com/rawpython/remi git https://github.com/rawpython/remi.git |
| octolytics-dimension-user_id | 59974634 |
| octolytics-dimension-user_login | rawpython |
| octolytics-dimension-repository_id | 17938217 |
| octolytics-dimension-repository_nwo | rawpython/remi |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17938217 |
| octolytics-dimension-repository_network_root_nwo | rawpython/remi |
| 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 | 7e5ae23c70136152637ceee8d6faceb35596ec46 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width