-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
grass.script: Pass encoding to Popen parameters #1914
grass.script: Pass encoding to Popen parameters #1914
Conversation
Added comment on why encoding kwarg is popped in start_command, it's that the rest of the kwargs will be used to construct the call to Popen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@albertoparadisllop removing from make_command parameters makes sense.
@petrasovaa Popen has an encoding parameter. Do we want to pass it to Popen? For that, it seems that adding it to _popen_args
would be the right solution. ...unless we want to ignore it.
I just thought about it, and it might make more sense to pass it to Popen parameters, as the encoding kwarg is used by other methods to decode the Popen object stdout and stderr (using In other words, if I understand correctly, the methods that use Popen object outputs expect them to be encoded using that specific encoding, so it should be passed to Popen. I'll wait for confirmation before jumping to conclusions though. |
I agree. If the encoding is specified, stdin/out/err will be unicode, so _make_unicode won't do anything, but that's fine I guess. |
Removed encoding pop and added it to Popen parameters on start_command.
#1521
Added comment on why encoding kwarg is popped in start_command, it's that the rest of the kwargs will be used to construct the call to Popen.
I simply didnt assign it to any variable. It could also have been done with the
del
keyword.A different approach could have been to, instead of popping
"encoding"
, do the following:Done as part of Hacktoberfest