Skip to content

Commit 155c2ec

Browse files
committedFeb 18, 2016
ctlmgr,worker: set PYTHONUNBUFFERED for subprocesses
1 parent ca3cced commit 155c2ec

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎artiq/devices/ctlmgr.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@ async def launcher(self):
8181
logger.info("Starting controller %s with command: %s",
8282
self.name, self.command)
8383
try:
84+
env = os.environ.copy()
85+
env["PYTHONUNBUFFERED"] = "1"
8486
self.process = await asyncio.create_subprocess_exec(
8587
*shlex.split(self.command),
86-
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
88+
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
89+
env=env)
8790
asyncio.ensure_future(
8891
LogParser(self._get_log_source).stream_task(
8992
self.process.stdout))

‎artiq/master/worker.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,13 @@ async def _create_process(self, log_level):
8181
if self.closed.is_set():
8282
raise WorkerError("Attempting to create process after close")
8383
self.ipc = pipe_ipc.AsyncioParentComm()
84+
env = os.environ.copy()
85+
env["PYTHONUNBUFFERED"] = "1"
8486
await self.ipc.create_subprocess(
8587
sys.executable, "-m", "artiq.master.worker_impl",
8688
self.ipc.get_address(), str(log_level),
87-
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
89+
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
90+
env=env)
8891
asyncio.ensure_future(
8992
LogParser(self._get_log_source).stream_task(
9093
self.ipc.process.stdout))

0 commit comments

Comments
 (0)
Please sign in to comment.