You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/17 11:24:52 UTC

[GitHub] [airflow] shizidushu opened a new issue #13132: Let user specify the decode encoding of stdout/stderr of WinRMOperator

shizidushu opened a new issue #13132:
URL: https://github.com/apache/airflow/issues/13132


   **Description**
   Let user specify the decode encoding used in WinRMOperator.
   
   **Use case / motivation**
   
   I'm trying to use winrm, but the task failed. After checked, I find https://github.com/apache/airflow/blob/master/airflow/providers/microsoft/winrm/operators/winrm.py#L117
   ```python
   for line in stdout.decode('utf-8').splitlines():
       self.log.info(line)
   for line in stderr.decode('utf-8').splitlines():
       self.log.warning(line)
   ```
   
   But my remote host powershell's default encoding is  'gb2312'. I try https://stackoverflow.com/questions/40098771/changing-powershells-default-output-encoding-to-utf-8 's solution, i.e., put `PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'` in `$PROFILE`. But it doesn't work in the WinRMOperator case.
   
   The alternative way may be set the decode encoding in the operator to avoid error.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil closed issue #13132: Let user specify the decode encoding of stdout/stderr of WinRMOperator

Posted by GitBox <gi...@apache.org>.
kaxil closed issue #13132:
URL: https://github.com/apache/airflow/issues/13132


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] shizidushu commented on issue #13132: Let user specify the decode encoding of stdout/stderr of WinRMOperator

Posted by GitBox <gi...@apache.org>.
shizidushu commented on issue #13132:
URL: https://github.com/apache/airflow/issues/13132#issuecomment-748102314


   Just submit the PR. I only test it locally on my machine.
   
   I mainly use the WinRMOperator to run powershell script. So I add the ability to run powershell script. (The main script is borrowed from https://github.com/diyan/pywinrm/blob/master/winrm/__init__.py#L51)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on issue #13132: Let user specify the decode encoding of stdout/stderr of WinRMOperator

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #13132:
URL: https://github.com/apache/airflow/issues/13132#issuecomment-747829922


   Are you willing to submit a PR?
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org