дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 09:41:34 +02:00
fix(python): run the Python Console in a Docker or Compose interpreter's container (#6686)
With a Docker or Compose run target as the project interpreter, the Python Console reported "No Python interpreter" because it only asked for a local interpreter. When there is none but a run target interpreter is set, the console now starts its driver as a python run, which Run already routes into the target's container (project mounted, the target's interpreter, docker stop on Stop). The driver exits on SIGTERM itself, since as a container's PID 1 it would otherwise ignore Stop until docker's SIGKILL. Closes #6685. Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
1 джерело
482143769f
коміт
611440f77f
4 files changed
+43
-3
No files matched your search
@@ -4,11 +4,15 @@
|
||||
import json
|
||||
import os
|
||||
import reprlib
|
||||
import signal
|
||||
import sys
|
||||
import textwrap
|
||||
import types
|
||||
|
||||
RS = "\x1e"
|
||||
# In a container (`docker compose run` has no `--init`) the driver is PID 1, which ignores
|
||||
# SIGTERM without a handler: Stop would wait for docker's SIGKILL after 10 s.
|
||||
signal.signal(signal.SIGTERM, lambda *_: os._exit(128 + signal.SIGTERM))
|
||||
_out = sys.stdout
|
||||
_repr = reprlib.Repr()
|
||||
_repr.maxstring = _repr.maxother = 200
|
||||
|
||||
Reference in new issue
Заблокувати користувача