-
-
Notifications
You must be signed in to change notification settings - Fork 37
-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Allow to pass encoding when creating shell #47
Comments
Thanks for the suggestion. I'm not sure there's anything particular special about the with spur.SshShell(...) as shell:
run = partial(shell.run, encoding="utf-8")
run(["ls"]) ? Admittedly, this doesn't work so well if you're using both |
My example wasn't the best. I don't really call many run commands in the same shell context, but I create the same shell to run commands in different functions.
I can then use I do think the But it's only a suggestion. If you think this is a too specific use case, I don't mind subclassing |
I think for simplicity, it's better to just have the |
The encoding parameter on run/spawn is nice, but it's a bit tedious to pass it to every run command.
It'd be nice to be able to pass it when creating the shell.
Something like that:
We could then run:
The above solution still allows to overwrite the encoding in the run command.
If you think it's a good idea, I can make a proper pull request.
The text was updated successfully, but these errors were encountered: