aichallenge/aichallenge — Issue #341: playgame.py incorrectly handles working directories and commands
Author: Storyyeller
Created: 2011-10-29 02:32:36+00:00
State: open

When passed a command invoking an executable in a different directory, playgame.py incorrectly splits the path and attempts to use the executable name relative to the detected working directory. But according to the official documentation of Subprocess, this is incorrect.

[quote]If cwd is not None, the child’s current directory will be changed to cwd before it is executed. Note that this directory is not considered when searching the executable, so you can’t specify the program’s path relative to cwd.[/quote]

Anyway, this bug can be fixed by changing line 262 of playgame.py from
[code]return wd, ' '.join(new_cmd)[/code]
to
[code]return wd, cmd[/code]