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

ShellSession.popen incorrectly processes Commands #644

Open
vient opened this issue Apr 14, 2023 · 1 comment
Open

ShellSession.popen incorrectly processes Commands #644

vient opened this issue Apr 14, 2023 · 1 comment

Comments

@vient
Copy link
Contributor

vient commented Apr 14, 2023

I think, or I am using it wrong.

Hi, so here https://github.com/tomerfiliba/plumbum/blob/v1.8.1/plumbum/machines/session.py#L280-L283 popen checks if cmd is BaseCommand, if so then calls formulate on it. After that it assumes that full_cmd is string but formulate returns list so popen crashes on full_cmd.strip() afterwards.

Should it be ' '.join(cmd.formulate(1)) on line 281?

@vient
Copy link
Contributor Author

vient commented Apr 14, 2023

If I pass cmd as string by joining it then it works.
There is something strange in cases when ProcessExecutionError is raised though: command line is printed as a bunch of numbers which are ASCII codes of characters from original command. For example, abc becomes 97 98 99.

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