Skip to content

Commit 7c140cf

Browse files
committed
feat: Update HubEngine to run subprocess from engine's directory for data file access
1 parent d3618e5 commit 7c140cf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

draughts/hub.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,17 @@ def start(self) -> None:
406406

407407
logger.info(f"Starting Hub engine: {self.path}")
408408

409+
# Run from the engine's directory so it can find its data files
410+
engine_dir = self.path.parent.resolve()
411+
409412
self.process = subprocess.Popen(
410-
[str(self.path), "hub"],
413+
[str(self.path.resolve()), "hub"],
411414
stdin=subprocess.PIPE,
412415
stdout=subprocess.PIPE,
413416
stderr=subprocess.PIPE,
414417
text=True,
415418
bufsize=1, # Line buffered
419+
cwd=str(engine_dir), # Run from engine's directory
416420
)
417421

418422
# Send hub command to start initialization

0 commit comments

Comments
 (0)