Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runner argument not parsed correctly on windows #126

Open
MaxumCSmith opened this issue Jun 15, 2022 · 0 comments
Open

Runner argument not parsed correctly on windows #126

MaxumCSmith opened this issue Jun 15, 2022 · 0 comments

Comments

@MaxumCSmith
Copy link

MaxumCSmith commented Jun 15, 2022

Upon running the following command,

$ poetry run poe test-integ-watch
Poe => ptw --runner "pytest -m integtest"

[Wed Jun 15 10:02:38 2022] Running: "pytest -m integtest"
'\"pytest -m integtest\"' is not recognized as an internal or external command,
operable program or batch file.

my windows machine produces an argv that is formed as
['"poetry', 'run', 'poe', 'test-integ"'] instead of being formed as ['poetry', 'run', 'poe', 'test-integ']. The line where the watcher fails is shown below.

found at

p = subprocess.Popen(argv, shell=is_windows)

Running the same command on a Mac would have a well-formed list of arguments.

One possible solution would be to clean the arguments before passing them into the constructor, i.e.,

def cleanArgv(argv):
  return [x.replace('\"', '') for x in argv]

argv = cleanArgv(argv) if is_windows else argv

# Run tests
p = subprocess.Popen(argv, shell=is_windows)
@MaxumCSmith MaxumCSmith changed the title subprocess arguments not parsed correctly on windows Runner argument not parsed correctly on windows Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant